From fb997092115642bc3ac796da3f60ca5ea450a2a8 Mon Sep 17 00:00:00 2001 From: Mpho Mphego Date: Thu, 14 Feb 2019 23:37:17 +0200 Subject: [PATCH] mosquitto_sub: add page (#2718) --- pages/common/mosquitto_sub.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/common/mosquitto_sub.md diff --git a/pages/common/mosquitto_sub.md b/pages/common/mosquitto_sub.md new file mode 100644 index 0000000000..34ff239cea --- /dev/null +++ b/pages/common/mosquitto_sub.md @@ -0,0 +1,15 @@ +# mosquitto_sub + +> A simple MQTT version 3.1.1 client that will subscribe to topics and print the messages that it receives. + +- Subscribe to the topic `sensors/temperature` information with Quality of Service (`QoS`) set to 1. (The default hostname is `localhost` and port `1883`): + +`mosquitto_sub -t {{sensors/temperature}} -q {{1}}` + +- Subscribe to all broker status messages publishing on `iot.eclipse.org` port `1885` and print published messages verbosely: + +`mosquitto_sub -v -h "iot.eclipse.org" -p 1885 -t {{\$SYS/#}}` + +- Subscribe to multiple topics matching a given pattern. (+ takes any metric name): + +`mosquitto_sub -t {{sensors/machines/+/temperature/+}}`