Installing Octoprint on a Raspberry Pi is a cheap and effective way to add remote access capabilities to a 3D printer such as the Ender 3. If you have looked at an expensive printer with WiFi access and wished that you too could remotely fling files to it and begin prints or monitor the current status of an existing print then Octoprint is for you. Read on to learn how to install and setup Octoprint on a Raspberry Pi computer.
What Is Octoprint?
Octoprint is a 3rd party web user interface for 3D printers created and supported by Gina Häußge (username foosel). It is 100% open source and compatible with the majority of consumer level 3D printers on the market. Octoprint can be run on Windows, Linux, or MacOS, though by far the most popular way to host a 3D printer is with the humble Raspberry Pi.
Why Do I Want Octoprint?
Hosting your printer with Octoprint allows for you to have remote access to the printer when not directly in front of it. You can attach a web camera and watch in real time, take timelapse videos, you can even use plugins like the Spaghetti Detective to detect failures and stop the print. Simple controls for heating up, cooling down, moving the axes, visualizing your bed level, plus much more. Convinced? Good, let’s get on with our install of Octoprint on a Raspberry Pi.
Supplies Needed to Install Octoprint on a Raspberry Pi
- Raspberry Pi
- Raspberry Pi Power Supply
- Micro SD Card
- Raspberry Pi Case (purchased or 3D Printed)
- Raspberry Pi Camera (optional, some USB webcams also supported)
- 5 Volt Fan (optional but recommended for the Pi4 and newer)
Steps to Install Octoprint on a Raspberry Pi
1) Download the current release of Octopi
Head on over to Octoprint.org and download the most recent release of Octoprint for Pi.
2) Download and install Balena Etcher
We are going to need a clean SD card to install the Octopi image onto. For this we’ll use Balena Etcher so you will need to download and install that as well.
3) Extract the img file from the zip and flash to an SD card using Etcher
Unzip the Octopi zip file and extract the .img file from it. In Etcher you select the SD card and the octopi image file and start writing it. Etcher will validate your install once it is done, if Windows asks you do you want to format anything on the SD card make sure you say no.
4) Add the connection details to the Pi if you want to use WiFi
Open up the octopi-wpa-supplicant.txt file with notepad or VSCode, do not use Wordpad of MS Office or you will corrupt the file. You need to add in the ssid of your network and the password in the relevant section based on the security on your network. Save this file and replace it on the SD card.
5) Insert the SD card into a Raspberry Pi and boot the Pi
Boot up the Raspberry Pi and give it a few minutes to connect. We are going to use a tool to access the pi remotely but if you wanted you could just as easily connect a keyboard and monitor and do everything that way.
6) Connect to the Pi via SSH
I’m connecting to the pi using PuTTY with the IP address of the pi. Check your router to find the IP assigned and set it to static first to make sure it doesn’t get changed later. The default user name is “pi” and the default password is “raspberry”.
7) Enter the Pi configuration menu
Run the command “sudo raspi-config” to ender the config menu. Since this is a sudo command it will be asking you for your password before it’ll run.
8) Change the default password for the Pi
Technically this is optional but let’s be real, you should never leave a device connected to a network using a default password. Botnets thrive on sloppy security so please change this to something secure. Select 1) System Options and then S3) Password to change it.
9) Configure the locale and timezone
Another optional step but a good one to set while you are in the config menu is the timezone and localization. Without changing this when you look at the timestamps on uploaded gcode files things will be pretty weird with newly uploaded files being flagged as 10 months old and other strange stuff like that. Select 5) Localization Options and then L1) Locale to change the region and language and L2) Timezone to change the timezone.
10) Change the Pi’s hostname
One last optional change in the config menu is to change the hostname of your octoprint instance. If you are running multiple printers on your network this is a good idea. Select 1) System Options and then S4) Hostname to change it. Whatever you select here can be used to replace “octopi” in http://octopi.local when connecting to the printer.
11) Shutdown the Pi and close PuTTY
OK we are done with configurations in the pi and we no longer need PuTTY (or the keyboard and monitor) if you were using that. We are doing to shut down the pi as our last step with the command “sudo shutdown” and once it is off it is time to move it to your printer.
12) Plug in the Pi to the 3D printer via USB
Connect the pi to your 3D printer through one of the USB ports and then power on the pi and the printer. Nothing interesting is going to happen yet so don’t be alarmed.
13) Connect to Octoprint on your Raspberry Pi
Open up a web browser on your PC and connect to Octoprint through http://(hostname).local or http://(your IP address). You should see the welcome screen and there will be a number of prompts we are going to step through to configure Octoprint for the first time.
14) Create an Octoprint username and password
You need to create a username and password to access Octoprint. This will be your administrator account (you can make user accounts later with less access if that is a thing you need). This is not the same as your Raspberry Pi account and honestly shouldn’t share a password if at all possible.
15) Enable or Disable anonymous tracking
Decide if you want to allow Anonymous Usage Tracking and click the correct button for it. Octoprint is open source and relies to some extent on this type of thing to make the product better. That being said not everyone is comfortable with handing over data without their explicit permission so you have the option to turn this off.
16) Configure the connectivity check
You can probably leave all these settings standard and just click “Test host & port” and “Test name resolution”. If everything checks out you should be good to go, if not we’ll need to do some configuration on your router.
17) Enable or Disable plugin blacklisting
Octoprint allows for plugin blacklisting where it will prevent plugins listed in it’s blacklist from being available for install. This is mostly to deal with old depreciated plugins and is optional. Decide if you want it on or off and make the selection, this can be changed later if you want.
18) Create printer profile
OK finally we are up to something specific to your printer. You need to create the profile giving Octoprint key information such as the printer name, model, bed size and origin, maximum feed rates to allow, and default extruder details. If you are setting this up for a Prusa with an MMU even though it only have 1 extruder if you want to be able to view and control for all 5 filament choices you need to tell it there are 5 extruders.
19) Connect to your 3D printer with Octoprint
We are done with configuration! Time to select the serial port and baudrate and hit connect (assuming your printer is turned on). Most of the time this can be left on Auto but if that isn’t working then look up what the details are for your printer’s board and use that.
Octoprint is Installed, Now What?
We have successfully completed our install and setup of Octoprint on a Raspberry Pi. At the top of the interface there are tabs for Temperature to control hotend and bed heating. Control will allow for moving of the axes as well as viewing of a webcam if you set one up. The GCode Viewer allows for seeing the details of the sliced file by layer and Terminal allows for viewing and sending of commands directly to the printer. Timelapse records timelapse videos of your print if you have a connected camera.
On the left side of the interface you will see at the bottom a files section. This is where you can upload sliced gcode files to the printer and then print them. Uploading to local stores the file on the Raspberry Pi and is fast and easy. You can upload to the SD card of the printer as well but it is extremely slow. In either case you can print files from the SD or the Pi. If your printer supports power loss resume you should know that if you are printing off the local storage of the Pi this will not work by default.
At the top of the interface you will see a wrench icon to access settings. Here you can change any of the configuration you already set, add in new user accounts, and install plugins (of which there are many amazing ones). You can shutdown or restart the Octoprint instance as well as the Pi itself with the power icon. Finally the user icon at the right logs in or out of the web interface if you want to run Octoprint with a different account.
If you want to further enhance your Octoprint experience then consider installing Octodash and a touchscreen, check out our guide for the details.
Well that’s it. You now have a 3D printer connected to your home network and can start printing and monitoring remotely. We hope this guide helped you and if you have any questions or suggestions please let us know in the comments.