2018 Jan 07, 06:46 PM
As you might know I want to make the mqtt plugin more reliable on whether or not the mqtt broker is available. The problem (if one may speak of a problem ) is that when the broker is not available the plugin never ever attempt to connect to it on a later moment.
I would like to change this and make it more robust. There are however different approaches possible to do this. The job as such is easy, just try to connect once every x seconds until the broker is reachable. My design thoughts are on which this should be done in a separate thread or, and this is unfortunately to my knowledge not (yet) possible, via a kind of trigger/heartbeat call from the framework to the plugin so that inside the plugin this could be handled.
Question; Is there a way to periodically get a trigger/heartbeat from the SIP framework (e.g. from the timer_loop) to wake-up the plugin to do "some work"? With "some work" I not only mean to start the mqtt connection but also other things like reading lots of sensors om which the plugin can decide to alter the irrigation schema.
Please let me know if there are any thought on this.
Thanks,
--Gerard
I would like to change this and make it more robust. There are however different approaches possible to do this. The job as such is easy, just try to connect once every x seconds until the broker is reachable. My design thoughts are on which this should be done in a separate thread or, and this is unfortunately to my knowledge not (yet) possible, via a kind of trigger/heartbeat call from the framework to the plugin so that inside the plugin this could be handled.
Question; Is there a way to periodically get a trigger/heartbeat from the SIP framework (e.g. from the timer_loop) to wake-up the plugin to do "some work"? With "some work" I not only mean to start the mqtt connection but also other things like reading lots of sensors om which the plugin can decide to alter the irrigation schema.
Please let me know if there are any thought on this.
Thanks,
--Gerard