Let's say you've bought and built a new 3D printer, and started printing stuff like crazy. Yet, you now find very painful to have to remove the SD card each time, insert in the SD card reader, plug on your computer, open Cura or whatever other slicer you might be using, slice and save on the SD card and put back the SD card again in the printer then select the file to print, each time you want to start a new print.
So, with Octoprint, you'll get:
Octoprint is a HTTP server software that's expected to run on a small computer. Many will install Octoprint on a Raspberry Pi (minimum Raspberry Pi 3 is required here) either manually, or by downloading a prebuild image (called OctoPi). However, this means you'll need to source a Raspberry Pi, a casing, likely the Raspicam also, and this is not cheap. All in all, it'll cost around 50€ for the board + casing and almost the same for the Raspicam here. Also Raspberry Pi model 3 is a bit outdated now.
Instead, I'm explaining here how to get the same features with an Orange Pi Zero 2 which is smaller, faster and cheaper.
You'll need a SBC (single board computer) and, currently, the best deal is the Orange Pi Zero 2. If I were you, I'd choose the 1GB version (even if it's a bit more expensive than the 512MB version). Don't be mistaken by all the other board from Orange Pi (like the Zero, the Zero+, the Zero+2). This one is using an Allwinner H616 CPU that's a 64bits ARM CPU.
It costs less than 30€. Right now, it's running Armbian with Debian Buster, but a port to latest version is coming (but not ready yet)
There's also a nice transparent case for it. You'll also need a µSDcard (8GB or 16GB is enough) but you can reuse any card you already have.
If you intend to monitor your 3D printer, you might be interested by buying a webcam too (~20€).
You'll need a USB-C cable to power it (you can reuse any cable here, only the 5V and ground pin is used here, you don't need the more expensive data cable).
Installation process is quite straightforward, provided you already know how to use Linux. If you don't, don't worry, I'll (try to) explain here what we are doing.
Unlike your computer, this small board does not have any non-volatile memory to boot from. This means that the operating system will have to be written to a SD card and it'll boot and run from this µSD card. You should use a 8GB or bigger card here. The larger the card, the less likely it'll run out of space with software update and card damage due to wear. So a 16GB card is probably 1€ more expensive, but if it saves you 4h for reinstalling everything, it's 1€ well spent.
Once you have the SD card ready, you'll need to download the Armbian image for this board from here.
Then you'll need to uncompress this file with 7-zip (on Windows), 7z (on linux) or The Unarchiver (on MacOS).
Once you've uncompressed the archive, you'll get a
.img file that you'll need to burn to the SD card.
Although it can be done with few low level commands, I recommend to use BalenaEtcher software:
The first boot is a bit long. You'll need to connect a Ethernet cable from your router to the Opiz2 port, even if you intend to use Wifi later on. Plug the ethernet, plug the USB-C cable and wait until the Ethernet is blinking in green. Once this is done, you'll have to find what IP address was leased to the Opiz2.
There are multiple way to do that (and if you don't know what I'm talking about, try each method below in order until one is working):
orangepizero2. This will give you the IP address (a sequence of 4 numbers separated by dot, like
192.168.1.32) of the board.
nmaptool (or an IP scanner tool). Scan your own network for new devices, with a ping scan. Typically, the nmap command is
nmap -sP 192.168.0.0/24or
nmap -sP 192.168.1.0/24. You'd get an answer like this:
Nmap scan report for orangepizero2 (192.168.0.7) Host is up (0.0015s latency).
ipconfig) and start playing trial and error here. For example, if you have an address of
192.168.1.2, try pinging
192.168.1.3and so on until you get an answer. This will return false positives here, so you'll need to check if the answer comes synchronously to the green LED blinking on the Opiz2.
Ok, now you have the IP address of the board, you'll have to connect to it. You'll need a SSH client for this. On both Linux and MacOS, it's as simple as typing
ssh firstname.lastname@example.org (replacing with the board's IP address here) in a terminal. Under Windows, you'll need to download Putty and follow the GUI here.
The initial root password is
The first command to run is to fetch the latest version of the operating system via:
Don't type the first
# in the command below.
$ means that the command must be issued by an unpriviledged user, and
# means that the command should be run by the root user
# apt-get update Blah blah, very long... # apt-get upgrade Say yes by typing 'y' and wait.
You might have to run this command pair from time to time to maintain your system fresh.
You don't want to leave a default user and password on a device. You need to customize it to your own here.
So we'll remove the
orangepi user and create your own and give you permissions to use all peripherals on the system. You must not remove the
root user (but you can change the password or remove it).
Replace yourname below by your private name
# adduser yourname # usermod -a -G sudo yourname # deluser orangepi # usermod -a -G video,plugdev,games,users,systemd-journal,netdev,input,ssh,dialout,audio,tty,disk yourname # passwd Type your new root password here twice
To enable WIFI, you'll need to perform two operations: join a WIFI network, and set a static IP address so your board is always reachable at the same address (no more guess my IP game anymore):
orangepi-configcommand to set the board's hostname, timezone and scan for WIFI network and join a WIFI network. If this fails, you'll need to exit the software, type
syncand reboot the board and try again once it has booted again.
nmtuicommand as root to change the IP address configuration for your WIFI link from dynamic to static IP. If you don't know what address to put here, I'd say that many router don't reserve all address pool for dynamic address, so they are likely using address from 1 to 100 (for the last number) for dynamic address DHCP, so it should be safe to use a 200-ish address or so for your board. You'll need to remember this IP address as it'll be the address to use from now on.
ssh email@example.com your computer.
sync && reboot) and test again. If it works, you can unplug the Ethernet cable, move your board to its final location: close to your printer.
To install Octoprint, we'll need to create a low priviledged user first and give him the minimum rights required to run octoprint and connect to any device (printer/camera/etc).
From now on, you don't need to connect to your board via the
root user, you should use
So, let's do that:
$ sudo adduser --home /home/pi --disabled-password --disabled-login pi $ sudo usermod -a -G tty pi $ sudo usermod -a -G dialout pi $ sudo usermod -a -G video pi $ sudo apt install python3-pip python3-dev python3-setuptools python3-venv git libyaml-dev build-essential ffmpeg $ sudo -u pi bash
Now you are in a sub-shell for this
pi user. We'll install octoprint for him:
$ mkdir OctoPrint && cd OctoPrint $ python3 -m venv venv $ source venv/bin/activate $ pip install pip --upgrade $ pip install octoprint $ ~/OctoPrint/venv/bin/octoprint serve
If everything went well, you'll need to connect your computer's browser to
http://your.board.ip.address:5000 and follow the setup instructions on this page.
Once it's done, you can stop Octoprint's program in the console by hitting
Ctrl + C and then
Ctrl + D, you'll be back at your own user shell.
We are now adding a service that'll start Octoprint when your board is booting:
$ wget https://github.com/OctoPrint/OctoPrint/raw/master/scripts/octoprint.service && sudo mv octoprint.service /etc/systemd/system/octoprint.service $ sudo systemctl enable octoprint $ sudo systemctl start octoprint
Make sure you can connect via your browser again, and if it's working you're done!
Afin de m'aider à financer l'infrastructure de ce blog, je liste à la fin des billets les liens affiliés sur le matériel évoqué ci-dessus.