This is a project providing Source and Sink plugins for MADS.
The plugins provides a bridge between a MQTT network and the MADS network. Compilation results in two plugins:
mqtt2mads.plugin: A Source plugin that subscribes to a MQTT topic and publishes the received messages to the MADS network.mads2mqtt.plugin: A Sink plugin that receives messages from the MADS network and publishes them to a MQTT topic.
This plugin has been updated for MADS v2
The system must provide libmosquitto and libmosquittopp libraries and development files.
Currently, the supported platforms are:
- Linux
- MacOS
Linux and MacOS:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX="$(mads -p)"
cmake --build build -j4
sudo cmake --install buildThe plugin supports the following settings in the INI file:
[mqtt2mads]
broker_host = "localhost" # MQTT broker host
broker_port = 1883 # MQTT broker port
silent = true # If true, no log messages are printed
QoS = 0 # MQTT Quality of Service
topic = "#" # MQTT topic to subscribe to
[mads2mqtt]
broker_host = "localhost" # MQTT broker host
broker_port = 1883 # MQTT broker port
silent = true # If true, no log messages are printed
QoS = 0 # MQTT Quality of Service
topic = "mads" # MQTT topic to publish toAll settings are optional; if omitted, the default values are used.
The plugin comes with an executable demo that can be used to test the plugin. The demo connects to a broker running on localhost, subscribes to the MQTT topic # and prints the received messages to the console.
An optional first argument is the address of a different broker (default localhost). An optional thirs argument is the broker port (default 1883)