guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.48k stars 366 forks source link

Fix vcgencmd get_camera output matching with libcamera #790

Closed cp2004 closed 2 years ago

cp2004 commented 2 years ago

On the newer images (incl. 1.0.0RC2, and if you run sudo apt upgrade on an older one - even buster) vcgencmd has been updated with different output:

supported=1 detected=1, libcamera interfaces=0

This comparison to the exact string then broke. Users with camera="raspi" meant that their cameras were not detected, such as this post on the forums https://community.octoprint.org/t/cannot-get-the-picam-to-work/45922/2?u=charlie_powell. Luckily it can be used in 'usb' mode as well with the v4l2 driver.

I have not verified that this change allows webcamd to work completely with a Raspberry Pi camera as I don't have one, but the regex matching has been tested.