Print
Sentinel.

Real-time print health monitoring for the Bambu Lab A1 — fusing MQTT telemetry with OpenCV defect detection into a single unified pipeline.
Hardware  |  Computer Vision  |  Python / MQTT / OpenCV

The Problem.

FDM print failures waste hours, material, and machine time. A spaghetti failure on a 6-hour part is obvious after the fact — but undetected for 90% of the print. The Bambu A1 ships with a camera and a telemetry API. The question was whether you could close the feedback loop automatically.

Print Sentinel subscribes to the printer's MQTT feed and runs an OpenCV defect detection pass on the live camera simultaneously — logging anomalies the moment they diverge from expected geometry.

Language

Python

Protocol

MQTT (Paho)

Vision

OpenCV

Hardware

Bambu Lab A1

Entry Point

bambu_combined.py

Live Telemetry Log.

bambu_combined.py — print_sentinel
[14:03:01] CONNECTED broker=192.168.1.42:8883 device=A1_00M00A0B0
[14:03:02] SUBSCRIBED topic=device/report
[14:03:05] print_state=RUNNING  layer=12/240  temp_nozzle=220°C  temp_bed=65°C
[14:03:05] fan_speed=70%  speed_level=Standard  gcode_file=vtol_bracket_v3.3mf
[14:04:12] VISION_OK frame=layer_12  anomaly_score=0.04  threshold=0.30
[14:07:44] VISION_WARN frame=layer_31  anomaly_score=0.34  contours_detected=7
[14:07:44] ANOMALY_LOG → saved to logs/layer_031_anomaly.jpg
[14:08:01] print_state=RUNNING  layer=32/240  anomaly_score=0.11  CLEAR
[14:09:55] VISION_OK frame=layer_38  anomaly_score=0.02
[14:10:00] _

Architecture.

Telemetry Thread

MQTT Subscriber

Subscribes to device/report — streaming nozzle temp, bed temp, print state, layer count, fan speed, and gcode filename in real time

Vision Thread

OpenCV Frame Analysis

Captures frames from the A1's onboard camera, runs contour detection and anomaly scoring per layer to flag spaghetti, warping, or delamination

Fusion Layer

bambu_combined.py

Single entry point merging both streams — correlating anomaly events with telemetry state so failures are stamped with full printer context at detection time

Anomaly Log

Timestamped JPEG + JSON

Each flagged frame is saved with its anomaly score, contour count, layer number, and live telemetry snapshot for post-print failure analysis

Key Features.

01
Unified Single Script Both MQTT telemetry and OpenCV vision run in bambu_combined.py — no service mesh, no orchestration overhead. One process, two threaded loops, shared state.
02
Bambu API Integration Uses the undocumented but stable Bambu Lab MQTT API over TLS — the same protocol the official Bambu Handy app uses for remote monitoring.
03
Context-Rich Failure Logs When vision flags an anomaly, the log entry includes the full telemetry state at that instant — so you know whether the failure correlated with a temp spike, fan drop, or speed change.

Why This Matters.

Most print monitoring tools pick either telemetry or vision. This project treats them as complementary signals. A spaghetti failure at layer 31 is more useful when you also know the nozzle was 8° low and the fan had just ramped down. That's the data Print Sentinel captures.

Python MQTT / Paho OpenCV Bambu Lab API Computer Vision Hardware Integration 3D Printing