Avatar for user111618

user111618

Member since Apr 2020 • Last active May 2020
  • 1 conversations
  • 12 comments

Most recent activity

    • 21 comments
    • 636 views
  • in ESP8266
    Avatar for user111618

    So according to this issue, I guess flash must have an amount of the abandoned data before running compact, if not, the compact function will cause data loss.

  • in ESP8266
    Avatar for user111618

    To reproduce it, you need to:
    (1).Get a string, length about 1000(I download string from WebSocket).
    (2).

    fs = require("Storage");
    fs.erase("aName");
    fs.write("aName", thatString);
    

    (3). Code in .boot0:

    if(fs.getFree()<4096) fs.compact();
    

    if the free space did less than 4096 and compact() has run and reboot itself after compact, then run fs.compact(); again, if those actions right, you will lost all data in flash.

  • in ESP8266
    Avatar for user111618

    I mean, I don't FOTA, so I would like to disable it on 01s(1mb board) and NodeMCU(12F). Now, I did it on 01s but failed on NodeMCU by using different firmware, but two firmware both added argument NO_FOTA=1.
    Are there any methods to do this on NodeMCU? Thanks.

  • in ESP8266
    Avatar for user111618

    I made a version using your arguments and flashed the 01s, but the issue still happened when I do the same actions. But I do get 196608 space like 4MB board.
    And, could I ask why the NO_FOTA=1 don't work for 4MB board, like NodeMCU, I can't still use FOTA on it. My purpose is to get more space beyond 196608 on 4MB board, thank you.

  • in ESP8266
    Avatar for user111618

    I have NodeMCU(32MB version), but the size(physical) is too big. And my project only needs 2 IOs.

    Besides, this happened when I tried to require("Storage").compact();, the free space on the flash at least has 60%, and my purpose is to compact it myself instead of automatically(when the free space run out), cause that will lead to data loss.

    And I don't know how to compile it myself, I cloned the source and tried to compile, but I have no idea where I could find the hex file, I am noob. :D.

    But anyway, thank you for the reply.

  • in ESP8266
    Avatar for user111618

    and I haven't tried this on nodemcu, but I guess I will get the same result.
    So someone please tell me how to deal with it, is my action wrong? Or just an issue in espruino, I don't want to take it out to code or upgrade after I set it into a dishwasher. Thanks!

  • in ESP8266
    Avatar for user111618

    @MaBe @Raik I tried to update to 2.05 and run some tests. The result is this issue does not vanish.
    I have code in .boot0 which is

    if(fs.getFree()<4096) fs.compact();
    

    and I can see espruino will compact and restart when the free space down below 4096, then I run fs.compact() again in console after it restarted, and after reboot, all data were lost. fs.getFree() shows me 16384 on esp8266-01s, and fs.list() has an empty array as result.

  • in ESP8266
    Avatar for user111618

    Yeah, I will try that, thank you.

Actions