This project is a comprehensive multi-protocol bridge system designed to connect Zenoh, MQTT, and ROS2 protocols. The project enables seamless data transfer between different communication protocols commonly used in IoT, robotics, and distributed systems.
Complete documentation available via MkDocs (can be deployed to GitHub Pages)
To view the documentation locally:
# Install dependencies
pip install -r requirements.txt
# Serve documentation
mkdocs serve
# Open http://localhost:8000 in your browserThe documentation includes:
- ๐ Installation and quick start guides
- ๐๏ธ Architecture overview with diagrams
- ๐ง Component-specific documentation
- โ๏ธ Configuration guides
- ๐งช Testing and usage examples
- ๐ก Real-world use cases
- ๐ API reference
- ๐ ๏ธ Troubleshooting guide
This project is a multi-protocol bridge system that enables different protocols to work together in modern IoT and robotics ecosystems. Its main objectives are:
- Multi-Protocol Translation: Data transfer between MQTT, Zenoh, and ROS2 protocols
- Real-Time Communication: Instant processing of sensor and robotics data
- Scalable Architecture: Docker-based microservices structure
- Monitoring and Control: Visual flow control with Node-RED
- Robotics Integration: ROS2 DDS bridge for robotics applications
- Testing Environment: Comprehensive testable system with multiple protocol support
- Port: 7447 (TCP), 8000 (REST HTTP)
- Role: Central router for Zenoh network
- Features:
- Message routing over Zenoh protocol
- REST API support
- Debug logging
- Port: 1883 (MQTT), 9001 (WebSocket)
- Role: Message broker for MQTT protocol
- Features:
- Eclipse Mosquitto based
- Configuration and log management
- ACL (Access Control List) support
- Port: 8001 (HTTP REST), 1884 (MQTT)
- Role: Protocol bridge between MQTT and Zenoh
- Features:
- Bidirectional message transfer
- Configuration-driven topic mapping
- Real-time data streaming
- Port: 8765 (Foxglove Bridge)
- Role: ROS2 robotics framework with DDS communication
- Features:
- ROS2 Humble distribution
- Foxglove Bridge for web visualization
- CycloneDDS middleware
- ROS domain configuration
- Port: 8002 (HTTP REST), 7449 (Zenoh)
- Role: Protocol bridge between ROS2 DDS and Zenoh
- Features:
- ROS2 topic/service/action bridging
- Namespace isolation (/bot1)
- Selective topic filtering
- Timestamping support
- Port: 1880 (Web UI)
- Role: Visual flow editor and automation platform
- Features:
- Web-based interface
- MQTT, Zenoh, and ROS integration
- Real-time dashboard creation
- Flow-based programming
- MQTT Publisher: Automatic sensor data generator
- MQTT Subscriber: Client listening to MQTT messages
- Zenoh Subscriber: Python application for Zenoh data
- External Test Scripts: pub.py and sub.py for development testing
graph TB
subgraph "Docker Environment"
MQTTPub[MQTT Publisher<br/>Sensor Data Generator]
MQTTSub[MQTT Subscriber<br/>MQTT Listener]
subgraph "Core Services"
Mosquitto[๐ฆ Mosquitto MQTT Broker<br/>Port: 1883, 9001]
ZenohRouter[๐ Zenoh Router<br/>Port: 7447, 8000]
MQTTBridge[๐ Zenoh-MQTT Bridge<br/>Port: 8001, 1884]
end
subgraph "ROS2 Ecosystem"
ROS2[๐ค ROS2 Humble<br/>Port: 8765<br/>Foxglove Bridge]
ROSBridge[๐ Zenoh-ROS2DDS Bridge<br/>Port: 8002, 7449<br/>Namespace: /bot1]
end
subgraph "Management & Monitoring"
NodeRED[๐ด Node-RED<br/>Port: 1880<br/>Visual Flow Editor]
end
subgraph "Zenoh Ecosystem"
ZenohSub[๐ Zenoh Subscriber<br/>Python Application]
end
subgraph "External Testing"
PubPy[๐ค pub.py<br/>Zenoh Publisher]
SubPy[๐ฅ sub.py<br/>Zenoh Subscriber]
end
end
%% Data Flow Connections
MQTTPub -->|MQTT Publish| MQTTBridge
MQTTBridge -->|MQTT Subscribe| Mosquitto
MQTTBridge <-->|Zenoh Protocol| ZenohRouter
ZenohRouter <-->|Zenoh Subscribe| ZenohSub
%% ROS2 Integration
ROS2 <-->|DDS Communication| ROSBridge
ROSBridge <-->|Zenoh Protocol| ZenohRouter
%% Traditional MQTT Flow
Mosquitto <-->|MQTT| MQTTSub
NodeRED <-->|MQTT| Mosquitto
NodeRED <-->|Zenoh-MQTT| MQTTBridge
NodeRED <-->|ROS Bridge| ROS2
%% External Testing
PubPy <-->|Zenoh Protocol| ZenohRouter
SubPy <-->|Zenoh Protocol| ZenohRouter
%% Styling
classDef mqttService fill:#e1f5fe
classDef zenohService fill:#f3e5f5
classDef bridgeService fill:#fff3e0
classDef rosService fill:#e8f5e8
classDef managementService fill:#fce4ec
class Mosquitto,MQTTPub,MQTTSub mqttService
class ZenohRouter,ZenohSub,PubPy,SubPy zenohService
class MQTTBridge,ROSBridge bridgeService
class ROS2 rosService
class NodeRED managementService
sequenceDiagram
participant Sensor as ๐ก MQTT Publisher<br/>(Sensor Simulator)
participant MQTTBridge as ๐ Zenoh-MQTT Bridge
participant MQTT as ๐ฆ Mosquitto Broker
participant ZRouter as ๐ Zenoh Router
participant ROSBridge as ๏ฟฝ Zenoh-ROS2DDS Bridge
participant ROS2 as ๐ค ROS2 Humble
participant ZSub as ๏ฟฝ Zenoh Subscriber
participant NodeRED as ๐ด Node-RED
Note over Sensor,NodeRED: Multi-Protocol Data Distribution
%% MQTT to Zenoh Flow
Sensor->>MQTTBridge: MQTT Publish<br/>topic: sensor/temperature<br/>payload: {"temp":25,"humidity":60}
MQTTBridge->>ZRouter: Zenoh Put<br/>key: mqtt/demo/sensor/temperature<br/>value: {"temp":25,"humidity":60}
%% Zenoh to ROS2 Flow
ZRouter->>ROSBridge: Zenoh Sample<br/>key: mqtt/demo/sensor/temperature
ROSBridge->>ROS2: ROS2 Topic<br/>/bot1/sensor_data<br/>DDS Message
%% Zenoh Subscriber
ZRouter->>ZSub: Zenoh Sample<br/>Subscription Match
%% Traditional MQTT Flow
MQTTBridge->>MQTT: MQTT Publish<br/>topic: sensor/temperature
MQTT->>NodeRED: MQTT Subscribe<br/>Real-time Monitoring
%% ROS2 to Zenoh (Bidirectional)
ROS2->>ROSBridge: ROS2 Publish<br/>/bot1/cmd_vel
ROSBridge->>ZRouter: Zenoh Put<br/>key: ros2/bot1/cmd_vel
ZRouter->>ZSub: Zenoh Sample<br/>Robot Commands
Note over Sensor,NodeRED: Triple Protocol Bridge Active<br/>MQTT โ Zenoh โ ROS2
graph LR
subgraph "zenoh-mqtt-net Network"
subgraph "MQTT Ecosystem"
MP[MQTT Publisher<br/>Auto Data Generation]
MS[MQTT Subscriber<br/>:1883]
MQ[Mosquitto Broker<br/>:1883, :9001]
end
subgraph "Bridge Layer"
MBR[Zenoh-MQTT Bridge<br/>:8001, :1884<br/>Config: json5]
RBR[Zenoh-ROS2DDS Bridge<br/>:8002, :7449<br/>Namespace: /bot1]
end
subgraph "Zenoh Ecosystem"
ZR[Zenoh Router<br/>:7447, :8000]
ZS[Zenoh Subscriber<br/>Python App]
end
subgraph "ROS2 Ecosystem"
ROS[ROS2 Humble<br/>:8765<br/>Foxglove Bridge]
end
subgraph "Management"
NR[Node-RED<br/>:1880<br/>Flow Editor]
end
end
subgraph "Host Network"
HOST[Host System<br/>pub.py & sub.py]
WEB[Web Browsers<br/>Monitoring Dashboards]
end
%% Network connections
MP -.->|MQTT| MBR
MBR <-->|MQTT| MQ
MBR <-->|Zenoh TCP| ZR
RBR <-->|Zenoh TCP| ZR
RBR <-->|DDS/ROS2| ROS
ZR <-->|Zenoh| ZS
MS <-->|MQTT| MQ
NR <-->|MQTT| MQ
NR -.->|Monitor| MBR
NR -.->|Monitor| ROS
HOST <-->|Zenoh TCP<br/>localhost:7447| ZR
WEB <-->|HTTP<br/>Various Ports| NR
WEB <-->|WebSocket<br/>:8765| ROS
%% Port mappings
MQ -.->|1883:1883<br/>9001:9001| HOST
ZR -.->|7447:7447<br/>8000:8000| HOST
MBR -.->|8001:8000<br/>1884:1883| HOST
RBR -.->|8002:8000<br/>7449:7449| HOST
ROS -.->|8765:8765| HOST
NR -.->|1880:1880| HOST
The MQTT bridge service is configured with the zenoh-mqtt-bridge/config.json5 file:
- Mode: Client mode (connects to Zenoh router)
- MQTT Port: 1883 (standard MQTT port) - mapped to host port 1884
- Scope:
mqtt/demo(MQTT messages are published in Zenoh with this prefix) - Topic Filters:
- Allow: Accept all messages (
.*) - Deny: Reject system messages (
^\\$SYS/.*)
- Allow: Accept all messages (
The ROS2 bridge service is configured with the zenoh-ros2dds-bridge/config.json5 file:
- Mode: Client mode (connects to Zenoh router)
- Namespace:
/bot1(ROS2 topics are prefixed with this namespace) - ROS Domain: 0 (ROS_DOMAIN_ID for DDS communication)
- Middleware: CycloneDDS (high-performance DDS implementation)
- Topic Filtering: Denies internal ROS2 topics (rosout, parameters, _internal)
- Features: Timestamping enabled, REST API on port 8000
- Distribution: ROS2 Humble (LTS version)
- DDS Middleware: CycloneDDS with custom XML configuration
- Foxglove Bridge: Web-based visualization on port 8765
- Network Configuration: Localhost-only for security
- MQTT Publisher โ generates sensor data (
sensor/temperature) - Zenoh-MQTT Bridge โ receives MQTT message and converts to Zenoh format (
mqtt/demo/sensor/temperature) - Zenoh Router โ distributes message across the network
- Zenoh-ROS2DDS Bridge โ converts Zenoh messages to ROS2 topics (
/bot1/...) - ROS2 System โ processes robotics data and publishes commands
- Multiple Subscribers โ Python applications, MQTT clients, and ROS2 nodes receive data
- Node-RED โ monitors and visualizes entire multi-protocol flow
- Sensor data from IoT devices (MQTT) โ Robot control systems (ROS2)
- Real-time environmental data for autonomous robots
- Multi-protocol communication in smart factories
- Legacy MQTT infrastructure integration
- Modern Zenoh protocol adoption
- ROS2 robotics ecosystem connectivity
- Protocol agnostic application development
- Multi-protocol testing environment
- Performance comparison between protocols
- Development sandbox for distributed systems
- Educational platform for protocol bridging
- SCADA systems (MQTT) โ Robot controllers (ROS2)
- Edge computing with protocol translation
- Real-time monitoring and control dashboards
- IoT sensors โ Autonomous vehicles communication
- Traffic management systems
- Environmental monitoring with robotic response
๐ฆ zenoh-multi-protocol-bridge/
โโโ ๐ณ docker-compose.yaml # Main orchestration file
โโโ ๐ README.md # This documentation
โโโ ๐ pub.py # Zenoh publisher test script
โโโ ๐ sub.py # Zenoh subscriber test script
โโโ ๐ fuxa.txt # Optional FUXA SCADA configuration
โโโ ๐ mosquitto/ # MQTT broker configuration
โ โโโ config/
โ โ โโโ acl.conf # Access Control List
โ โ โโโ mosquitto.conf # Broker configuration
โ โโโ data/ # Persistent MQTT data
โ โโโ log/ # MQTT broker logs
โโโ ๐ nodered/ # Node-RED configuration
โ โโโ ๐ณ Dockerfile
โ โโโ ๐ฆ package.json
โ โโโ data/
โ โโโ flows.json # Node-RED flows
โ โโโ settings.js # Node-RED settings
โโโ ๐ ros2-humble/ # ROS2 Humble container
โ โโโ ๐ณ Dockerfile # ROS2 setup with Foxglove
โ โโโ cyclonedds.xml # DDS configuration
โโโ ๐ zenoh/ # Legacy Zenoh configurations
โ โโโ bridge-config.json5
โโโ ๐ zenoh-mqtt-bridge/ # MQTT Bridge configuration
โ โโโ config.json5 # Main MQTT bridge config
โ โโโ config.yaml # Alternative config format
โโโ ๐ zenoh-ros2dds-bridge/ # ROS2 Bridge configuration
โ โโโ ๐ณ Dockerfile # Custom ROS2 bridge container
โ โโโ config.json5 # ROS2 bridge configuration
โโโ ๐ zenoh-subscriber/ # Python Zenoh subscriber
โโโ ๐ณ Dockerfile
โโโ subscriber.py # Zenoh listener application
# Start all services
docker-compose up -d
# Follow logs for all services
docker-compose logs -f
# Check specific service logs
docker-compose logs -f zenoh-router
docker-compose logs -f zenoh-mqtt-bridge
docker-compose logs -f zenoh-ros2dds-bridge
# Run external test scripts
python3 pub.py # Terminal 1 - Zenoh publisher
python3 sub.py # Terminal 2 - Zenoh subscriber
# Web interfaces and APIs
# Node-RED Dashboard: http://localhost:1880
# Zenoh REST API: http://localhost:8000
# MQTT Bridge API: http://localhost:8001
# ROS2 Bridge API: http://localhost:8002
# Foxglove Studio: http://localhost:8765| Service | Port | Protocol | Description |
|---|---|---|---|
| Mosquitto MQTT | 1883 | MQTT | Standard MQTT broker |
| Mosquitto WebSocket | 9001 | WebSocket | MQTT over WebSocket |
| Zenoh Router | 7447 | Zenoh | Main Zenoh routing |
| Zenoh REST API | 8000 | HTTP | Zenoh REST interface |
| MQTT Bridge | 1884 | MQTT | Bridge MQTT interface |
| MQTT Bridge API | 8001 | HTTP | Bridge configuration API |
| ROS2 Bridge | 7449 | Zenoh | ROS2-Zenoh bridge port |
| ROS2 Bridge API | 8002 | HTTP | ROS2 bridge REST API |
| Foxglove Bridge | 8765 | WebSocket | ROS2 web visualization |
| Node-RED | 1880 | HTTP | Flow editor and dashboard |
# Terminal 1: Subscribe to all Zenoh traffic
python3 sub.py
# Terminal 2: Publish MQTT message (auto-bridge to Zenoh)
mosquitto_pub -h localhost -p 1884 -t "robot/cmd" -m '{"linear":1.0,"angular":0.5}'
# Terminal 3: Monitor ROS2 topics (if ROS2 tools installed locally)
# This will show bridged data in ROS2 namespace /bot1/# Monitor MQTT traffic
mosquitto_sub -h localhost -p 1883 -t "sensor/#" -v
# Monitor specific Zenoh keys
# Use the web interfaces for real-time monitoring:
# - Node-RED: http://localhost:1880 (create custom dashboards)
# - Foxglove: http://localhost:8765 (ROS2 data visualization)This project represents a comprehensive solution for modern distributed systems requiring seamless communication between IoT devices (MQTT), high-performance messaging (Zenoh), and robotics platforms (ROS2). It's designed for developers, researchers, and engineers working on next-generation autonomous systems, smart manufacturing, and IoT-robotics integration.
