Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ran into this error when trying your scripts #2

Open
Deses opened this issue Jul 30, 2023 · 2 comments
Open

Ran into this error when trying your scripts #2

Deses opened this issue Jul 30, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@Deses
Copy link
Contributor

Deses commented Jul 30, 2023

pi@pi3:~/timelapses/TimelapsePy $ python timelapse.py
tlogger.py <version 0.0.2> imported.
usersettings.py <version 0.0.1> imported.
tutilities.py <version 0.0.3> imported.
[2:07:28.607665408] [2178]  INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[2:07:28.648126597] [2180]  INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media3 and ISP device /dev/media0
[2:07:28.648294565] [2180]  INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[2:07:28.660302209] [2178]  INFO Camera camera.cpp:1033 configuring streams: (0) 3840x2160-BGR888 (1) 2592x1944-SGBRG10_CSI2P
[2:07:28.660905695] [2180]  INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 2592x1944-SGBRG10_1X10 - Selected unicam format: 2592x1944-pGAA
2023-07-30 16:16:49,218 - TimelapsePy - ERROR - Error at division
Traceback (most recent call last):
  File "/home/pi/timelapses/TimelapsePy/timelapse.py", line 35, in <module>
    picam2.set_controls({"AfMode": util.get_focal_mode(users.user_focus_mode),
  File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 1093, 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

I'm using an old Pi Camera 1.3 that doesn't have AF or anything fancy, uses the ov5647 sensor and works well when I manually use libcamera-still.

If i comment line 35 and 36, it works.

@benstanfish benstanfish added the bug Something isn't working label Jul 30, 2023
@benstanfish benstanfish self-assigned this Jul 30, 2023
@benstanfish
Copy link
Owner

I was having some issues with Lines 35 and 36 myself. I'm debating whether to remove them all together, or add code to determine if the camera has AF capability before applying controls. More to come.

@Deses
Copy link
Contributor Author

Deses commented Jul 30, 2023

You are in luck! I spent most of today tinkering around my Pi and the camera and did some changes you might like.

Kindly review it here: #6 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants