This is a simple tool that allows subscribing to an arbitrary number of MQTT topics as well as publishing to an MQTT broker using a command line utility.
The configuration file that's sourced by both tools is supplied in JSON format:
{
"broker" : {
"broker" : "example.com",
"port" : 1883
},
"auth" : {
"user" : "exampleuser",
"password" : "examplepassword"
}
}
Dumping as plain text:
$ mqttsubscribe --cfg /path/to/configfile --topic "#"
Dumping as JSON:
$ mqttsubscribe --cfg /path/to/configfile --topic "#" --json
$ mqttsubscribe --cfg /path/to/configfile --topic "quakesr/experiment/camera/ebeam/raw/stored" --json
$ mqttpublish --cfg /path/to/configfile --topic "examples/testtopic" --payload "Test payload"