You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • The error during restart is because the server won't have been able to close instantly, but you are trying to recreate it on basically the next line. It's also possible the ESP8266 is taking a while to try and close all the active connections to the server...

    You could try:

    if (server) server.close();
    server=undefined;
    setTimeout(function() {
        server = http.createServer(pageHandler);
        ....
    }, 1000);
    
About

Avatar for Gordon @Gordon started