@Gordon I' ve found something to improve in MQTT module.
In some cases call of underlying require("net").connect(...) throws exception. mqo.emit('disconnected') is not called in such case. So general reconnection algorithm (reconnect on disconnected) is not working.
So may be it is a good idea to catch the exception in MQTT module and emit disconnected event:
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon I' ve found something to improve in MQTT module.
In some cases call of underlying require("net").connect(...) throws exception. mqo.emit('disconnected') is not called in such case. So general reconnection algorithm (reconnect on disconnected) is not working.
So may be it is a good idea to catch the exception in MQTT module and emit disconnected event:
It will simplify usage of MQTT module.