Webcam stream not working

Take a look at the photos here in my tutorial, especially the ones which indicate ribbon cable orientation in the connectors. So the blue side of the ribbon cable goes on the top side of the webcam board, for example. On the Pi, the blue side of the ribbon cable points toward the end of the board which has the USB connectors.

I'm having a similar error here. I have 2 instances of OctoPrint running on a Pi 4B (simultaneous printing works great!) , PiCam2 and an old Microsoft LifeCam on USB. PiCam2 just works.

I can see the stream from the LifeCam if I manually run mjpg_streamer "pointing" at /dev/video1 and punch in the URL on my browser (http://xxx.xxx.xxx.xxx:8081/?action=stream) but adding that URL to the Webcam settings in my 2nd instance of OctoPrint doesn't seem to work. If I click Test, I get a cached image, but there's no stream and not even a video "window" under Control for this instance.

Without the manual start of mjpg_streamer, if I fire up the GUI and run Cheese, I see the LifeCam stream and the PiCam stream is working in the 1st instance of OctoPrint.

I'm sure I'm overlooking something simple, but after 2 evenings of trying, I'm just not seeing it.

After rebooting the Pi this afternoon, the new video stream is all of a sudden working. I now have both the PiCam2 and the USB camera working at the same time. I still have to start the video stream for the USB camera manually, but at least I know it works...

Now to automate it all.. :slight_smile:

Was probably a browser caching problem, for what it's worth.

You may be right, but long story short, I got both cams working and was able to create a .service file to start the 2nd camera at boot time.

1 Like

Hi Folks,
I recently rebuilt my Laptop with LinuxMint 20. After sucxessful Installation of OctoPrint with Python 3.x I ran into the same Issue with my C270 Cam. After some searching in the scripts I found some famous copy-/paste errors.
The username for /home/your_username/webcam and Daemon was wrong.
Too easy that I needed some times to figure out the real problem... :slightly_frowning_face:
Now I need to change some settings in UDEV, to prevent from Using the internal webcam.

A post was merged into an existing topic: Webcam will stream on octopiIP:8080 but not on /webcam/?action+stream

Thank you so much !!!!

This solved my problem with Logitech C270

Only these commands where necessary:

sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo reboot
1 Like

Solve for me as well. I've been troubleshooting the cam issue for months. The camera fps is also noticeably smoother after running these updates.

Yup same for me. I have the 5MP Camera Module (ribbon cable) and those two commands solved my issue. It also prompted me to upgrade Octoprint again and it broke again. So I won't be doing any updates for a time.

Hey, if you've got issues feel free to get help!

We don't try and break things on purpose :wink:

1 Like

Hi
I'm using Raspberry Pi4 and raspberry pi camera on Octoprint 0.17.0,
but if fails to show any image, I've tried multiple options with no avail.
The latest being:
sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo raspi-config
sudo reboot
I've tried multiple browser all with the same issue.
When I go to control Tab to see webcam image I get: " Webcam stream not loaded"
When I go to /webcam/?action=stream i get "The webcam server is currently not running"

I've already tried editing octopi.txt and enable the cam, but the issue remains.

Have you checked the logs? Specifically webcamd.log.

Access it using journalctl -u webcamd.

1 Like

pi@octopi:~ $ journalctl -u webcamd
-- Logs begin at Thu 2019-02-14 10:11:59 GMT, end at Sat 2020-12-26 15:14:38 GMT
dez 26 14:17:04 octopi systemd[1]: Starting the OctoPi webcam daemon with the us
dez 26 14:17:04 octopi webcamd[346]: Starting up webcamDaemon...
dez 26 14:17:04 octopi webcamd[346]: --- Configuration: ------------------------
dez 26 14:17:05 octopi webcamd[346]: cfg_file: /boot/octopi.txt
dez 26 14:17:05 octopi webcamd[346]: camera: auto
dez 26 14:17:05 octopi webcamd[346]: usb options: -r 640x480 -f 10
dez 26 14:17:05 octopi webcamd[346]: raspi options: -fps 10
dez 26 14:17:05 octopi webcamd[346]: http options: -w ./www-octopi -n
dez 26 14:17:05 octopi webcamd[346]: Explicitly USB device:
dez 26 14:17:05 octopi webcamd[346]: -------------------------------------------
dez 26 14:17:05 octopi webcamd[346]: Found video devices:
dez 26 14:17:05 octopi webcamd[346]: /dev/video10
dez 26 14:17:05 octopi webcamd[346]: /dev/video11
dez 26 14:17:05 octopi webcamd[346]: /dev/video12
dez 26 14:17:05 octopi webcamd[346]: /dev/video13
dez 26 14:17:05 octopi webcamd[346]: /dev/video14
dez 26 14:17:05 octopi webcamd[346]: /dev/video15
dez 26 14:17:05 octopi webcamd[346]: /dev/video16
dez 26 14:17:05 octopi webcamd[346]: config file='/boot/octopi.txt':USB device w
dez 26 14:17:05 octopi webcamd[346]: [69B blob data]
dez 26 14:17:05 octopi webcamd[346]: <13>Dec 26 14:17:05 root: Starting USB webc
dez 26 14:17:05 octopi webcamd[346]: Running ./mjpg_streamer -o output_http.so -
lines 1-23...skipping...
-- Logs begin at Thu 2019-02-14 10:11:59 GMT, end at Sat 2020-12-26 15:14:38 GMT
dez 26 14:17:04 octopi systemd[1]: Starting the OctoPi webcam daemon with the us
dez 26 14:17:04 octopi webcamd[346]: Starting up webcamDaemon...
dez 26 14:17:04 octopi webcamd[346]: --- Configuration: ------------------------
dez 26 14:17:05 octopi webcamd[346]: cfg_file: /boot/octopi.txt
dez 26 14:17:05 octopi webcamd[346]: camera: auto
dez 26 14:17:05 octopi webcamd[346]: usb options: -r 640x480 -f 10
dez 26 14:17:05 octopi webcamd[346]: raspi options: -fps 10
dez 26 14:17:05 octopi webcamd[346]: http options: -w ./www-octopi -n
dez 26 14:17:05 octopi webcamd[346]: Explicitly USB device:
dez 26 14:17:05 octopi webcamd[346]: -------------------------------------------
dez 26 14:17:05 octopi webcamd[346]: Found video devices:
dez 26 14:17:05 octopi webcamd[346]: /dev/video10
dez 26 14:17:05 octopi webcamd[346]: /dev/video11
dez 26 14:17:05 octopi webcamd[346]: /dev/video12
dez 26 14:17:05 octopi webcamd[346]: /dev/video13
dez 26 14:17:05 octopi webcamd[346]: /dev/video14
dez 26 14:17:05 octopi webcamd[346]: /dev/video15
dez 26 14:17:05 octopi webcamd[346]: /dev/video16
dez 26 14:17:05 octopi webcamd[346]: config file='/boot/octopi.txt':USB device w
dez 26 14:17:05 octopi webcamd[346]: [69B blob data]
dez 26 14:17:05 octopi webcamd[346]: <13>Dec 26 14:17:05 root: Starting USB webc
dez 26 14:17:05 octopi webcamd[346]: Running ./mjpg_streamer -o output_http.so -
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: starting applica
dez 26 14:17:05 octopi webcamd[346]: MJPG Streamer Version: git rev: 501f6362c5a
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: MJPG Streamer Ve
dez 26 14:17:05 octopi webcamd[346]: i: Using V4L2 device.: /dev/video10
dez 26 14:17:05 octopi webcamd[346]: i: Desired Resolution: 640 x 480
dez 26 14:17:05 octopi webcamd[346]: i: Frames Per Second.: 10
dez 26 14:17:05 octopi webcamd[346]: i: Format............: JPEG
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: Using V4L2 devic
dez 26 14:17:05 octopi webcamd[346]: i: TV-Norm...........: DEFAULT
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: Desired Resoluti
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: Frames Per Secon
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: Format..........
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: TV-Norm.........
dez 26 14:17:05 octopi webcamd[346]: Error opening device /dev/video10: video ca
dez 26 14:17:05 octopi webcamd[346]: Init v4L2 failed !! exit fatal
dez 26 14:17:05 octopi webcamd[346]: i: init_VideoIn failed
dez 26 14:17:05 octopi mjpg_streamer[467]: MJPG-streamer [467]: init_VideoIn fai
dez 26 14:17:06 octopi webcamd[346]: Done bring up all configured video device
dez 26 14:17:06 octopi webcamd[346]: Goodbye...
dez 26 14:17:06 octopi systemd[1]: webcamd.service: Succeeded.
dez 26 14:17:06 octopi systemd[1]: Started the OctoPi webcam daemon with the use
dez 26 14:17:06 octopi systemd[1]: webcamd.service: Service RestartSec=100ms exp
dez 26 14:17:06 octopi systemd[1]: webcamd.service: Scheduled restart job, resta
dez 26 14:17:06 octopi systemd[1]: Stopped the OctoPi webcam daemon with the use
dez 26 14:17:06 octopi systemd[1]: Starting the OctoPi webcam daemon with the us
dez 26 14:17:06 octopi webcamd[494]: Starting up webcamDaemon...
dez 26 14:17:06 octopi webcamd[494]: --- Configuration: ------------------------
dez 26 14:17:06 octopi webcamd[494]: cfg_file: /boot/octopi.txt
dez 26 14:17:06 octopi webcamd[494]: camera: auto
dez 26 14:17:06 octopi webcamd[494]: usb options: -r 640x480 -f 10
dez 26 14:17:06 octopi webcamd[494]: raspi options: -fps 10
lines 1-54

Looks like the camera was not found on the system.

Run vcgencmd get_camera, make sure you have it plugged in properly and there are no problems with the Pi's power supply such as undervoltage.

1 Like

pi@octopi:~ $ vcgencmd get_camera
supported=1 detected=0
Power supply looks adequate.

Well there you are, the camera is not detected. Something is probably wrong with the camera ribbon or the board itself. Make sure it is properly seated and the right way around.

So I thought I'd pop in with my odd findings. I was having a similar problem where the camera (USB Logitech C270) would work one day, and then fail to work on a reboot with no consistency.

I happened to get a new Raspberry Pi kit with a different power supply, and was troubleshooting at my PC with the new power supply. Worked on every start-up. Then I took it to my printer location with the old power supply, and it wouldn't load up. Camera starts ( camera LED on), then shuts down during Octoprint boot.

Moved the new power supply to the printer location and the camera is starting up without issue.

Old Power Supply: Came with Canakit Pi 4 Starter Kit.
New Power Supply: Came with Labists Pi 4 Starter Kit.

After a lot of tinkering with the cable with the pi turned off.
I'm getting:
pi@octopi:~ $ vcgencmd get_camera
supported=1 detected=1
but still no image.

now when i go to "control" i get " Webcam stream loading... "
I've reinstalled octoprint and issue remains.

Thanks this fixed my issue as well! Keep being awesome!