• First off, thank you to everyone who has contributed to the espruino project, I love it.

    I'm running into an issue using an esp32 where, after multiple calls to fs.readFile / fs.writeFile, E.openFile starts returning undefined, and both fs.readFile / fs.writeFile start returning false. Below is an example of fs.writeFile returning false after only 10 writes:

    Failure of writeFile

    E.srand(4546455454545454);
    
    
    var fs = require('fs');
    
    function writeData(i){
      if(i < 100){
       var data = Math.random().toString();
       var name = `file_${i}`;
       var res = fs.writeFile(name, data);
       if(res){
         console.log(`wrote... ${name}, ${data}`);
         setTimeout(function(){
           writeData(i + 1);
         }, 100);
       }
       else{
         console.log(`did not write!, ${name}, ${data}`);
       }
      }
    }
    
    writeData(0);
    

    I don't think there are any js functions exposed to inspect the situation that is causing this, but please let me know if there is. Also, I'm using a setTimeout above so I don't hit the watchdog timeout, basically simulating if I typed this into the espruino IDE 9 times. below is version information:

    {
      "VERSION": "2v00",
      "GIT_COMMIT": "ff35517",
      "BOARD": "ESP32",
      "FLASH": 0, "RAM": 524288,
      "SERIAL": "240ac4af-68e4",
      "CONSOLE": "Serial1",
      "MODULES": "Flash,Storage,heatshrink,fs,net,dgram,t­ls,http,NetworkJS,Wifi,TelnetServer,cryp­to,neopixel",
      "EXPTR": 1073483756 }
    

    Also, I've tried variations of this with E.openFile thinking that I could circumvent the issue but the same problem occurs.

    Thank you in advanced for the help!!

About

Avatar for mike_k @mike_k started