Camera model
Logitech c920e
What is the problem?
I have been using the previously established method of starting and stopping the Webcamd service to enable and disable my camera when not printing. During one of my prints this morning, the webcam stopped working entirely. After the print was finished, I restarted the Pi 4 completely, and the webcam works again. But now, the Webcamd service can't be started or stopped, it doesn't even exist anymore.
What did you already try to solve it?
Rebooted several times.
Fully reflashed Octopi onto the SD card
Logs (/var/log/webcamd.log
, syslog, dmesg, ... no logs, no support)
pi@octopi:~ $ service --status-all
[ + ] alsa-utils
[ + ] avahi-daemon
[ + ] bluetooth
[ + ] change_hostname
[ + ] change_password
[ - ] console-setup.sh
[ + ] cron
[ + ] dbus
[ + ] dhcpcd
[ + ] dphys-swapfile
[ + ] fake-hwclock
[ + ] haproxy
[ - ] hwclock.sh
[ - ] keyboard-setup.sh
[ + ] kmod
[ + ] lighttpd
[ + ] networking
[ - ] nfs-common
[ - ] nginx
[ - ] paxctld
[ + ] pihole-FTL
[ + ] procps
[ + ] raspi-config
[ ? ] rng-tools
[ - ] rpcbind
[ - ] rsync
[ + ] rsyslog
[ - ] screen-cleanup
[ + ] ssh
[ - ] sudo
[ + ] triggerhappy
[ + ] udev
[ - ] x11-common
Starting up webcamDaemon...
--- Configuration: ----------------------------
cfg_file: /boot/octopi.txt
camera: auto
usb options: -r 640x480 -f 10
raspi options: -fps 10
http options: -w ./www-octopi -n --listen 127.0.0.1
Explicitly USB device:
-----------------------------------------------
Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jun 15 23:23:10 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...
- It seems that you don't have VL805 (Raspberry Pi 4).
There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
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-octopi/
o: HTTP TCP port........: 8080
o: HTTP Listen Address..: 127.0.0.1
o: username:password....: disabled
o: commands.............: disabled
Done bring up all configured video device
Goodbye...
Additional information about your setup (OctoPrint version, OctoPi version, ...)
Octoprint Version 1.6.1
Octopi Version 0.18.0, running on Raspberry Pi 4 Model B Rev 1.4
browser.user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36
connectivity.connection_check: 1.1.1.1:53
connectivity.connection_ok: true
connectivity.enabled: true
connectivity.online: true
connectivity.resolution_check: octoprint.org
connectivity.resolution_ok: true
env.hardware.cores: 4
env.hardware.freq: 1500
env.hardware.ram: 8204619776
env.os.bits: 32
env.os.id: linux
env.os.platform: linux
env.plugins.pi_support.model: Raspberry Pi 4 Model B Rev 1.4
env.plugins.pi_support.octopi_version: 0.18.0
env.plugins.pi_support.throttle_state: 0x0
env.python.pip: 20.3.3
env.python.version: 3.7.3
env.python.virtualenv: true
octoprint.safe_mode: false
octoprint.version: 1.6.1
printer.firmware: Prusa-Firmware 3.10.0 based on Marlin
systeminfo.generator: systemapi
How do you know the webcamd service is missing? It doesn't just delete itself, and the paste you have above from service --status-all
is very incomplete. There's no OctoPrint service there either, and probably more. I checked on my OctoPi installs and got the same result.
You are correct, I attempted a different method to list the services, and it seems much more complete.
Octopi and Webcamd are both present in the list below. It is strange that while it's running its state is either "Start Start" or "Activating Auto-Restart" which it seems to cycle between.
pi@octopi:~ $ systemctl list-units --type=service --all
UNIT LOAD ACTIVE SUB DESCRIPTION
alsa-restore.service loaded active exited Save/Restore Sound Card State
alsa-state.service loaded active running Manage Sound Card State (restore and store)
β apparmor.service not-found inactive dead apparmor.service
apt-daily-upgrade.service loaded inactive dead Daily apt upgrade and clean activities
apt-daily.service loaded inactive dead Daily apt download activities
β auditd.service not-found inactive dead auditd.service
auth-rpcgss-module.service loaded inactive dead Kernel Module supporting RPCSEC_GSS
avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack
bluetooth.service loaded active running Bluetooth service
β bthelper@hci0.service loaded failed failed Raspberry Pi bluetooth helper
change_hostname.service loaded active exited LSB: Change pi's hostname via /boot/octopi-hostname.txt
change_password.service loaded active exited LSB: Change pi's password via /boot/octopi-password.txt
β connman.service not-found inactive dead connman.service
β console-screen.service not-found inactive dead console-screen.service
console-setup.service loaded active exited Set console font and keymap
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
dhcpcd.service loaded active running dhcpcd on all interfaces
β display-manager.service not-found inactive dead display-manager.service
dphys-swapfile.service loaded active exited dphys-swapfile - set up, mount/unmount, and delete a swap file
emergency.service loaded inactive dead Emergency Shell
fake-hwclock.service loaded active exited Restore / save the current clock
ffmpeg_hls.service loaded inactive dead FFMPEG HLS webcam streaming service
gencert.service loaded inactive dead Ensure that haproxy certs are generated
getty-static.service loaded inactive dead getty on tty2-tty6 if dbus and logind are not available
getty@tty1.service loaded active running Getty on tty1
β gssproxy.service not-found inactive dead gssproxy.service
haproxy.service loaded active running HAProxy Load Balancer
hciuart.service loaded active running Configure Bluetooth Modems connected by UART
ifupdown-pre.service loaded active exited Helper to synchronize boot up for ifupdown
β kbd.service not-found inactive dead kbd.service
keyboard-setup.service loaded active exited Set the console keyboard layout
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
lighttpd.service loaded active running Lighttpd Daemon
logrotate.service loaded inactive dead Rotate log files
man-db.service loaded inactive dead Daily man-db regeneration
β mountkernfs.service masked inactive dead mountkernfs.service
networking.service loaded active exited Raise network interfaces
β NetworkManager.service not-found inactive dead NetworkManager.service
β nfs-blkmap.service not-found inactive dead nfs-blkmap.service
nfs-config.service loaded inactive dead Preprocess NFS configuration
β nfs-server.service not-found inactive dead nfs-server.service
nfs-utils.service loaded inactive dead NFS server and client services
nginx.service loaded inactive dead NGINX server for serving HLS and JPEG frames
octoprint.service loaded active running The snappy web interface for your 3D printer
phpsessionclean.service loaded inactive dead Clean php session files
pihole-FTL.service loaded active exited LSB: pihole-FTL daemon
β plymouth-quit-wait.service not-found inactive dead plymouth-quit-wait.service
β plymouth-start.service not-found inactive dead plymouth-start.service
raspberrypi-net-mods.service loaded inactive dead Copy user wpa_supplicant.conf
raspi-config.service loaded active exited LSB: Switch to ondemand cpu governor (unless shift key is pressed)
rc-local.service loaded active exited /etc/rc.local Compatibility
regenerate_ssh_host_keys.service loaded inactive dead Regenerate SSH host keys
rescue.service loaded inactive dead Rescue Shell
rng-tools.service loaded active running rng-tools.service
rpc-gssd.service loaded inactive dead RPC security service for NFS client and server
rpc-svcgssd.service loaded inactive dead RPC security service for NFS server
rpi-eeprom-update.service loaded active exited Check for Raspberry Pi EEPROM updates
rsync.service loaded inactive dead fast remote file copy program daemon
rsyslog.service loaded active running System Logging Service
ssh.service loaded active running OpenBSD Secure Shell server
sshswitch.service loaded inactive dead Turn on SSH if /boot/ssh is present
streamer_select.service loaded inactive dead OctoPi streamer selector
systemd-ask-password-console.service loaded inactive dead Dispatch Password Requests to Console
systemd-ask-password-wall.service loaded inactive dead Forward Password Requests to Wall
systemd-binfmt.service loaded inactive dead Set Up Additional Binary Formats
systemd-fsck-root.service loaded active exited File System Check on Root Device
systemd-fsck@dev-disk-by\x2dpartuuid-a78c3181\x2d01.service loaded active exited File System Check on /dev/disk/by-partuuid/a78c3181-01
systemd-fsckd.service loaded inactive dead File System Check Daemon to report status
systemd-hwdb-update.service loaded inactive dead Rebuild Hardware Database
systemd-initctl.service loaded inactive dead initctl Compatibility Daemon
systemd-journal-flush.service loaded active exited Flush Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-machine-id-commit.service loaded inactive dead Commit a transient machine-id on disk
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-networkd.service loaded inactive dead Network Service
systemd-quotacheck.service loaded inactive dead File System Quota Check
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-rfkill.service loaded inactive dead Load/Save RF Kill Switch Status
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-sysusers.service loaded active exited Create System Users
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-tmpfiles-clean.service loaded inactive dead Cleanup of Temporary Directories
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
β systemd-update-done.service not-found inactive dead systemd-update-done.service
systemd-update-utmp-runlevel.service loaded inactive dead Update UTMP about System Runlevel Changes
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
β systemd-vconsole-setup.service not-found inactive dead systemd-vconsole-setup.service
triggerhappy.service loaded active running triggerhappy global hotkey daemon
user-runtime-dir@1000.service loaded active exited User Runtime Directory /run/user/1000
user-runtime-dir@999.service loaded active exited User Runtime Directory /run/user/999
user@1000.service loaded active running User Manager for UID 1000
user@999.service loaded active running User Manager for UID 999
webcamd.service loaded activating auto-restart the OctoPi webcam daemon with the user specified config
wpa_supplicant.service loaded active running WPA supplicant
I guess my issues with Controlling Webcamd are something else entirely.
Open two SSH/terminal sessions to your Pi. On one, enter tail -f /var/log/webcamd.log
so you can watch the log file. On the other, try restarting the service sudo service webcamd restart
. See if anything shows up in the log file, if it does, find errors, see what changes. If you can't restart webcamd, what message does it give you?
It seems to repeat this every time
Starting up webcamDaemon...
--- Configuration: ----------------------------
cfg_file: /boot/octopi.txt
camera: auto
usb options: -r 640x480 -f 10
raspi options: -fps 10
http options: -w ./www-octopi -n --listen 127.0.0.1
Explicitly USB device:
-----------------------------------------------
Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jun 16 16:28:44 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...
- It seems that you don't have VL805 (Raspberry Pi 4).
There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r 640x480 -f 10 -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 10
i: Format............: JPEG
i: TV-Norm...........: DEFAULT
libv4l2: error setting pixformat: Device or resource busy
Unable to set format: 1196444237 res: 640x480
Init v4L2 failed !! exit fatal
i: init_VideoIn failed
Done bring up all configured video device
Goodbye...
The stream was running the whole time without interruption.
When I ran systemctl list-units --type=service --all before restarting the service, it was marked dead/inactive, which went back to the auto-restart/start state after restarting the service.
The stream was running while the service was marked inactive/dead as well.
I've fixed the resolution but it has not changed much:
Starting up webcamDaemon...
--- Configuration: ----------------------------
cfg_file: /boot/octopi.txt
camera: usb
usb options: -r 1920x1080 -f 30
raspi options: -fps 10
http options: -w ./www-octopi -n --listen 127.0.0.1
Explicitly USB device:
-----------------------------------------------
Found video devices:
/dev/video0
/dev/video1
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
config file='/boot/octopi.txt':USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Jun 16 17:20:29 root: Starting USB webcam
Checking for VL805 (Raspberry Pi 4)...
- It seems that you don't have VL805 (Raspberry Pi 4).
There should be no problems with USB (a.k.a. select() timeout)
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -n --listen 127.0.0.1 -i input_uvc.so -r 1920x1080 -f 30 -d /dev/video0
MJPG Streamer Version: git rev: 5554f42c352ecfa7edaec6fc51e507afce605a34
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1920 x 1080
i: Frames Per Second.: 30
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-octopi/
o: HTTP TCP port........: 8080
o: HTTP Listen Address..: 127.0.0.1
o: username:password....: disabled
o: commands.............: disabled
Done bring up all configured video device
Goodbye...
From the service's perspective here there's no errors (aside from the resolution one) and it seems to think that everything is OK.
When you try and access the stream URL (/webcam/?action=stream
in the browser, does it work? Or does it show the 'Webcam server is not currently running' page?
/webcam/?action=stream works as long as the stream seems to be functioning, but if the stream cuts out part way, it 502 gateway errors.