Octoprint with Logitech C905 webcam problem

#1

What is the problem?
I have a Logitech C905 webcam connected to my raspberry pi3 running octoprint. Sometimes the webcam works, sometimes not. There is no pattern to when it works and when it does not. Lately it is not working 9 times out of 10 and is not usable at all.

What did you already try to solve it?

Being total noob to Ocptoprint command line, I tried googling for similar problems and found no solution. Found the webcam model to work with 800x600 resolution and 10fps (https://github.com/foosel/OctoPrint/wiki/Webcams-known-to-work) for other people, still, it's not working for me.

When I do a cat /var/log/webcamd.log, I get the following result:
Starting up webcamDaemon...

--- Configuration: ----------------------------
camera: auto
usb options: -r 800x600 -f 10
raspi options: -fps 10
http options: -w ./www


Found video devices:
/dev/video0
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>May 7 22:24:04 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www -i input_uvc.so -r 800x600 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 800 x 600
i: Frames Per Second.: 10
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
o: www-folder-path......: ./www/
o: HTTP TCP port........: 8080
o: HTTP Listen Address..: (null)
o: username:password....: disabled
o: commands.............: enabled
i: select() timeout
i: cleaning up resources allocated by input thread`

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

OctoPrint version 1.3.10, OctoPi version 0.16.0, Ender3, Marlin 1.1.9

#2

Hello, I did some additional digging into this issue and am pasting some logs from a successful octoprint boot and an unsuccessful octoprint boot. During the successful boot the camera came online and was working, with the unsuccessful one it did not.

I am struggling to understand the logs and what I should do, to make the camera work all the time. Any advice please?

This is info from the failed boot sessions:

pi@octopi:~ $ cat /var/log/webcamd.log

Starting up webcamDaemon...

--- Configuration: ----------------------------
camera:        auto
usb options:   -r 800x600 -f 15
raspi options: -fps 10
http options:  -w ./www
-----------------------------------------------

Found video devices:
/dev/video0
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>May  8 19:53:10 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www  -i input_uvc.so -r 800x600 -f 15 -d /dev/video0
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 800 x 600
 i: Frames Per Second.: 15
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: ./www/
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
 i: select() timeout
 i: cleaning up resources allocated by input thread

pi@octopi:~ $ lsusb
Bus 001 Device 005: ID 046d:0991 Logitech, Inc. QuickCam Pro for Notebooks
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

pi@octopi:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=ch341, 12M
        |__ Port 4: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 5, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 4: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 5, If 3, Class=Audio, Driver=snd-usb-audio, 480M

pi@octopi:~ $ systemctl status webcamd
â webcamd.service - LSB: webcam daemon
   Loaded: loaded (/etc/init.d/webcamd; generated; vendor preset: enabled)
   Active: active (running) since Wed 2019-05-08 19:53:10 BST; 13min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 416 ExecStart=/etc/init.d/webcamd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/webcamd.service
           ââ441 /bin/bash /root/bin/webcamd
           ââ465 ./mjpg_streamer -o output_http.so -w ./www  -i input_uvc.so -r 800x600 -f 15 -d /dev/video0

May 08 19:53:10 octopi mjpg_streamer[465]: MJPG-streamer [465]: TV-Norm...........: DEFAULT
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: www-folder-path......: ./www/
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: HTTP TCP port........: 8080
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: HTTP Listen Address..: (null)
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: username:password....: disabled
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: commands.............: enabled
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: starting input plugin input_uvc.so
May 08 19:53:11 octopi mjpg_streamer[465]: MJPG-streamer [465]: starting output plugin: output_http.so (ID: 00)
May 08 19:53:16 octopi mjpg_streamer[465]: MJPG-streamer [465]: select() timeout
May 08 19:53:16 octopi mjpg_streamer[465]: MJPG-streamer [465]: cleaning up resources allocated by input thread

And this is info from the successful boot session:

pi@octopi:~ $ cat /var/log/webcamd.log

Starting up webcamDaemon...

--- Configuration: ----------------------------
camera:        auto
usb options:   -r 800x600 -f 15
raspi options: -fps 10
http options:  -w ./www
-----------------------------------------------

Found video devices:
/dev/video0
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>May  7 23:44:26 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www  -i input_uvc.so -r 800x600 -f 15 -d /dev/video0
MJPG Streamer Version: git rev: ddb69b7b4f114f3c2ca01adf55712792ca8aed43
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 800 x 600
 i: Frames Per Second.: 15
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: ./www/
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
pi@octopi:~ $ lsusb
Bus 001 Device 005: ID 046d:0991 Logitech, Inc. QuickCam Pro for Notebooks
Bus 001 Device 004: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@octopi:~ $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/5p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=ch341, 12M
        |__ Port 4: Dev 5, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 5, If 2, Class=Audio, Driver=snd-usb-audio, 480M
        |__ Port 4: Dev 5, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 4: Dev 5, If 3, Class=Audio, Driver=snd-usb-audio, 480M
pi@octopi:~ $ systemctl status webcamd
â webcamd.service - LSB: webcam daemon
   Loaded: loaded (/etc/init.d/webcamd; generated; vendor preset: enabled)
   Active: active (running) since Tue 2019-05-07 23:44:26 BST; 7h ago
     Docs: man:systemd-sysv-generator(8)
  Process: 411 ExecStart=/etc/init.d/webcamd start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/webcamd.service
           ââ431 /bin/bash /root/bin/webcamd
           ââ461 ./mjpg_streamer -o output_http.so -w ./www  -i input_uvc.so -r 800x600 -f 15 -d /dev/video0

May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: Frames Per Second.: 15
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: Format............: JPEG
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: TV-Norm...........: DEFAULT
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: www-folder-path......: ./www/
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: HTTP TCP port........: 8080
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: HTTP Listen Address..: (null)
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: username:password....: disabled
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: commands.............: enabled
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: starting input plugin input_uvc.so
May 07 23:44:26 octopi mjpg_streamer[461]: MJPG-streamer [461]: starting output plugin: output_http.so (ID: 00)
pi@octopi:~ $