πŸ‡ΊπŸ‡¦ We stand with Ukraine! πŸ‡ΊπŸ‡¦

Focus USB camera on octopi using SSH not working

Continuing the discussion from Anyway to disable the autofocus for cameras?:

I'm using two cameras, the Raspi Cam and a USB Endoscope with Octoprint, both are setup and work great. But I'm having trouble trying to set the focus for the Endoscope cam.

I tried all the commands in this thread but get errors. Did something change with newer version of Octopi/Octoprint?

I entered these:

cd mjpg-streamer/

sudo v4l2-ctl --set-ctrl=focus_auto=0

and it returns:

unknown control 'focus_auto'

I installed the uvcdynctrl and tried:

uvcdynctrl -s "Focus, Auto" 0

but it returns:

[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x00980001, name = 'User Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00980001, name = 'User Controls'
[libwebcam] Unknown V4L2 user control ID encountered: 0x00980927 (V4L2_CID_USER_BASE + 39)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x00980001, name = 'User Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00980001, name = 'User Controls'
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098090E (V4L2_CID_USER_BASE + 14)
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098090F (V4L2_CID_USER_BASE + 15)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009F0001, name = 'Image Processing Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009F0001, name = 'Image Processing Controls'
[libwebcam] Unknown V4L2 control ID encountered: 0x009F0905
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009F0905, name = 'Digital Gain'
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x00980001, name = 'User Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00980001, name = 'User Controls'
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098090E (V4L2_CID_USER_BASE + 14)
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098090F (V4L2_CID_USER_BASE + 15)
[libwebcam] Unknown V4L2 user control ID encountered: 0x00980914 (V4L2_CID_USER_BASE + 20)
[libwebcam] Unknown V4L2 user control ID encountered: 0x00980915 (V4L2_CID_USER_BASE + 21)
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098091F (V4L2_CID_USER_BASE + 31)
[libwebcam] Unknown V4L2 user control ID encountered: 0x00980922 (V4L2_CID_USER_BASE + 34)
[libwebcam] Unknown V4L2 user control ID encountered: 0x0098092A (V4L2_CID_USER_BASE + 42)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x00990001, name = 'Codec Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00990001, name = 'Codec Controls'
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909CE (V4L2_CID_MPEG_BASE + 206)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909CF (V4L2_CID_MPEG_BASE + 207)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909E2 (V4L2_CID_MPEG_BASE + 226)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A66 (V4L2_CID_MPEG_BASE + 358)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A67 (V4L2_CID_MPEG_BASE + 359)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A6B (V4L2_CID_MPEG_BASE + 363)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A0001, name = 'Camera Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0001, name = 'Camera Controls'
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A0913, name = 'Auto Exposure, Bias', type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0913, name = 'Auto Exposure, Bias'
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A0914 (V4L2_CID_CAMERA_CLASS_BASE + 20)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A0916 (V4L2_CID_CAMERA_CLASS_BASE + 22)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A0917, name = 'ISO Sensitivity', type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0917, name = 'ISO Sensitivity'
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A0918 (V4L2_CID_CAMERA_CLASS_BASE + 24)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A0919 (V4L2_CID_CAMERA_CLASS_BASE + 25)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A091A (V4L2_CID_CAMERA_CLASS_BASE + 26)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009D0001, name = 'JPEG Compression Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009D0001, name = 'JPEG Compression Controls'
[libwebcam] Unknown V4L2 control ID encountered: 0x009D0903
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009D0903, name = 'Compression Quality'
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x00990001, name = 'Codec Controls', type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x00990001, name = 'Codec Controls'
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909CE (V4L2_CID_MPEG_BASE + 206)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909CF (V4L2_CID_MPEG_BASE + 207)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909D8 (V4L2_CID_MPEG_BASE + 216)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909E2 (V4L2_CID_MPEG_BASE + 226)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x009909E5 (V4L2_CID_MPEG_BASE + 229)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A66 (V4L2_CID_MPEG_BASE + 358)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A67 (V4L2_CID_MPEG_BASE + 359)
[libwebcam] Unknown V4L2 MPEG control ID encountered: 0x00990A6B (V4L2_CID_MPEG_BASE + 363)

is there no way to focus a USB camera now if it doesn't have a focus ring to manually adjust?

The Raspi cam doesn't have an autofocus motor, and has to be adjusted manually. Could you link the second, so we can see if it looks like it does? Not all webcams have an autofocus motor in them to adjust the lenses, some are completely fixed focus and others have manual adjustment.

Ahh ok. This probably doesn't have an autofocus motor on, but I was just confused why the command in SSH didn't even work at all and said not found.
https://www.amazon.com/gp/product/B07PBF6DX5/ref=ppx_yo_dt_b_asin_title_o09_s00?ie=UTF8&psc=1