Tested on a Raspberry Pi 3 with trixie.
$> cd
$> sudo apt-get install -y git virtualenv gcc build-essential libyaml-dev
$> sudo apt-get install -y python-pip python-dev python-setuptools python-venvThen you can install octoprint from source, as regular user, using:
$> git clone https://github.com/OctoPrint/OctoPrint.git
$> cd OctoPrint
$> python3 -m venv venv # create an env dedicated to octoprint
$> source ./venv/bin/activate # activate this env
$> pip install pip --upgrade # optional
$> pip install . # install octoprint from source int the envYou may need to add the user to the dialout and tty groups,
so that the user can access the serial ports. To do so, do:
# add the user to the dialout group and tty so that the user can access the serial ports
$> sudo usermod -a -G tty $USER
$> sudo usermod -a -G dialout $USER # for access to webcam
$> sudo usermod -a -G video $USER # for access to vcgencmdTest octoprint is working fine:
$> ~/OctoPrint/venv/bin/octoprint serveThen, visit http://xxx:5000/
where xxx is the address of your device (can be localhost).
If your user is not pi, change it in the scripts/octoprint.default.
The following will do it for you:
$> cd
$> git clone https://github.com/leoheck/octoprint-systemd.git
$> cd octoprint-systemd
$> make install # be sure to execute as user (not sudo).The path may be written with wrong case ("octoprint" instead of "OctoPrint"). Check and fix using:
$> sudo nano /etc/systemd/system/octoprint.service #< to check ExecStart = ...
$> sudo sed -i "s,/octoprint/,/OctoPrint/,g" /etc/systemd/system/octoprint.service # fix
$> sudo systemctl daemon-reload
$> sudo systemctl restart octoprint.service
$> sudo systemctl status octoprint.service
$> sudo systemctl enable octoprintFirst allow octoprint user to reboot.
sudo groupadd power # create a group allowed to reboot
sudo usermod -a -G power $USER # add users to that group
sudo visudo # allow the group to take those actionsAdd at the end the following:
## user is allowed to execute halt and reboot
%power ALL=(ALL) NOPASSWD: /bin/systemctl poweroff,/bin/systemctl halt,/bin/systemctl rebootNote to myself:
Passwd prompt might be a pb. See add "NOPASSWD:ALL" to avoid passwd prompt.
Explore sudo echo $USER >> /etc/shutdown.allow
Then, in the OctoPrint web-ui, go to Settings > Server > Commands, configure the following commands:
-
Restart OctoPrint:
sudo /usr/bin/systemctl restart octoprint.service -
Restart system:
sudo /usr/bin/systemctl reboot -
Shutdown system:
sudo /usr/bin/systemctl poweroff
-
Bed Level Visualizer: Displays 3D mesh of bed topography report.
-
OctoPrint-PrintTimeGenius: Use a gcode pre-analysis to provide better print time estimation
-
DisplayLayerProgress: Progress and other data on "Printer-Display"
-
OctoPrint-MQTT + OctoPrint-HomeAssistant
-
Themeify: dark theme
-
Cura Thumbnail: support for Ultimaker Format Package (.ufp) files
-
OctoPrint-TabOrder: ordering of tabs
Let’s keep in mind the evolution of the camera stack: https://github.com/cp2004/OctoPrint-CameraStreamer-Control
Neet to host both webcam and octoprint. It redirects to octoprint or webcam based on the url. Install haproxy :
$> sudo apt install -y haproxy
$> sudo mv /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bak
$> sudo nano /etc/haproxy/haproxy.cfg
# check the configuration is valid!
$> /usr/sbin/haproxy -c -V -f /etc/haproxy/haproxy.cfgglobal
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
option forwardfor
server octoprint1 127.0.0.1:5000
backend webcam
http-request replace-path /webcam/(.*) /\1
server webcam1 127.0.0.1:8080Activate the reverse proxy:
$> sudo systemctl start haproxy $> sudo systemctl status haproxy $> sudo systemctl enable haproxy