This is the repository reference for publishing detection telemetry to MQTT directly from the pipeline. Use it when you need broker-integrated object-count messages rather than a video stream.
- You need MQTT messages emitted from the running pipeline.
- You want detection-derived telemetry instead of image transport.
- You need a reference for using a
Scriptnode with a vendored MQTT client.
- You need RTSP, MJPEG, TCP, or WebRTC video delivery.
- You need rich structured detection payloads.
- You need host-side broker logic instead of device-side publication.
Category:streaming/poe-mqttShape:script+standalonePrimary task:publish rolling detection-count averages to MQTTEntrypoint:main.pyStandalone path:oakapp.tomlFrontend:noneRuns on:network-reachable devices; intended for PoE deployment, with RVC2 peripheral, RVC4 peripheral, and RVC4 standalone packaging supported by the example layoutRequires:reachable MQTT broker, YOLOv6 model assets, and script-node network accessInput:live camera by default orReplayVideovia--media_pathOutput:MQTT publishes plusVideoandDetectionsvisualizer topicsModels:YOLOv6 YAMLs in depthai_models/Visualizer / UI:DepthAI Visualizer plus any MQTT client/subscriber
- main.py runs YOLOv6 on camera or replay input and publishes normal visualizer topics for
VideoandDetections. - A
Scriptnode onLEON_CSSreceives parsed detections and embeds the vendored MQTT client from utils/paho-mqtt.py. - The script keeps a rolling total and frame count, then publishes the average number of detections every
10seconds. - Broker host, port, topic, username, and password are interpolated into the generated script text at startup.
- The payload is only the average detection count over the last
10seconds, not raw detections or class-level summaries. - The default broker/topic pair is public test infrastructure:
test.mosquitto.org:1883andtest_topic/detections. - MQTT credentials are passed into the generated script body in main.py, so treat this as a simple example rather than a hardened secret-management pattern.
- streaming/mjpeg-streaming: use this when you need image transport instead of telemetry
- streaming/rtsp-streaming: use this when you need a standard live video endpoint
- neural-networks/counting/people-counter: use this when your main goal is counting logic rather than broker transport
Run:python3 main.pyBroker override:python3 main.py --broker <HOST> --port 1883 --topic my/topicSuccess looks like:the Visualizer showsVideoandDetections, and an MQTT subscriber receives numeric average-count messages roughly every10secondsCommon failure meaning:the broker is unreachable from the runtime, the topic or credentials are wrong, or the user expects per-detection events rather than aggregated counts