From 9d73296a3b824b29aed101f209b796db3988307c Mon Sep 17 00:00:00 2001 From: Peter Siegmund Date: Thu, 15 Jan 2026 23:15:32 +0100 Subject: [PATCH] add README.md Signed-off-by: Peter Siegmund --- README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3c6854 --- /dev/null +++ b/README.md @@ -0,0 +1,75 @@ +# BambuLab MQTT Bridge + +This project provides a bridge between a BambuLab 3D printer and an MQTT broker. It allows you to forward status and event messages from your printer to any MQTT-compatible system, enabling easy integration with home automation, monitoring, or logging solutions. + +## Features + +- Connects securely to a BambuLab printer via MQTT over TLS +- Forwards all printer messages to a target MQTT broker +- Supports custom topic prefixing to avoid collisions +- Runs as a minimal, secure Docker container (multi-arch: amd64 & arm64) +- Configuration via environment variables or `.env` file + +## Usage + +### 1. Configuration + +Create a `.env` file in the project directory or provide the following environment variables: + +``` +PRINTER_IP=192.168.1.100 +PRINTER_ACCESS_CODE=your_printer_code +PRINTER_SERIAL=your_printer_serial +TARGET_BROKER_IP=mqtt.example.com +TARGET_PORT=8883 +TARGET_USERNAME=mqttuser +TARGET_PASSWORD=mqttpassword +TARGET_PREFIX=bambulab/ +``` + +### 2. Build Docker Image + +``` +docker build -t bambu-mqtt . +``` + +### 3. Run Container + +``` +docker run --rm \ + --env-file .env \ + bambu-mqtt +``` + +Or set environment variables directly with `-e`. + +### 4. Portainer/Compose Example + +```yaml +services: + bambu-mqtt: + image: git.mars3142.dev/mars3142/bambu_mqtt:latest + env_file: + - .env + restart: unless-stopped +``` + +## Development + +- Python dependencies are managed via `requirements.txt`. +- The code is fully commented in English. +- The Dockerfile follows best practices: non-root, multi-arch, healthcheck, minimal size. + +## Versioning & CI + +- The Docker image is automatically built and pushed for `amd64` and `arm64` via Gitea Actions. +- Image tags are derived from the version label in the Dockerfile. + +## License + +MIT License + +## Author + +Peter Siegmund (mars3142@noreply.mars3142.dev) +ChatGPT