EspBootstrap icon indicating copy to clipboard operation
EspBootstrap copied to clipboard

SPIFFS is deprecated and should be replaced by LittleFS

Open jostsalathe opened this issue 3 years ago • 9 comments
trafficstars

See https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#spiffs-deprecation-warning.

That page claims it should be relatively easy to switch over since they "share a compatible API"...

jostsalathe avatar Feb 19 '22 00:02 jostsalathe

Users should should consider that switching from SPIFFS to LittleFS will cause loss of data on the file system since the two "have incompatible on-flash implementations".

jostsalathe avatar Feb 19 '22 00:02 jostsalathe

I like spiffs and have no plans to switch in the nearest future.

arkhipenko avatar Feb 19 '22 00:02 arkhipenko

The main reason why I like spiffs is I can create the filesystem on a PC and upload it to the MC. Is there a similar script that can create LittleFS file on a PC that could be later flashed into a MC.?

arkhipenko avatar Feb 19 '22 00:02 arkhipenko

Apparently, there is if I read this correctly: https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system

Edit: ESP8266LittleFS is the Name.

I must admit, I haven't tested that tool, though.

I also don't know how all this may affect the ESP32, to be honest. I only used EspBootstrap on ESP8266 for now.

jostsalathe avatar Feb 19 '22 01:02 jostsalathe

Originally I noticed the compilation to fail and saw the last output of the Arduino build which was the deprecation warning about SPIFFS.

On closer inspection I just noticed that the actual cause of the failure are a lot of redefinition errors like this:

In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/EspBootstrapDict.h:37,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:8:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h: At global scope:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:3:8: error: redefinition of 'int8_t node::create(const char*, uint8_t, const char*, uint8_t, node*, node*)'
3 | int8_t node::create(const char* aKey, _DICT_KEY_TYPE aKeySize, const char* aVal, _DICT_VAL_TYPE aValSize, node* aLeft, node* aRight) {
|        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/ParametersSPIFFS.h:35,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:7:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:3:8: note: 'int8_t node::create(const char*, uint8_t, const char*, uint8_t, node*, node*)' previously defined here
3 | int8_t node::create(const char* aKey, _DICT_KEY_TYPE aKeySize, const char* aVal, _DICT_VAL_TYPE aValSize, node* aLeft, node* aRight) {
      |        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/EspBootstrapDict.h:37,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:8:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:58:8: error: redefinition of 'int8_t node::updateValue(const char*, uint8_t)'
58 | int8_t node::updateValue(const char* aVal, _DICT_VAL_TYPE aValSize) {
|        ^~~~
In file included from C:\Users\josts\OneDrive\Documents\Arduino\libraries\EspBootstrap\src/ParametersSPIFFS.h:35,
from c:\Users\josts\Downloads\gitClones\HumiTempSensor\HumiTempSensor.ino:7:
C:\Users\josts\OneDrive\Documents\Arduino\libraries\Dictionary\src/Dictionary.h:58:8: note: 'int8_t node::updateValue(const char*, uint8_t)' previously defined here
   58 | int8_t node::updateValue(const char* aVal, _DICT_VAL_TYPE aValSize) {
      |        ^~~~
[...]

I have the feeling that the Dictionary library has changed since I last successfully built my project (jostsalathe/HumiTempSensor). It appears to me that it has no header guard surrounding its contents which would make it unsuitable for including it in multiple other header files...

Now I don't really know what to do with that information, though...

Would you mind checking if you can reproduce this? Just to be sure that my setup isn't just broken, somehow...

jostsalathe avatar Feb 19 '22 02:02 jostsalathe

Hello there. Apologies about this. I have started migrating the libs to be more PlatformIO friendly, and it is a long process with some breaks in between. I will look into this.

https://github.com/arkhipenko/Dictionary#platformio-support

arkhipenko avatar Feb 20 '22 12:02 arkhipenko

Apparently, there is if I read this correctly: https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system

Edit: ESP8266LittleFS is the Name.

I must admit, I haven't tested that tool, though.

I also don't know how all this may affect the ESP32, to be honest. I only used EspBootstrap on ESP8266 for now.

Yes, there are tools integrating with Arduino IDE. I am talking about a standalone PC-based CLI utility! Is there one for LittleFS? I just have not searched. Maybe there is.

https://github.com/igrr/mkspiffs

arkhipenko avatar Feb 20 '22 13:02 arkhipenko

Hello there. Apologies about this. I have started migrating the libs to be more PlatformIO friendly, and it is a long process with some breaks in between. I will look into this.

https://github.com/arkhipenko/Dictionary#platformio-support

I just opened a separate issue (#4) for this since it is unrelated to SPIFFS being deprecated.

jostsalathe avatar Feb 25 '22 19:02 jostsalathe

There seems to be a project that is directly based off of mkspiffs here: https://github.com/earlephilhower/mklittlefs

I didn't really look into it but maybe this can do the trick.

jostsalathe avatar Feb 25 '22 23:02 jostsalathe