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);
}
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
@Gordon Thanks for the tip, but it did not help.
I still get this at server startup:
Here is the inactivity checker with 2 sec delay for server start: