Explicitly set LittleFS for uploadfs; log filesystem contents on boot
This commit is contained in:
@@ -25,6 +25,7 @@ board = esp32dev
|
|||||||
framework = arduino
|
framework = arduino
|
||||||
platform = espressif32
|
platform = espressif32
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
|
board_build.filesystem = littlefs
|
||||||
lib_deps =
|
lib_deps =
|
||||||
tzapu/WiFiManager @ ^2.0.17
|
tzapu/WiFiManager @ ^2.0.17
|
||||||
bblanchon/ArduinoJson @ ^7.4.3
|
bblanchon/ArduinoJson @ ^7.4.3
|
||||||
|
|||||||
+9
-1
@@ -461,7 +461,15 @@ static void applyFactoryResetIfNeeded(int count) {
|
|||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
Serial.println("\n\n=== ESP32 Device boot ===");
|
Serial.println("\n\n=== ESP32 Device boot ===");
|
||||||
LittleFS.begin(true);
|
if (!LittleFS.begin(false)) {
|
||||||
|
Serial.println("[FS] mount failed, formatting...");
|
||||||
|
LittleFS.begin(true);
|
||||||
|
} else {
|
||||||
|
Serial.println("[FS] mounted OK");
|
||||||
|
File root = LittleFS.open("/");
|
||||||
|
File f = root.openNextFile();
|
||||||
|
while (f) { Serial.printf("[FS] %s (%u bytes)\n", f.name(), f.size()); f = root.openNextFile(); }
|
||||||
|
}
|
||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
hostnameParam.setValue(hostname, sizeof(hostname) - 1);
|
hostnameParam.setValue(hostname, sizeof(hostname) - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user