Usb webcam randomly connects and not connect on startup to octopi

What is the problem?
When I startup octoprint,
sometimes the USB webcam will connect and show the video
and other times (mostly) it will not show anything other than message "Webcam stream loading..."

What did you already try to solve it?
Restarting octoprint.
Restart system
Connect the webcam to a different usb port on octopi
Change power supply

Logs (octoprint.log, serial.log or output on terminal tab, browser error console ...)
octoprint 190904.log (68.6 KB)
webcamd.log (350.5 KB)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ...)
OctoPrint version = 1.3.11
OctoPi version = 0.16.0
printer - wanhao i3
firmware = Marlin bugfix-2.0.x
browser = chrome

Pi model - Raspberry Pi 3 Model B Plus Rev 1.3
Webcam = Logitech QuickCam Pro 9000

I saw a little undervoltage going on there. You didn't mention which Pi you're using.

Raspberry Pi 3 Model B Plus Rev 1.3
Webcam = Logitech QuickCam Pro 9000

yeah I noticed sometimes there is a solid under voltage symbol appears but it is not flashing to indicate a current problem.

I have tried switching power supplies including using an apple charger but there is not much I can do about that issue.

I checked lsusb and it indicated my usb webcam is connected

pi@octopi:~ $ lsusb
Bus 001 Device 004: ID 046d:0809 Logitech, Inc. Webcam Pro 9000
Bus 001 Device 005: ID 1d50:6029 OpenMoko, Inc.
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Right now my octoprint is showing the video stream and there is no under voltage symbol showing.

But the problem is it randomly works and doesn't work.

Here's my webcam log when it was not working
webcamd.log (350.5 KB)

Does it maybe not work if you don't power on your printer before you power on your pi or if you shut it down while the pi is stil running?

If that's the case try this

Are you saying put tape on the 5V pin of the usb cable that is attach from the 3D printer to the pi
to prevent 3D printer drawing power from the pi and this is the cause of the under voltage?

  • ie the 3D printer LCD screen drawing the power from the pi which then causes the pi to not get enough volts/power etc.

As far as I am aware the only thing that the pi can power is the LCD screen of the 3D printer
since no stepper motors run until I turn on the power switch of the 3D printer..

BTW just for extra info I got both my pi and 3D printer connected to a double adapter
so that I can just turn on one switch of my power board.

yep that is what I'm saying. Not every printer is drawing too much from usb when powered by usb but some do - my ender 3 pro for example does it.
If I turned it off while the pi was on some of my usb devices even stopped working.

So they turn on at the same time? Well I don't know maybe the printer turns on a bit earlier and causes this problems. Just try to power the printer on first and see if the problem remains :smiley:

Btw if you scroll up the thread from my quote above you will see a person who had that exact problem :smiley:

yeah but I also tested it by powering them on separately (ie no double adapter) and the problem still occurred..

So the pi should be powered on first before the printer?

so basically this problem is due to the initial undervoltage at the start
which causes the usb device/webcam to not get enough power
which then causes it to fail the detection/connection to octoprint?

yeah I did scroll up that thread..

I will see if testing your method will work

No the printer first. Sry I read it wrong at the first time

Exactly. I don't know if the problem is caused by the pi or the camera itself but yeah if the printer draws too much it can happen.

I cross my fingers for you :slight_smile:

edit: read the first quote wrong