IMX219 on Raspi zero unable to control focus motor

I followed the included direction packets and all the directions I have found online and I can’t seem to communicate with the camera’s motor to focus. The raspi OS, libraries, kernel, ArduCAM git folders are up to date. The settings match recommended. The boot file has been edited as recommended. This is the 3rd ArduCAM unit I’ve bought and I get the same issue with all. Please help!!

I can preview a clean image when I issue command: libcamera-still -t 0 however when I try to use one of the Python or C files on the github (RaspberryPi/Motorized_Focus_Camera/python at master · ArduCAM/RaspberryPi · GitHub) I get errors. For example:

[email protected]:~/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/[email protected]/[email protected] 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/[email protected]/[email protected] - 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

Maybe an i2C communication issue? Also have gotten Segmentation Fault errors. What is the Mismatch between Unicam and CamHelper error message? If there are any ideas on how to fix this, please let me know.

hi, @twall

Sorry, reply to you so late.

This problem is caused by the current Libcamera Python library, which is not compatible with the latest libcamera-dev.

We initially planned not to maintain the library and fully supported Picamera2. However, after testing, Picamera2 does not support autofocus. We decided to continue to maintain the library until Picamera2 supports all the functions of the camera.

In addition, the Focuserexample.py Example we rewrite it to Picamera2, you can refer to Readme installation and use.