mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-02 20:59:05 +00:00
The mqttc demo under example path can not support mbedtls api. Because of the MQTT-C source code already contains many types of link examples, so we added the corresponding makefile to support mbedtls mqttc connections publisher and posix mqttc connections publisher and subscriber. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| Kconfig | ||
| Make.defs | ||
| Makefile | ||
| mqttc_pub.c | ||
| README.md | ||
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".