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:
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:
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.
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:
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:
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!!