• I've recently encountered this problem, in which I sometimes try to save some data (come configurations, no more than 100 characters in total) in a file using this function fs.writeFile(), but after like 2 or 3 tries, it just stop working, and the function returns false every time...

    I also tried to use the E.openFile() and File.close() pattern, but sadly I'm getting the same results. Does anyone else have this problem? I'm using firmware version 1.95 btw

  • Hmm, 1.95 is old, better upgrade and try again.

  • Same issue in 2.14. I think the filesystem just crashes silently if there are is not enough heap or too few variables.
    A webserver serving multiple files in parallel can crash the filesystem, or a webserver and some other background processes can lead to a crash (using E.pipe).
    It doesn't crash by repeated read access, if there's a sufficient free memory available. Storage is much more stable (require('Storage')).
    Disclaimer: My experience comes from the ESP8266 with a custom firmware build. Yet, I'm pretty sure there are some undiscovered bugs in the filesystem (require('fs')).

  • I only use Storage. Can you add a sample to reproduce the crash, or just add infos to https://github.com/espruino/Espruino/iss­ues/1777

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

fs.writeFile() and fs.readFile() not working properly in ESP32

Posted by Avatar for user139113 @user139113

Actions