Webcam USB on OctoPrint

Ssh way to configure octoprint usb webcam

Nicola Landro
1 min readFeb 1

--

This is a simple and complete guide to configure webcam on OctoPrint.

Webcam working on OctoPrint

My configuration and installation of OctoPrint is made following this guide on a Raspberry Pi 3 Model B with a 16GB ssd memory.

SSH

All start from ssh to your machine for example

$ ssh pi@192.168.1.<XXX>

Information about the webcam

Now we need the correct configuration from the webcam, plug the usb and run this command:

$ v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
...
Size: Discrete 1280x960
Interval: Discrete 0.111s (9.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 1280x1024
Interval: Discrete 0.111s (9.000 fps)
Interval: Discrete 0.200s (5.000 fps)

Configure

Now we need to configure (with one of the parameter that you list before) and reboot the system:

$ sudo nano /boot/octopi.txt
...
camera="usb"
...
camera_usb_options="-r 1280x1024 -f 9"
...
camera_raspi_options="-fps 9"
...
$ sudo reboot

Now go to the OctoPrint and see the webcam!

--

--

Nicola Landro

Linux user and Open Source fun. Deep learning PhD. , Full stack web developer, Mobile developer, cloud engineer and Musitian.