Closed josef2600 closed 1 year ago
and for partition scheme, use any SPIFFS
partition for project, then use app for formatting and creating and uploading LittleFS
partition to esp. the app link:
https://github.com/lorol/arduino-esp32fs-plugin
the
SPIFFS
has been out of support for a long time and has many problems. you can change it toLittleFS
easily.
replace all
SPIFFS
withLittleFS
. and replace all#include <SPIFFS.h>
to#include <LittleFS.h>
.you can do the same for
FFat
too.the only change in code is
freeBytes()
. for this you can do thisLittleFS.totalBytes() - LittleFS.usedBytes()
.and that is that!
the speed is 4 to 5 times faster to
LittleFS
. and it is resistance to many problems, included power lost and corruption of files. and probably to badsectors as well. and the amount of used ram is very low. specially compare to FAT, it is nothing! fat uses more than 45 KB more and when the page is open, it uses tow time the space in ram per file. in general it is better than fat, except in speed. it doesn't make a lot of different though! it is microcontroller anyway!
LittleFS
is included in the ESP Arduino boards and doesn't need any extra lib. it is updates with board manager.
That looks like a really good and easy enough improvement. Could you open a PR with only the fix to support LittleFS ?
I have solve this problem,and I port this project to platformio system. link: https://github.com/lyxer123/ESP32-Automation
the
SPIFFS
has been out of support for a long time and has many problems. you can change it toLittleFS
easily.SPIFFS
withLittleFS
. and replace all#include <SPIFFS.h>
to#include <LittleFS.h>
.FFat
too.freeBytes()
. for this you can do thisLittleFS.totalBytes() - LittleFS.usedBytes()
. and that is that! the speed is 4 to 5 times faster toLittleFS
. and it is resistance to many problems, included power lost and corruption of files. and probably to badsectors as well. and the amount of used ram is very low. specially compare to FAT, it is nothing! fat uses more than 45 KB more and when the page is open, it uses tow time the space in ram per file. in general it is better than fat, except in speed. it doesn't make a lot of different though! it is microcontroller anyway!LittleFS
is included in the ESP Arduino boards and doesn't need any extra lib. it is updates with board manager.