Overview of the Brokerless MQTT Example
masterThe Brokerless MQTT Example demonstrates how to run two independent MQTT brokers (using the mosquitto component) on two separate ESP32 devices and synchronize them over a peer-to-peer (P2P) connection. This allows MQTT connectivity between two private networks without requiring a central cloud broker.
Key Concepts
- Dual Brokers: Each ESP32 acts as a local MQTT server for its own IoT network (served via Wi-Fi SoftAP).
- P2P Synchronization: The two brokers are synchronized as if they were a single network. Messages published on one broker are automatically forwarded to the other.
- NAT Traversal: The connection uses either
libjuice(ICE-UDP) oresp-webRTCto establish a direct connection between devices located behind different NATs.