• Is this something that will need to be implemented into the Espruino firmware

    It'd be done in the MQTT.js source code. I've just made some tweaks - please can you try using require("https://raw.githubusercontent.com/espruino/EspruinoDocs/master/modules/MQTT.js") in your code instead of just MQTT and see if that works? That'll use the version from GitHub rather than the one on the website.

    However the issue would seem to be that you were uploading your code, running onInit() manually, and then calling save()? That could likely cause you other issues (like having multiple instances of the MQTT library kicking around), so I wonder how much it's worth bloating the MQTT lib to try and avoid that.

  • require("https://raw.githubusercontent.c­om/espruino/EspruinoDocs/master/modules/­MQTT.js")

    @Gordon. Before I tested your recommendations I unplugged the ethernet cable to my raspberrypi. waited a few moments and I received MQTT disconnected... reconnecting. which stayed there for a few more moments. Then I received "Uncaught Error: This socket is closed.".

    I then reconnected everything and uploaded the code with the new require. Everything connected. Removed the lan cable again..... received the MQTT disconnected message. Waite a few more moments and no Error :-)

About

Avatar for d0773d @d0773d started