Raspberry Pi running OctoPi
Introduction
At first I was going to publish this as a add-on to my Setting Up A Raspberry Pi guide but the more I thought about it the more I realized how much easier it is to just flash the OctoPi image as opposed to flashing Raspberry Pi OS and going through installing all the dependents and everything else you’d need.
What is OctoPrint and why should you use it?
OctoPrint is a service that is ran from a Raspberry Pi, Desktop, Laptop, etc. It allows you to remotely control your 3D printer, send Gcode, and monitor your 3D printer from a local URL or app on your phone. There are all sorts of plugins that can be added to OctoPrint such as the ability to make timelapse videos, cancel individual objects from a print job instead of stopping the entire print, monitor and detect through AI when a print is failing, adjust your bed to make it more leveled through the nyloc mod, and much more.
What is OctoPi?
OctoPi is essentially a Raspberry Pi OS image but with everything you’d need to run OctoPrint built-in. The vanilla Raspberry Pi OS image does not have certain dependents and services that are required for OctoPrint to run. Instead of scouring the entire internet looking for these dependents and services a group of people were nice enough to package it in a nice little image that simply needs to be flashed to your MicroSD as you would any Raspberry Pi OS image and be up and running OctoPrint in a few minutes.
What’s needed?
Since this is a guide on how to get OctoPrint setup on a Raspberry Pi, you’ll need one. I cannot recommend a Raspberry Pi 0W for this project as it lacks power, yes you can run OctoPrint on it but once you add a webcam and a few other things there is a significant decrease in performance. So I recommend either a Raspberry Pi 3B+ or a Raspberry Pi 4B.
Software needed?
BalenaEtcher - This is the software which you need in order to flash images on your Raspberry Pi
Latest OctoPi - This is the latest version of OctoPi which includes everything you’ll need to run OctoPrint
Setting up OctoPi
Install and open up BalenaEtcher > Select the OctoPi image that was just downloaded > Make sure the correct MicroSD card is targeted > Press the “Flash!” button
Setting up WiFi on OctoPi
To get WiFi working on the OctoPi, on the root of the flashed MicroSD card there should be a file called octopi-wpa-supplicant.txt, open this with notepad and fill in your network name in the “ssid” portion and your network password in the “psk”. If you require more help or something isn’t working right you can refer to this page: OctoPi WiFi Troubleshooting, once those fields are filled out, save and close the text file, eject it from your computer and insert it into the Raspberry Pi
Powering and Booting OctoPi
Once the MicroSD card has been inserted, supply the Pi with power. The boot process may take a couple of minutes. You can always open up Command Prompt and run: Ping octopi.local -4 -t to see if the Raspberry Pi is up and responding.
SSH and Configurations
At this point you’re pretty much done, but I’d like to do a few housekeeping items. Something I always do after setting up any Pi is making sure I change the default password. What you want to do is use PuTTY or any other kind of SSH client and connect to the Rasberry Pi via the IP address, if you need more in-depth instructions please refer to my other guide. Once you are connected the default username and password are: pi/raspberry once you are logged in you can either run the passwd command and simply change your password to something different.
OctoPrint Access
You are now able to simply open an internet browser and type the IP address or host name Octopi.local into the URL bar. The first time you access this page you will be greeted with a “Configure Access Control” popup, you will want to set a username and password here, this is important as you do not want just anyone to be able to access OctoPrint. This is also important if you open up OctoPrint to the internet and allow external access. Once done, click on the Keep Access Control Enabled button. Reload the page and log in with the newly set username and password you just set. You will most likely be greeted with a notification stating Update Available, go ahead and Update now as this will bring you to the latest version of OctoPrint. This will also cause the Pi itself to restart after the update is completed.
Connect 3D Printer to Pi
You’ll need a USB-B cable if you’re using a Prusa 3D printer, I believe most boards utilize the same type of port but can’t say for sure. Once you have plugged the USB cable into the 3D printer’s board, plug the other end into one of the Raspberry Pi’s USB ports. Open up Octoprint and on the right side there should be a “Connect” button. Check if OctoPrint sees your printer under Serial Port (You can just set it to AUTO and see if it recognizes your printer, and set the Baudrate to AUTO as well, then just click the “Connect” button.
Conclusion
After doing the update and restarting your Raspberry Pi, you’re done. You are now able to add GCODE through OctoPrint and no longer need to take your SD card out of your printer. You can also control your printer from OctoPrint. Being able to stop and pause prints when you see issues is pretty useful. I’ll write up a guide on my favorite OctoPrint plugins in the near future.
For more help you can always take a look at the OctoPrint Community: OctoPrint Community, there are lots of FAQs, Guides, and everything you’d need to get OctoPrint working the way you want.