OctoPrint is an open-source web interface for controlling and monitoring 3D printers. It enhances the functionality of a standard 3D printer by providing remote access, real-time monitoring, and extensive plugin support.
Key Features of OctoPrint
- Remote Access:
- Control and monitor your 3D printer from a web browser.
- Start, pause, stop prints, and manage print jobs remotely.
- File Management:
- Upload, organize, and manage print files (e.g., G-code).
- Slice files directly using integrated slicer plugins.
- Live Monitoring:
- Stream real-time video of the print process with a connected webcam.
- Monitor temperature, print progress, and other parameters.
- Timelapse Creation:
- Automatically generate timelapse videos of completed prints.
- Plugin System:
- Extend functionality using community-developed plugins for tasks like advanced monitoring, custom UIs, and integration with third-party services.
- Open Source:
- Highly customizable and supports a wide range of printers.
Setup
To use OctoPrint, you typically install it on a small computer like a Raspberry Pi, often using the OctoPi imageāa preconfigured OctoPrint installation for Raspberry Pi.
Hardware Requirements:
- Raspberry Pi (e.g., 3B+, 4)
- MicroSD card (16 GB or more)
- Power supply for the Raspberry Pi
- USB connection to your 3D printer
- Optional: Webcam for live monitoring
Installation
- Download OctoPi:
- Flash SD Card:
- Use tools like Raspberry Pi Imager or balenaEtcher.
- Configure Wi-Fi:
- Edit the
octopi-wpa-supplicant.txt
file on the SD card to set your Wi-Fi credentials.
- Edit the
- Connect and Power Up:
- Insert the SD card into the Raspberry Pi and connect it to your 3D printer.
- Access OctoPrint:
- Open a web browser and navigate to the OctoPrint interface using the Raspberry Pi’s IP address.
Sample Workflow
- Upload G-code:
- Drag and drop your G-code file into the OctoPrint interface.
- Start the Print:
- Use the web interface to start the print job.
- Monitor progress and adjust parameters (e.g., speed, temperature) as needed.
- Monitor via Webcam:
- Watch the print in real-time and pause or cancel if any issues arise.
- Download Timelapse:
- Retrieve the generated timelapse video of your print.
Popular Plugins
- OctoLapse:
- Creates smooth, high-quality timelapse videos.
- Bed Visualizer:
- Displays a 3D heatmap of your printer’s bed leveling.
- OctoEverywhere:
- Enables secure remote access from anywhere.
- Telegram/Discord Notifications:
- Sends print status updates via messaging platforms.
Sample Python Script for Controlling OctoPrint
If you want to interact programmatically with OctoPrint’s REST API, here’s a Python example:
pythonCopy codeimport requests
# OctoPrint API URL and API Key
OCTOPRINT_URL = "http://your-octoprint.local/api"
API_KEY = "your-api-key"
# Headers with API Key
headers = {"X-Api-Key": API_KEY}
# Start a print job
def start_print(file_name):
url = f"{OCTOPRINT_URL}/files/local/{file_name}"
response = requests.post(f"{url}/select", headers=headers)
if response.ok:
print(f"File {file_name} selected successfully.")
response = requests.post(f"{OCTOPRINT_URL}/job", headers=headers, json={"command": "start"})
if response.ok:
print("Print started.")
else:
print("Failed to start print:", response.text)
else:
print("Failed to select file:", response.text)
# Example usage
start_print("example.gcode")
https://octoprint.org/