arkhipenko / EspBootstrap

A simple way to get your ESP8266 or ESP32 project configured and online quickly
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

SPIFFS is deprecated and should be replaced by LittleFS #3

Open jostsalathe opened 2 years ago

jostsalathe commented 2 years ago

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 commented 2 years ago

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".

arkhipenko commented 2 years ago

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

arkhipenko commented 2 years ago

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.?

jostsalathe commented 2 years ago

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 commented 2 years ago

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

arkhipenko commented 2 years ago

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 commented 2 years ago

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

jostsalathe commented 2 years ago

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 commented 2 years ago

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.