0

After updating ESP32 to core version 2.0.4 (file in Arduino IDE preferences was replaced tohttps://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json to upgrade), I get the following error:

/Users/guydvir/Dropbox/Arduino/libraries/LittleFS_esp32/src/LITTLEFS.cpp: In member function 'virtual bool LITTLEFSImpl::exists(const char*)':
/Users/guydvir/Dropbox/Arduino/libraries/LittleFS_esp32/src/LITTLEFS.cpp:44:28: error: no matching function for call to 'LITTLEFSImpl::open(const char*&, const char [2])'
     File f = open(path, "r");
                            ^
In file included from /Users/guydvir/Dropbox/Arduino/libraries/LittleFS_esp32/src/LITTLEFS.cpp:17:
/Users/guydvir/Library/Arduino15/packages/esp32/hardware/esp32/2.0.4/libraries/FS/src/vfs_api.h:38:17: note: candidate: 'virtual fs::FileImplPtr VFSImpl::open(const char*, const char*, bool)'
     FileImplPtr open(const char* path, const char* mode, const bool create) override;
                 ^~~~

I minimized code to headers only ( and empty setup and loop:

#include "FS.h" //#include "LITTLEFS.h" // <----- commenting out stops the error message #include <time.h> #include <WiFi.h>

What may be the error and how to fix it ?

6
  • 1
    maybe uninstall the library. github.com/lorol/LITTLEFS#readme
    – Juraj
    Aug 29, 2022 at 9:06
  • @Juraj now after downgade back to 1.0.4 (still in new repository) it cant find $PATH for python.....
    – guyd
    Aug 29, 2022 at 9:41
  • @Juraj see pic below
    – guyd
    Aug 29, 2022 at 9:48
  • you have 2.0.4, not 1.0.4
    – Juraj
    Aug 29, 2022 at 10:02
  • @Juraj I'm trying to understand what have change between 1.0.4 to 2.0.4
    – guyd
    Aug 29, 2022 at 11:56

2 Answers 2

2

As you experienced, the Lorol's LittleFS_esp32 library was merged into ESP32 core from v1.0.6 and creates compile error to some old codes.

The difference is you have to use #include <LittleFS.h> instead of #include <LITTLEFS.h> for new cores (v1.0.6, v2.0.0+)

Check and modify the following snippet (used widely in my ESP_WiFiManager library ) for your purpose

// Check cores/esp32/esp_arduino_version.h and cores/esp32/core_version.h
//#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) )  //(ESP_ARDUINO_VERSION_MAJOR >= 2)
#if ( defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 2) )
  #if (_WIFIMGR_LOGLEVEL_ > 3)
    #warning Using ESP32 Core 1.0.6 or 2.0.0+
  #endif
  
  // The library has been merged into esp32 core from release 1.0.6
  #include <LittleFS.h>       // https://github.com/espressif/arduino-esp32/tree/master/libraries/LittleFS
  
  FS* filesystem =      &LittleFS;
  #define FileFS        LittleFS
  #define FS_Name       "LittleFS"
#else
  #if (_WIFIMGR_LOGLEVEL_ > 3)
    #warning Using ESP32 Core 1.0.5-. You must install LITTLEFS library
  #endif
  
  // The library has been merged into esp32 core from release 1.0.6
  #include <LITTLEFS.h>       // https://github.com/lorol/LITTLEFS
  
  FS* filesystem =      &LITTLEFS;
  #define FileFS        LITTLEFS
  #define FS_Name       "LittleFS"
#endif
0

As Juraj commented - no need for LittleFS_esp32 library, after upgrade to esp32 Arduino 2.0.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.