#Lost connection after installing Crowsnest and connecting a USB camera

20 messages · Page 1 of 1 (latest)

hard ferry
#

I occasionally experience lost connection issues when my webcam is activated with Crowsnest. Even when the printer is just sitting idle, after a minute or two, if the webcam is persistently on, Klipper will lose connection. A normal restart doesn't work; I have to do a firmware restart, twice (the first time fails because it says that the mcu is shutdown, and the second time works).

This seems to only happen when I'm actively viewing the stream over WebRTC.

Hardware

Raspberry Pi 3B+ (with Canakit Power Adapter)
Elegoo Neptune 3 Pro, connected via USB
Nexigo N60 Webcam, also connected via USB
Using Wi-Fi

Config Notes

Camera is running using camera-streamer over WebRTC at 1920x1080@30fps

Extra Notes

For WebRTC to work, I had to do the bookworm workaround for GPU memory

[pi3]
gpu_mem=128

Logs and config attached.

lilac steppeBOT
#

Ahoi @hard ferry!
Welcome to the Mainsail support-forum!
There is a problem with the tags you selected for this post. Please fix them to fit your question.
For further information on tags please check the readme: https://discord.com/channels/758059413700345988/1320321898009071616

To change the tags of this post:

  1. Open the ... menu on the top right corner of this post.
  2. Find Edit tags
  3. Select the checkbox of the correct tags.

Usually you just need to select one tag!
If you still have no idea which one to choose, feel free to ask here.

Note: This is an automated message

Thanks for your cooperation!

#

Ahoi @hard ferry!
It looks like you did not provide all the necessary information we need to help you.
Please upload your logfiles and a detailed description of your problem.
For further information see: https://docs.mainsail.xyz/faq/getting-help/discord#provide-information
Note: We only accept .log and .txt files as log files.
This is an automated message

We are glad to help and chat with you on our Community Discord, but if you need help and want the best support possible you should, follow a few simple rules:

hard ferry
#

Update

It seems like this problem isn't happening when I changed my resolution from 1920x1080 to 1280x720, still at 30fps (this also resolved a green bar issue at the bottom of the image)

I would like to run at 1080p though, is this potentially related to power draw? I'd think it shouldn't be much of an issue since the webcam is the only thing plugged in besides the printer, but maybe I'd need to buy a powered USB hub to go above 720p stably.

undone herald
#

It can be a lot of different problems

#

Most likely related to usb bandwidth

#

The pi3 should not need the bookwom workaround, if you really need it, try to lower it further down. The value was just tested on a Pi4, I don't know if 128 is maybe bad on a Pi3

hard ferry
# undone herald The pi3 should not need the bookwom workaround, if you really need it, try to lo...

It did need the bookworm workaround, as WebRTC was flat out not working even at 480p until I added it. Any suggestions for a good memory value to try?

Also if it is USB bandwidth that kinda sucks, I just DuckDuckGo'd and saw that the 3B+ shares all of its USB 2.0 bandwidth across the 4 ports. I do have a Pi 4 around but I would like to reserve that for a different project so I'm using the 3B+ right now.

undone herald
#

You can ofc also try a powered usb hub, but I don't think the powerdraw should differ enough between 720p and 1080p

#

For the memory, just try to lower it in maybe 20MB steps, no idea. Just try it

hard ferry
#

gotcha

hard ferry
#

Yeah I don't think it's a power issue when both the camera and the printer can be on just fine, I think it's just USB bandwidth trying to stream 1080p@30fps, which is the max for this camera. Means I'll stick with 720p, but that's fine (or I can migrate to my Pi 4 down the line maybe)

Regarding the bookworm gpu_mem workaround, I've had success lowering it to exactly 81 but not lower as then there will be no WebRTC connection. Safe bet might be 85 or 96 maybe.

My /boot/firmware/config.txt snippet for Raspberry Pi 3B+ (if anyone is searching in the future)

[pi3]
gpu_mem=81
hard ferry
#

Weirdly, now only while I'm actively printing and watching the stream it will crash, which is bad

#

I might honestly just consider switching to a Pi 4 if this keeps happening tbh, it's a dealbreaker if my printer stops midprint due to the camera taking up bandwidth

undone herald
#

The 128 was the exact amount needed on the Pi4 iirc, no "buffer" ^^

hard ferry
#

Yeah so 81 exactly then for the Pi 3, no buffer

#

but i’m gonna switch to the pi 4 today lol

hard ferry
#

And yeah after switching to the Pi 4 and doing gpu_mem=128, no more crashing issues even when running at 1080p@30fps

undone herald
#

That sounds like usb bandwidth then. Assuming that you used a 2 and 3 port