Webcam server not running

Camera model

5 Megapixel Infrared Night Vision IR-CUT Camera For Raspberry Pi from eBay. The camera works fine as I have taken pictures using raspistill (although very out of focus I think? I will be playing with this once I can stream live.).

What is the problem?

OctoPrint is not seeing the camera, saying webcam server is currently not running. Running OctoPrint 1.6.0 on a Pi 3B+. The camera is new and so has not connected before. OctoPrint itself works fine, I have been printing for a couple of months with it.

What did you already try to solve it?

Tried various random things I've found from googling the issue like disabling auto-connect, changing resolution in octopi.txt. It has been rebooted, the camera disconnected and reconnected, cable changed (this was before I realised the camera was working fine). I'm at a loss as to what to try as I dont really understand what the issue is beyond "it won't connect".

Logs

(/var/log/webcamd.log, syslog, dmesg, ... no logs, no support)
octoprint (1).log (240.3 KB)

octopi.txt.log (2.9 KB)

webcamd.log:

Starting up webcamDaemon...

--- Configuration: ----------------------------
/boot/octopi.txt: line 3: '\r': command not found /boot/octopi.txt: line 6: '\r': command not found
/boot/octopi.txt: line 15: '\r': command not found /boot/octopi.txt: line 17: '\r': command not found
/boot/octopi.txt: line 23: '\r': command not found /boot/octopi.txt: line 25: '\r': command not found
/boot/octopi.txt: line 53: '\r': command not found /boot/octopi.txt: line 62: '\r': command not found
/boot/octopi.txt: line 64: '\r': command not found /boot/octopi.txt: line 75: '\r': command not found
/boot/octopi.txt: line 78: $'\r': command not found
cfg_file: /boot/octopi.txt
camera: auto
usb options: -r 1920x1080
raspi options: -r 1920x1080
http options: -w ./www

Explicitly USB device:

Found video devices:
/dev/video0
/dev/video10
/dev/video11
/dev/video12
/dev/video13
/dev/video14
/dev/video15
/dev/video16
raspi
Scan again in two minutes

Journal CTL repeats this a bunch:

Apr 29 16:55:12 octopi systemd[1]: webcamd.service: Service RestartSec=1s expired, scheduling restart.
Apr 29 16:55:12 octopi systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 7.
Apr 29 16:55:12 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Apr 29 16:55:12 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Apr 29 16:56:43 octopi systemd[1]: webcamd.service: Start operation timed out. Terminating.
Apr 29 16:56:43 octopi systemd[1]: webcamd.service: Failed with result 'timeout'.
Apr 29 16:56:43 octopi systemd[1]: Failed to start the OctoPi webcam daemon with the user specified config.
Apr 29 16:56:44 octopi systemd[1]: webcamd.service: Service RestartSec=1s expired, scheduling restart.
Apr 29 16:56:44 octopi systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 8.
Apr 29 16:56:44 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Apr 29 16:56:44 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Apr 29 16:58:14 octopi systemd[1]: webcamd.service: Start operation timed out. Terminating.
Apr 29 16:58:14 octopi systemd[1]: webcamd.service: Failed with result 'timeout'.
Apr 29 16:58:14 octopi systemd[1]: Failed to start the OctoPi webcam daemon with the user specified config.
Apr 29 16:58:15 octopi systemd[1]: webcamd.service: Service RestartSec=1s expired, scheduling restart.
Apr 29 16:58:15 octopi systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 9.
Apr 29 16:58:15 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Apr 29 16:58:15 octopi systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Apr 29 16:59:46 octopi systemd[1]: webcamd.service: Start operation timed out. Terminating.
Apr 29 16:59:46 octopi systemd[1]: webcamd.service: Failed with result 'timeout'.

Also
Additional information about your setup (OctoPrint version, OctoPi version, ...)

Looks like the octopi.txt file was saved w/ DOS newline encoding.

### Windows users: To edit this file use Notepad++, VSCode, Atom or SublimeText.
### Do not use Notepad or WordPad.

### MacOSX users: If you use Textedit to edit this file make sure to use 
### "plain text format" and "disable smart quotes" in "Textedit > Preferences"
1 Like

Ah! I was using NFOPad, I guess this isn't suitable. How do I "fix" this then, do I need a new file or can I just open and save with say Notepad++?

Can likely just use dos2unix

Via SSH:

sudo apt install dos2unix
sudo dos2unix /boot/octopi.txt
sudo reboot

I get this when I try to do the dos2unix line. It installed fine though, and I rebooted to check.

dos2unix: Failed to open temporary output file: Permission denied
dos2unix: problems converting file /boot/octopi.txt

Whoops, should be sudo dos2unix /boot/octopi.txt

1 Like