diff --git a/src/webserver.cpp b/src/webserver.cpp index e022b39..02ed67a 100644 --- a/src/webserver.cpp +++ b/src/webserver.cpp @@ -1210,9 +1210,20 @@ bool WebServerHandler::setupWebServer() { } } #else // defined( ESP32 ) + File root = LittleFS.open("/"); + File f = root.openNextFile(); + while (f) { + Log.notice(F("WEB : File=%s, %d bytes" CR), f.name(), + f.size()); + if (!f.size()) { + Log.notice(F("WEB : Empty file detected, removing file." CR)); + LittleFS.remove(f.name()); + } -#warning "Implement file listning for ESP32" - + f = root.openNextFile(); + } + f.close(); + root.close(); #endif // Static content diff --git a/src/wifi.cpp b/src/wifi.cpp index 436e238..1885eb6 100644 --- a/src/wifi.cpp +++ b/src/wifi.cpp @@ -74,10 +74,7 @@ bool WifiConnection::hasConfig() { if (strlen(userSSID)) return true; // Check if there are stored WIFI Settings we can use. -#if defined(ESP32) -#warning \ - "Cant read SSID on ESP32 until a connection has been made, this part will not work, change to WifiManager" -#endif +#if defined(ESP8266) String ssid = WiFi.SSID(); if (ssid.length()) { Log.notice(F("WIFI: Found credentials in EEPORM." CR)); @@ -88,6 +85,10 @@ bool WifiConnection::hasConfig() { myConfig.saveFile(); return true; } +#else // defined( ESP32 ) +#warning "Cant read SSID property on ESP32 until a connection has been made!" +#endif + return false; }