From b74a675609f62580a3952efd61930cf57736f89e Mon Sep 17 00:00:00 2001 From: Andy Brown Date: Fri, 22 Jul 2022 19:41:32 +0100 Subject: [PATCH] Migrated to LittleFS - andyb2000 --- README.md | 10 ++++++---- library.json | 2 +- library.properties | 2 +- src/ConfigManager.cpp | 6 +++--- src/ConfigManager.h | 2 +- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 8f9c2c2..6a7a131 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,9 @@ configManager.save(); ### Additional files saved -Upload the ```index.html``` file found in the ```data``` directory into the SPIFFS. +Upload the ```index.html``` file found in the ```data``` directory into the LittleFS (note SPIFFS is currently deprecated). +Please see: https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html + Instructions on how to do this vary based on your IDE. Below are links instructions on the most common IDEs: @@ -96,13 +98,13 @@ on the most common IDEs: * [Arduino IDE](http://arduino-esp8266.readthedocs.io/en/latest/filesystem.html#uploading-files-to-file-system) -* [Platform IO](http://docs.platformio.org/en/stable/platforms/espressif.html#uploading-files-to-file-system-spiffs) +* [Platform IO](http://docs.platformio.org/en/stable/platforms/espressif.html#uploading-files-to-file-system) #### ESP32 * [Arduino IDE](https://github.com/me-no-dev/arduino-esp32fs-plugin) -* [Platform IO](http://docs.platformio.org/en/stable/platforms/espressif32.html#uploading-files-to-file-system-spiffs) +* [Platform IO](http://docs.platformio.org/en/stable/platforms/espressif32.html#uploading-files-to-file-system) # Documentation @@ -146,7 +148,7 @@ void setAPPassword(const char *password) ``` void setAPFilename(const char *filename) ``` -> Sets the path in SPIFFS to the webpage to be served by the access point. +> Sets the path in LittleFS to the webpage to be served by the access point. ### setAPTimeout ``` diff --git a/library.json b/library.json index 328924d..ddf6d05 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "ConfigManager", - "version": "2.1.1", + "version": "2.1.2", "keywords": "wifi, wi-fi, config", "description": "WiFi connection manager for ESP8266 and ESP32", "repository": diff --git a/library.properties b/library.properties index 1afeac4..a0444bb 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=ConfigManager -version=2.1.1 +version=2.1.2 author=Nick Wiersma maintainer=Nick Wiersma sentence=WiFi connection manager for ESP8266 and ESP32 diff --git a/src/ConfigManager.cpp b/src/ConfigManager.cpp index 68f3200..c5b355c 100644 --- a/src/ConfigManager.cpp +++ b/src/ConfigManager.cpp @@ -454,18 +454,18 @@ void ConfigManager::createBaseWebServer() { } void ConfigManager::streamFile(const char* file, const char mime[]) { - SPIFFS.begin(); + LittleFS.begin(); File f; if (file[0] == '/') { - f = SPIFFS.open(file, "r"); + f = LittleFS.open(file, "r"); } else { size_t len = strlen(file); char filepath[len + 1]; strcpy(filepath, "/"); strcat(filepath, file); - f = SPIFFS.open(filepath, "r"); + f = LittleFS.open(filepath, "r"); } if (f) { diff --git a/src/ConfigManager.h b/src/ConfigManager.h index 7a59445..dff7e7c 100644 --- a/src/ConfigManager.h +++ b/src/ConfigManager.h @@ -4,12 +4,12 @@ #include #include #include +#include #if defined(ARDUINO_ARCH_ESP8266) // ESP8266 #include #include #elif defined(ARDUINO_ARCH_ESP32) // ESP32 -#include #include #include #endif