MQTT adapter with http/xml endpoint
- Install python 2.7 + pip
- Install the required packages by running
pip install cherrypy dicttoxml paho-mqtt
- Configure the connection and topics in
config.json
Run with python mqtt_xml.py
(config.json
must be in the run directory). The last 5 messages sent to each topic is available in xml format on localhost:8080
. The number of messages kept can be configured with the history
parameter in config.json
. Runtime modifications to subscribed topics is not possible.
Note that the program requires a local mqtt broker to be run as-is. The broker mosquitto
is suitable for this purpose.
Password protected MQTT brokers can be connected to by adding the parameters username
and password
to mqtt_connection
in config.json
.