-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Start
Get the exporter running in under 5 minutes.
- Docker installed
- Bambu Lab printer on your LAN (or cloud credentials)
- Printer serial number and LAN access code
- Find these in: Bambu Studio → Device → LAN Mode, or on the printer at Settings → Network
The exporter supports two transport modes. local_mqtt is the default — no extra configuration needed if your printer is on the same LAN.
| Mode |
BAMBULAB_TRANSPORT value |
When to use |
|---|---|---|
| Local (default) | local_mqtt |
Printer is on your LAN and LAN Mode is enabled |
| Cloud | cloud_mqtt |
Printer is not directly reachable (remote location, CGNAT, etc.) |
Omitting BAMBULAB_TRANSPORT is equivalent to setting it to local_mqtt.
BAMBULAB_TRANSPORT=local_mqtt # optional — this is the default
BAMBULAB_HOST=192.168.1.100 # your printer's IP
BAMBULAB_SERIAL=01P00A000000000 # your printer serial
BAMBULAB_ACCESS_CODE=12345678 # LAN access codeAll three of BAMBULAB_HOST, BAMBULAB_SERIAL, and BAMBULAB_ACCESS_CODE are required for Local mode. The container will refuse to start if any are missing.
docker run -d \
--name bambulab-exporter \
-p 9109:9109 \
--env-file .env \
ghcr.io/theblackbush/bambulab_metrics_exporter:latestcurl http://localhost:9109/health
curl http://localhost:9109/metrics | grep bambulab_printer_connectedYou should see bambulab_printer_connected 1 in the metrics output.
Use this mode when the printer is not directly reachable over LAN.
| Variable | Required | Description |
|---|---|---|
BAMBULAB_TRANSPORT |
✅ | Must be cloud_mqtt
|
BAMBULAB_SERIAL |
✅ | Printer serial number |
BAMBULAB_SECRET_KEY |
✅ | Encrypts stored credentials — keep stable |
BAMBULAB_CLOUD_EMAIL |
✅ (for OTP flow) | Your Bambu account email |
BAMBULAB_CLOUD_USER_ID + BAMBULAB_CLOUD_ACCESS_TOKEN
|
Alternative | Use if you already have tokens |
BAMBULAB_SECRET_KEY encrypts your cloud credentials on the config volume. Generate one before proceeding:
openssl rand -hex 32Add it to your .env (and keep it out of version control):
BAMBULAB_SECRET_KEY=<output from above>Keep this key stable. Changing it invalidates stored credentials and requires re-authentication.
Cloud authentication uses a one-time verification code sent to your Bambu account email.
Step 1 — Send the verification code:
docker run --rm -it \
ghcr.io/theblackbush/bambulab_metrics_exporter:latest \
bambulab-cloud-auth --email you@example.com --send-codeStep 2 — Exchange the code and save credentials:
docker run --rm -it \
-v /your/config/path:/config \
-e BAMBULAB_SECRET_KEY="your-strong-secret-key" \
ghcr.io/theblackbush/bambulab_metrics_exporter:latest \
bambulab-cloud-auth --email you@example.com --code 123456 \
--serial <serial> --save --secret-key "$BAMBULAB_SECRET_KEY"Mount /your/config/path to the same path the running exporter uses for its config volume so the saved credentials are picked up automatically.
Step 3 — Start the exporter:
BAMBULAB_TRANSPORT=cloud_mqtt
BAMBULAB_SERIAL=01P00A000000000
BAMBULAB_SECRET_KEY=<your-secret-key>
BAMBULAB_CLOUD_EMAIL=you@example.comdocker run -d \
--name bambulab-exporter \
-p 9109:9109 \
-v /your/config/path:/config \
--env-file .env \
ghcr.io/theblackbush/bambulab_metrics_exporter:latestThe container handles cloud authentication natively on startup — no manual bambulab-cloud-auth runs required if you use this flow.
Initial authentication (container-native OTP flow):
- Set
BAMBULAB_CLOUD_EMAILin your.env. Do not setBAMBULAB_CLOUD_CODE. - Start the container. Because no valid credentials exist yet, it sends a verification code to your Bambu account email, then exits.
- Check your email for the code.
- Add
BAMBULAB_CLOUD_CODE=<code from email>to your.envand restart the container. - The container authenticates, persists encrypted credentials to the config volume, and continues running normally.
-
Remove
BAMBULAB_CLOUD_CODEfrom.env— codes are single-use. It is not needed for steady-state operation.
After step 6, the exporter loads stored credentials automatically on every restart.
When BAMBULAB_CLOUD_CODE is needed again:
Repeat the flow above if any of the following occur:
- Stored credentials are missing or cleared (fresh config volume, accidental deletion).
- The Bambu Cloud session has expired or the account password was changed.
-
BAMBULAB_SECRET_KEYwas changed — the encrypted credential file can no longer be decrypted.
In all these cases, start the container without BAMBULAB_CLOUD_CODE to trigger a new code delivery, then follow steps 3–6 above.
| What | Where |
|---|---|
| Add to Prometheus | Prometheus Setup |
| Tune all env vars | Configuration |
| Import Grafana dashboard | Grafana Dashboard |
| Something not working | Troubleshooting |