Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider moving from SPIFFS to LittleFS #276

Closed
MallocArray opened this issue Jan 23, 2025 · 2 comments
Closed

Consider moving from SPIFFS to LittleFS #276

MallocArray opened this issue Jan 23, 2025 · 2 comments

Comments

@MallocArray
Copy link
Contributor

MallocArray commented Jan 23, 2025

Consider changing from using SPIFFS to LittleFS for these devices.

Currently

#include "SPIFFS.h"
uses SPIFFS.h which ultimately limits us to the ESP board manager 2.x line. When using Board Manager for ESP v3.x there are multiple errors that stem from SPIFFS not working.

After looking around, it appears that SPIFFS is generally considered depreciated due to not being maintained, and that LittleFS is considered a near drop-in replacement and actively supported:

esp8266/Arduino#7095
esp8266/Arduino#7529
https://www.reddit.com/r/esp32/comments/y28m78/spiffs_deprecated_for_littlefs_in_the_past_but_no/

Related info on migrating from board v2.x to 3.x
https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html

Compiles correctly with ESP32 board v 2.0.11 or 2.0.17
Example of errors with v3.1.1

C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp: In member function 'void Configuration::saveConfig()':
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:221:3: error: 'File' was not declared in this scope
  221 |   File file = SPIFFS.open(CONFIG_FILE_NAME, "w", true);
      |   ^~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:222:7: error: 'file' was not declared in this scope
  222 |   if (file && !file.isDirectory()) {
      |       ^~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp: In member function 'void Configuration::loadConfig()':
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:246:3: error: 'File' was not declared in this scope
  246 |   File file = SPIFFS.open(CONFIG_FILE_NAME);
      |   ^~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:247:7: error: 'file' was not declared in this scope
  247 |   if (file && !file.isDirectory()) {
      |       ^~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:256:5: error: 'SPIFFS' was not declared in this scope
  256 |     SPIFFS.format();
      |     ^~~~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp: In member function 'bool Configuration::begin()':
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgConfigure.cpp:333:8: error: 'SPIFFS' was not declared in this scope
  333 |   if (!SPIFFS.begin(true)) {
      |        ^~~~~~
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgApiClient.cpp: In member function 'bool AgApiClient::postToServer(String)':
C:\Users\WDAGUtilityAccount\Documents\Arduino\libraries\arduino-master\src\AgApiClient.cpp:122:7: error: 'WiFi' was not declared in this scope
  122 |   if (WiFi.isConnected() == false) {
      |       ^~~~

exit status 1

Compilation error: exit status 1
@samuelbles07
Copy link
Collaborator

Hi @MallocArray ,

Thanks for pointing this out!

Our development is using PlatformIO and latest arduino-esp32 version that PlatformIO use is 2.0.17. And from discussion here looks like PlatformIO will not get the latest arduino-esp32 version (in this case 3.x).

So i don't think there's a real benefit to move to LittleFS (for now). Unless we decide to use other than PlatformIO or there's an update about this from espressif side.

@MallocArray
Copy link
Contributor Author

ok. I'm not familiar with what PlatformIO brings to the table, just concerned that if you are staying on 2.x that isn't regularly updated, it will fall behind.

When other users are trying to compile firmware on their own, it is a manual choice to downgrade to 2.x since the latest 3.x is automatically selected in Arduino IDE

Thank you for at least reading it and considering. You have your reasons to stay where you are and with that I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants