Adds optional Spoolman (https://github.com/Donkie/Spoolman) integration for live filament consumption tracking. Config (config.ini [spoolman] section or env vars): SPOOLMAN_SERVER = http://192.168.x.x:7912 SPOOLMAN_SYNC_RATE = 30 # mid-print sync interval in seconds (0=end only) How it works: - Uses supplies_usage from the printer's own MQTT print/report payload — the printer's cumulative extrusion counter in mm, reset each print. Discovered via MQTT payload inspection: matches slicer estimate within ~1% for model filament, and also captures the printer's purge/prime sequence that the slicer doesn't count. - Reports to Spoolman via PUT /api/v1/spool/{id}/use with use_length (mm), letting Spoolman convert to weight using the spool's filament profile. - Accurate for both completed and cancelled prints — no estimation needed. - For multi-slot prints, total filament is split equally across mapped spools (v1 approximation; per-slot MQTT breakdown not available). UI changes: - Filament assignment dialog gains a Spoolman section (hidden when not configured): one spool dropdown per assigned AMS slot, loaded async from GET /kx/spoolman/spools. - AMS slot display shows a 🧵 #N badge on any slot with a mapped spool. - Spool assignments persist across prints (sticky until changed). New API endpoints: GET /kx/spoolman/status — configured flag, server URL, slot map GET /kx/spoolman/spools — spool list proxied from Spoolman POST /kx/spoolman/active-spool — body: {"slot_map": {"0": 42, "1": 17}} Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45 lines
1.3 KiB
Plaintext
45 lines
1.3 KiB
Plaintext
# KX-Bridge Konfigurationsdatei
|
|
# Kopiere diese Datei nach config.ini und trage deine Werte ein:
|
|
# cp config.ini.example config.ini
|
|
#
|
|
# Credentials automatisch eintragen:
|
|
# python3 tools/fetch_credentials.py --ip 192.168.x.x --write-config
|
|
# Alternativ (Windows, ohne Drucker-IP bekannt):
|
|
# extract_credentials.exe --write-env (liest aus laufendem AnycubicSlicerNext)
|
|
|
|
[connection]
|
|
# IP-Adresse des Druckers im lokalen Netzwerk
|
|
printer_ip = 192.168.x.x
|
|
|
|
# MQTT-Port (Anycubic Kobra X Standard: 9883)
|
|
mqtt_port = 9883
|
|
|
|
# MQTT-Zugangsdaten (druckerspezifisch, beginnt mit "user")
|
|
username = userXXXXXXXXXX
|
|
password = XXXXXXXXXXXXXXX
|
|
|
|
# Geräte-ID (32-stelliger Hex-String, druckerspezifisch)
|
|
device_id = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
# Modell-ID (Kobra X Standard: 20030)
|
|
mode_id = 20030
|
|
|
|
[print]
|
|
# Standard-AMS-Slot für Einfarbdruck (auto = alle belegten Slots, 0-3 = fixer Slot)
|
|
default_ams_slot = auto
|
|
|
|
# Auto-Leveling vor jedem Druck (1 = an, 0 = aus)
|
|
auto_leveling = 1
|
|
|
|
[bridge]
|
|
# Poll-Intervall in Sekunden
|
|
poll_interval = 3
|
|
|
|
[spoolman]
|
|
# URL der Spoolman-Instanz (leer lassen um Spoolman zu deaktivieren)
|
|
# server = http://192.168.x.x:7912
|
|
|
|
# Wie oft (Sekunden) der Filamentverbrauch während des Drucks gemeldet wird
|
|
# (0 = nur beim Druckende)
|
|
# sync_rate = 0
|