• Ahh good shout, seem I can use the standard MQTT library even if there's an error. So now instead of waiting for a successful connection (which never comes) I just run my subscribes in the on error handler instead.

    mqtt.on("error", (err) => {
        console.log("error", err);
        console.log("mqtt connected");
        lightsOff();
        lightsOn({r: 0, g: 128, b: 0}, speed);
        mqtt.subscribe("espruino/rgb");
        mqtt.subscribe("espruino/speed");
      });
    

    Doesn't matter that I receive an error NaN, everything works as expected afterwards. Thanks for supporting me on this Gordon its good enough for a home automation project I'm working on. Looking forward to getting the next Espruino you put out in the future.

About

Avatar for Coder2012 @Coder2012 started