• It were the watchdog timer doing the reset.
    This works.

    var chk=1024;
    var tdata=new Uint8Array(chk);
    var i=0;
    
    tdata.fill(0x30);
    
    function draino(){
    }
    
    D=new draino();
    
    D.on('drain',function(){
     console.log(i);i++;
     console.log(E.toString(tdata));
     process.memory(); //fails if this is commented
    });
    
    setInterval(function (){
     D.emit('drain');
    },100);
    

    The emit and drain are simulating serving data to a socket.
    Code for doing that would obsfucate the issue a bit more.

    Gordon has addressed the problem shown by commenting out the process.memory, but his fix isn't in the published 1v95 code yet.

    Thanks for the tip about the watchdog. The ESP8266 Espruino is a different paradigm from the Pico. Is there a similar watchdog in the ESP32 Espruino?

About