Forrest logo
back to the mosquitto_sub tool

mosquitto_sub:tldr:7d3eb

mosquitto_sub: 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-#}
try on your machine

The command you provided is used to subscribe to MQTT topics using the mosquitto_sub command-line utility. Here's a breakdown of each part of the command:

  • mosquitto_sub: This is the command to run the mosquitto_sub utility, which is a MQTT subscriber provided by the Mosquitto MQTT broker.

  • -v: This flag enables verbose output, which means it will display more information in the terminal while subscribing to topics.

  • -h "iot.eclipse.org": This option specifies the MQTT broker hostname or IP address to connect to. In this case, it connects to the broker hosted at iot.eclipse.org.

  • -p 1885: This option specifies the port number to connect to on the MQTT broker. In this case, it connects to port 1885.

  • -t ${\$SYS-#}: This option specifies the topic to subscribe to. ${\$SYS-#} is a placeholder that represents a topic filter. It is likely an example topic filter, and you should replace it with an actual topic filter of your interest.

When you run this command, it connects to the MQTT broker at iot.eclipse.org on port 1885, subscribes to the specified topic (\$SYS-#), and displays any received messages in a verbose manner (topic and payload) on the terminal.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the mosquitto_sub tool