I have a Logitech QuickCam Pro 9000, on a Raspberry Pi 3B+, which was running fine - probably until I started to update/upgrade it, but I had been monitoring tabs other than with the webcam stream.
I noticed the camera had stopped working, with one error being "It might not be configured correctly or require authentication."
This particular setup has been running for about 6 months with no issue (call this OctoPi-A). I have just set up my second 3D printer with Octoprint within the last week with a fresh download of the SD card image (call this OctoPi-B) - so I can compare the two.
The OctoPi-B has been configured identically to the OctoP-A, with the only differences being the machine name and IP address (as well as a different colour scheme in Themify plugin). I have updated Octoprint and logged in via SSH, running "sudo apt update" and "sudo apt upgrade" on both and rebooting so they should be the same.
Hardware-wise the only difference is the webcam - OctoPi A running the Logitech QuickCam Pro 9000 (USB ID 046d:0990) and OctoPi B running a Logitech HD Pro Webcam C920 (USB ID 046d:082d). Unfortunately, I did not swap them to see if the error moved from one machine to the other!
Having looked around and come across editing /boot/octopi.txt (which gave me options but did not fix the problem) as well as other possible solutions I found the following:
- Accessing OctoPi A by name, octopi.local, IP address or otherwise, with or without http:// or https:// results in the same problem - suggestions elsewhere regarding this can then be ignored and you can jump onto other testing.
- On OctoPi A, the command "ps -ax|grep mjpg" came back wrong (I don't have a copy of that unfortunately) - after fixing it now shows something including " ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1920x1080 -f 5 -d /dev/video0" which is better - I assume this just means it is up and running OK.
- After other tests the webcamd.service appeared to be the problem. The following is the commands and output:
login as: pi
pi@OctoPi-A's password:
Linux OctoPi-A 5.4.72-v7+ #1356 SMP Thu Oct 22 13:56:54 BST 2020 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 9 09:23:48 2020 from 192.168.0.235
------------------------------------------------------------------------------
Access OctoPrint from a web browser on your network by navigating to any of:
http://OctoPi-A.local
http://192.168.0.185
https is also available, with a self-signed certificate.
------------------------------------------------------------------------------
This image comes without a desktop environment installed because it's not
required for running OctoPrint. If you want a desktop environment you can
install it via
sudo /home/pi/scripts/install-desktop
------------------------------------------------------------------------------
OctoPrint version : 1.4.2
OctoPi version : 0.17.0
------------------------------------------------------------------------------
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-09 10:06:11 GMT; 2min 15s ago
Process: 335 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
Main PID: 443 (mjpg_streamer)
Tasks: 3 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ443 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1920x1080 -f 5 -d /dev/video0
Nov 09 10:06:11 OctoPi-A mjpg_streamer[443]: MJPG-streamer [443]: commands.............: disabled
Nov 09 10:06:11 OctoPi-A mjpg_streamer[443]: MJPG-streamer [443]: starting input plugin input_uvc.so
Nov 09 10:06:11 OctoPi-A mjpg_streamer[443]: MJPG-streamer [443]: starting output plugin: output_http.so (ID: 00)
Nov 09 10:06:11 OctoPi-A webcamd[335]: Done bring up all configured video device
Nov 09 10:06:11 OctoPi-A webcamd[335]: Goodbye...
Nov 09 10:06:11 OctoPi-A systemd[1]: Started the OctoPi webcam daemon with the user specified config.
Nov 09 10:06:16 OctoPi-A webcamd[335]: i: select() timeout
Nov 09 10:06:16 OctoPi-A webcamd[335]: i: cleaning up resources allocated by input thread
Nov 09 10:06:16 OctoPi-A mjpg_streamer[443]: MJPG-streamer [443]: select() timeout
Nov 09 10:06:16 OctoPi-A mjpg_streamer[443]: MJPG-streamer [443]: cleaning up resources allocated by input thread
pi@OctoPi-A:~ $ sudo service webcamd restart
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: activating (start) since Mon 2020-11-09 10:08:45 GMT; 948ms ago
Cntrl PID: 885 (webcamd)
Tasks: 2 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ885 /bin/bash /root/bin/webcamd
ββ910 sleep 1
Nov 09 10:08:45 OctoPi-A webcamd[885]: i: TV-Norm...........: DEFAULT
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: Using V4L2 device.: /dev/video0
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: Desired Resolution: 1920 x 1080
Nov 09 10:08:45 OctoPi-A webcamd[885]: Unable to set format: 1196444237 res: 1920x1080
Nov 09 10:08:45 OctoPi-A webcamd[885]: Init v4L2 failed !! exit fatal
Nov 09 10:08:45 OctoPi-A webcamd[885]: i: init_VideoIn failed
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: Frames Per Second.: 5
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: Format............: JPEG
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: TV-Norm...........: DEFAULT
Nov 09 10:08:45 OctoPi-A mjpg_streamer[909]: MJPG-streamer [909]: init_VideoIn failed
pi@OctoPi-A:~ $ sudo service webcamd restart
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: activating (start) since Mon 2020-11-09 10:09:15 GMT; 670ms ago
Cntrl PID: 1031 (webcamd)
Tasks: 2 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ1031 /bin/bash /root/bin/webcamd
ββ1056 sleep 1
Nov 09 10:09:15 OctoPi-A webcamd[1031]: i: Frames Per Second.: 5
Nov 09 10:09:15 OctoPi-A mjpg_streamer[1055]: MJPG-streamer [1055]: Frames Per Second.: 5
Nov 09 10:09:15 OctoPi-A webcamd[1031]: i: Format............: JPEG
Nov 09 10:09:15 OctoPi-A mjpg_streamer[1055]: MJPG-streamer [1055]: Format............: JPEG
Nov 09 10:09:15 OctoPi-A webcamd[1031]: i: TV-Norm...........: DEFAULT
Nov 09 10:09:15 OctoPi-A mjpg_streamer[1055]: MJPG-streamer [1055]: TV-Norm...........: DEFAULT
Nov 09 10:09:15 OctoPi-A webcamd[1031]: Error opening device /dev/video10: video capture not supported.
Nov 09 10:09:15 OctoPi-A webcamd[1031]: Init v4L2 failed !! exit fatal
Nov 09 10:09:15 OctoPi-A webcamd[1031]: i: init_VideoIn failed
Nov 09 10:09:15 OctoPi-A mjpg_streamer[1055]: MJPG-streamer [1055]: init_VideoIn failed
pi@OctoPi-A:~ $ sudo service webcamd restart
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-09 10:09:33 GMT; 1s ago
Process: 1137 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
Main PID: 1161 (mjpg_streamer)
Tasks: 3 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ1161 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1920x1080 -f 5 -d /dev/video0
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: www-folder-path......: ./www-octopi/
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: HTTP TCP port........: 8080
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: HTTP Listen Address..: (null)
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: username:password....: disabled
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: commands.............: disabled
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: starting input plugin input_uvc.so
Nov 09 10:09:32 OctoPi-A mjpg_streamer[1161]: MJPG-streamer [1161]: starting output plugin: output_http.so (ID: 00)
Nov 09 10:09:33 OctoPi-A webcamd[1137]: Done bring up all configured video device
Nov 09 10:09:33 OctoPi-A webcamd[1137]: Goodbye...
Nov 09 10:09:33 OctoPi-A systemd[1]: Started the OctoPi webcam daemon with the user specified config.
pi@OctoPi-A:~ $ lsusb
Bus 001 Device 005: ID 1eaf:0004
Bus 001 Device 011: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@OctoPi-A:~ $
What you have is webcamd.service, or related code (mjpg_streamer in particular) is not working properly, restarting webcamd.service a number of times fixes it (eventually and temporarily). Note the webcam is now Device 011 even though it has not been changed/unplugged.
I rebooted and tested again. It did not work immediately so the fix above does not work across reboots. You can tell it is working once you see the HTTP TCP port 8080 in the service status response. You can also see that the webcam remained as Device 004 throughout.
login as: pi
pi@OctoPi-A's password:
Linux OctoPi-A 5.4.72-v7+ #1356 SMP Thu Oct 22 13:56:54 BST 2020 armv7l
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Mon Nov 9 10:08:15 2020 from 192.168.0.235
------------------------------------------------------------------------------
Access OctoPrint from a web browser on your network by navigating to any of:
http://OctoPi-A.local
http://192.168.0.185
https is also available, with a self-signed certificate.
------------------------------------------------------------------------------
This image comes without a desktop environment installed because it's not
required for running OctoPrint. If you want a desktop environment you can
install it via
sudo /home/pi/scripts/install-desktop
------------------------------------------------------------------------------
OctoPrint version : 1.4.2
OctoPi version : 0.17.0
------------------------------------------------------------------------------
pi@OctoPi-A:~ $ lsusb
Bus 001 Device 005: ID 1eaf:0004
Bus 001 Device 004: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-09 10:11:45 GMT; 1min 3s ago
Process: 331 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
Main PID: 448 (mjpg_streamer)
Tasks: 2 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ448 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1920x1080 -f 5 -d /dev/video0
Nov 09 10:11:45 OctoPi-A mjpg_streamer[448]: MJPG-streamer [448]: commands.............: disabled
Nov 09 10:11:45 OctoPi-A mjpg_streamer[448]: MJPG-streamer [448]: starting input plugin input_uvc.so
Nov 09 10:11:45 OctoPi-A mjpg_streamer[448]: MJPG-streamer [448]: starting output plugin: output_http.so (ID: 00)
Nov 09 10:11:45 OctoPi-A webcamd[331]: Done bring up all configured video device
Nov 09 10:11:45 OctoPi-A webcamd[331]: Goodbye...
Nov 09 10:11:45 OctoPi-A systemd[1]: Started the OctoPi webcam daemon with the user specified config.
Nov 09 10:11:50 OctoPi-A webcamd[331]: i: select() timeout
Nov 09 10:11:50 OctoPi-A webcamd[331]: i: cleaning up resources allocated by input thread
Nov 09 10:11:50 OctoPi-A mjpg_streamer[448]: MJPG-streamer [448]: select() timeout
Nov 09 10:11:50 OctoPi-A mjpg_streamer[448]: MJPG-streamer [448]: cleaning up resources allocated by input thread
pi@OctoPi-A:~ $ lsusb
Bus 001 Device 005: ID 1eaf:0004
Bus 001 Device 004: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@OctoPi-A:~ $ sudo service webcamd restart
pi@OctoPi-A:~ $ lsusb
Bus 001 Device 005: ID 1eaf:0004
Bus 001 Device 004: ID 046d:0990 Logitech, Inc. QuickCam Pro 9000
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@OctoPi-A:~ $ sudo service webcamd status
β webcamd.service - the OctoPi webcam daemon with the user specified config
Loaded: loaded (/etc/systemd/system/webcamd.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2020-11-09 10:13:10 GMT; 11s ago
Process: 825 ExecStart=/root/bin/webcamd (code=exited, status=0/SUCCESS)
Main PID: 849 (mjpg_streamer)
Tasks: 3 (limit: 1939)
CGroup: /system.slice/webcamd.service
ββ849 ./mjpg_streamer -o output_http.so -w ./www-octopi -n -i input_uvc.so -r 1920x1080 -f 5 -d /dev/video0
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: www-folder-path......: ./www-octopi/
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: HTTP TCP port........: 8080
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: HTTP Listen Address..: (null)
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: username:password....: disabled
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: commands.............: disabled
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: starting input plugin input_uvc.so
Nov 09 10:13:09 OctoPi-A mjpg_streamer[849]: MJPG-streamer [849]: starting output plugin: output_http.so (ID: 00)
Nov 09 10:13:10 OctoPi-A webcamd[825]: Done bring up all configured video device
Nov 09 10:13:10 OctoPi-A webcamd[825]: Goodbye...
Nov 09 10:13:10 OctoPi-A systemd[1]: Started the OctoPi webcam daemon with the user specified config.
pi@OctoPi-A:~ $
Obviously a permanent fix would be preferable. However, in the meantime you can create a cron job that executes the restart for webcamd.service, or if someone can script something that checks the status and restarts it, testing again and repeating, 3 times after a delay each time.
Hope this helps people.