How do I subscribe to all topics of a MQTT broker
Subscribing to #
gives you a subscription to everything except for topics that start with a $
(these are normally control topics anyway).
It is better to know what you are subscribing to first though, of course, and note that some broker configurations may disallow subscribing to #
explicitly.
You can use mosquitto_sub
(which is part of the mosquitto-clients
package) and subscribe to the wildcard topic #
:
mosquitto_sub -v -h broker_ip -p 1883 -t '#'