After the installation of OctoPrint and CuraEngine in the previous article
OctoPrint Package Installation
we treat now the configuration of the 3d print server.
As first operation, we set up the automatic startup of OctoPrint.
Run the following commands
1 2 3 |
sudo cp /opt/octoprint/OctoPrint/scripts/octoprint.init /etc/init.d/octoprint sudo chmod +x /etc/init.d/octoprint sudo cp /opt/octoprint/OctoPrint/scripts/octoprint.default /etc/default/octoprint |
Edit the /etc/ defaults/octoprint file changing the pointing to the executable to start OctoPrint using vi
1 |
sudo vi /etc/default/octoprint |
or nano
1 |
sudo nano /etc/default/octoprint |
and edit the file from
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Configuration for /etc/init.d/octoprint # The init.d script will only run if this variable non-empty. OCTOPRINT_USER=pi # base directory to use #BASEDIR=/home/pi/.octoprint # configuration file to use #CONFIGFILE=/home/pi/.octoprint/config.yaml # On what port to run daemon, default is 5000 PORT=5000 # Path to the OctoPrint executable, you need to set this to match your installation! #DAEMON=/home/pi/OctoPrint/venv/bin/octoprint # What arguments to pass to octoprint, usually no need to touch this DAEMON_ARGS="--port=$PORT" # Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user UMASK=022 # Process priority, 0 here will result in a priority 20 process. # -2 ensures Octoprint has a slight priority over user processes. NICELEVEL=-2 # Should we run at startup? START=yes |
to
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# Configuration for /etc/init.d/octoprint # The init.d script will only run if this variable non-empty. OCTOPRINT_USER=octoprint # base directory to use #BASEDIR=/home/octoprint/.octoprint # configuration file to use #CONFIGFILE=/home/octoprint/.octoprint/config.yaml # On what port to run daemon, default is 5000 PORT=5000 # Path to the OctoPrint executable, you need to set this to match your installation! DAEMON=/opt/octoprint/OctoPrint/venv/bin/octoprint # What arguments to pass to octoprint, usually no need to touch this DAEMON_ARGS="--port=$PORT" # Umask of files octoprint generates, Change this to 000 if running octoprint as its own, separate user UMASK=022 # Process priority, 0 here will result in a priority 20 process. # -2 ensures Octoprint has a slight priority over user processes. NICELEVEL=-2 # Should we run at startup? START=yes |
taking into account also the different user being used.
Add the script to startup automatically OctoPrint
1 |
sudo update-rc.d octoprint defaults |
Start OctoPrint with the command
1 |
sudo systemctl start octoprint |
Check that OctoPrint is active on port 5000 of the Orange PI PC by accessing the address
1 |
http://IPORANGEPIPC:5000 |
Rebooting the Orange PI PC, the OctoPrint server now starts automatically.
In the next article, Linux will be configured to connect to OctoPrint on the Http standard port, i.e. on port 80