I am doing my testing using NodeMcu 0.9.6 (Doit.am Version) build 20150701 powered by Lua 5.1.4
I've used MQTT and everything works as expected except I noticed some times the MQTT module would loose it's connection with the broker but NOT notify its internal m:on("offline", function(con) function so effectively the lua interpreter and from there -- the script do NOT know the low-level client has lost connection to the broker. The broker knows and publishes /LWT but that doesn't do me any good since I have a frozen client so to speak. The only way out is a reboot. Interestingly if I try to manually (from the console) reconnect I get stdin:1: already connected which clearly is NOT credible.
I then setup more of a lab testing environment where I can block the IP to the broker at will in order to facilitate testing. That lead to a sad results: I can make it loose connection to the broker in about 15 seconds and from that point forward the client is frozen. Obviously re-establishing connectivity to the broker does not fix this situation since all along the thing believes that it is connected so it never kicks the re-connect function. By "loose connectivity" I mean it stops receiving messages on the subscribed feeds and it acts as if published messages go just fine except no sign of those at the broker. For all intents and purposes there's no meaningful communication any longer between the MQTT client and the broker.
Can anyone share observations specifically on the scenarios where MQTT looses connectivity to the broker and effectively renders the module frozen in terms of MQTT functionality?
Thank you