Is there a way to disable auto exposure control on an RPI camera2?

I ave one Mendel90 where the camera exposure changes from too dark to overexposed as the bed moves backwards and forwards exposing more or less black DiBond. Is there a parameter to add to the camera config that will fix the exposure level?

Yes, it will be adapting automatically. Also, it's calibrated for "typical" use cases, so very bright lights that are quite different from outdoor lighting would be the kind of thing that might confuse it. You can use the "set_controls" function to control these parameters. You could:

  • Turn off the AEC/AGC ("picam2.set_controls({'AeEnable': False})") and AWB (set 'AwbEnable' to False). Maybe do this once they've settled?
  • Or you could set specific values for the exposure and gain ('ExposureTime' and 'AnalogueGain'), and the colour gains ('ColourGains').
  • You could restrict the AWB range ('AwbMode') so that bright lights won't tend to force it towards daylight.

The camera settings plugin might be your friend here, which will allow you to adjust available settings and set up a profile with those settings to load on startup.

1 Like

Thanks. I added the camera settings plugin but none of the settings have any effect. I even added vertical flip and that made no difference.

The log says:

2024-07-06 19:59:26,869 - octoprint.plugins.camerasettings - INFO - Excluding camera bcm2835-isp-capture0 based on ^bcm2835-isp-\w+$

Seems I didn't follow the install instructions. I needed to set the camera type to usb despite it not being a usb camera.