If you use console.log in a program but disconnect the program execution is blocked when the console buffer is full.
For example:
// Console.log blocks LED On/Off flashing when
// disconnected
var l=0;
myinterval=setInterval(function () {
digitalWrite(LED1,l=!l);
}, 1000);
var i=0;
setInterval(function(){
console.log(i);
i++;
},200);
// load program
// LED is pulsing On an dOff
// Console is displaying the count in i
// Disconnect the WebIde
// The LED action stops
// Reconnect the WebIde
// Buffered count is displayed
// LED resumes action
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.
If you use console.log in a program but disconnect the program execution is blocked when the console buffer is full.
For example:
and the output:
If you are using console.log to show the connection status etc. of a WiFi connection, disconnecting the WebIde will block the server.
Not complaining about this, just posting to let others know about this gotcha.