• We're going properly off-topic here! New thread?


    @the1laz how does node.js handle requesting certain versions? Is it all done via npm - or can you require("foo@1.2")?

    The issue for me at the moment is that there is no versioning on the modules. I'm not 100% sure there should be either as Git commits maybe make more sense... Someone could easily come up with a historic modules plugin for the Web IDE that let you choose from a list of modules, and then let you choose the git commit from a list (which could also show date and commit message) or maybe even add your own URL if you wanted to do some development work.


    On topic again :)

    @tve I totally agree here. Espruino's about trying to bring the simplicity of scripting on desktop to an MCU, so dealing with WiFi disconnect shouldn't be something you have to worry about.

    Making the connection persistent (at least between soft resets) is vital if there's going to be any OTA programming too.

    Only thing I see with connection at startup is it's very likely that someone will do function onInit() { require('http').get("http://foo/i_am_alive); }.

    In that case, what do you do? When the ESP8266 boots, it might be trying to connect, but it almost certainly won't have connected when onInit runs.

    ... and you can't delay onInit - it's very likely someone might want to display Connecting... on an LCD or something.

    So you could delay executing any pending network requests until you have a connection I guess? It all gets a bit complicated.

    Also, connecting to a WiFi network shouldn't really involve a write to flash memory (but it would have to if it were to be persistent?).

    I'd be tempted to say:

    • After connection, WiFi should stay connected between soft resets
    • On a reboot, WiFi isn't connected and needs to be enabled
    • (possibly) if the user does a save() while WiFi is connected, it could auto-connect at power-on?
About

Avatar for Gordon @Gordon started