settimeout for mqtt socket
Problem statement: If there are any network issues, mqtt will block on socket non-deterministically. In such cases, only way to come out of the blocking is to reboot using watch dog timers. This is costly solution.
Solution: Alternatively, developer can set the max timeout for the socket. Upon any issue, mqtt lib will throw exception. Developer can catch it, take right actions like, restarting the task without rebooting the whole device.
This brings determinism and gives the control to developer to choose right time for her/his use case. This fix works for async applications too.
(I plan to make whole umqtt async compatible.)
I plan to make whole umqtt async compatible.
See https://github.com/tve/mqboard/tree/master/mqtt_async
I plan to make whole umqtt async compatible.
See https://github.com/tve/mqboard/tree/master/mqtt_async
Thank you for the link. Is it going to be part of the micropython? [https://github.com/micropython/micropython-lib/tree/master/micropython] If so, it will have higher visibility.
Thank you for the link. Is it going to be part of the micropython?
Actually, this is a better version: https://github.com/peterhinch/micropython-mqtt
Eventually we would like to add links from this repository to external/third-party libraries like the above, to make them easier to install, and have better visibility.
I plan to make whole umqtt async compatible.
See https://github.com/tve/mqboard/tree/master/mqtt_async
This will be a lot helpful to all those who use async. Async really shines as it gives better control to developer over threads/processes in terms of scheduling. This in turn solves many locking issues that are common in threads. in anycase, async mqtt blends nicely into all async applications.