Commit d23adc

2026-05-30 06:38:15 Manuel Weiser: docs: Add Moonraker plugin documentation and update table of contents
docs/de/00-inhalt.md ..
@@ 30,6 30,7 @@
| 16 | [Plugin: Spoolman API](/Docs/De/16-Plugin-Spoolmanapi) | Spoolman-kompatible API für externe Tools |
| 17 | [Plugin: Bambuddy](/Docs/De/17-Plugin-Bambuddy) | Bambuddy-Integration: Inventory-Sync und Verbrauchsmeldung |
| 18 | [FilaManDB Community-Datenbank](/Docs/De/18-Filamandb) | Filamente und Hersteller aus der Community-Datenbank importieren |
+ | 19 | [Plugin: Moonraker](/Docs/De/19-Plugin-Moonraker) | Klipper/Moonraker-Integration: Driver-Plugin und Moonraker-Komponente |
| 20 | [Installation auf dem Raspberry Pi](/Docs/De/20-Installation-Raspberry-Pi) | Schritt-für-Schritt-Anleitung für Einsteiger |
---
/dev/null .. docs/de/19-plugin-moonraker.md
@@ 0,0 1,231 @@
+ # Plugin: Moonraker
+
+ Die **Moonraker-Integration** besteht aus zwei Komponenten, die zusammen die vollständige Anbindung von Klipper/Moonraker-Druckern an FilaMan ermöglichen:
+
+ 1. **FilaMan Moonraker Driver Plugin** – wird in FilaMan installiert und stellt den Druckertreiber bereit
+ 2. **FilaMan Moonraker Component** – wird manuell in Moonraker installiert und läuft auf dem Drucker-Server (z. B. Raspberry Pi); übernimmt Extrusionsmessung und Verbrauchsmeldung
+
+ **Installation des Driver-Plugins:** → [Admin: Plugin-Verwaltung](/Docs/De/11-Admin#115-system-plugin-verwaltung)
+
+ ---
+
+ ## Übersicht
+
+ | Eigenschaft | Wert |
+ |-------------|------|
+ | **Plugin-Typ** | Driver (Druckertreiber) |
+ | **Autor** | FilaMan |
+ | **Quelle** | [Fire-Devils/filaman-plugins](https://github.com/Fire-Devils/filaman-plugins) (Registry) |
+ | **Verbindung** | HTTP über lokales Netzwerk |
+ | **Fähigkeiten** | Spulenzuweisung, Extrusionsmessung, automatische Verbrauchserfassung |
+
+ ---
+
+ ## Teil 1: FilaMan Moonraker Driver Plugin
+
+ Das Driver Plugin wird in FilaMan installiert und ermöglicht die Kommunikation mit dem Moonraker-Server. Es leitet Spulenzuweisungen aus FilaMan an den Moonraker-Endpunkt `/server/filaman/spool_id` weiter.
+
+ ### Konfiguration
+
+ Beim Hinzufügen oder Bearbeiten eines Moonraker-Druckers stehen folgende Konfigurationsfelder zur Verfügung:
+
+ | Feld | Pflicht | Beschreibung |
+ |------|---------|-------------|
+ | **Moonraker URL** | Ja | Adresse des Moonraker-Servers (z. B. `http://192.168.1.20:7125`) |
+ | **API Key** | Nein | Moonraker API-Key, sofern in Moonraker konfiguriert |
+ | **Mode** | Nein | Betriebsmodus: `toolhead_only` (Standard) oder `tray_macros` |
+ | **Request Timeout (s)** | Nein | Timeout in Sekunden für HTTP-Anfragen (Standard: 10) |
+ | **Slot Count** | Nein | Anzahl der manuellen Slots (nur bei manueller Konfiguration) |
+ | **Slot Targets** | Nein | Manuelle Slot-Konfiguration (überschreibt Auto-Discovery) |
+
+ Beispielkonfiguration (JSON):
+
+ ```json
+ {
+ "moonraker_url": "http://192.168.1.20:7125",
+ "api_key": "",
+ "mode": "toolhead_only",
+ "request_timeout_seconds": 10,
+ "slot_count": 1,
+ "slot_targets": [
+ {
+ "slot_index": "0-0",
+ "slot_name": "Toolhead 1",
+ "slot_kind": "toolhead",
+ "assign_gcode": "SET_TRAY_SPOOL TRAY=1 SPOOL={spool_id}"
+ }
+ ]
+ }
+ ```
+
+ ### Modi
+
+ | Modus | Verhalten |
+ |-------|-----------|
+ | `toolhead_only` (Standard) | Spulenzuweisung setzt nur die aktive Spule in Moonraker. Slots werden automatisch aus Moonraker ermittelt (Toolheads und verfügbare Trays). |
+ | `tray_macros` | Spulenzuweisung setzt die aktive Spule in Moonraker **und** führt zusätzlich das `assign_gcode` des passenden Slots aus. |
+
+ ### Slot-Discovery (Auto-Erkennung)
+
+ Das Plugin erkennt die vorhandenen Slots automatisch aus den Moonraker-Druckerobjekten:
+
+ - **Toolhead-Slots** werden aus den Druckerobjekten ermittelt (`extruder`, `extruder1`, ...)
+ - **Tray-Slots** (AFC/MMU) werden nur angezeigt, wenn Moonraker entsprechende AFC- oder MMU-Objekte meldet
+ - Wenn keine Tray-Objekte vorhanden sind, werden ausschließlich Toolhead-Slots angezeigt
+ - Die manuelle Angabe von `slot_targets` in der Konfiguration überschreibt die Auto-Discovery
+
+ ### Platzhalter für `assign_gcode`
+
+ Im Modus `tray_macros` unterstützt das Feld `assign_gcode` folgende Platzhalter:
+
+ | Platzhalter | Beschreibung |
+ |-------------|-------------|
+ | `{spool_id}` | FilaMan Spulen-ID |
+ | `{slot_index}` | Index des Slots (z. B. `0-0`) |
+ | `{ams_id}` | AMS/Tray-Einheit |
+ | `{tray_id}` | Tray-Slot-Nummer |
+ | `{material_type}` | Materialtyp (z. B. `PLA`) |
+ | `{color}` | Farbe der Spule (Hex) |
+
+ ---
+
+ ## Teil 2: FilaMan Moonraker Component (manuelle Installation)
+
+ Die Moonraker-Komponente ist eine native Moonraker-Erweiterung, die auf demselben Server wie Moonraker läuft (meist ein Raspberry Pi). Sie übernimmt:
+
+ - **Verbrauchsmessung** – Extrusionslänge aus Klipper-Toolhead-Updates messen
+ - **Gewichtsberechnung** – Länge (mm) in Gewicht (g) umrechnen anhand der Filament-Metadaten
+ - **Verbrauchsmeldung** – Verbrauch automatisch an FilaMan melden (`/api/v1/spools/{id}/consumptions`)
+ - **Spool-Tracking** – Aktive Spule per Moonraker-Endpunkt und Remote-Method verwalten
+
+ > **Hinweis:** Die Moonraker-Komponente ist **optional**, aber empfohlen. Ohne sie kann FilaMan keine automatische Verbrauchserfassung für Klipper-Drucker durchführen.
+
+ ### Voraussetzungen
+
+ - Moonraker und Klipper sind installiert und lauffähig
+ - FilaMan ist im lokalen Netzwerk erreichbar
+ - SSH-Zugriff auf den Drucker-Server (z. B. Raspberry Pi)
+
+ ### Installation
+
+ **Schritt 1: Komponentendatei herunterladen**
+
+ Verbinden Sie sich per SSH mit dem Drucker-Server und laden Sie die Datei `filaman.py` in das Moonraker-Komponentenverzeichnis herunter:
+
+ ```bash
+ cd ~/moonraker/moonraker/components
+ wget https://github.com/Fire-Devils/FilaMan-Moonraker-Komponente/raw/main/filaman.py
+ ```
+
+ Alternativ können Sie die Datei manuell herunterladen und per SFTP/SCP übertragen.
+
+ **Schritt 2: Moonraker-Konfiguration anpassen**
+
+ Öffnen Sie die Datei `moonraker.conf` (in der Regel unter `~/printer_data/config/moonraker.conf` oder `~/klipper_config/moonraker.conf`) und fügen Sie den folgenden Abschnitt hinzu:
+
+ ```ini
+ [filaman]
+ server: http://192.168.1.50:8000
+ api_key: uak.123.xxxxxxxxxxxxxxxxxxxxx
+ sync_rate: 5
+ default_density_g_cm3: 1.24
+ default_diameter_mm: 1.75
+ ```
+
+ Ersetzen Sie `http://192.168.1.50:8000` durch die tatsächliche URL Ihrer FilaMan-Instanz.
+
+ **Schritt 3: Moonraker neu starten**
+
+ ```bash
+ sudo systemctl restart moonraker
+ ```
+
+ Überprüfen Sie anschließend die Moonraker-Logs auf Fehler:
+
+ ```bash
+ journalctl -u moonraker -n 50
+ ```
+
+ ### Konfigurationsoptionen
+
+ | Option | Pflicht | Standardwert | Beschreibung |
+ |--------|---------|--------------|-------------|
+ | `server` | Ja | – | Basis-URL der FilaMan-Instanz |
+ | `api_key` | Empfohlen | – | FilaMan API-Key (`uak.<id>.<geheimnis>`) |
+ | `sync_rate` | Nein | `5` | Meldeintervall in Sekunden |
+ | `default_density_g_cm3` | Nein | `1.24` | Fallback-Dichte für Gewichtsberechnung (g/cm³) |
+ | `default_diameter_mm` | Nein | `1.75` | Fallback-Filamentdurchmesser in mm |
+
+ ### HTTP-Endpunkte
+
+ Nach der Installation stellt die Komponente folgende Endpunkte bereit:
+
+ | Methode | Endpunkt | Beschreibung |
+ |---------|----------|-------------|
+ | `GET` / `POST` | `/server/filaman/spool_id` | Aktive Spule abrufen oder setzen |
+ | `GET` | `/server/filaman/status` | Verbindungs- und Synchronisierungsstatus |
+ | `POST` | `/server/filaman/proxy` | Proxy-Anfragen an FilaMan weiterleiten |
+
+ Zusätzlich sind Spoolman-kompatible Aliase immer aktiv:
+
+ | Methode | Endpunkt |
+ |---------|----------|
+ | `GET` / `POST` | `/server/spoolman/spool_id` |
+ | `GET` | `/server/spoolman/status` |
+ | `POST` | `/server/spoolman/proxy` |
+
+ ### Remote-Methoden (GCode-Makros)
+
+ Die Komponente registriert folgende Remote-Methoden, die in Klipper-Makros aufgerufen werden können:
+
+ - `filaman_set_active_spool`
+ - `spoolman_set_active_spool` (Spoolman-kompatibler Alias)
+
+ ### GCode-Makros einrichten
+
+ Fügen Sie diese Makros in Ihre `printer.cfg` oder eine eingebundene Konfigurationsdatei ein, um die aktive Spule über GCode steuern zu können:
+
+ ```ini
+ [gcode_macro SET_ACTIVE_SPOOL]
+ gcode:
+ {% if params.ID %}
+ {% set id = params.ID|int %}
+ {action_call_remote_method("filaman_set_active_spool", spool_id=id)}
+ {% else %}
+ {action_respond_info("Parameter 'ID' is required")}
+ {% endif %}
+
+ [gcode_macro CLEAR_ACTIVE_SPOOL]
+ gcode:
+ {action_call_remote_method("filaman_set_active_spool", spool_id=None)}
+ ```
+
+ Anschließend können Sie in Ihrem Druckstart-Makro oder manuell über die Konsole die aktive Spule setzen:
+
+ ```
+ SET_ACTIVE_SPOOL ID=42
+ CLEAR_ACTIVE_SPOOL
+ ```
+
+ ---
+
+ ## Zusammenspiel beider Komponenten
+
+ ```
+ FilaMan Moonraker-Server (Pi)
+ ───────── ─────────────────────
+ Driver Plugin ←──► Moonraker Component
+ │ │
+ │ POST spool_id │ Extrusionsdaten
+ │ (Zuweisung) │ (Verbrauchsmeldung)
+ └──────────────────► └──────────────────► FilaMan API
+ ```
+
+ - Das **Driver Plugin** sendet Spulenzuweisungen aus FilaMan an Moonraker
+ - Die **Moonraker-Komponente** misst den Extrusionsfortschritt und meldet den Verbrauch direkt an FilaMan zurück
+
+ > **Tipp:** Beide Komponenten arbeiten unabhängig voneinander. Sie können das Driver Plugin ohne die Moonraker-Komponente nutzen (nur Zuweisung, keine Verbrauchsmessung) oder umgekehrt.
+
+ ---
+
+ ← [Zurück: FilaManDB Community-Datenbank](/Docs/De/18-Filamandb) | [Weiter: Installation auf dem Raspberry Pi →](/Docs/De/20-Installation-Raspberry-Pi)
docs/en/00-contents.md ..
@@ 30,6 30,7 @@
| 16 | [Plugin: Spoolman API](/Docs/En/16-Plugin-Spoolmanapi) | Spoolman-compatible API for external tools |
| 17 | [Plugin: Bambuddy](/Docs/En/17-Plugin-Bambuddy) | Bambuddy integration: inventory sync and consumption reporting |
| 18 | [FilaManDB Community Database](/Docs/En/18-Filamandb) | Import filaments and manufacturers from the community database |
+ | 19 | [Plugin: Moonraker](/Docs/En/19-Plugin-Moonraker) | Klipper/Moonraker integration: driver plugin and Moonraker component |
| 20 | [Installation on Raspberry Pi](/Docs/En/20-Installation-Raspberry-Pi) | Step-by-step guide for beginners |
---
/dev/null .. docs/en/19-plugin-moonraker.md
@@ 0,0 1,231 @@
+ # Plugin: Moonraker
+
+ The **Moonraker integration** consists of two components that together enable full Klipper/Moonraker printer connectivity with FilaMan:
+
+ 1. **FilaMan Moonraker Driver Plugin** – installed in FilaMan, provides the printer driver
+ 2. **FilaMan Moonraker Component** – manually installed in Moonraker, runs on the printer server (e.g. Raspberry Pi); handles extrusion tracking and consumption reporting
+
+ **Installing the Driver Plugin:** → [Admin: Plugin Management](/Docs/En/11-Admin#115-system-plugin-management)
+
+ ---
+
+ ## Overview
+
+ | Property | Value |
+ |----------|-------|
+ | **Plugin Type** | Driver (Printer Driver) |
+ | **Author** | FilaMan |
+ | **Source** | [Fire-Devils/filaman-plugins](https://github.com/Fire-Devils/filaman-plugins) (Registry) |
+ | **Connection** | HTTP over local network |
+ | **Capabilities** | Spool assignment, extrusion tracking, automatic consumption reporting |
+
+ ---
+
+ ## Part 1: FilaMan Moonraker Driver Plugin
+
+ The driver plugin is installed in FilaMan and enables communication with the Moonraker server. It forwards spool assignments from FilaMan to the Moonraker endpoint `/server/filaman/spool_id`.
+
+ ### Configuration
+
+ When adding or editing a Moonraker printer, the following configuration fields are available:
+
+ | Field | Required | Description |
+ |-------|----------|-------------|
+ | **Moonraker URL** | Yes | Address of the Moonraker server (e.g. `http://192.168.1.20:7125`) |
+ | **API Key** | No | Moonraker API key, if configured in Moonraker |
+ | **Mode** | No | Operating mode: `toolhead_only` (default) or `tray_macros` |
+ | **Request Timeout (s)** | No | Timeout in seconds for HTTP requests (default: 10) |
+ | **Slot Count** | No | Number of manual slots (only for manual configuration) |
+ | **Slot Targets** | No | Manual slot configuration (overrides auto-discovery) |
+
+ Example configuration (JSON):
+
+ ```json
+ {
+ "moonraker_url": "http://192.168.1.20:7125",
+ "api_key": "",
+ "mode": "toolhead_only",
+ "request_timeout_seconds": 10,
+ "slot_count": 1,
+ "slot_targets": [
+ {
+ "slot_index": "0-0",
+ "slot_name": "Toolhead 1",
+ "slot_kind": "toolhead",
+ "assign_gcode": "SET_TRAY_SPOOL TRAY=1 SPOOL={spool_id}"
+ }
+ ]
+ }
+ ```
+
+ ### Modes
+
+ | Mode | Behavior |
+ |------|----------|
+ | `toolhead_only` (default) | Spool assignment only sets the active spool in Moonraker. Slots are automatically discovered from Moonraker (toolheads and available trays). |
+ | `tray_macros` | Spool assignment sets the active spool in Moonraker **and** additionally executes the `assign_gcode` of the matching slot. |
+
+ ### Slot Discovery (Auto-Detection)
+
+ The plugin automatically detects available slots from the Moonraker printer objects:
+
+ - **Toolhead slots** are discovered from printer objects (`extruder`, `extruder1`, ...)
+ - **Tray slots** (AFC/MMU) are only shown when Moonraker reports corresponding AFC or MMU objects
+ - If no tray objects are present, only toolhead slots are displayed
+ - Manually specifying `slot_targets` in the configuration overrides auto-discovery
+
+ ### Placeholders for `assign_gcode`
+
+ In `tray_macros` mode, the `assign_gcode` field supports the following placeholders:
+
+ | Placeholder | Description |
+ |-------------|-------------|
+ | `{spool_id}` | FilaMan spool ID |
+ | `{slot_index}` | Slot index (e.g. `0-0`) |
+ | `{ams_id}` | AMS/tray unit |
+ | `{tray_id}` | Tray slot number |
+ | `{material_type}` | Material type (e.g. `PLA`) |
+ | `{color}` | Spool color (hex) |
+
+ ---
+
+ ## Part 2: FilaMan Moonraker Component (Manual Installation)
+
+ The Moonraker component is a native Moonraker extension that runs on the same server as Moonraker (usually a Raspberry Pi). It handles:
+
+ - **Consumption tracking** – measuring extrusion length from Klipper toolhead updates
+ - **Weight calculation** – converting length (mm) to weight (g) using filament metadata
+ - **Consumption reporting** – automatically reporting usage to FilaMan (`/api/v1/spools/{id}/consumptions`)
+ - **Spool tracking** – managing the active spool via Moonraker endpoint and remote method
+
+ > **Note:** The Moonraker component is **optional** but recommended. Without it, FilaMan cannot perform automatic consumption tracking for Klipper printers.
+
+ ### Prerequisites
+
+ - Moonraker and Klipper are installed and running
+ - FilaMan is reachable on the local network
+ - SSH access to the printer server (e.g. Raspberry Pi)
+
+ ### Installation
+
+ **Step 1: Download the component file**
+
+ Connect to the printer server via SSH and download the `filaman.py` file into the Moonraker components directory:
+
+ ```bash
+ cd ~/moonraker/moonraker/components
+ wget https://github.com/Fire-Devils/FilaMan-Moonraker-Komponente/raw/main/filaman.py
+ ```
+
+ Alternatively, download the file manually and transfer it via SFTP/SCP.
+
+ **Step 2: Update the Moonraker configuration**
+
+ Open `moonraker.conf` (typically located at `~/printer_data/config/moonraker.conf` or `~/klipper_config/moonraker.conf`) and add the following section:
+
+ ```ini
+ [filaman]
+ server: http://192.168.1.50:8000
+ api_key: uak.123.xxxxxxxxxxxxxxxxxxxxx
+ sync_rate: 5
+ default_density_g_cm3: 1.24
+ default_diameter_mm: 1.75
+ ```
+
+ Replace `http://192.168.1.50:8000` with the actual URL of your FilaMan instance.
+
+ **Step 3: Restart Moonraker**
+
+ ```bash
+ sudo systemctl restart moonraker
+ ```
+
+ Then check the Moonraker logs for errors:
+
+ ```bash
+ journalctl -u moonraker -n 50
+ ```
+
+ ### Configuration Options
+
+ | Option | Required | Default | Description |
+ |--------|----------|---------|-------------|
+ | `server` | Yes | – | Base URL of the FilaMan instance |
+ | `api_key` | Recommended | – | FilaMan API key (`uak.<id>.<secret>`) |
+ | `sync_rate` | No | `5` | Reporting interval in seconds |
+ | `default_density_g_cm3` | No | `1.24` | Fallback density for weight calculation (g/cm³) |
+ | `default_diameter_mm` | No | `1.75` | Fallback filament diameter in mm |
+
+ ### HTTP Endpoints
+
+ After installation, the component exposes the following endpoints:
+
+ | Method | Endpoint | Description |
+ |--------|----------|-------------|
+ | `GET` / `POST` | `/server/filaman/spool_id` | Get or set the active spool |
+ | `GET` | `/server/filaman/status` | Connection and sync status |
+ | `POST` | `/server/filaman/proxy` | Forward proxy requests to FilaMan |
+
+ Additionally, Spoolman-compatible aliases are always active:
+
+ | Method | Endpoint |
+ |--------|----------|
+ | `GET` / `POST` | `/server/spoolman/spool_id` |
+ | `GET` | `/server/spoolman/status` |
+ | `POST` | `/server/spoolman/proxy` |
+
+ ### Remote Methods (GCode Macros)
+
+ The component registers the following remote methods that can be called from Klipper macros:
+
+ - `filaman_set_active_spool`
+ - `spoolman_set_active_spool` (Spoolman-compatible alias)
+
+ ### Setting Up GCode Macros
+
+ Add these macros to your `printer.cfg` or an included configuration file to control the active spool via GCode:
+
+ ```ini
+ [gcode_macro SET_ACTIVE_SPOOL]
+ gcode:
+ {% if params.ID %}
+ {% set id = params.ID|int %}
+ {action_call_remote_method("filaman_set_active_spool", spool_id=id)}
+ {% else %}
+ {action_respond_info("Parameter 'ID' is required")}
+ {% endif %}
+
+ [gcode_macro CLEAR_ACTIVE_SPOOL]
+ gcode:
+ {action_call_remote_method("filaman_set_active_spool", spool_id=None)}
+ ```
+
+ You can then set the active spool in your print start macro or manually via the console:
+
+ ```
+ SET_ACTIVE_SPOOL ID=42
+ CLEAR_ACTIVE_SPOOL
+ ```
+
+ ---
+
+ ## How Both Components Work Together
+
+ ```
+ FilaMan Moonraker Server (Pi)
+ ───────── ─────────────────────
+ Driver Plugin ←──► Moonraker Component
+ │ │
+ │ POST spool_id │ Extrusion data
+ │ (assignment) │ (consumption report)
+ └──────────────────► └──────────────────► FilaMan API
+ ```
+
+ - The **Driver Plugin** sends spool assignments from FilaMan to Moonraker
+ - The **Moonraker Component** tracks extrusion progress and reports consumption directly back to FilaMan
+
+ > **Tip:** Both components work independently. You can use the Driver Plugin without the Moonraker Component (assignment only, no consumption tracking), or vice versa.
+
+ ---
+
+ ← [Back: FilaManDB Community Database](/Docs/En/18-Filamandb) | [Next: Installation on Raspberry Pi →](/Docs/En/20-Installation-Raspberry-Pi)
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9