Products > 3D printing
Troubleshooting Octoprint webcam streaming
Alex_Baker:
Hey folks
For a long time now my raspberry pi refuses to stream my webcam to the octoprint webpage, I figured I would try and get it working. The webcam is a cheap generic usb one from amazon, and the PI is a 3B+ I think.
I have looked through several forum pages but they all ended up with "my mistake, the camera was broken or not plugged in all the way", not very useful to me. All the stream/snapshot urls are at their default values because I have never changed them. Going to http://octopi.local/webcam/?action=stream I get 502 bad gateway, the snapshot stream under time lapse gives me a refused to connect error also.
Unfortunately I don't have time to screw around in the terminal right now, I know there are a few things to test. I will also try to get my hands on a different usb camera to see if that works. Anyway, there is some background, has anybody here had any experience with this kind of issue?
xrunner:
--- Quote from: Alex_Baker on September 13, 2023, 12:46:29 pm ---Hey folks
For a long time now my raspberry pi refuses to stream my webcam to the octoprint webpage, I figured I would try and get it working. The webcam is a cheap generic usb one from amazon, and the PI is a 3B+ I think.
--- End quote ---
Hi,
What I can tell you is I've always had a camera on my Pi 3 B+ for Octoprint which uses a cable to the on-board CSI interaface slot on top of the Pi. It's always "just worked". Why don't you get that kind of camera?
MarkF:
Here's what I did for my Logitech webcam:
--- Code: ---Tools needed:
Win32 Disk Imager from [url]https://sourceforge.net/projects/win32diskimager/[/url]
PuTTY from [url]https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html[/url]
Images needed:
Download OctoPi from [url]https://octoprint.org/download/[/url]
Latest image used:
octopi-0.18.0-1.7.3-20220323100241.zip
Procedure:
- Copy image to MicroSD card
- Open MicroSD card
- Edit "octopi-wpa-supplicant.txt"
Uncomment WPA/WPA2 network section and enter WiFi SSID and PSK
Uncomment the country Pi is in
- Edit "octopi.txt" - Uncomment and set camera options:
camera_usb_options="-r 960x540 -f 10"
camera_raspi_options="-fps 10"
- Insert card into Raspberry Pi and power up
- Open PuTTY and access Pi: "octopi.local"
- Login: username="pi" password="raspberry"
- Change configuration: sudo raspi-config
Expand file system
Change user password
Advanced options >> Hostname
Change PI hostname
- Reboot
Change camera resolution:
- Open PuTTY and access Pi: "octopi.local"
- Login: username="pi" password="raspberry"
- Change directory: cd /root/bin
- Edit "webcamd" file: sudo nano webcamd
- Change Init Config section:
camera_usb_options="-r 960x540 -f 10"
camera_raspi_options="-fps 10"
CTRL-O
CTRL-X
- Reboot
->960x540, 864x486 smaller resolution
Get processor temperature:
- Open PuTTY and access Pi: "octopi.local"
- Login: username="pi" password="raspberry""
- watch cat /sys/class/thermal/thermal_zone0/temp
Access OctoPrint from web browser: http://octopi.local or http://hostname.local if hostname was changed
ALWAYS POWER DOWN RASPBERRY PI VIA OCTOPRINT (Top right system menu)
--- End code ---
There are also some nice videos out there:
Lindley:
Agree with @xrunner the Pi camera works fine for us and just as cheap or cheaper than a usb camera.
Alex_Baker:
--- Quote from: Lindley on September 13, 2023, 08:06:57 pm ---Agree with @xrunner the Pi camera works fine for us and just as cheap or cheaper than a usb camera.
(Attachment Link)
--- End quote ---
I do like those cameras, however they will not work for my setup. I have a heated enclosure where the printer electronics are in a separate case outside, so the cable required is around 600mm, and the USB cam plugs into a panel mount USB on top of the electronics case. A delicate ribbon cable would not be very good in this scenario I don't think.
When I get a chance I will go into the terminal and try some things.
Navigation
[0] Message Index
[#] Next page
Go to full version