Juerd / ESP-WiFiSettings

WiFi Manager for the ESP32 Arduino environment
Other
166 stars 34 forks source link

Make filesystem configurable #31

Open notsleep196 opened 1 year ago

notsleep196 commented 1 year ago

Hello!

This library uses SPIFFS as the only filesystem for ESP32. But in many sources SPIFFS marked as deprecated and it is recommended to move to LittleFS. Now LittleFS is added to arduino-esp32 and may be preffered filesystem for many projects.

Necessary changes in WiFiSettings.cpp to work using LittleFS:

#ifdef ESP32
    #define ESPFS SPIFFS
    #define ESPMAC (Sprintf("%06" PRIx64, ESP.getEfuseMac() >> 24))
    #include <SPIFFS.h>

should be changed with:

#ifdef ESP32`
    #define ESPFS LittleFS
    #define ESPMAC (Sprintf("%06" PRIx64, ESP.getEfuseMac() >> 24))
    #include <LittleFS.h>

Using this changes everything works fine with LittleFS Maybe filesystem type should be configurable or lib should work with both filesystems?