Compare commits

...

5 Commits

Author SHA1 Message Date
Gangoke
31913d4a43 feat: add API endpoint for bridge restart functionality 2026-05-20 21:34:03 -10:00
534ea41816 docs: Update-Warnung im 0.9.13-CHANGELOG 2026-05-20 17:56:50 +02:00
f1bfab969c build: sources for v0.9.13 2026-05-20 15:14:37 +02:00
81729c37a5 build: sources for v0.9.12 2026-05-20 15:00:02 +02:00
fe1ed4b096 build: sources for v0.9.11 2026-05-20 11:12:53 +02:00
10 changed files with 4176 additions and 2581 deletions

2
.gitignore vendored
View File

@@ -7,3 +7,5 @@ dist/
releases/*/kx-bridge
releases/*/extract_credentials
releases/*/extract_credentials.exe
config/config.ini
data/

View File

@@ -1,5 +1,82 @@
# Changelog
## [0.9.13] 2026-05-20
============================================================
STOPP — VOR DEM DRÜCKEN VON "UPDATE" LESEN
============================================================
Der "Update"-Button ist in 0.9.11 und 0.9.12 KAPUTT.
NICHT benutzen. Stattdessen einmalig manuell updaten —
ab 0.9.13 funktioniert er wieder.
>> WINDOWS-.EXE / LINUX-BINARY-Nutzer — GEFAHR:
Update ÜBERSCHREIBT deine kx-bridge.exe / kx-bridge mit
einer Textdatei. Das Programm STARTET DANN NICHT MEHR
und kann sich nicht selbst reparieren.
--> Manuell updaten: die 0.9.13
kx-bridge-windows.zip / kx-bridge-linux.zip von der
Releases-Seite laden und die alte Datei ersetzen.
Deine config/- und data/-Ordner bleiben erhalten.
>> DOCKER-Nutzer:
Update führt zur Crash-Loop des Containers
(ModuleNotFoundError: No module named '_web_assets').
--> Manuell updaten:
docker compose pull (oder docker compose up -d --build)
config- + data-Volumes bleiben erhalten.
Ab 0.9.13 ist der In-App-Updater repariert und wieder sicher.
============================================================
### Fixes
- **Self-Update war in 0.9.11 und 0.9.12 kaputt (kritisch):** Der In-App-Updater
ersetzte nur `kobrax_moonraker_bridge.py`. Zwei Probleme:
- **Binary/EXE-Modus:** Er überschrieb die laufende Programmdatei
(`sys.executable`) mit einer Python-Textdatei — übrig blieb ein nicht mehr
startbares Programm, das sich nicht selbst reparieren kann (manueller
Re-Download nötig).
- **Python/Docker-Modus:** Seit 0.9.12 importiert die Hauptdatei das
ausgelagerte `_web_assets.py` (gebündeltes Frontend), das der Updater nicht
mitlud → `ModuleNotFoundError: No module named '_web_assets'` → Crash-Loop.
Der Updater lädt jetzt **alle** Bridge-Module (Hauptdatei + `_web_assets.py` +
Client + Loader) erst vollständig herunter, ersetzt sie dann atomar und
**verweigert das Self-Update im Binary-Modus** (mit Verweis auf den manuellen
Download).
## [0.9.12] 2026-05-20
### Fixes
- **Pause-Status** wird jetzt korrekt erkannt: Die Bridge las den Geräte-State
statt des verschachtelten Druckauftrags-States, dadurch wurde ein pausierter
Druck teils noch als „druckend" angezeigt. Layer/Fortschritt/Restzeit kommen
jetzt ebenfalls aus dem Auftrags-Report.
### Intern
- Frontend (HTML/CSS/JS) aus der Python-Datei nach `web/index.html` ausgelagert,
zur Build-Zeit wieder eingebettet — besser wartbar, für Nutzer keine Änderung.
### Doku
- Community-**Home-Assistant-Integration** von @gangoke verlinkt.
## [0.9.11] 2026-05-20
### Neu
- **ACE Pro 2 Support (experimentell, Community-Beitrag von @gangoke, PR #26):** Die Bridge erkennt jetzt die Filament-Hardware automatisch und passt sich an:
- **Modi:** `toolhead` (kein ACE, Standard-4-Slot-Box), `ace_direct` (ein ACE Pro 2 direkt am Toolhead), `ace_hub` (bis zu 4 ACE-Units am Slot-4-Hub) — insgesamt bis zu **19 Slots**.
- **AMS Auto-Refill** Umschalter.
- **Trockner:** Temperatur-/Luftfeuchte-Monitor, Start/Stop/Temp/Dauer-Steuerung, mit Material-Presets in einer neuen Config-Sektion `[ace_dry_presets]` (PLA, PLA+, PETG, TPU, ABS/ASA, PA/PC + 3 Custom).
- **UI:** Filament-Sektion skaliert auf 19 Slots, Modus-Label, geladener Slot grün umrandet mit Lade-/Entlade-Puls-Animation, Unload/Load direkt aus dem Slot-Edit-Dialog.
- **GCode-Farb-Mapping:** ACE2-fähig, Farbe-aus-GCode-Fix, Hinweis bei Inkonsistenz zwischen Mapping und Objekten, besseres Default-Mapping.
> **⚠️ Experimentell:** Die ACE-Pro-2-Hardware-Pfade wurden vom Contributor mit einer einzelnen ACE2-Unit entwickelt und getestet; die 24-Unit-Hub-Konfigurationen sind theoretisch und auf echter Hardware ungetestet. Wir haben hier ebenfalls keine ACE2-Hardware zur Verifikation. Der Standard-`toolhead`-Pfad (ohne ACE) wurde live gegen einen echten Kobra X getestet. Wer ein Multi-ACE-Setup betreibt: bitte per Issue Rückmeldung geben.
### Fixes
- **Happy-Hare-MMU-Emulation:** Es werden nur belegte Slots gesynct — kein Placeholder für leere Slots (kompatibel mit OrcaSlicer PR #13372).
- **GCode-Farb-Dialog** zeigt nach einem neuen Upload nicht mehr die Daten der vorherigen Datei.
---
## [0.9.10] 2026-05-17
> **Hinweis:** Mit diesem Release wird der Fokus von neuen Features auf

View File

@@ -1,5 +1,80 @@
# Changelog
## [0.9.13] 2026-05-20
============================================================
STOP — READ THIS BEFORE PRESSING "UPDATE"
============================================================
The in-app "Update" button is BROKEN in 0.9.11 and 0.9.12.
Do NOT use it. Update manually instead (one time), then it
works again from 0.9.13 onward.
>> WINDOWS .EXE / LINUX BINARY users — DANGER:
Pressing Update OVERWRITES your kx-bridge.exe / kx-bridge
with a text file. The program will NOT start anymore.
It cannot repair itself.
--> Update manually: download the 0.9.13
kx-bridge-windows.zip / kx-bridge-linux.zip from the
Releases page and replace your old file.
Your config/ and data/ folders are kept.
>> DOCKER users:
Pressing Update makes the container crash-loop
(ModuleNotFoundError: No module named '_web_assets').
--> Update manually:
docker compose pull (or docker compose up -d --build)
Your config + data volumes are kept.
From 0.9.13 on, the in-app updater is fixed and safe again.
============================================================
### Fixes
- **Self-update was broken in 0.9.11 and 0.9.12 (critical):** the in-app updater
only replaced `kobrax_moonraker_bridge.py`. Two problems:
- **Binary/EXE mode:** it overwrote the running executable (`sys.executable`)
with a Python text file, leaving an unstartable program that can't recover
itself — manual re-download required.
- **Python/Docker mode:** since 0.9.12 the main file imports the extracted
`_web_assets.py` (bundled frontend), which the updater didn't fetch →
`ModuleNotFoundError: No module named '_web_assets'` → crash loop.
The updater now downloads **all** bridge modules (main file + `_web_assets.py`
+ client + loaders) fully, then swaps them atomically, and **refuses to
self-update in binary mode** (pointing you to the manual download instead).
## [0.9.12] 2026-05-20
### Fixes
- **Pause state** is now read correctly: the bridge was looking at the device-level
state instead of the nested print-job state, so a paused print sometimes still
showed as printing. Layer/progress/remaining-time are now also taken from the
job report.
### Internal
- Frontend (HTML/CSS/JS) extracted from the Python file into `web/index.html`,
bundled back in at build time — easier to maintain, no change for users.
### Docs
- Linked the community **Home Assistant integration** by @gangoke.
## [0.9.11] 2026-05-20
### New
- **ACE Pro 2 support (experimental, community contribution by @gangoke, PR #26):** the bridge now auto-detects the filament hardware and adapts:
- **Modes:** `toolhead` (no ACE, stock 4-slot box), `ace_direct` (one ACE Pro 2 directly on the toolhead), `ace_hub` (up to 4 ACE units on the slot-4 hub) — up to **19 slots** total.
- **AMS auto-refill** toggle.
- **Dryer:** temperature/humidity monitor, start/stop/temp/duration control, with material presets configurable in a new `[ace_dry_presets]` config section (PLA, PLA+, PETG, TPU, ABS/ASA, PA/PC + 3 custom).
- **UI:** filament section scales to 19 slots, mode label, loaded slot is green-outlined with a load/unload pulse animation, unload/load straight from the slot-edit dialog.
- **GCode color mapping:** ACE2-aware, color-from-GCode fix, inconsistency notifier when the mapping doesn't match the objects, better default mapping.
> **⚠️ Experimental:** the ACE Pro 2 hardware paths were developed and tested by the contributor with a single ACE2 unit; the 24 unit hub configurations are theoretical and untested on real hardware. We don't have ACE2 hardware to verify against either. The standard `toolhead` (no-ACE) path was verified live against a real Kobra X here. If you run a multi-ACE setup, please report back via Issues.
### Fixes
- **Happy Hare MMU emulation:** only populated slots are now synced — no placeholder for empty slots (aligns with OrcaSlicer PR #13372).
- **GCode color dialog** no longer shows the previously-uploaded file's data after a new upload.
---
## [0.9.10] 2026-05-17
> **Heads-up:** with this release the focus shifts from new features to

View File

@@ -6,6 +6,7 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY kobrax_moonraker_bridge.py .
COPY _web_assets.py .
COPY config_loader.py .
COPY env_loader.py .
COPY kobrax_client.py .

View File

@@ -16,6 +16,8 @@ Eine Moonraker-kompatible Bridge, die direkt mit dem Drucker spricht.
 
[![Releases](https://img.shields.io/badge/Download-Releases-2EA043?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.it-drui.de/viewit/KX-Bridge-Release/releases)
 
[![Downloads](https://img.shields.io/badge/Downloads-800%2B-8957E5?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.it-drui.de/viewit/KX-Bridge-Release/releases)
 
[![Video](https://img.shields.io/badge/YouTube-Tutorial-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/watch?v=1Ql4wfH27fM)
<sub>Gefällt dir KX-Bridge? Ein Kaffee auf <a href="https://ko-fi.com/viewitde">Ko-fi</a> hält das Projekt am Leben. ☕</sub>
@@ -99,6 +101,17 @@ Drucker → Verbindungstyp **Moonraker** → Host: `http://BRIDGE-IP:7125`
---
## 🏠 Community & Integrationen
- **[Home-Assistant-Integration](https://github.com/gangoke/kobrax-lan-hass-component)**
von [@gangoke](https://github.com/gangoke) — bindet Sensoren, Drucksteuerung,
Licht, Kamera und das GCode-Vorschaubild als native Home-Assistant-Entitäten ein.
> Dies sind **Community-Projekte**, die nicht von KX-Bridge betreut oder
> supportet werden. Bei Fragen oder Problemen bitte das verlinkte Repository nutzen.
---
## 🔧 Zugangsdaten manuell ermitteln
Normalerweise nicht nötig — *„+ Drucker hinzufügen"* macht das automatisch. Falls doch:

View File

@@ -16,6 +16,8 @@ A Moonraker-compatible bridge that talks directly to the printer.
&nbsp;
[![Releases](https://img.shields.io/badge/Download-Releases-2EA043?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.it-drui.de/viewit/KX-Bridge-Release/releases)
&nbsp;
[![Downloads](https://img.shields.io/badge/Downloads-800%2B-8957E5?style=for-the-badge&logo=gitea&logoColor=white)](https://gitea.it-drui.de/viewit/KX-Bridge-Release/releases)
&nbsp;
[![Video](https://img.shields.io/badge/YouTube-Tutorial-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/watch?v=1Ql4wfH27fM)
<sub>Like KX-Bridge? A coffee on <a href="https://ko-fi.com/viewitde">Ko-fi</a> keeps the project alive. ☕</sub>
@@ -99,6 +101,17 @@ Printer → Connection type **Moonraker** → Host: `http://BRIDGE-IP:7125`
---
## 🏠 Community & Integrations
- **[Home Assistant integration](https://github.com/gangoke/kobrax-lan-hass-component)**
by [@gangoke](https://github.com/gangoke) — exposes sensors, print controls,
light, camera and the GCode thumbnail as native Home Assistant entities.
> These are **community projects**, not maintained or supported by KX-Bridge.
> For questions or issues, please use the linked repository.
---
## 🔧 Getting credentials manually
Normally not needed — *"+ Add printer"* does this automatically. If you do need it:

View File

@@ -1 +1 @@
0.9.10
0.9.13

2991
_web_assets.py Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,13 @@ Verwendung:
info = client.query_info()
print(info["data"]["temp"])
client.disconnect()
────────────────────────────────────────────────────────────────────────────
Copyright (C) 2026 viewit (KX-Bridge contributors)
Licensed under GPLv3 — see LICENSE in the project root.
Protocol reverse-engineered for interoperability (§69e UrhG / EU Software
Directive Art. 6). Not affiliated with Anycubic. See NOTICE.md.
"""
import hashlib

File diff suppressed because it is too large Load Diff