In this Raspberry Pi OctoPrint tutorial, we will be walking you through all the steps that you need to follow to be able to set up OctoPrint on your Raspberry Pi and connect to it from Cura.
To simplify things, we will be using the OctoPi distribution. This distribution is a pre-setup version of Raspbian with everything that you need to get OctoPrint up and running already installed. It also helps simplify the process of setting up a WiFi connection among other things.
To be able to use OctoPrint make sure that your 3D Printer has an available serial port. Many 3D printers allow this ability over a USB cable connection.
However, some printers might require more complicated methods that we won’t be touching on in this tutorial. Our tutorial will assume you already have your Raspberry Pi connected to your 3D printer via its serial connection.
You can find all the pieces of equipment that I recommend for this Octoprint setup guide for the Raspberry Pi.
- Raspberry Pi 2 or newer
- Micro SD Card
- Power Supply
- Ethernet Cable (Recommended) or Wi-Fi
- 3D Printer
Formatting your SD Card
One of the first things we must do to get OctoPrint onto our Raspberry Pi is to ensure it has been correctly formatted. The reason for doing this is to ensure that the Raspberry Pi can access all the space on the SD card and can get the best possible read and write performance from the SD Card.
By following the steps below, you will quickly and correctly format your SD Card.
1. To begin, you will need to use a tool designed to format the SD Card. The most reliable one is the one put out by SD Card Association themselves.
Once on the site, you will find a download SD Formatter for either Windows or Mac located at the bottom of the page.
2. Once you have downloaded the install file, run it and follow the prompts to install the SD Card Formatting tool on your device.
3. Insert your SD card into the computer or laptop’s SD card reader and check the drive letter allocated to it, e.g., G:/. Ensure you have found the correct drive letter otherwise you will end up formatting the wrong device.
4. Launch the SD Formatting tool that you installed earlier, make sure you select the correct drive letter for your SD card (e.g., G:/). Also, make sure that you “FORMAT SIZE ADJUSTMENT” set to “ON“. Once you are certain, you have everything set correctly, then press the “FORMAT” button.
Installing OctoPrint to your Pi
1. Head over to the OctoPrint website and download the latest zip file. Once downloaded, unzip the file so, you are left with a .img file.
2. Next, you will need some tools to be able to write the image to the SD card. For this we will use a tool called Etcher, you can download it from Etcher’s website. Etcher is available on Window, Mac OS X and Linux.
3. Open Etcher and select the image that we downloaded and unzipped earlier.
4. Next, select the SD card, make sure you double check to ensure it is the SD Card otherwise you might accidentally wipe a hard drive.
5. Next, click flash and wait while it writes the image to the SD card.
Once finished, keep your SD Card plugged into your device if you want to setup WiFi. Otherwise, skip to Step 4 of this tutorial.
Configuring OctoPrint for WiFi
The process of setting up Raspberry Pi OctoPrint WiFi differs to how you usually set the WiFi configuration. The process of how to do it is listed right below.
1. With your SD Card still plugged into your device open up its folder on your computer.
2. On the root of the SD Card, you should find a file called “octopi-network.txt“. This file holds all the information needed to connect to a WiFi device.
To add in your WiFi details open the file using a text editor, make sure you use a program such as Notepad++, Atom or VSCode as they don’t tend to mangle the file without first warning you.
Avoid editing the file with other programs such as WordPad (Windows) or TextEdit (Mac OS X) as they will enforce their encodings on the file making it fail to work.
3. Now within this file find the following text, this is where you will set your WiFi networks SSID name and its password.
You will need to uncomment this text and add your networks SSID and password.
## WPA/WPA2 secured #iface wlan0-octopi inet manual # wpa-ssid "put SSID here" # wpa-psk "put password here"
## WPA/WPA2 secured iface wlan0-octopi inet manual wpa-ssid "put SSID here" wpa-psk "put password here"
4. Once you have made the required changes to the file, then save it. Just take your SD Card out and put it on the Raspberry Pi.
These are the last changes we should need to make while the SD card is still plugged into the computer. With these changes made we can now proceed to set up OctoPrint through its interface.
Getting Started with OctoPrint
1. Begin by going to your Raspberry Pi’s IP Address, if you don’t have this you should be able to find it on your router. In some cases, you can go to
http://octopi.local to be able to load up the interface, but this does not work in all cases.
2. On your first visit to the OctoPrint web interface, you should be greeted with the following message. Over the next few steps, we will walk you through everything that needs doing.
To begin, click the “Next” button.
3. Now on this screen, you need to enter a username and a password (1.) to utilize to access the web interface. Not using this is a huge security risk as someone could take control of your 3D Printer.
After that click the “Keep Access Control Enabled” button (2.) and then the “Next” button (3.)
4. Unless you have a slicing profile that you want to utilize, press the “Next” button on this screen.
5. This screen is highly important, on this you will need to fill out all the information of your 3D printer. Make sure you go through each tab and ensure that the values there match the specifications of your 3D printer. You may have to google your printer to get the correct information.
Failing to enter the correct information can cause printing issues.
6. Now OctoPrint is almost ready to go, press the “Finish” button on this screen to continue.
7. Now on here press the “Reload now” button. After pressing this button, we will be taken to the main OctoPrint interface.
8. Now you should be taken to the main OctoPrint screen, take time to familiarize yourself with this interface. Once you have your Raspberry Pi connected up to your 3D printer, you can then press the “Connect” button (1.)
To connect up a slicer like CURA we will need to do a couple more steps, begin by clicking your username in the top right-hand corner (2.) and then clicking the “User Settings” button underneath it (3.)
9. On this screen in the API Key section click the refresh button as shown below. This button will generate a new API key for us to utilize in CURA.
10. Now copy the current API key that is now shown. We will need this for getting CURA to connect with OctoPrint so keep it safe. With the API Key copied down, that is everything you need to do within the web interface for now.
Connecting Cura to OctoPrint
1. In the newer versions of Cura, you will have to actually enable OctoPrint support by installing a plugin. Our next few steps will walk you through the process of doing this.
If you haven’t installed Cura, then you can find it for download over at their website. There is also plenty of other software packages you can use for setting up your prints correctly.
To begin to launch up Cura, click “Plugins” in the toolbar and then select “Browse Plugins“.
2. Within this screen look for “OctoPrint Connection” and click the “Download” button to install the plugin.
3. You will now be asked whether you accept the license agreement provided by the OctoPrint connection plugin. If you are happy with agreeing to the license, click the “Accept” button.
4. Now you will need to click the “OK” button. Once pressed you will need to manually close out of Cura and re-open it for the plugin to be loaded in.
5. Now we need to set Cura up so it will use OctoPrint, to do this we need to click “Preferences” in the toolbar then click “Configure Cura“.
6. On this screen click the Raspberry Pi OctoPrint server you want to connect to on the left-hand side, then enter the API Key that you got earlier from the OctoPrint web interface (1.)
With the correct API key entered the “Connect” button (2.) should become clickable. Once the button is clicked, you have successfully set up Cura to be able to print using your OctoPrint web server.
Hopefully, by the end of this tutorial, you will have your Raspberry Pi with OctoPrint working. You will also hopefully have Cura successfully being able to connect to your 3D printer and send sliced files.
There is more you’re able to do with this cool little server. For example, if you wanted to access your OctoPi outside your home, you might want to set up some port forwarding. Just make sure you set a strong password so random people can’t just start prints on your machine.
If you have any issues with this Raspberry Pi Octoprint tutorial or have any feedback, then feel free to leave a comment below.
Do I have to use an SD card. I have my Raspberry Pi 3 set up with an SSD hard drive. It will no longer boot off of SD card. Do I need to purchase another Raspberry Pi just for OctoPI?
You don’t require an SD card if you have it booting off a different drive.
Pretty cool..since you are running a linux server you could add pivpn, then port forward the vpn port thru the firewall…then use an app on your phone like openvpn, tunnel into network, then print as if you are local, port forwarding without encryption is somewhat dangerous