• Is it possible for the espruino to check if it is connected to a computer, if not, don't output text or just periodically clear the buffer?

    That's what it does - hence why it works on a power bank. However it can't easily tell if an application is running on the PC or not, which is the frustrating bit :(

    Does the current mqtt connection get terminated if the Pico looses power?

    Yes - however what might have happened is when you save, it basically just stops everything right there, then kills all the socket connections. It means that the connection is killed, but by that point it's not running and JavaScript, so the JS never gets told the connection has been destroyed and so when it loads again it tries to use that connection and gets the error.

    I guess the MQTT library could trap that error and then decide that the socket had closed and tidy up.

  • I guess the MQTT library could trap that error and then decide that
    the socket had closed and tidy up.

    Is this something that will need to be implemented into the Espruino firmware or is this something that I would need to code into the IDE? Either way I wouldn't know where to begin to "trap the error"

About

Avatar for Gordon @Gordon started