How to Set Up and Use OctoPrint for 3D Printing
OctoPrint is a great tool for managing your 3D printer(s). Using OctoPrint you can control your 3D printer from the network and allows you to monitor your printer’s current status and print progress. In this guide we will cover how to install and use OctoPrint on a Raspberry Pi.
Here are the steps to installing and using OctoPrint for 3D Printing.
- Download the OctoPi Image
- Image Your Raspberry Pi’s SD card
- Configure Network Settings
- Boot the Raspberry Pi
- Configure OctoPi Settings Via SSH
- Connect to OctoPrint from a Web Browser
- Configure OctoPrint Settings
- Connect your Printer to OctoPrint
- Add Plugins to OctoPrint
- Using Printoid with OctoPrint
- Connect a Webcam to OctoPrint
- Upload and Print
- Using OctoPi for Printer Configuration
In order to use OctoPrint you will need a Raspberry Pi, power source, SD card, SD card USB adapter, USB A to B cable, and a 3D printer that can be controlled via USB. If you already have a spare Raspberry Pi 3b or 4 laying around that will work great. If you need a Raspberry Pi, I recommend this Raspberry Pi 4 from CanaKit (Amazon link).
This guide was developed using a Windows PC and an Android phone (for Printoid). I don’t have access to a Mac, so I am unable to offer guidance on some of the steps for a Mac. However, the steps are still the same regardless of what OS you use.
This guide ended up being rather lengthy due to the numerous screen shots I added. I wanted to be thorough in the guide so that even those who may not have lots of technical knowledge could follow it. I also want to point out a distinction in the guide. OctoPi refers to the raspberry Pi that we install to. OctoPrint is the program that you use and runs on your OctoPi. Ok, let’s get into the guide!
What is OctoPrint?
OctoPrint is a web interface for your 3D printer that allows you to monitor and manage your 3D printers over a network connection. You can upload files directly to the OctoPrint server without copying to an SD card. You can remotely control every aspect of your printer from starting, pausing, and cancelling prints, to monitoring the printer with a USB webcam.
Features of OctoPrint include:
- An embedded webcam feed.
- Monitoring of the current status of your print job
- Set the temperature of your hot end for filament changes.
- Temperature charting
- Move the print head along all axes, extrude filament, retract filament, and define your own custom controls.
OctoPrint has an extensive library of plugins that allow you to further customize your experience. With these plugins you can extend the functionality of OctoPrint:
- Receive a push notification on job progress via Pushbullet, Pushover, or my favorite Printoid.
- Integrate OctoPrint into Telegram or Slack
- Collect Statistics on your printer and print jobs using Print History or Print Statistics Plugin
OctoPrint is 100% open source and the code is available on GitHub. If you are a programmer and want to modify it in anyway, you are free to do so!
And a few other features:
- Create time-lapse recordings of your prints
- Slice your STL files directly in OctoPrint
- Built-in access control lets you determine who can control your printer
- Any many more
Now that we have reviewed what OctoPrint can do, let’s move on to getting OctoPrint installed.
Download the OctoPi Image
The first thing you will need to do is to download the latest image of OctoPi which is a preconfigured image of OctoPrint for the Raspberry Pi. As of this writing the current OctoPi version is 0.17.0 as seen in the image below. If there is a newer version at the time you are reading this guide get the newer version.
Click the download button to start the download. Depending on your connection this may take some time. The image is 687 megabytes compressed so you may need to wait a few minutes while the image downloads.
Once it’s done open the zip file and extract the .img file to an easy to remember location such as the Desktop.
Once you have downloaded and extracted the image you can move on to imaging your SD card.
Image your Raspberry Pi’s SD card
Now you need to write the .img file to your Raspberry Pi’s SD card, but we can’t just copy it. The .img file is a special file format like a zip file. A .img file is used to store an image of a disc and is used to distribute program such as operating systems, which, is exactly what we are installing. OctoPi installs an operating system to your Raspberry Pi that already has OctoPrint included. In order to properly prepare the SD card, we need to use a program that will properly copy the .img file to the SD card preparing it as a bootable drive for the Pi. I recommend Rufus for this task.
You will also need a way to use your SD card in your computer. If you have one of the CanaKits I recommended earlier, it will have included a small USB to SD card adapter you can use. If you don’t have one you can pick them up for a few dollars here. Insert the SD card from your Pi into the USB adapter and plug it into the computer.
Download Rufus from the link and then run it. It will ask for permission to make changes on your computer. The program needs the ability to write to drives on the computer which is why it requests the permission. After it opens you will be asked to allow it to check for updates. Select yes, and then the program should open and you will see a screen like the one below:
As you can see it already detected the SD card attached to the computer and has put it into the device selection. If Rufus does not find your SD card automatically, click the dropdown link and browse to it. This process WILL DELETE all the data on the SD card. If there is any data you want saved be sure to do so before proceeding! Now click on the SELECT button and navigate to the OctoPi image you extracted earlier. Once selected the image name will show under Boot selection.
Click Start and Rufus will warn you that all data on the card will be destroyed.
Click OK to proceed.
The imaging process may take several minutes depending on your computer’s specifications. After the imaging process finishes, remove and reinsert the SD card into your computer. If Windows asks you to format the SD card, DO NOT! We are now ready to move on to configuring the network settings.
Configure Network Settings
If you are planning to connect your OctoPi to your network with a wired connection, you can skip to booting the Pi. If you want to use your OctoPi over Wi-Fi you will need to configure a file on the SD card before booting your Pi. In newer versions of Windows, I’m looking at you Windows 10, when you try to access the SD card you probably see this message:
When the OctoPi image is created on the SD card two file systems are created. One file system is only readable by Linux and the other /boot is readable in Windows. We need to access the /boot directory in order to modify our Wi-Fi settings. Let’s get started.
Accessing the wpa-supplicant-info.txt file on a Windows 10 PC
First You need to open the Computer Management program in Windows.
Click the Windows button on the task bar and search for Computer Management.
Next, under Storage click on Disk Management
On the bottom of the Computer Management Program you should see several boxes that represent the drives on your computer:
You are looking for the removable disk like I have highlighted in the picture above. Now right click on the box that says boot and select “Change Drive Letters and Paths”
On Change Drive Letters and Paths Dialog Box Click Add
Select Assign the following drive letter (Windows should auto select the next available letter) and Click OK.
You should now see the drive letter assigned in Disk Management:
Open Windows File Explorer (Windows Key + E) and scroll down on the left side. You should see the newly assigned drive letter.
Click on the boot drive you just added, and you should now be able to access all the files on the /boot partition of the OctoPi SD card.
We need to edit the highlighted file octopi-wpa-supplicant.txt.
Right-click on the file and select edit. This will open the file in notepad so we can make the necessary changes.
Scroll down to this section:
Delete the # from the last 4 lines of the block. Leave the ## in front of WPA/WPA2 secured. Replace the two highlighted areas with the SSID (network name) and password for your Wi-Fi network. I have included an example of what it should look like below. be sure to replace SSID and PASSWORD with YOUR network’s SSID and password!
Scroll down in the file to set the country locale. In the image below I have set the country to US by removing the # at the beginning of the line. Remove the # from the appropriate location for you. I’m in the US so I have set my region to United States.
Once you have made the changes save the file (Control-S) and close the file.
Alright, that was a lot of work, but it was necessary so that we can communicate with the Pi. With the Wi-Fi networking configured we can boot it up without the need to connect it to a monitor, mouse, and keyboard.
We’re finally ready to boot up OctoPi for the first time!
Boot the Raspberry Pi
Insert the SD card back into your Raspberry Pi. Connect the power cable to the pi and wait a few minutes for it to boot up. In order to connect and configure security options for our Pi we need to connect to it with SSH (Secure SHell). We can do this with a free program called Putty. In the next few steps, we will download and configure putty to login to OctoPi.
Configure OctoPi Settings Via SSH
We are going to use a free program called PuTTY to configure out Pi via SSH.
Download putty from here. Click the downloaded exe file and follow the prompts to install Putty. You can leave all the settings as they are. Once it finishes open putty. Search Putty in Windows if you can’t find the app.
Under Host Name enter octopi.local and click Open
On the Putty security alert click Yes. I have crossed out my key’s in the below image for security reasons.
Now enter the default login credentials as below.
Login as: pi
[email protected]’s password: raspberry
You won’t see any indication that you are typing the password. Type in the login credentials and press enter to continue.
You should now be connected to your OctoPi:
Now we need to run the raspberry pi configuration. In the Putty terminal enter:
sudo raspi-config and press Enter
When prompted for the sudo password enter: raspberry
You will now be presented with the Pi’s configuration utility:
The first step is to change the password.
- Using the up and down arrow key highlight Change User Password and Press Enter.
- The utility will inform you that you will be asked for a new password. Press Enter.
- Enter your new password for the OctoPi and press Enter.
- Reenter the password to confirm and press Enter.
- On the successfully changed screen press Enter.
- You will be returned to the main configuration menu.
Next set your time zone by selecting Localisation Options and pressing Enter.
- Select Change Time zone and press Enter.
- Select the geographic area where you live, and press Enter.
- Select your time zone in the list and press Enter.
- You will be returned to the main configuration menu.
If you are planning on having multiple OctoPis on your network, you may want to change the host name. If you only plan to have one OctoPi, this step is not needed.
- Select Network Options and press Enter.
- Select Hostname and press Enter.
- Press Enter
- Enter the new hostname and press Enter.
- You will be returned to the configuration menu.
If you changed the host name you will need to use the new hostname to connect to your OctoPi so keep track of it!
On the main configuration page press tab to highlight select. Then press the right arrow key to highlight Finish and press Enter.
Press Enter when asked if you would like to reboot. Your putty connection will be terminated at this point.
Go ahead and close Putty as we are done with SSH. Let’s move on to the next step.
Connect to OctoPrint from a Web Browser
After a giving the pi a few moments to reboot let’s try connecting via web browser. Open your web browser and enter the hostname for your octopi. If everything went as planned, you should now be greeted with the OctoPrint setup wizard:
Alright, that step was easy! Let’s move on to configuring your OctoPrint installation.
Configure OctoPrint Settings
On the Setup wizard click Next.
The first option to configure is Access Control. You will need to enter a username and password in the Access Control screen. While you do have the option to disable access control, don’t do it! If anyone is able to get access to your printer, they could cause damage to the printer or even worse, start a fire.
Enter a username and password and press Keep Access Control Enabled. Then click Next.
The next screen is Anonymous Usage Tracking. You will need to click either Disable or Enable Anonymous Usage tracking. Once you have made your choice click Next.
The next step is the online connectivity check. I recommend enabling this setting. Click Enable Connectivity Check. Then click Next.
Next, we have the Plugin Blacklist setting. I recommend enabling the plugin blacklist. Click Enable Plugin Blacklist Processing and click Next.
The default printer profile page allows you to enter information about your 3D printer. This setup will allow you to use OctoPrint to slice files automatically by uploading the STL to be printed to OctoPrint. I don’t use this feature, so I skip it. If you decide later that you want to use the built-in slicing on OctoPrint you can add a printer in Settings à Printer Profiles.
Click Next to skip adding a default printer profile.
The last step! Click Finish!
And that’s it! We’re done the OctoPrint setup wizard.
Now we are presented with the interface for OctoPrint:
After accessing the Web interface, I recommend rebooting the entire OctoPi. After it reboots, you may get a notification about updates for OctoPrint:
Click Update now then click on Proceed to let OctoPrint update and restart your OctoPi. After a few minutes the OctoPi will reboot and prompt you to reload the web interface. After reloading the web interface, you can move on to connecting your printer.
Connect Your Printer to OctoPrint
This step is easy! Connect a USB A to B cable from your OctoPi to your printer. Leave the Serial Port and Baud rate set to Auto on the OctoPrint web interface and click Connect. Your web interface should change slightly and now shows the printer state as Operational.
Alright! Now we can control our printer from our OctoPi! But first, let’s learn how to install plugins.
Add Plugins to OctoPrint
Plugins allow you to extend the functionality of OctoPrint. Keep in mind, that the more plugins you install, the more resources OctoPrint will use. With too many resource intensive plugins you can affect the quality of your prints. If your OctoPi can’t keep up with the demands of all the plugins it won’t send G-Code to the printer in a timely manner causing print issues.
I have two favorite plugins that I use with OctoPrint. PrintTimeGenius and Printoid are the two plugins that I highly recommend. We will look at Printoid in the next section which uses the Printoid plugin in order to control the printer from an Android phone. PrintTimeGenius analyzes the G-Code files uploaded to the printer and give highly accurate printing time estimates.
I will use the Printoid plugin as an example of how to install plugins for OctoPrint. In the next section we’ll look at getting the android app and connecting to our OctoPrint server.
Click the small wrench icon on the top of the web interface. On the left side of the settings menu click Plugin Manager. Under installed Plugins at the bottom of the page click “Get More”
In the search box enter the plugin you are looking for. In our case I will search for Printoid.
Once you find the plugin you want Click Install. OctoPrint will download and install the plugin from the repository. After the install finishes you will be prompted to reboot OctoPrint.
Click Restart now and then click Proceed to reboot.
That’s it! After OctoPrint reboots your plugin is now installed.
In the next section I will cover using Printoid with OctoPrint.
Using Printoid with OctoPrint
I am not always near a computer or have one turned on when I need to work with my 3D printers. If I want to control the printer without using a PC I access OctoPrint with an app called Printoid. There are two versions of Printoid, the lite version which is free and the premium version which costs around $8.00. We will use the lite version for installation and setup with our OctoPi server.
- Open the Google Play store and search for Printoid Lite.
- Install Printoid – Remote for OctoPrint [LITE] on your phone.
- Open the app after it installs
- Flip through the introduction screens to learn more about the app
Now we come to the initial setup screens for Printoid. I’ve included screen shots of each of the setup pages for reference. The app does a great job at walking you through the setup but for completeness sake of the guide I included screenshots.
On the subsequent screens you will enter the appropriate information relative to your OctoPrint installation. Once you have entered the necessary information on the screen click the arrow in the bottom right corner.
I entered Octopi4 for my profile to keep with the naming convention I used in this guide. I recommend you use the hostname you chose for your OctoPi or the printer name that it will be attached to.
After I entered the hostname Printoid could not find OctoPrint, so I used Putty to get the IP address.
If you have similar issues, open an SSH connection with Putty and after logging in enter the command ifconfig. You are looking for the WLAN adapter IP address that will look something like 192.168.1.10 (example IP yours will be different). Enter the IP address you get from the ifconfig command in Printoid and you should be good to go. One caveat to using the IP address is if it changes in the future you will need to change it in Printoid.
I do not use, nor do I recommend using this feature. Exposing your OctoPi to the Internet is risky.
To get your OctoPrint API key click the small QR code on the Pritoid screen and grant it access to use your camera. Then follow the steps below to get the API key from OctoPrint.
Open the API Settings in OctoPrint by going to settings –> API.
Scan the API QR Code with Printoid on your phone. This is a test setup I used to capture images for this tutorial, so I don’t care that the API key is publicly available. You should not share your API key.
Enter the username and password you created for OctoPrint earlier.
We did not set up https on the OctoPrint so we don’t need to set any of these options. Click the arrow to continue.
Review all the settings on this page to ensure everything is correct then press the Check Mark.
Congratulations, Printoid is setup and ready to go. I chose to use the tab view as that as what I am familiar with. Each tab offers different options to control OctoPrint. The main tab I use is the control tab:
I use this tab to change filaments on my printer by setting the hot end temperature and then using the extrude function to feed the new filament into the extruder and hot end.
Another great feature that I love about Printoid is notifications. If a printer goes offline, starts, or finishes a print I get a notification on my phone. You can also set it to give you notifications at 25, 50, 75 and 100% print progress. I have mine set to 50 and 100% progress but that is a personal preference.
If you buy the premium version of the app you can also see webcam views of your printer. This requires you to have a web cam connected to your OctoPi and that is what we will cover next.
Connect a Webcam to OctoPrint
If you want to keep an eye on your printer while you are in another room of the house, you can connect a web cam to OctoPrint. Simply plugin a USB web cam and OctoPrint will recognize it after a few seconds. Click on the control tab to see your live feed of the webcam. If your webcam doesn’t show up at first try rebooting your OctoPi. Click on the power Icon in the OctoPrint menu bar and select Reboot System.
A cool feature on the control tab is the keyboard control. If you hover your mouse over the webcam image and click the up arrow next to keyboard controls, you will see the available commands. Then you can use your keyboard to manipulate the printer.
Ok, I think it’s finally time for us to upload and print something using OctoPrint! In the next section we’ll cover using OctoPrint to print a 3D model!
Upload and Print
Alright, let’s slice up a model and upload it to OctoPrint! I’m going to send a retraction calibration print to my Wanhao Duplicator 6 for some tuning. If you’re interested in reading my guide on tuning your FDM printer, you can read it here.
Simply drag your G-Code file over the left side of the OctoPrint screen and release.
Here we can see the G-Code file has been uploaded to OctoPrint. The gold star next to the file name is from the PrintTimeGenius plugin indicating that the file has been analyzed.
At this point you can either click the printer icon on the file to start the print or simply use the load button (open folder icon) and see the print time estimate. Once you’re ready to go click print!
The printing state changes to Printing and the temperature graph indicates the current temperature of the hot end and heated bed. The print time indicates how long the print has been running and time left indicates an estimate of how much time is left. Time left is more accurate with the PrintTime Genius plugin but it’s still not perfect.
Don’t mind the crazy temperature chart. I had to cancel the print twice due to incorrect slicer settings. Always check your slicer settings before slicing! I forgot I had changed them for a test I was running and sliced the current model with bad settings.
If you need to pause or cancel the print for any reason simply click the corresponding button.
We can also see in Printoid that our monitor tab has updated to indicate that the printer is printing.
There we are, we’ve got OctoPrint installed, configured, and printing! Before we end this guide there is one more feature I want to show you that will be useful.
Using OctoPi for Printer Configuration
Another of my favorite features of OctoPi is the ability to use the terminal tab to send commands directly to the printer. This feature is useful for calibrating and tuning your printer as you don’t have to be near a computer. Click on the Terminal tab in OctoPrint to access the terminal command interface.
Check the three boxes underneath auto scroll to reduce unnecessary status messages while you work in the terminal. Now you can enter commands directly into the text line and send them. Here I’ve sent an M503 command to see all the current settings stored in the printer’s memory.