Adding webcam causing printer stop

Camera model
Logitech C920 HD Pro

What is the problem?
after installing cam, printing stops randomly
from log it seems that the camera causing all USB to disconnect
and i guess also the printer USB shutsdown

What did you already try to solve it?
check usb cables and power supply all god
i can measure 5.05V on gpio on boot and after, adapter is 4A max.
unplug camera to verify and everything good without it

Logs
from massages.log:
WARN::dwc_otg_hcd_handle_hc_fsm:2458: Unexpected IRQ state on FSM transaction:dev_addr=17 ep=2 fsm=6, hcint=0x00000002
Mar 8 11:46:35 octopi kernel: [16800.396990]
Mar 8 11:46:35 octopi kernel: [16800.398392] usb 1-1.2: USB disconnect, device number 16
Mar 8 11:46:35 octopi kernel: [16800.400374] usb 1-1.3: USB disconnect, device number 19
Mar 8 11:46:35 octopi kernel: [16800.597106] Indeed it is in host mode hprt0 = 00001501
Mar 8 11:46:35 octopi kernel: [16800.806091] usb 1-1: new high-speed USB device number 20 using dwc_otg
Mar 8 11:46:35 octopi kernel: [16800.806223] Indeed it is in host mode hprt0 = 00001101
Mar 8 11:46:35 octopi kernel: [16801.046223] usb 1-1: New USB device found, idVendor=0424, idProduct=2514
Mar 8 11:46:35 octopi kernel: [16801.046232] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Mar 8 11:46:35 octopi kernel: [16801.046641] hub 1-1:1.0: USB hub found
Mar 8 11:46:35 octopi kernel: [16801.046689] hub 1-1:1.0: 4 ports detected
Mar 8 11:46:35 octopi kernel: [16801.366039] usb 1-1.1: new high-speed USB device number 21 using dwc_otg
Mar 8 11:46:35 octopi kernel: [16801.496211] usb 1-1.1: New USB device found, idVendor=0424, idProduct=2514
Mar 8 11:46:35 octopi kernel: [16801.496220] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
Mar 8 11:46:35 octopi kernel: [16801.496618] hub 1-1.1:1.0: USB hub found
Mar 8 11:46:35 octopi kernel: [16801.496668] hub 1-1.1:1.0: 3 ports detected
Mar 8 11:46:36 octopi kernel: [16801.796038] usb 1-1.2: new high-speed USB device number 22 using dwc_otg
Mar 8 11:46:36 octopi kernel: [16802.026051] usb 1-1.1.3: new full-speed USB device number 23 using dwc_otg
Mar 8 11:46:36 octopi kernel: [16802.160698] usb 1-1.1.3: New USB device found, idVendor=2341, idProduct=abcd
Mar 8 11:46:36 octopi kernel: [16802.160706] usb 1-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3

from webcamd:

--- Configuration: ----------------------------
camera: auto
usb options: -d /dev/logi -r 1920x1080 -f 15
raspi options: -fps 15
http options: -w ./www-octopi -p 8082

Found video devices:
/dev/video0
/dev/video1
USB device was not set in options, start MJPG-streamer with the first found video device: /dev/video0
<13>Mar 9 09:05:57 pi: Starting USB webcam
Running ./mjpg_streamer -o output_http.so -w ./www-octopi -p 8082 -i input_uvc.so -d /dev/logi -r 1920x1080 -f 15
MJPG Streamer Version: git rev: 821c330ea6bbb5fbed98d48e00aac156e923161b
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1920 x 1080
i: Frames Per Second.: 15
i: Format............: JPEG
i: TV-Norm...........: DEFAULT

Additional information about your setup
Pi 3B+
Klipper
skr 1.3
octoprint v1.3.12
octopi v0.15.0

That sounds suspicious, to be honest. Are you sure this isn't a charger? And you didn't mention which Raspberry this is.

updated, thanks
well i measured with a good DMM and there's no voltage drop on boot
actually the voltage is pretty good
charger are a quality brand (1 plus) rated 4A
usb from pi to skr 1.3 also quality brand (UGREEN)

Imagine putting a sine wave on a mirror so that any negative-going pulses are reflected so that they look like positive ones. That's a charger. It's just alternating current that goes through transformer to change the voltage and a rectifier... and done. Cheap.

Now imagine that you want a solid voltage out of this. You now build two more stages of circuitry and voila, it's a horizontal line on the oscilloscope and the Pi is gonna have a good time.

thanks for the informative explanation
my 1+ charger actually called a power supply unit but anyway..
here is an oscilloscope measurements comparing it to
a cheap charger and a linear power supply
notice the pick to pick (pk-pk)
i am not an electrician fell free to tell if my measurements are incorrect

I'm actually like a 7-level on this one (Air Force training). They actually trained me on how to design and build these circuits. (Your tax dollars hard at work.)

The proof-in-the-pudding would be to put your output on an oscilloscope. But in lieu of that, why not post a link to the product itself so that we can help to evaluate it.

I just used my own digital multimeter on an assembly language coding project. I was toggling a GPIO pin ON/OFF rapidly. I note that my multimeter can't really show me that level of change. I would need to plug in my oscilloscope to see the curves, bumps, square waves, whatever for that.

But you say "solid" so I assume maybe that you believe it's good. And yet, adding more load is causing the printer to stop so that's usually not a good sign.

Sir yes sir..
Ok i didn't found a manual or datasheet even hard to find link..i guess because it is coming with the phone..
So its called 'dash'
Here is a link to buy it with some info
https://a.aliexpress.com/_dVHJhdp
I found a youtube video showing it


Hope that helps..
Maybe i can try a pc psu just for testing
If that's the problem i will buy an original power supply

Yeah... it's a charger. Next time you're on Aliexpress buy one of these on the cheap. And yes, I wrote the manual. ha

Thanks seems nice but i am happy with my Siglent i recently got and learning to operate.
Can you recommend a power supply to buy?
Do you think just for testing if i will power
With a PC PSU is a good idea?

I can buy this one in my country later
https://piitel.co.il/shop/power-supply-5v-2-5a-for-raspberry-pi-white/

That one looks great. 5V @ 2.5A with the microUSB connector (fits Raspberry Pi 3B+).

With respect to powering from a beefy PSU, just know that the microUSB connection standard itself is part of the problem. Technically-speaking, it's supposed to "top out" at 2.1A rather than the Pi's expected 2.5A power requirement. So what happens is that cable manufacturers use the smallest gauge of wire possible in these cables; it saves them money. But this then limits the power delivered over those cables. Also, the pins inside the microUSB connector are relatively small, making it difficult to solder larger-gauge wires.

So... when you side-power a Raspberry Pi project from a beefy PSU, it's best to bring in the 5V to the GPIO pins rather than via the microUSB connector. Note that many of the female-ended jumper wires themselves have smaller-gauge wire. Honestly, it should be bigger than 22AWG in my humble opinion.

If you can find one, scavenge a two-pin (two wire) connector from a PC that looks a little beefier and plug it to BOARD pins 4&6 on the GPIO header.

Or simply wait for that bonafide power adapter to arrive.

so now i am more clueless then before
i managed to get the original raspberry power supply and still the print stops.

dmesg through putty:

octoprint terminal
image

klippy.log

I took that first error message into a websearch and immediately got this closed issue in the Raspbian repository.

6by9: "My instinctive answer is the PSU and low voltage."

First:

sudo apt-get update
sudo apt-get upgrade
# Wait for that to finish
sudo reboot

This might fix it since it's a closed issue in the Raspbian software itself. Note that this isn't anything to do with either OctoPrint or the OctoPi IMG.

You might try this as posted in that thread.

i managed to do a full print now around 30 minutes.

I lowered the c920 to 640x480 10 fps

also disabled the octoprint timelapse recording,
it was giving a rendering error massage
(cause i disconnected the pi cam on csi that was config for snapshot)

also set the c920 for web cam-stream url

don't know what helped here.
i am gonna try update as you wrote
(i saw this issue before but i am pretty new to raspbian)
then crank the res to 2K and try to print again

finished updateing..
now camera not showing at all on octoprint
tried different resolutions .. sometimes it works for a second
but generally no picture

i made sure it's active with:
systemctl status webcamd.service
and it's working but no picture in octoprint

Is dmesg clean of that error now?

Well this error shows after a print and i can't print without a camera.. luckily i got a backup image
I went back to it and now at least i got the image back

1 Like

did a lot of more tries.. safemode, different usb cables, different resolution
no success
i also checked for throttling using this helpful video:

i saw people work with c920 on same pi (3b+) but not with klipper
i saw people work with c920 on pi 4 with klipper
but don't know if it's a cpu issu cause the cpu load is around 20%
not going even above 30%

If it were me, I would invest in another camera.