Skip to content

Commit 67cf479

Browse files
authored
Update 'No webcam' page to reference the new camera stack (#4)
* Add updated 503-no-webcam.http file * Add to script to swap haproxy error files
1 parent c1a4411 commit 67cf479

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed

scripts/10-install-camera-streamer

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ sed -i 's/^camera_auto_detect=0/camera_auto_detect=1/' /boot/config.txt
3636
# Only enable the camera-streamer service, it will start the others as configured
3737
systemctl enable camera-streamer.service
3838

39+
# Swap the Haproxy 503 error page to reference the new webcam stack
40+
cp /files/503-no-webcam.http /etc/haproxy/errors/503-no-webcam.http
41+
3942
### --- clean up the old stuff ------------------------------------------------
4043

4144
cat > /boot/octopi.txt <<EOF

scripts/files/503-no-webcam.http

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
HTTP/1.0 503 Service Unavailable
2+
Cache-Control: no-cache
3+
Connection: close
4+
Content-Type: text/html
5+
6+
<html>
7+
<head>
8+
<title>Webcam server is currently not running</title>
9+
<style>
10+
body {
11+
margin: 0;
12+
font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
13+
font-size: 14px;
14+
line-height: 20px;
15+
color: #333333;
16+
background-color: #ffffff;
17+
}
18+
19+
code {
20+
font-family: Monaco,Menlo,Consolas,"Courier New",monospace;
21+
font-size: 12px;
22+
border-radius: 3px;
23+
padding: 2px 4px;
24+
color: #d14;
25+
white-space: nowrap;
26+
background-color: #f7f7f7;
27+
border: 1px solid #e1e1e8;
28+
}
29+
30+
pre {
31+
font-family: Monaco,Menlo,Consolas,"Courier New",monospace;
32+
font-size: 12px;
33+
border-radius: 3px;
34+
padding: 2px 4px;
35+
white-space: nowrap;
36+
background-color: #f7f7f7;
37+
border: 1px solid #e1e1e8;
38+
}
39+
40+
@media (max-width: 767px) {
41+
.wrapper {
42+
padding: 20px;
43+
}
44+
}
45+
46+
@media (min-width: 768px) {
47+
.wrapper {
48+
position: absolute;
49+
width: 750px;
50+
height: 600px;
51+
top: 50%;
52+
left: 50%;
53+
margin: -300px 0 0 -375px;
54+
}
55+
}
56+
57+
h1 {
58+
line-height: 1.3;
59+
}
60+
</style>
61+
</head>
62+
<body>
63+
<div class="wrapper">
64+
<h1>The webcam server is currently not running</h1>
65+
66+
<p><strong>
67+
If you do not have a camera attached, this is normal and can be safely ignored.
68+
</strong></p>
69+
70+
<p>
71+
Otherwise, if you just started up your Raspberry Pi or just plugged in your camera,
72+
please wait a couple of seconds.
73+
</p>
74+
75+
<p>
76+
If the issue persists, please check the following:
77+
</p>
78+
79+
<ul>
80+
<li>
81+
If you have a Raspberry Pi camera, verify that it is properly attached. The ribbon
82+
cable can be plugged in the wrong way. <strong>Power off your Pi first, do not attempt
83+
to attach or detach the Raspberry Pi camera while the Pi is powered!</strong>
84+
</li>
85+
<li>
86+
Your camera might not be configured correctly. Please check the configuration files in <code>/boot/camera-streamer/</code> and
87+
make sure they are correct for your camera. See <a href="https://faq.octoprint.org/camera-streamer-config">the configuration documentation</a>
88+
for more info.
89+
</li>
90+
<li>
91+
Log into your Raspberry Pi via SSH. Check if your <strong>USB</strong> camera is detected by the system via <code>lsusb</code>.
92+
</li>
93+
<li>
94+
Log into your Raspberry Pi via SSH. Check if your <strong>Raspberry Pi camera</strong> is detected by the system via
95+
<code>libcamera-hello --list-cameras</code>.
96+
</li>
97+
<li>
98+
If your camera is detected, check what the camera stack is reporting by running <code>journalctl -u camera-streamer\* | pb</code>. You can use the resulting
99+
<a href="https://paste.octoprint.org">paste.octoprint.org</a> link to view the logs or share them with the community easily.
100+
You can also get these logs by downloading a systeminfo bundle from your OctoPrint server.
101+
</li>
102+
</ul>
103+
<p>
104+
If all that doesn't help to troubleshoot the issue, you can seek
105+
support on the <a href="https://community.octoprint.org">OctoPrint Community Forum</a> or <a href="https://discord.octoprint.org">Discord Server</a>.
106+
Please provide as much detail as possible, including your camera model and the <strong>results of all the troubleshooting points</strong> above. Making
107+
your post as detailed as possible makes it more likely you'll solve your issue.
108+
</p>
109+
</div>
110+
</body>
111+
</html>

0 commit comments

Comments
 (0)