Octoprint as a systemd service - running it with high priority


Octoprint provides remote access to your 3D printer, and as it's written in Python, you can run it on practically any operating system.

If you are using a standard Raspberry PI image (for instance, because you run it on an Orange PI), rather than the customised Octoprint image, you can manually install it and create a systemd service to run it:




Add this to /etc/systemd/system/octoprint.service 


[Unit]
Description=Octoprint
After=network.target

[Service]
ExecStart=/home/pi/octoprint/bin/octoprint serve
WorkingDirectory=/home/pi/octoprint
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi
CPUSchedulingPolicy=rr
CPUSchedulingPriority=80

[Install]
WantedBy=multi-user.target


Then run


sudo systemctl daemon-reload
sudo systemctl enable octoprint



This will start Octoprint on every reboot with a high priority (so unlikely to stutter during printing).



Comments

Popular posts from this blog

MurMurHash3, an ultra fast hash algorithm for C# / .NET

Quick select algorithm - find the Kth element in a list in linear time