I'm setting this up on a debian linux laptop, so I'm not using a Pi. I'm providing this info for others if they run into this issue.
I had issues with the haproxy configuration since things apparently change after a certain version. I'm running version 2.2.9-1
While this probably doesn't affect the Pi, it might eventually.
I got these warnings and errors:
[WARNING] 051/085546 (3107) : unexpected character 'i' after the timer value '15min', only (us=microseconds,ms=milliseconds,s=seconds,m=minutes,h=hours,d=days) are supported. This will be reported as an error in next versions.
[WARNING] 051/085546 (3107) : unexpected character 'i' after the timer value '15min', only (us=microseconds,ms=milliseconds,s=seconds,m=minutes,h=hours,d=days) are supported. This will be reported as an error in next versions.
[NOTICE] 051/085546 (3107) : haproxy version is 2.2.9-1
[NOTICE] 051/085546 (3107) : path to executable is /usr/sbin/haproxy
[ALERT] 051/085546 (3107) : parsing [/etc/haproxy/haproxy.cfg:28] : The 'reqrep' directive is not supported anymore since HAProxy 2.1. Use 'http-request replace-path', 'http-request replace-uri' or 'http-request replace-header' instead.
[ALERT] 051/085546 (3107) : parsing [/etc/haproxy/haproxy.cfg:33] : The 'reqrep' directive is not supported anymore since HAProxy 2.1. Use 'http-request replace-path', 'http-request replace-uri' or 'http-request replace-header' instead.
[ALERT] 051/085546 (3107) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg
[ALERT] 051/085546 (3107) : Fatal errors found in configuration.
I fixed it by changing the haproxy.cfg to:
global
maxconn 4096
user haproxy
group haproxy
daemon
log 127.0.0.1 local0 debug
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
option http-server-close
option forwardfor
maxconn 2000
timeout connect 5s
timeout client 15m
timeout server 15m
frontend public
bind :::80 v4v6
use_backend webcam if { path_beg /webcam/ }
default_backend octoprint
backend octoprint
http-request replace-path ^([^\ :]*)\ /(.*) \1\ /\2
option forwardfor
server octoprint1 127.0.0.1:5000
backend webcam
http-request replace-path /webcam/(.*) /\1
server webcam1 127.0.0.1:8080
I have installed OctoPrint according to the guide at the top of this page and everything appeared to go without any errors or warnings. I setup autostart according to the guide and the service starts on bootup and can be restarted, stopped and started by the appropriate commands. The only problem is when opening the web interface I get nothing. No feedback no nothing. It just times out. I have been using OctoPrint for 4 or 5 years and always installed from the octopi image. This time I did not want to erase my pi. The browser I am using is running another instance of OctoPrint on a seperate rPi. I am using winSCP and Putty to investigate as these are headless
The command "ps -ef | grep -i octoprint | grep -i python" returns:
pi 1966 101 4.3 144592 38796 ? Ssl 15:56 0:04 /home/pi/OctoPrint/venv/bin/python3 /home/pi/OctoPrint/venv/bin/octoprint
pi 1981 0.0 1.7 22644 15344 ? R 15:56 0:00 /home/pi/OctoPrint/venv/bin/python3 -m pip --version
The command "curl -D - localhost:5000" puts out more than 100 pages of HTML.
Hopefully someone may take a look at this info and be able to help an old man out. Thanks for any insight provided.
You probably need to check the haproxy section then, since the webcam URL is using that.
If you try http://your-ip:8080/?action=stream, it should work because this is not using haproxy. However, to avoid the port and make it relative you need that proxy section complete.
Hi, I'm stuck on the haproxy.cfg sample. I can't edit it, showing an error "Failed to save document. Permission denied." How can I edit and save the haproxy.cfg file?
Why? If this is the only thing it is used for, why does it matter? Seems like running this virtually just makes it inherently use more resources?
I just got a 3D printer and I'm interested in Octoprint. Less for the video, because I have some great 2k pan and tilt cameras that give me a good view, but more so for stats.
A virtual environment is NOT a virtual machine. Think of it as a dedicated folder for the software itself and the dependencies. There's no resource overhead there, apart from a tiny amount of additional storage for some copies of the Python binaries that are miniscule.
And why? We've had too many issues with people who went "this is the only software that will run there" and then it turned out it wasn't.
Great instructions, but I'm trying to futz with my camera and /boot/octoprint.txt just isn't there.
Did I miss something? I've been running this for almost two years now, everything works and updates but the file's just not there! Is there a default somewhere I can start with? THanks!
/boot/octoprint.txt is a part of OctoPi and this guide doesn't create it or set it up. To change the mjpg-streamer settings you'd have to edit the scripts you created originally. It's possible this guide changed since you did it or that you decided to do something different, so saying exactly what/where is impossible, but starting with what the guide has for setting up mjpg-streamer to start up automatically is a good place to start.