diff options
| author | Serguey Parkhomovsky <xindigo@gmail.com> | 2026-03-17 20:59:22 -0700 |
|---|---|---|
| committer | Serguey Parkhomovsky <xindigo@gmail.com> | 2026-03-17 20:59:22 -0700 |
| commit | 4faa1e67a1a92d70d87a7297060e41db6988707e (patch) | |
| tree | 0f6ca7c846ed6237b2e639639791ceb001267c37 /README.md | |
| parent | 9451281af9dc1eded8c832ae6d3e85bb27e73395 (diff) | |
Add readme
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..e598e7d --- /dev/null +++ b/README.md @@ -0,0 +1,88 @@ +# 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 |
