Webcam Stream stopped working?


#1

What is the problem?
When I initially set up Octoprint with the Logitech C270 webcam it initially worked great. however, over time, it seemed to fail more and more often, and now it doesn't work at all. I've tried manually reconfiguring and reinstalling mjpegstreamer, but still the webcam stream is nonfunctional.
What did you already try to solve it?
I tried following several tutorials for setting up mjpegstreamer, including https://jacobsalmela.com/2014/05/31/raspberry-pi-webcam-using-mjpg-streamer-over-internet/ , https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=109352&p=751735#p751735 , https://stackoverflow.com/questions/13437244/mjpg-streaming-with-a-raspberry-pi-and-a-webcam#14121736 , and https://iotalot.com/2016/05/28/video-streaming-using-raspberry-pi-3-and-usb-webcam/
Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...) I'm using OctoPrint 1.3.9 (same behavior in other recent versions) on Raspberry Pi 3 running Raspbian Jesse with the Logitech C270 Webcam. The raspberry Pi is running other servers too, so I can't just reformat it or install octopi.


#2

The Raspberry Pi 3B includes two serial UARTs, a good one and a cheap one. If you have a variety of USB-based things plugged in, then perhaps something stole that remaining UART. Short version: only have the serial cable to the printer and the Logitech and see if that works.

The same advice goes for Bluetooth which—when working—consumes the "good" UART by default. So, no Bluetooth-related headphones, keyboard/mouse/whatever.

The Logitech C270 is, I believe, the one preferred by foosel herself. This is a pretty good reference.

Check to see if you have available disk space on your microSD. It could be as simple as that.

It might be good to write down your list of plugins and profiles and start over from scratch with a new OctoPi download.


#3

Hi, @OutsourcedGuru, thanks for the suggestions. Unfortunately, none of them seemed to work.
The pi has around 10GB free SD card space, and it still doesn’t work with all nonessential devices disconnected and Bluetooth disabled. As I stated in the first post, the Pi is hosting some other minor servers, so I can’t just reformat the SD card and start over. It’s not running OctoPi, but OctoPrint, and I don’t think reinstalling OctoPrint would help, given that the problem is with MJPGStreamer, and not directly with OctoPrint?
Do you (or anyone else) have any other suggestions I could try?
Also do you have any links to more information about the limit of 2 UARTs over USB, I haven’t seen that mentioned anywhere else?


#4

Ok, I’ve got it working when it’s connected directly to the raspberry pi, I redid the steps of one of the tutorials, then modified ~/scripts/webcamDaemon. However, it still doesn’t work when connected through a USB hub (as it is when in use; the Pi is several feet away from the printer). It used to work through the hub, so I know it’s possible. Does anyone have any suggestions what I need to change to use it that way again?


#5

If it were me, I think I would go to school on Guy's own code which produces OctoPi (since you went another route to get this going). See the section at lines 54-87. Looks like he's pulling an experimental version of the mjpg-streamer from what I'm seeing there.