MQTT is open, simple and low overhead communication protocol for sending messages between many clients which are connected to the central MQTT broker.
Every message contains two parts - topic and payload.
Topic describes content of the message.
Topic name contains "directory" structure - each level is divided with symbol
Topic can be
MQTT server is called the broker and clients can publish messages and subscribeto different topics.
The task of MQTT broker is to deliver messages from publishers to the subscribers.
You can use the
+ symbol to subscribe to all topics in the current topic (
# symbol to subscribe to all sub-topics (
BigClown is using open-source Mosquitto MQTT broker. All messages are routed through MQTT broker. This allows further expansion of BigClown system.
When you connect the Core Module or Radio Dongle with connected remote node, you can display all incoming messages using
mosquitto-cli package by typing:
mosquitto_sub -t "#" -v
pi@hub:~ $ mosquitto_sub -t "#" -vnode/836d19821664/thermometer/0:1/temperature 24.69node/836d19821664/thermometer/0:1/temperature 24.94node/836d19821664/push-button/-/event-count 5
You can use BigClown Playground for subscribing and publishing MQTT messages. You can do it in Messages tab.
Subscribe mode is default mode when you open Messages tab in Playground. In beginning you have already subscribed
node/# topic. We can try to send MQTT messages with payload
test message and topic
node/test by typing following command.
mosquitto_pub -t "node/test" -m "test message"
Now you can see test message in Playground message window.
You can also publish message from Playground. Just switch to Publish mode, type topic and payload and Publish your message. You can see it in message window on top of Messages tab.