examples/networking/mqtt/paho-mqtt/README.md
This application demonstrates the usage of the Eclipse paho MQTT package in RIOT.
For using this example, two prerequisites have to be fulfilled:
You need a running MQTT broker like Mosquitto broker for example. Take a look at Mosquitto Broker. Check online any guide that will help you setting up the broker into some port (a). For example this one for debian base linux users How to setup a Mosquitto MQTT Server and receive data.
Your RIOT node needs to be able to speak to that broker at the same port you set in 1.
native on Linuxsudo ./dist/tools/tapsetup/tapsetup -c 1Run on RIOT's root directory:
make -C examples/paho-mqtt all term
To connect to a broker, use the con command:
con <broker ip addr> [port] [clientID] [user] [password] [keepalivetime]
sub with the topic name as parameter and a QoS
level between 1 to 3, e.g.sub hello/world 2
unsub with the topic name e.g.unsub hello/world
pub command with a QoS level between 1 to 3:pub hello/world "One more beer, please." 2