Camera stops working randomly

Camera model PS3 Camera.

What is the problem? Totally plug and play. Works well, but randomly stops on a frame and won't recover.

What did you already try to solve it? Different USB Ports and also reflashed octoprint

Logs (/var/log/webcamd.log, syslog, dmesg, ...) I'll have to try and get them.

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

:smile:

1 Like

How do I go about obtaining the log? Pretty new to the camera aspect of Octoprint. First time trying, but for a used $2 camera I figured it is worth a try just for fun.

This link will tell you how you get the logs

I tried using SSH, but I cannot access the log for the webcam. Even using sudo doesn't give me high enough access to open the file. Any suggestions? Also, doing it through octoprint it doesnt show a log for the camera. I am however able to find it using ssh but cant access it.

Try to stop the webcam stream sudo systemctl stop webcamd
If you still can't access the log post the error here :slight_smile:

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
pi@octopi:~$ sudo systemctl stop webcamd
[sudo] password for pi:
Sorry, user pi is not allowed to execute '/bin/systemctl stop webcamd' as root o n octopi.

Oh just systemctl stop webcamd then

pi@octopi:~$ systemctl stop webcamd
Failed to stop webcamd.service: Interactive authentication required.
See system logs and 'systemctl status webcamd.service' for details.

pi@octopi:~$

I'd love to see the logs....

I think I figured it out... I just need to plug the camera in and wait for it to fail. I used "su" and it seems to allow me to open the file. I'll post back with the log results. It usually fails within 10-20 minutes.

webcamd.log: line 1: Starting: command not found
webcamd.log: line 3: ---: command not found
webcamd.log: line 4: camera:: command not found
webcamd.log: line 5: usb: command not found
webcamd.log: line 6: raspi: command not found
webcamd.log: line 7: http: command not found
webcamd.log: line 8: -----------------------------------------------: command no t found
webcamd.log: line 10: Found: command not found
webcamd.log: line 11: /dev/video0: Permission denied
webcamd.log: line 12: USB: command not found
webcamd.log: line 13: syntax error near unexpected token 13' webcamd.log: line 13:<13>Nov 13 14:02:49 pi: Starting USB webcam'
pi@octopi:/var/log$

All the log said. It works then just... doesn't randomly.

This looks like you executed the log, not access its contents. Try cat /var/log/webcamd.log.

"I don't always execute logs... but when I do, I use an ax which I've sharpened myself using a 300ct diamond which I mined myself (when I was younger, of course)..."

~ The Most Interesting Man in the World

I'll give it a go and report the results.

My video sometimes stops for no apparent reason. I just click on Temperature then back to Control and it's back again. I just assumed that it was a glitch in Octopi. It isn't a big deal for me so have never delved into it. I'm using a noname usb webcam which may or not be completely compatible.
I am not these days a computer geek and have noticed that sometimes on here the fixes result in more issues than the original problem :slight_smile:

It's worth trying a different browser at least temporarily to see if the problem follows your original browser. If it's consistent across two different browser manufacturers then you can focus on the Pi, the mjpg_streamer and OctoPrint.

I've tested many devices to no avail. I just reflashed an earlier version of Octopi and have the same issue. It is just frustrating because when it works, it suits my needs perfectly.

Like I said it's not a big deal for me, now that I'm 76 years old I just focus on the important stuff.
When I was 26 and playing with my DEC PDP-8E I would sometimes stay up all night troubleshooting an issue like this. Most of the folk here probably weren't born when that mini computer became obsolete.

I think I found the solution! I reflashed to an older version of Octopi (Didn't help). I then changed the default 10 fps to 60 fps(the native fps for the cam), and it hasn't frozen in hours. Every now and then I have to refresh my browser, but the camera feed seems to be fine.

1 Like