Skip to main content
The Zenoh-MQTT bridge runs on edge devices alongside Edge Core. It connects the local high-performance Zenoh data bus (cyberwave.data) to the cloud MQTT broker, forwarding selected channels in both directions.

Overview

DirectionSourceDestinationUse case
OutboundZenoh channelMQTT topicInference results, events, health to cloud
InboundMQTT topicZenoh channelWorkflow sync commands from cloud
When MQTT is disconnected, outbound messages are buffered to a persistent file-backed queue and drained in FIFO order on reconnect.

Quick start

from cyberwave.zenoh_mqtt import ZenohMqttBridge, BridgeConfig

bridge = ZenohMqttBridge(
    config=BridgeConfig(
        twin_uuids=["<twin_uuid>"],
        outbound_channels=["model_output", "event", "model_health"],
    ),
    mqtt_host="<mqtt_host>",
    mqtt_port=8883,
    mqtt_password="<api_key>",
)
bridge.start()

Default topic mapping

Zenoh keyMQTT topicDirection
cw/{twin}/data/model_outputcyberwave/twin/{twin}/model_outputEdge to Cloud
cw/{twin}/data/eventcyberwave/twin/{twin}/eventEdge to Cloud
cw/{twin}/data/model_healthcyberwave/twin/{twin}/model_healthEdge to Cloud
cyberwave/twin/{twin}/commands/sync_workflowsCloud to Edge

Offline queue

When the MQTT connection drops:
  1. Outbound messages are appended to segmented files under CYBERWAVE_BRIDGE_QUEUE_DIR.
  2. On reconnect, the queue is drained in FIFO order before resuming live forwarding.
  3. Queue size is bounded by CYBERWAVE_BRIDGE_QUEUE_MAX_BYTES (default 50 MiB); oldest segments are evicted when the budget is exceeded.

Configuration

Environment variableDefaultDescription
CYBERWAVE_BRIDGE_ENABLEDfalseMaster switch
CYBERWAVE_BRIDGE_TWIN_UUIDSComma-separated twin UUIDs
CYBERWAVE_BRIDGE_OUTBOUND_CHANNELSmodel_output,event,model_healthChannels forwarded to MQTT
CYBERWAVE_BRIDGE_INBOUND_TOPICScommands/sync_workflowsMQTT suffixes forwarded to Zenoh
CYBERWAVE_BRIDGE_QUEUE_DIR/tmp/cyberwave_bridge_queuePersistent queue directory
CYBERWAVE_BRIDGE_QUEUE_MAX_BYTES52428800Max offline queue size (bytes)
CYBERWAVE_BRIDGE_MQTT_QOS1MQTT QoS for bridge messages

Transition compatibility

Existing direct MQTT paths (cw.mqtt.publish(...)) continue to work unchanged. The bridge is additive — channels published via both Zenoh and MQTT are handled idempotently on the cloud side.