Working around USB webcam auto exposure sticking

The webcam I use for my birdfeeder stream regularly exhibits a glitch where the autoexposure gets stuck.

This often leads to an underexposed image in low light conditions.

Restarting the device resolves this but I wanted a simpler and less intrusive workaround.

I found that toggling the exposure mode to manual and back to auto resolved the issue temporarily.

Scheduling this using a V4l2 command in crontab works well for my use case:

v4l2-ctl -d /dev/cams/cam3 -c auto_exposure=1
v4l2-ctl -d /dev/cams/cam3 -c auto_exposure=3

You can see from my cron, I’ve scheduled this to run on the hour and at a minute past the hour.