You are reading a single comment by @samppa and its replies. Click here to read the full conversation.
  • @Gordon Thanks for the tip, but it did not help.

    I still get this at server startup:

    Inactivity detected restarting webserver...
    Webserver restarted.
    >Uncaught Error: CIPSERVER failed (Timeout)
     at line 1 col 53
    throw Error("CIPSERVER failed ("+(a?a:"Timeout")+")");
                                                        ^
    in function called from system
    

    Here is the inactivity checker with 2 sec delay for server start:

    function checkInactivity() {
      if (Date.now() - lastPageHandled > 60000) {
        clearInterval(checkInactivityIntervalId)­;
        lastPageHandled = Date.now();
        // Close server and reopen it.
        console.log("Inactivity detected restarting webserver..."); 
        if (server) {
          server.close();
        }
        server=undefined;
        setTimeout(function() {
          server = http.createServer(pageHandler);
          if (server) {
            console.log("Webserver restarted.");
            checkInactivityIntervalId = setInterval(checkInactivity, 2000);
            server.listen(80);
          } else {
            console.log("ERROR createServer() returned false."); 
            console.log(err); 
            setTimeout(function() { reboot(); }, 5000);
            return;
          }
        }, 2000);
      }
    }
    
About

Avatar for samppa @samppa started