nuttx-apps/examples/mqttc
simbit18 75ddde9c56 apps/examples/mqttc/Makefile: Add missing Apache Foundation copyright header
Add missing Apache Foundation copyright header
2023-04-03 16:14:35 +03:00
..
Kconfig examples: Add an MQTT-C example. 2021-03-29 08:52:14 -05:00
Make.defs examples: Add an MQTT-C example. 2021-03-29 08:52:14 -05:00
Makefile apps/examples/mqttc/Makefile: Add missing Apache Foundation copyright header 2023-04-03 16:14:35 +03:00
mqttc_pub.c apps: unify FAR attribute usage across apps 2022-04-05 00:55:22 +08:00
README.md mqttc example: provide sane hostname default to avoid crash 2021-03-30 14:51:32 -05:00

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 not 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".