Loxberry
Loxberry copied to clipboard
MQTT to Plugin forwarder
Implementation of a method to forward mqtt data to a Plugin without need of an mqtt listener in the plugin.
- The forwarder would listen to a static subscription for that LoxBerry.
- Subtopic would be the plugin name
- All subs behind the plugin name get forwarded to a handler of the Plugin. This handler is provided by the Plugin author.
- The handler would be a script with fixed name in the Plugin directory and executed by Shell from the Forwarder (Shebang based).
- The script from the Plugin can use the data in every way (call an url, send data further to the main script by udp, change a Config file, send any data to mqtt)
Challenges:
- External scripts need to run async in own process or thread.
- Dying scripts should not kill the Forwarder
- It possibly needs a queue (one script execution per Plugin at once), therefore the forwarder needs to monitor the script execution state