diff --git a/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin b/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin index eee6f0e..f926bb3 100644 Binary files a/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin and b/Arduino_Sketch/HASwitchPlate.ino.d1_mini.bin differ diff --git a/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino b/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino index 7e4cfd9..40ab1da 100644 --- a/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino +++ b/Arduino_Sketch/HASwitchPlate/HASwitchPlate.ino @@ -2158,6 +2158,7 @@ void configRead() if (SPIFFS.exists("/config.json")) { // File exists, reading and loading debugPrintln(F("SPIFFS: reading /config.json")); + debugPrintFile("/config.json"); File configFile = SPIFFS.open("/config.json", "r"); if (configFile) { @@ -2376,9 +2377,11 @@ void configSave() else { serializeJson(jsonConfigValues, configFile); + configFile.println(""); yield(); configFile.close(); } + debugPrintFile("/config.json"); shouldSaveConfig = false; } @@ -3681,6 +3684,25 @@ void debugPrintCrash() SaveCrash.clear(); } +//////////////////////////////////////////////////////////////////////////////////////////////////// +void debugPrintFile(const String &fileName) +{ // Debug output line of text to our debug targets + File debugFile = SPIFFS.open(fileName, "r"); + if (debugFile) + { + uint16_t lineCount = 1; + while (debugFile.available()) + { + debugPrintln(F("SPIFFS: file:") + fileName + F(" line:") + String(lineCount) + F(" data:")+ debugFile.readStringUntil('\n')); + lineCount++; + } + debugFile.close(); + } + else { + debugPrintln("SPIFFS: Error opening file for read: " + fileName); + } +} + //////////////////////////////////////////////////////////////////////////////////////////////////// // Submitted by benmprojects to handle "beep" commands. Split // incoming String by separator, return selected field as String diff --git a/Arduino_Sketch/debug/HASwitchPlate.ino.d1_mini.elf b/Arduino_Sketch/debug/HASwitchPlate.ino.d1_mini.elf index 64da7f2..0d6db29 100644 Binary files a/Arduino_Sketch/debug/HASwitchPlate.ino.d1_mini.elf and b/Arduino_Sketch/debug/HASwitchPlate.ino.d1_mini.elf differ