mosquitto_sub Command Examples

A simple MQTT version 3.1.1 client that will subscribe to topics and print the messages that it receives. More information: https://mosquitto.org/man/mosquitto_sub-1.html.

mosquitto_sub {{[-t|--topic]}} {{sensors/temperature}} {{[-q|--qos]}} {{1}}

mosquitto_sub {{[-v|--verbose]}} {{[-h|--host]}} "iot.eclipse.org" {{[-p|--port]}} 1885 {{[-t|--topic]}} {{\$SYS/#}}

mosquitto_sub {{[-t|--topic]}} {{sensors/machines/+/temperature/+}}