nuttx-apps/examples/mqttc/README.md
Abdelatif Guettouche 6ae35ffc71 examples: Add an MQTT-C example.
Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-03-29 08:52:14 -05:00

576 B

This is a simple MQTT publisher example using MQTT-C

By default it publishes to the "test" topic and exits. Default behaviour including, host, port, topic, message and loop count can be changed through different arguments.

To test: From the host start an MQTT broker and subscribe to the "test" topic. Here mosquitto is used:

mosquitto&
mosquitto_sub -t test

Make sure that mosquitto is configured in local mode only.

From the nsh:

Launch the built-in app mqttc_pub specifying the host:

mqttc_pub -h HOST

The target will publish the message "test".