IMX219 electric focus cannot be controlled on Raspberry Pi 4B – need commands/program

Hi everyone, I’m having trouble with my IMX219 camera on a Raspberry Pi 4B. It’s the motorized focus variant, but I can’t figure out how to control the electric focus at all — I’ve never gotten it to work. I’ve tried looking around but can’t find any commands or programs to adjust the focus motor. Does anyone know if there are specific commands or software to control the IMX219 electric focus? I’ve attached a couple photos of my setup. Thanks in advance.

Thanks for reaching out. Before we dive into the software side, could you post clear front and back photos of the camera module itself? I want to make sure we’re dealing with the correct hardware variant first — there are a few different IMX219 modules out there and the motorized focus version has some specific requirements.

Sure, here are the front and back photos of the camera module. This was bought from an online retailer and it’s supposed to be the motorized focus model. Let me know if you need better angles.

Thanks for the photos — that does look like the Arducam IMX219 Motorized Focus Camera. The good news is the focus motor is definitely controllable from the Pi, but you need to use the right toolchain.

The official quick start guide for this camera covers everything you need. Check out the image sensor section here:

https://docs.arducam.com/Raspberry-Pi-Camera/Motorized-Focus-Camera/Quick-Start-Guide/IMX219-Motorized-Focus-Camera/#image-sensor

That page walks through the setup, driver configuration, and the control commands for the focus motor. The motorized focus is driven via I2C commands through the camera’s onboard controller — it’s not something that works out of the box with the standard libcamera or raspistill alone. You’ll need to use the focus control utilities covered in that guide.

Give that a try and let us know how it goes or if you hit any snags along the way.