These scripts are scripts that I’ve written while experimenting with MQTT.
You are welcome to download and use if you want to. Get them from the download Page.
Grateful any comments/problems or requests.
- Simple data Logger Class
- MQTT Ping – Test if broker is up
- MQTT- Monitor -Monitors Selected topics
- Mosquitto Comment Stripper
- Retained Message Scripts
Simple MQTT Data Logger Class
MQTT Ping – Test if broker is up.
Type python mqtt-ping.py -h
- 1.use -c 10 for 10 pings
- 2. Use -d 5 for 5 second delay between pings
- use -s to only print end result
MQTT- Monitor -Monitors Selected topics
Type python mqtt-monitor.py -h
- Can add multiple topics by repeated use of -t option
- Use -v no to display only changed messages
- Use -c 100 to stop after 100 seconds
- Use -q value (0 or 1 or 2) to set the QOS of all topics
- Use -d yes to turn on debugging mode
3.Mosquito Config File Comment Stripper
If you are using the default mosquitto.conf file with all of the comments then finding your settings can be a little tricky.
This script prints the settings from a config file
- -f filename – check this file
Retained Message Scripts
This script will list topics that have a retained message and optionally delete the retained message. Can be use from the command prompt by supplying options.
Run with the -h option to list options.
>python retained-messsage.py -h
This script will create retained messages from a list of topics. This is useful when testing
The script can be run from command prompt but it is easier to edit, and run in the IDE or from the command prompt with no options.
Part of the MQTT-Script-tools package on downloads page