-
Notifications
You must be signed in to change notification settings - Fork 180
Description
first of all, many thanks for this great initiative!
I am having a problem, most likely with the camera settings and need help from the community.
I run the code on a Raspberry Pi® 4 B 4 GB 4 x 1.5 GHz with latest version of bookworm insalled. My camera is a Raspberry Pi® SC0024 Camera Module V2 NoIR 8MP. When running speed-cam.py I get the error message enclosed. I have tried multiple camera settings by now but could not find the reason for the error message. Camera is working - tried it with direct access. As I am running the lastest version changing raspi-config (as suggested) is not solution.
many thanks for your help
2025-04-18 10:41:31 INFO pluginEnabled /home/philipp/speed-camera/plugins/picam240.py
2025-04-18 10:41:31 INFO Copy /home/philipp/speed-camera/plugins/picam240.py to /home/philipp/speed-camera/plugins/current.py
2025-04-18 10:41:31 INFO strmcam Imported Required Camera Stream Settings from config.py
2025-04-18 10:41:31 WARNING strmcam cannot import name 'RTSPCAM_SRC' from 'plugins.current' (/home/philipp/speed-camera/plugins/current.py)
2025-04-18 10:41:31 INFO strmcam PILIBCAM Imported New Camera Stream Settings from plugin picam240
2025-04-18 10:41:31 INFO is_pi_legacy_cam Check for Legacy Pi Camera Module with command - vcgencmd get_camera
2025-04-18 10:41:31 WARNING is_pi_legacy_cam Problem Finding Pi Legacy Camera supported=0 detected=0, libcamera interfaces=0
2025-04-18 10:41:31 WARNING is_pi_legacy_cam Check Camera Connections and Legacy Pi Cam is Enabled per command sudo raspi-config
Traceback (most recent call last):
File "/home/philipp/speed-camera/./speed-cam.py", line 1983, in
vs = strmcam() # start video stream thread
^^^^^^^^^
File "/home/philipp/speed-camera/strmcam.py", line 171, in strmcam
vs = create_cam_thread(CAMERA)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/philipp/speed-camera/strmcam.py", line 116, in create_cam_thread
vs = CamStream(size=IM_SIZE,
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/philipp/speed-camera/strmpilibcam.py", line 78, in init
self.picam2.set_controls({"AfMode": 0, "LensPosition": 1}) # turns off autofocus
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1242, in set_controls
self.controls.set_controls(controls)
File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 58, in set_controls
self.setattr(k, v)
File "/usr/lib/python3/dist-packages/picamera2/controls.py", line 33, in setattr
raise RuntimeError(f"Control {name} is not advertised by libcamera")
RuntimeError: Control AfMode is not advertised by libcamera