One of most interesting uses of Raspberry PI is controlling a 3D printer (mine one is an Anet A6) without needing to be connected with your PC.
This can help for long prints and improve controls available on printer status.
It is also really useful in tuning operations, because it allows to easily control manually your printer motors, so getting fastly correct positioning to improve bed and extruder accessibility and levelling.
OctoPi is a fork from Octoprint, built to run on Raspberry Pi.
OctoPrint is an Open Source project which enables an improved web interface to control 3D printer and printing jobs. It allows to:
Everyone knows my love for Docker. But in this case the official Docker image available on Docker Hub is not built on ARM processor, se there is the need to use an unofficial image.
From the various images that I tried, the one from urrizzz user (https://hub.docker.com/r/urrizzz/octopi/) was correctly working on my Raspberry Pi.
Some considerations on Hardware. OctoPrint notifies that the Raspberry Pi Zero W is not recommended since severe performance issues were observed, caused by the WiFi interface when bandwidth is utilized (look here for GitHub issue). So I decided to test it on my Raspberry Pi 3 Model A+, which has also a Raspberry PI camera connected that will be used for video streaming.
As usual, I suggest adding from now to your favourite e-commerce shopping cart all the needed hardware, so that at the end you will be able to evaluate overall costs and decide if to continue with the project or remove them from the shopping cart. So, hardware will be only:
Check hardware prices with following links:
We start from a Raspbery PI with a light operating system installing Raspberry PI OS Lite. We’ll also need Docker installed (please follow Raspberry PI Docker installation procedure).
The following step is installing MotionEye into a container (also this can be done with the Raspberry PI Motioneye installation in Docker procedure, being careful to map also 8081 port for video streaming).
Before staring, we need to identify the port related to USB. Once your printer is powered on and connected with your Raspberry Pi, type:
ls /dev | grep tty
The port should sound something like /dev/ttyUSB0. Now the power of Docker comes to us and allows OctoPi installation with a single command line:
docker run -d --device /dev/ttyUSB0:/dev/ttyUSB0 -p 4000:5000 --name octopi urrizzz/octopi
Fantastic, isn’t it? Note that we had to change the host port (4000) in order to avoid port conflict with MotionEye
At the end of image download, extraction and run you will be able to connect your OctoPi setup wizard page by browsing the address http://<<YOUR_RPI_IP_ADDRESS>>:4000.
You can configure or simply press next (except for user and password creation) to reach the home page (all the settings can be edited later):
Click connetct to contact your printer.
To connect also your webcam to OctoPi:
My configuration appears as in the following picture:
Press “Save” and you should find your video streaming in Control Section:
Enjoy!
In this tutorial, we will use two Arduino Uno to demonstrate the Serial Peripheral Interface…
In this tutorial, we will be making an automatic irrigation system (AIS) with Arduino and…
This tutorial will show you how to use Python Virtual Environment with Raspberry PI computer…
This tutorial will show you how to get betting odds with Raspberry PI by using…
This tutorial will show you how to perform the backup of Raspberry PI (computer board)…
This tutorial will show you how to install Honeygain on a Raspberry PI computer board…
View Comments
G'Day,
Great write up! Very easy to follow.
I am having one problem when it comes to the Octoprint container starting when the printer is off. Obviously it cant find /dev/ttyUSB0, and this causes the container not to start. The problem is, i want to use Octoprint and a relay switched using the GPIOs to turn the printer on with a plug-in for Octoprint. Is there a work around for this? Is there a way to tell the container to start even though the device is not present?
Thanks