ArduCAM IMX219 autofocus camera not working on Raspberry Pi Zero, can't control focus motor

Hi, I’m stuck trying to get an ArduCAM IMX219 autofocus camera working on a Raspberry Pi Zero. The camera itself shows up, but I can’t get the focus motor to respond at all. I’ve posted about this on the ArduCAM forum ( IMX219 on Raspi zero unable to control focus motor ) and also submitted a web ticket but haven’t gotten any help yet. I’ve bought a bunch of ArduCAMs over the years and I’ve never been able to get this one working. Any pointers would be really appreciated.

Setup:

  • Raspberry Pi Zero
  • ArduCAM IMX219 autofocus camera

I don’t have any code or logs to share yet since I’m not even sure where to start. Thanks.

Sorry to hear you’re running into trouble with the IMX219 autofocus camera and not being able to command the focus motor. Don’t worry, we’ll help you get to the bottom of this. I’ve seen your forum post as well, thanks for linking it.

We’ll test the same camera setup on our side tomorrow and reply as soon as we have something. In the meantime, hang tight and don’t change anything on your end just yet. We’ll follow up here.

Just checking in — any progress on this? I still haven’t seen a response on the web ticket I submitted and I’m blocked on getting the focus motor to do anything. Last update was that you’d test it and reply as soon as possible. Hoping we can pick this back up.

Thanks for your patience. We tested the product on our side and the focus motor works normally under our recommended demo, so the hardware itself looks fine. That makes me think the issue may be which demo/software you’re running.

Can you confirm which demo you’re currently using? Please try the official ArduCAM Motorized Focus Camera Python demo here:

Let us know what you see when you run it.

Ok, I tried the procedure at that link many many times and every single attempt gives me the same error output. It really feels like an I2C problem to me. Can you tell me what the error below actually means and how to fix it? Also, curious how you tested it on your side.

Environment:

  • Raspberry Pi 4 Model B AND Raspberry Pi Zero W 2 (I tried both)
  • Fresh Raspberry Pi OS loaded from Raspberry Pi Imager v1.7.2 on each
  • Working dir: pi@raspberrypi:~/RaspberryPI/Motorized_Focus_Camera/python
  • Camera: IMX219 (@10) registered at /base/soc/i2c0mux/i2c@1/imx219@10
  • libcamera v0.0.0

Commands I ran:
python3 AutofocusTest.py -i 10
python FocuserExample.py -i 10

Log output:

pi@raspberrypi:~/RaspberryPI/Motorized_Focus_Camera/python $ python FocuserExample.py -i 10
[0:01:48.418752770] [1109]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0
[0:01:48.820297976] [1110]  WARN RPI raspberrypi.cpp:1233 Mismatch between Unicam and CamHelper for embedded data usage!
[0:01:48.821615756] [1110] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[0:01:48.822064426] [1110]  INFO RPI raspberrypi.cpp:1356 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media3 and ISP device /dev/media0
[0:01:48.823302567] [1109]  INFO Camera camera.cpp:1028 configuring streams: (0) 640x360-RGB888
[0:01:48.823987448] [1110]  INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1920x1080-SBGGR10_1X10 - Selected unicam format: 1920x1080-pBAA
[0:01:48.827641136] [1110] ERROR Serializer control_serializer.cpp:442 Unsupported controls format version 474
[0:01:48.827746767] [1110] ERROR Serialization byte_stream_buffer.cpp:291 Unable to read 32 bytes: out of bounds
[0:01:48.827802760] [1110] ERROR Serializer control_serializer.cpp:544 Out of data
[0:01:48.827862971] [1110] ERROR IPADataSerializer ipa_data_serializer.cpp:394 Failed to deserialize ControlList: buffer overflow
[0:01:48.868832810] [1110] ERROR Serializer control_serializer.cpp:579 Can't deserialize ControlList: unknown ControlInfoMap
10
[0:02:07.211730559] [1110] ERROR Serializer control_serializer.cpp:579 Can't deserialize ControlList: unknown ControlInfoMap
[0:02:07.253712318] [1110] ERROR Serializer control_serializer.cpp:579 Can't deserialize ControlList: unknown ControlInfoMap

Same result on both Pis, every time. Would love any ideas on what this means or how to fix it.