# printstats A printer monitoring service that aggregates status from multiple 3D printers (Prusa and Bambu) and exposes them through a unified HTTP API. ## Features - Monitor Prusa and Bambu 3D printers simultaneously - Prusa: polls via HTTP REST API every 5 seconds - Bambu: real-time updates via MQTT subscription - Unified JSON endpoint for all printer states - Tracks bed temperature and print status per printer ## Prerequisites - Rust - Network connectivity to your printers ## Setup 1. Copy the example config and fill in your printer details: ```sh cp example_config.toml config.toml ``` 2. Edit `config.toml`: ```toml [[printers]] type = "prusa" name = "MyPrusa" host = "192.168.1.10" api_key = "your-api-key" [[printers]] type = "bambu" name = "MyBambu" host = "192.168.1.11" access_code = "12345678" serial_number = "ABCDEFGH" ``` ## Build & Run ```sh cargo build --release ./target/release/printstats ``` Or directly: ```sh cargo run ``` The server listens on `0.0.0.0:3000`. ## API ### `GET /` Returns the current state of all configured printers. **Response:** ```json { "MyPrusa": { "bed_temp": 60.0, "status": "Printing" }, "MyBambu": { "bed_temp": 0.0, "status": "Idle" } } ``` **Status values:** `Idle`, `Printing`, `Paused`, `Finished`, `Unknown` ## Logging Uses the `tracing` crate. Control log level via `RUST_LOG`: ```sh RUST_LOG=debug cargo run ``` ## License MIT