• @Gordon:

    ESP8266 NodeMCU 1.0 (ESP-12E)

    Yes, the issue is the event-driven nature of JS. I was looking for a way to write simpler code since there isn't a reliable async or Promise flow control library to use; I'll have to work with flags then. Some questions:

    1. Do you know if http.createServer() returns a new instance with a listener every time it's invoked like node.js? Or is there code beneath the hood that will check for an existence of a http.Server object? I did a quick test to invoke http.createServer() twice in succession and there was no namespace conflicts or EADDRINUSE errors, nor did the callback trigger twice upon a POST to my ESP8266.

    2. Does the Wifi class trigger an event when it has connected to a network? Something like Wifi.on('connected', function(){...}) -- Nevermind, found the docs: http://www.espruino.com/Reference#t_l_Wi­fi_connected

    3. Is there a way to save a key/value pair to flash? (or just any variable)

About

Avatar for pthieu @pthieu started