Explicitly set LittleFS for uploadfs; log filesystem contents on boot
This commit is contained in:
+2
-1
@@ -25,7 +25,8 @@ board = esp32dev
|
||||
framework = arduino
|
||||
platform = espressif32
|
||||
monitor_speed = 115200
|
||||
lib_deps =
|
||||
board_build.filesystem = littlefs
|
||||
lib_deps =
|
||||
tzapu/WiFiManager @ ^2.0.17
|
||||
bblanchon/ArduinoJson @ ^7.4.3
|
||||
knolleary/PubSubClient @ ^2.8
|
||||
|
||||
+9
-1
@@ -461,7 +461,15 @@ static void applyFactoryResetIfNeeded(int count) {
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
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();
|
||||
hostnameParam.setValue(hostname, sizeof(hostname) - 1);
|
||||
|
||||
Reference in New Issue
Block a user