How to control your 3D printer using OctoPrint and Raspberry Pi

All tutorials

Control and manage your 3D printer and more using OctoPrint and Raspberry Pi. Here’s everything you need to know to get started!

What you’ll need:

For the initial SD card setup, you’ll also need:

Another computer connected to your network. We’ll refer to this as “your usual computer”, to distinguish it from the Raspberry Pi computer that you are setting up for retro gaming.

Choosing the right Raspberry Pi and accessories

While older Raspberry Pi devices are supported by OctoPrint, we’ll be using a 2GB Raspberry Pi 4 for our tutorial, because this will give you a faster, smoother experience. With this model you will need a USB-C power supply. If you plan to use an older model, you’ll need a micro USB power supply instead.

Installing OctoPi

We’re going to use an application called Raspberry Pi Imager to write Raspberry Pi OS to our microSD card. Raspberry Pi Imager is available for free for Windows, macOS, Ubuntu for x86, and Raspberry Pi OS. You can download it to your usual computer here.

Open Raspberry Pi Imager and connect your microSD card to your usual computer using a microSD card adapter. Now we can go ahead and install OctoPi to the SD card. In Raspberry Pi Imager:

CHOOSE OS: Select Other specific purpose OS, followed by 3D printing.

Next, select OctoPi, then OctoPi (stable).

Open the advanced menu: select the cogwheel icon in the bottom right corner.

Enable SSH: check the Enable SSH box and set a username and strong memorable password.

Configure wifi: enter the SSID of your network and its password, then select Save to close the advanced menu.

CHOOSE STORAGE: select your microSD card.

WRITE: lastly, click to write OctoPi to your microSD card.

Set up your Raspberry Pi

Once your microSD card is ready, insert it into your Raspberry Pi. Next, connect your 3D printer using your USB cable. The type of 3D printer you have will determine what type of USB cable you need. For this tutorial, we’re using an Ender 5, which requires a USB-A-to-mini-USB cable.

Lastly, connect the USB-C power supply to your Raspberry Pi.

Set up OctoPrint

Open a web browser on any computer connected to the same local network as your Raspberry Pi, and type http://octopi.local into the address bar. This will allow you to set up OctoPrint. Follow the on-screen instructions to set up OctoPrint and enter details of your 3D printer. Once complete, OctoPrint will restart and you’ll be able to get printing by following the on-screen instructions.

You can access OctoPrint at any time by visiting http://octopi.local on a computer or mobile device that is connected to the same network as your Raspberry Pi.

Optional: add a camera

Add a Raspberry Pi camera or a USB webcam to your Raspberry Pi to allow you to keep an eye on your model as it prints.

To do this, unplug your Raspberry Pi from the power supply, and connect your Raspberry Pi camera or webcam.

Reconnect the power supply and open OctoPrint by going to http://octopi.local.

Next, go into OctoPrint settings by clicking the wrench icon at the top, and select Webcam & Timelapse under FEATURES.

Here, you can click the Test button to make sure your camera is working properly and make any necessary changes, such as altering aspect ratio and rotation.

You can also enable timelapse recordings of your prints and save them to your Raspberry Pi.

You can view your camera settings under Control on the main OctoPrint dashboard.

Using OctoPrint

OctoPrint offers an easy-to-use dashboard that most users will be able to navigate quickly. More advanced users, and those interested in expanding their 3D printing experience may want to look into the vast array of third-party plugins managed by its wide community of users. You can find them in the OctoPrint Settings menu.

OctoPrint is a free-to-download open-source web interface created and maintained by Gina Häußge. If you would like to support OctoPrint, you can make a contribution via their website.

Learn more about 3D printing with HackSpace magazine

Would you like to learn more about 3D printing? HackSpace is a monthly magazine for creative people, and it provides a wealth of 3D-printing tips and tricks, along with news, reviews, interviews and tutorials for every kind of making and crafting you can think of. You can download HackSpace for free here, or buy it in print from your favourite supermarket or newsagent, as well as from the Raspberry Pi Press store.

For a taste of what to expect from HackSpace, here’s their video all about 3D printing infill patterns.

Help and support

More help and information on OctoPrint is available from their website and forums.