OctoPi webcamn troubleshooting

Start is the web cam is not working

https://community.octoprint.org/t/webcam-stream-not-working/6049/30

Check updates:

sudo apt-get update –fix-missing

sudo apt-get upgrade

(Checked the camera was enabled after running the updates)

sudo raspi-config

sudo reboot

run:

curl -v http://localhost:8080/

I would take a look at what was returned (if anything). Here’s what I see on mine:

* Expire in 0 ms for 6 (transfer 0xdfb7c0)
# many of those, repeated
*   Trying ::1...
* TCP_NODELAY set
* Expire in 149998 ms for 3 (transfer 0xdfb7c0)
* Expire in 200 ms for 4 (transfer 0xdfb7c0)
* Connected to localhost (::1) port 8080 (#0)
> GET / HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.64.0
> Accept: */*
> 
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Content-type: text/html
< Connection: close
< Server: MJPG-Streamer/0.2
< Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0
< Pragma: no-cache
< Expires: Mon, 3 Jan 2000 12:34:56 GMT
< 
<html>
<head><title>mjpg_streamer test page</title></head>
<body>
<h1>Snapshot</h1>
<p>Refresh the page to refresh the snapshot</p>
<img src="./?action=snapshot" alt="Snapshot">
<h1>Stream</h1>
<img src="./?action=stream" alt="Stream">
</body>
</html>
* Closing connection 0

So when this is working correctly the Pi is serving up just a simple webpage with a couple of links. If your install isn’t serving up (locally) on the Pi this content then troubleshoot this as a haproxy problem. Assuming that it does return a webpage then the next step locally on the Pi is to see if you can fetch a screenshot image.

curl -o ~/screenshot.png http://localhost:8080/?action=snapshot
ls -l ~/screenshot.png
  -rw-r--r-- 1 pi pi 39230 Oct 29 11:56 /home/pi/screenshot.png

Personally, I would use scp to fetch that file over to my workstation and see if it’s what’s expected.

Jan D.
Jan D.

"The only real security that a man will have in this world is a reserve of knowledge, experience, and ability."

Articles: 678

Leave a Reply

Vaše e-mailová adresa nebude zveřejněna. Vyžadované informace jsou označeny *