Convert Figma logo to code with AI

guysoft logoOctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web

2,534
371
2,534
120

Top Related Projects

OctoPrint is the snappy web interface for your 3D printer!

16,596

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

Firmware for Original Prusa i3 3D printer by PrusaResearch

10,029

Klipper is a 3d-printer firmware

Quick Overview

OctoPi is a Raspberry Pi distribution that includes OctoPrint, a web interface for controlling 3D printers. It allows users to remotely monitor and control their 3D printers through a web browser, providing features like file management, temperature control, and live video streaming.

Pros

  • Easy setup: Pre-configured image for Raspberry Pi, simplifying installation
  • Remote control: Manage and monitor 3D prints from anywhere via web interface
  • Extensible: Supports plugins to add new features and functionality
  • Active community: Regular updates and extensive user support

Cons

  • Limited to Raspberry Pi hardware: Not compatible with other single-board computers
  • Requires additional hardware: Needs a Raspberry Pi and camera module for full functionality
  • Learning curve: May be challenging for users new to Linux or Raspberry Pi
  • Performance limitations: Resource-intensive features may strain older Raspberry Pi models

Getting Started

  1. Download the latest OctoPi image from the official GitHub repository.
  2. Flash the image to a microSD card using a tool like Etcher or Raspberry Pi Imager.
  3. Insert the microSD card into your Raspberry Pi and connect it to your network.
  4. Power on the Raspberry Pi and wait for it to boot.
  5. Access OctoPrint by entering http://octopi.local in your web browser.
  6. Follow the on-screen instructions to complete the initial setup and connect your 3D printer.

Competitor Comparisons

OctoPrint is the snappy web interface for your 3D printer!

Pros of OctoPrint

  • Core software focus, allowing for more frequent updates and feature additions
  • Larger community of contributors and plugin developers
  • More flexible installation options (not limited to Raspberry Pi)

Cons of OctoPrint

  • Requires manual setup and configuration of the operating system
  • Less beginner-friendly for users new to 3D printing or Raspberry Pi

Code Comparison

OctoPrint (Python):

@octoprint.plugin.BlueprintPlugin.route("/status", methods=["GET"])
def get_status(self):
    return flask.jsonify(dict(
        operational=self._printer.is_operational(),
        printing=self._printer.is_printing(),
        paused=self._printer.is_paused(),
        ready=self._printer.is_ready()
    ))

OctoPi (Bash script):

#!/bin/bash
# This is a simplified example, as OctoPi mainly consists of configuration files
sudo apt-get update
sudo apt-get install -y octopi
sudo systemctl enable octopi.service
sudo systemctl start octopi.service

Note: OctoPi is primarily a pre-configured Raspberry Pi image that includes OctoPrint, so the code comparison is limited. OctoPi focuses on system configuration and setup scripts rather than core functionality.

16,596

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.

Pros of Marlin

  • Direct firmware for 3D printers, offering low-level control and optimization
  • Extensive customization options for specific printer hardware
  • Large community support and regular updates

Cons of Marlin

  • Requires more technical knowledge to set up and configure
  • Limited remote management capabilities out of the box
  • Lacks built-in web interface for printer control

Code Comparison

Marlin (configuration.h):

#define BAUDRATE 250000
#define MOTHERBOARD BOARD_RAMPS_14_EFB
#define X_DRIVER_TYPE  A4988
#define Y_DRIVER_TYPE  A4988
#define Z_DRIVER_TYPE  A4988

OctoPi (config.yaml):

server:
  host: 0.0.0.0
  port: 5000
webcam:
  stream: /webcam/?action=stream
  snapshot: http://127.0.0.1:8080/?action=snapshot

Summary

Marlin is a firmware solution for 3D printers, offering direct hardware control and extensive customization. It's ideal for users who need fine-tuned control over their printer's operations. OctoPi, on the other hand, is a Raspberry Pi image that includes OctoPrint, providing a web interface for remote printer management and monitoring. While Marlin focuses on low-level printer control, OctoPi emphasizes ease of use and remote accessibility. The choice between them depends on the user's technical expertise and specific needs for printer management.

Firmware for Original Prusa i3 3D printer by PrusaResearch

Pros of Prusa-Firmware

  • Specifically optimized for Prusa 3D printers, offering tailored features and performance
  • Regular updates and active development from the Prusa team
  • Includes advanced features like mesh bed leveling and filament sensor support

Cons of Prusa-Firmware

  • Limited to Prusa printers, lacking the versatility of OctoPi
  • Requires more technical knowledge to modify or customize
  • Doesn't offer the same level of remote management capabilities as OctoPi

Code Comparison

Prusa-Firmware (Configuration.h):

#define CUSTOM_MENDEL_NAME "Prusa i3 MK3S"
#define DEFAULT_AXIS_STEPS_PER_UNIT   {100,100,3200/8,280}
#define DEFAULT_MAX_FEEDRATE          {200, 200, 12, 120}

OctoPi (config.yaml):

server:
  host: 0.0.0.0
  port: 5000
webcam:
  stream: /webcam/?action=stream
  snapshot: http://127.0.0.1:8080/?action=snapshot

The code snippets highlight the different focus areas of each project. Prusa-Firmware deals with printer-specific configurations, while OctoPi focuses on server and webcam settings for remote management.

10,029

Klipper is a 3d-printer firmware

Pros of Klipper

  • Higher print speeds and improved print quality due to advanced motion planning
  • More precise control over printer hardware, utilizing the host computer's processing power
  • Supports a wider range of 3D printer hardware configurations

Cons of Klipper

  • Steeper learning curve and more complex setup process
  • Requires additional hardware (e.g., Raspberry Pi) to run alongside the printer's mainboard
  • May not be compatible with all existing OctoPrint plugins

Code Comparison

Klipper configuration (printer.cfg):

[stepper_x]
step_pin: PC2
dir_pin: PB9
enable_pin: !PC3
microsteps: 16
rotation_distance: 40
endstop_pin: ^PA5
position_endstop: 0
position_max: 200

OctoPi configuration (config.yaml):

serial:
  port: /dev/ttyACM0
  baudrate: 250000
temperature:
  profiles:
    - name: ABS
      extruder: 230
      bed: 100

While OctoPi provides a user-friendly interface and easy setup for OctoPrint, Klipper offers more advanced control and optimization of printer hardware. OctoPi is better suited for beginners, while Klipper caters to users seeking enhanced performance and customization.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

OctoPi

.. image:: https://raw.githubusercontent.com/guysoft/OctoPi/devel/media/OctoPi.png .. :scale: 50 % .. :alt: OctoPi logo

A Raspberry Pi <http://www.raspberrypi.org/>_ distribution for 3d printers. It includes the OctoPrint <https://octoprint.org>_ host software for 3d printers out of the box and mjpg-streamer with RaspiCam support <https://github.com/jacksonliam/mjpg-streamer>_ for live viewing of prints and timelapse video creation.

This repository contains the source script to generate the distribution out of an existing Raspberry Pi OS <https://www.raspberrypi.com/software/>_ distro image or Le Potato AML-S905X-CC <https://hub.libre.computer/t/debian-12-bookworm-and-11-bullseye-for-libre-computer-boards/230>_ (currenly in beta).

Where to get it?

Download the latest stable build via this button:

.. image:: https://i.imgur.com/NvUOGfS.png :target: https://octopi.octoprint.org/latest

Official mirror is here <https://github.com/guysoft/OctoPi/releases>_

Second mirror is here <https://octopi.gnethomelinux.com/Distros/OctoPi/>_

Nightly builds are available here <https://unofficialpi.org/Distros/OctoPi/nightly/>_

64bit Nightly builds are available here <https://unofficialpi.org/Distros/OctoPi/nightly-arm64/>_

You can also access the nightly builds raspberrypi imager channel by running::

rpi-imager --repo https://unofficialpi.org/rpi-imager/rpi-imager-octopi.json

or for second mirror::

rpi-imager --repo https://octopi.gnethomelinux.com/rpi-imager/rpi-imager-octopi.json

How to use it?

#. Unzip the image and install it to an sd card like any other Raspberry Pi image <https://www.raspberrypi.org/documentation/installation/installing-images/README.md>_ #. Configure your WiFi by editing octopi-wpa-supplicant.txt on the root of the flashed card when using it like a thumb drive #. Boot the Pi from the card #. Log into your Pi via SSH (it is located at octopi.local if your computer supports bonjour <https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux/overview>_ or the IP address assigned by your router), default username is "pi", default password is "raspberry". Run sudo raspi-config. Once that is open:

a. Change the password via "Change User Password" b. Optionally: Change the configured timezone via "Localization Options" > "Timezone". c. Optionally: Change the hostname via "Network Options" > "Hostname". Your OctoPi instance will then no longer be reachable under octopi.local but rather the hostname you chose postfixed with .local, so keep that in mind.

You can navigate in the menus using the arrow keys and Enter. To switch to selecting the buttons at the bottom use Tab.

You do not need to expand the filesystem, current versions of OctoPi do this automatically.

OctoPrint is located at http://octopi.local <http://octopi.local>_ and also at https://octopi.local <https://octopi.local>_. Since the SSL certificate is self signed (and generated upon first boot), you will get a certificate warning at the latter location, please ignore it.

To install plugins from the commandline instead of OctoPrint's built-in plugin manager, :code:pip may be found at :code:/home/pi/oprint/bin/pip. Thus, an example install cmd may be: :code:/home/pi/oprint/bin/pip install <plugin-uri>

If a USB webcam or the Raspberry Pi camera is detected, MJPG-streamer will be started automatically as webcam server. OctoPrint on OctoPi ships with correctly configured stream and snapshot URLs pointing at it. If necessary, you can reach it under http://octopi.local/webcam/?action=stream <http://octopi.local/webcam/?action=stream>_ and SSL respectively, or directly on its configured port 8080: http://octopi.local:8080/?action=stream <octopi.local:8080/?action=stream>_.

Features

  • OctoPrint <https://octoprint.org>_ host software for 3d printers out of the box
  • Raspberry Pi OS <https://www.raspberrypi.com/software/>_ tweaked for maximum performance for printing out of the box
  • mjpg-streamer with RaspiCam support <https://github.com/jacksonliam/mjpg-streamer>_ for live viewing of prints and timelapse video creation.

Developing

Requirements


#. `qemu-arm-static <https://packages.debian.org/sid/qemu-user-static>`_
#. `CustomPiOS <https://github.com/guysoft/CustomPiOS>`_
#. Downloaded `Raspberry Pi OS <https://www.raspberrypi.com/software/>`_ image.
#. root privileges for chroot
#. Bash
#. git
#. sudo (the script itself calls it, running as root without sudo won't work)
#. jq (part of CustomPiOS dependencies)

Build OctoPi From within OctoPi / Raspberry Pi OS / Debian / Ubuntu

OctoPi can be built from Debian, Ubuntu, Raspberry Pi OS, or even OctoPi. Build requires about 2.5 GB of free space available. You can build it by issuing the following commands::

sudo apt-get install gawk util-linux qemu-user-static git p7zip-full python3 jq

git clone https://github.com/guysoft/CustomPiOS.git
git clone https://github.com/guysoft/OctoPi.git
cd OctoPi/src/image
wget -c --trust-server-names 'https://downloads.raspberrypi.org/raspios_lite_armhf_latest'
cd ..
../../CustomPiOS/src/update-custompios-paths
sudo modprobe loop
sudo bash -x ./build_dist

Building OctoPi Variants


OctoPi supports building variants, which are builds with changes from the main release build. An example and other variants are available in `CustomPiOS, folder src/variants/example <https://github.com/guysoft/CustomPiOS/tree/CustomPiOS/src/variants/example>`_.

docker exec -it mydistro_builder::

    sudo docker exec -it mydistro_builder build [Variant]

Or to build a variant inside a container::

    sudo bash -x ./build_dist [Variant]
    
Building Using Docker
~~~~~~~~~~~~~~~~~~~~~~
`See Building with docker entry in wiki <https://github.com/guysoft/CustomPiOS/wiki/Building-with-Docker>`_
    
Building Using Vagrant
~~~~~~~~~~~~~~~~~~~~~~
There is a vagrant machine configuration to let build OctoPi in case your build environment behaves differently. Unless you do extra configuration, vagrant must run as root to have nfs folder sync working.

Make sure you have a version of vagrant later than 1.9!

If you are using older versions of Ubuntu/Debian and not using apt-get `from the download page <https://www.vagrantup.com/downloads.html>`_.

To use it::
    
    sudo apt-get install vagrant nfs-kernel-server virtualbox
    sudo vagrant plugin install vagrant-nfs_guest
    sudo modprobe nfs
    cd ../OctoPi
    git clone https://github.com/guysoft/CustomPiOS.git    
    cd OctoPi/src
    ../../CustomPiOS/src/update-custompios-paths
    cd OctoPi/src/vagrant
    sudo vagrant up
    run_vagrant_build.sh

After provisioning the machine, its also possible to run a nightly build which updates from devel using::

    cd OctoPi/src/vagrant
    run_vagrant_build.sh
    
To build a variant on the machine simply run::

    cd src/vagrant
    run_vagrant_build.sh [Variant]
    

Usage
~~~~~

#. If needed, override existing config settings by creating a new file ``src/config.local``. You can override all settings found in ``src/modules/octopi/config``. If you need to override the path to the Raspberry Pi OS image to use for building OctoPi, override the path to be used in ``ZIP_IMG``. By default the most recent file matching ``*-raspios*.xz`` found in ``src/image`` will be used.
#. Run ``src/build_dist`` as root.
#. The final image will be created at the ``src/workspace``

Code contribution would be appreciated!