Arducam 16MP IMX519 - RuntimeError: Control AfMode is not advertised by libcamera

When trying the autofocus example below, I receive the error RuntimeError: Control AfMode is not advertised by libcamera. I can use the camera with the command line, even with e.g. autofocus-on-capture, without error - but the camera is not focusing.

I am running a headless setup with ssh to the RPi (4, 8gb). libcamera-dev 0.0.12.

I followed this guide for installation:

import time

from picamera2 import Picamera2, Preview

picam2 = Picamera2()


preview_config = picam2.create_preview_configuration()




# If your libcamera-dev version is lower than 0.0.10, please use the following code.

# picam2.set_controls({"AfTrigger": 0})

# If your libcamera-dev version is greater than or equal to 0.0.10, please use the following code.

# AfMode Set the AF mode (manual, auto, continuous)

picam2.set_controls({"AfMode": 1 ,"AfTrigger": 0})



wget -O
chmod +x
./ -p imx519_kernel_driver_low_speed

Have you installed the motor driver corresponding to imx519? It is installed through the corresponding installation script.

Yes. I have followed the installation guide on several blank images. I just went through the script you provided and I still recieve the same error:

[0:11:26.973240087] [1931] INFO Camera camera_manager.cpp:299 libcamera v0.0.3+40-9b860a66
[0:11:26.999585051] [1932] INFO RPI raspberrypi.cpp:1425 Registered camera /base/soc/i2c0mux/[email protected]/[email protected] to Unicam device /dev/media2 and ISP device /dev/media0
[0:11:27.004852455] [1931] INFO Camera camera.cpp:1028 configuring streams: (0) 640x480-XBGR8888
[0:11:27.005241563] [1932] INFO RPI raspberrypi.cpp:805 Sensor: /base/soc/i2c0mux/[email protected]/[email protected] - Selected sensor format: 1280x720-SRGGB10_1X10 - Selected unicam format: 1280x720-pRAA
Traceback (most recent call last):
File “/home/tecologyTrap1/tecology/”, line 28, in
picam2.set_controls({“AfMode”: 1 ,“AfTrigger”: 0})
File “/usr/lib/python3/dist-packages/picamera2/”, line 1066, in set_controls
File “/usr/lib/python3/dist-packages/picamera2/”, line 58, in set_controls
self.setattr(k, v)
File “/usr/lib/python3/dist-packages/picamera2/”, line 33, in setattr
raise RuntimeError(f"Control {name} is not advertised by libcamera")
RuntimeError: Control AfMode is not advertised by libcamera

1 Like


Before, I need some information

Please reboot your device and execute the following command:

wget -O arducam-camera-bug-report
chmod +x ./arducam-camera-bug-report

This will output an arducam-bug-report.txt in the current directory.

Please send this file to me via google cloud disk or similar platform or email ([email protected])…

Thank you for your cooperation and have a nice life.