@Gordon : Closing and creating the server does not seem to resolve the jam. I made the inactivity checker like this:
function checkInactivity() { if (Date.now() - lastPageHandled > 20000) { clearInterval(checkInactivityIntervalId); lastPageHandled = Date.now(); console.log("Inactivity detected restarting webserver..."); if (server) { server.close(); } 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; } } }
Should I do some deeper cleanup/reset/disconnection than just recreating the http server?
Also I get these errors during the restart:
>Uncaught Error: CIPSERVER failed (Timeout) at line 1 col 53 throw Error("CIPSERVER failed ("+(a?a:"Timeout")+")"); ^ in function called from system
@samppa started
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 : Closing and creating the server does not seem to resolve the jam.
I made the inactivity checker like this:
Should I do some deeper cleanup/reset/disconnection than just recreating the http server?
Also I get these errors during the restart: