Connects Prusa printers to Obico via Docker
1.0K
Standalone Docker service that connects Prusa Core One printers (via PrusaLink) to Obico (self-hosted or cloud). Runs as an Obico agent — no modifications to Obico or PrusaLink required. One container = one printer.
The bridge acts as a translator between your Prusa Core One printer and Obico. It polls the printer's PrusaLink HTTP API for status and job data, captures the RTSP camera stream via ffmpeg, and forwards everything to Obico over WebSocket. The Obico control panel then shows your printer's state, lets you watch the live stream, and can pause or cancel a print if the AI detects a failure.
rtsp://[printer-ip]/live) — mandatory, Obico requires a live stream for AI failure detectionJANUS_HOST_IP below)Pull the image and run it with your Docker host's LAN IP:
docker run -d \
-p 3000:3000 \
-p 10100-10200:10100-10200/udp \
-v ./config:/config \
-e JANUS_HOST_IP=192.168.1.x \
rleban/sentry-bridge:latest
# Open http://localhost:3000 → follow setup wizard
Replace 192.168.1.x with the LAN IP of the machine running Docker. Without this, the WebRTC live stream will not work.
For the full guide → docs/guide/
For persistent setups, use the included docker-compose.yml at the repo root, or copy this block:
services:
bridge:
image: rleban/sentry-bridge:latest
container_name: sentry-bridge
ports:
- "3000:3000"
- "10100-10200:10100-10200/udp" # WebRTC ICE media (browser ↔ Janus)
volumes:
- ./config:/config
environment:
- PORT=3000
- CONFIG_PATH=/config/config.json
- JANUS_MODE=bundled
- JANUS_DEBUG_LEVEL=2
- JANUS_HOST_IP=${JANUS_HOST_IP:-}
- CIRCUIT_BREAKER_THRESHOLD=5
- CIRCUIT_BREAKER_RESET_TIMEOUT_MS=60000
- RETRY_BASE_DELAY_MS=1000
- RETRY_MAX_DELAY_MS=30000
- HEALTHCHECK_CRITICAL_TIMEOUT_MS=120000
healthcheck:
test:
[
"CMD-SHELL",
'node -e "fetch(''http://localhost:3000/api/health/live'').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"',
]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
restart: unless-stopped
stop_grace_period: 30s
docker compose up -d
# Open http://localhost:3000 → follow setup wizard
The repo includes a ready-to-use docker-compose.yml — just clone and run.
| Variable | Default | Required / Optional | Description |
|---|---|---|---|
PORT | 3000 | Optional | HTTP port |
CONFIG_PATH | /config/config.json | Optional | Config file path |
JANUS_HOST_IP | (unset) | Required (for WebRTC) | LAN IP of the Docker host. Janus advertises this as its ICE candidate so the browser can reach it. Without this, the live stream falls back to MJPEG snapshots. |
JANUS_MODE | auto | Optional | bundled — bridge manages Janus binary; hosted — external/sidecar; auto — detect |
JANUS_DEBUG_LEVEL | 2 | Optional | Janus log verbosity: 0=Fatal 1=Err 2=Warn 3=Info 4=Verbose 5=Huge |
CIRCUIT_BREAKER_THRESHOLD | 5 | Optional | Consecutive PrusaLink failures before circuit opens |
CIRCUIT_BREAKER_RESET_TIMEOUT_MS | 60000 | Optional | Time (ms) before retrying after circuit opens |
RETRY_BASE_DELAY_MS | 1000 | Optional | Initial retry delay (ms) |
RETRY_MAX_DELAY_MS | 30000 | Optional | Maximum retry delay (ms) |
HEALTHCHECK_CRITICAL_TIMEOUT_MS | 120000 | Optional | Time (ms) a critical component can stay DOWN before /api/health/ready returns 503 |
The wizard writes /config/config.json on the mounted volume. All fields can also be set manually:
{
"prusalink": {
"url": "http://192.168.1.x",
"username": "maker",
"password": "your-prusalink-password"
},
"camera": {
"rtspUrl": "rtsp://192.168.1.x/live",
"frameIntervalSeconds": 10
},
"obico": {
"serverUrl": "https://app.obico.io",
"apiKey": ""
},
"polling": {
"statusIntervalMs": 5000
}
}
prusalink — printer URL, username, and password for HTTP Digest Auth access to PrusaLinkcamera — RTSP stream URL and snapshot interval in secondsobico — server URL and pairing token (apiKey is empty until the wizard completes pairing)polling — polling interval in milliseconds (default: 5000)On first start the bridge serves a 4-step wizard at http://localhost:3000:
http://192.168.x.x), username (maker), and password. The wizard performs a live connection test before continuing.rtsp://[printer-ip]/live and shows a preview frame. This step is mandatory — it blocks until a frame is received.https://app.obico.io or your self-hosted instance). The wizard displays a 6-digit pairing code. Confirm it in Obico's "Link Printer" dialog.These are intentional product decisions, not bugs:
http://<printer-ip> not http://<printer-ip>/curl -u <username>:<password> --digest http://<printer-ip>/api/v1/statusffmpeg -rtsp_transport tcp -i rtsp://<printer-ip>/live -frames:v 1 -f image2 test.jpghttps://app.obico.io or your self-hosted URL) — no trailing slashdocker logs <container> | grep obicoJANUS_HOST_IP must be set to the Docker host's LAN IP, not 127.0.0.1 or 0.0.0.010100-10200 are published and reachable from the browserdocker exec <container> env | grep JANUS_HOST_IPdocker compose up -d --force-recreateFor local development or custom builds:
git clone https://github.com/reneleban/sentry-bridge.git
cd sentry-bridge
npm run install:all
npm run dev:all # backend (ts-node watch) + frontend (Vite)
Frontend proxies /api/* to the backend automatically.
On Mac, Janus cannot be installed natively. Run it as a Docker sidecar:
docker compose -f docker-compose.dev.yml up -d
This starts Janus with:
8188 (bridge relay)17732/udp (from ffmpeg)10100–10200/udp (WebRTC)For WebRTC to work during local development, set nat_1_1_mapping in config/janus/janus.jcfg to your Mac's LAN IP (e.g. 192.168.1.x). This tells Janus which IP to advertise for ICE so the browser can reach it.
The bridge auto-detects a running Janus on ws://127.0.0.1:8188 before looking for a local binary.
In production (Docker image), Janus runs natively inside the container — set JANUS_HOST_IP in the environment instead of editing the config file directly.
npm run test:backend
npm run build:all # TypeScript + Vite → dist/ + frontend/dist/
npm run build:docker # Docker image (single platform)
Prusa Core One
├── PrusaLink HTTP → Bridge (status poll, pause/resume/cancel)
└── RTSP /live → ffmpeg → H.264 RTP → Janus (WebRTC)
↕ WS relay
Browser ← Obico Server ← /ws/janus/{id}/ ← Bridge
Content type
Image
Digest
sha256:3abe37b70…
Size
118.3 MB
Last updated
4 months ago
docker pull rleban/sentry-bridge