Klipper Architecture / Ecosystem

Klipper Architecture / Ecosystem

Calling Klipper a 3D printer firmware is not complete to its full extent. In fact it is a 3D printing application with an associated ecosystem.

The following overview shows how the different aspects interact. Only the red boxes is Klipper in its original sense, the other boxes are independent products forming the entire ecosystem.

Klipper Host

  • The core of the Klipper environment
  • Typically running on a Single Board Computer (SBC), e.g. RPi etc, but runs on basically any Linux machine
  • Manages the entire “3D-printing-logic”, like (not comprehensive):
    • Reading the gcode file
    • Creating the steps (path planning) from the gcode taking into account computational intensive features like Pressure Advance or Input Shaping
    • Compressing the generated steps and sending them to the printer-board
    • Reading and reacting upon sensor values from the printer board, e.g. temperature etc.
    • Executing macros
  • Interfaces to the rest of the ecosystem

Klipper Firmware

  • The Firmware is running on the printer board or on any supported Micro Controller Unit (MCU)
  • It connects to the Klipper Host via USB, direct serial connection (UART) or CAN-Bus
  • Manages the hardware of the printer or any connected peripherals like sensors etc
  • One or multiple Klipper Firmwares can be managed by one Klipper Host process
  • The managed Klipper Firmware instances are reflected in the printer.cfg within the [mcu] blocks

Klipper Host MCU

  • The above mentioned SBCs, on which the Klipper Host is running, can also act as an MCU. For example one can connect an Accelerometer to the SBC for Input Shaping
  • Managing such hardware interfaces is the responsibility of the Klipper Host MCU
  • It connects to the Klipper Host over the /tmp/klipper_host_mcu pseudo-tty
  • In the printer.cfg this is typically reflected via the [mcu rpi] configuration block

Moonraker

  • Moonraker (developed by @Arksine) is a multipurpose interface and information broker process
  • Among its capabilities are
    • Providing an interface between User Interfaces (see below) and the Klipper Host
    • Interfaces to other IOT services like MQTT, Home Assistant, GPIO devices, smart sockets etc
    • Distributes update notifications across the ecosystem
    • Distributes announcements across the ecosystem
    • A lot more
  • Typically connects to the Klipper Host via the Unix Domain Socket (UDS) /tmp/klippy_uds
    • Can be changed in the moonraker.cfg configuration file
    • Changes need to be reflected in the Klipper service file as well

User Interfaces

  • One of the core features of Moonraker is the ability to interface with modern and powerful User Interfaces
  • Most common but again not comprehensive are:
  • These application connect to Moonraker via JSON RPC over Websockets

OctoPrint

  • OctoPrint is kind of the veteran among the 3D printer interfaces
  • Support in Klipper has been established long before Moonraker and others have been thought of
  • While the other User Interfaces can be considered more modern, the support and functionality is very mature and there are a lot of plugins to customize basically every aspect
  • OctoPrint connects to the Klipper Host via the pseudo-tty /tmp/printer

Diagram was created with Diagrams.net. Source attached for future convenience: Klipper Architecture.zip (1.9 KB)

8 Likes
Klipper use with Android controller
Other Single Board Computers (SBC) apart from Raspberry Pis
Motherboard fan: can I switch it off?
About the Knowledge Base category / Table of Contents
Printer.cfg backups vs moonraker.conf backups
Klipperscreen on btt pad 7
Fluidd and OctoPrint?
Sonicpad and Ender 5 s1 will not connect
Hi , Printer ocasionally crash
MCU Protocol error caused by running an older version of the firmware
Recommendations sought on best latop distro for hosting klipper
Clarifying Questions!
Help please! sigma d25
Raspberry Pi 4 Model B + Duet 3 6 HC
Help needed, DFROBOT Speaker Module v2, klipper raspberry pi
Unable to connect to MCU Octoprint
Is klipper for me and my printer?
PIN is not a valid PIN name on MCU
Basic questions concerning Klipper
KlipperScreen configuration on OctoKlipperPi: Unable to connect MCU Error
Implementing Klipper through a Raspberry Pi 4 on a Duet 6XD board
Printer main board not flashing klipper
Help setting up LIS2DW sensors
Files for Tronxy X5SA-400 Pro?
PIN Name not accepted by MCU
Hello everyone,UART received data garbled characters
Flsun speederpad & btt manta m8p v2 installation
Leapfrog Bolt pro - upgrade?
Error message 'cycle _time' 'output_pin driver_fan'
MANTA M5P Flashing and Running Custom Firmware
New voron zero 0.2R1 build using BTT Pi
Will a Klipper Printer print much faster?
Updated everything and now I can't even log in. What is this?
Moonraker status’s don’t match the Klipper UI (Mainsail)
DS18B20 Temperature Sensor Configuration
Unable to extract params from: query_thermocouple - PT100 CANBUS EBB42
Ender 3 V2 not connecting
Ender 6 w/ OctoKlipper
CR10S V2.2 board
Save backup files to a dedicated directory?
Klipper half-duplex uart
Octoklipper vs Klipper
BTT Octopus Pro PT1000 issues
Sonic pad and kobra max
Installing Klipper with KIAUH
Help With My Issue Please
Permission issue when connecting to printer - Unable to open serial port, operation not permitted
Problem with simultaneous connection of two printers
Mid print error MCU 'mcu' shutdown: Can't assign oid
Mainsail plugin for print farms
Printer.cfg for Anycubic Kobra 2 Plus/Pro/Max
Arduino uno ATmega328PB CH340G
Hello everyone,UART received data garbled characters
Issue after doing full update