From 936c773074f55cc2cef979db4c57373a24066a82 Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Sun, 26 Feb 2023 12:31:24 +0100 Subject: [PATCH 1/4] SD card basic RW check + folder structure check --- .../components/jomjol_helper/sdcard_check.cpp | 112 ++++++++++++++++++ code/components/jomjol_helper/sdcard_check.h | 11 ++ code/main/main.cpp | 19 ++- 3 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 code/components/jomjol_helper/sdcard_check.cpp create mode 100644 code/components/jomjol_helper/sdcard_check.h diff --git a/code/components/jomjol_helper/sdcard_check.cpp b/code/components/jomjol_helper/sdcard_check.cpp new file mode 100644 index 000000000..ed06ec975 --- /dev/null +++ b/code/components/jomjol_helper/sdcard_check.cpp @@ -0,0 +1,112 @@ +#include "sdcard_check.h" +#include +#include +#include +#include +#include +#include + +#include "esp_rom_crc.h" +#include "ClassLogFile.h" + +static const char *TAG = "SDCARD"; + +int SDCardCheckRW(void) +{ + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Basic R/W check started..."); + FILE* pFile = NULL; + int iCRCMessage = 0; + + pFile = fopen("/sdcard/sdcheck.txt","w"); + if (pFile == NULL) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E1) No able to open file to write"); + return -1; + } + else { + std::string sMessage = "This message is used for a SD-Card basic check!"; + iCRCMessage = esp_rom_crc16_le(0, (uint8_t*)sMessage.c_str(), sMessage.length()); + if (fwrite(sMessage.c_str(), sMessage.length(), 1, pFile) == 0 ) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E2) Not able to write file"); + fclose(pFile); + unlink("/sdcard/sdcheck.txt"); + return -2; + } + fclose(pFile); + } + + pFile = fopen("/sdcard/sdcheck.txt","r"); + if (pFile == NULL) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E3) Not able to open file to read back"); + unlink("/sdcard/sdcheck.txt"); + return -3; + } + else { + char cReadBuf[50]; + if (fgets(cReadBuf, sizeof(cReadBuf), pFile) == 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E4) Not able to read file back"); + fclose(pFile); + unlink("/sdcard/sdcheck.txt"); + return -4; + } + else { + if (esp_rom_crc16_le(0, (uint8_t*)cReadBuf, strlen(cReadBuf)) != iCRCMessage) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E5) Read back, but wrong CRC"); + fclose(pFile); + unlink("/sdcard/sdcheck.txt"); + return -5; + } + } + fclose(pFile); + } + + if (unlink("/sdcard/sdcheck.txt") != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Basic R/W check: (E6) Unable to delete the file"); + return -6; + } + + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Basic R/W check successful"); + return 0; +} + + +bool SDCardCheckFolderStructure() +{ + struct stat sb; + bool bRetval = true; + + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder structure check started..."); + /* check if path exists: config */ + if (stat("/sdcard/config", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W1) Folder /config not found"); + bRetval = false; + } + + /* check if path exists: html */ + if (stat("/sdcard/html", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W2) Folder /html not found"); + bRetval = false; + } + + /* check if file exists: wlan.ini */ + if (stat("/sdcard/wlan.ini", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W3) File /wlan.ini not found"); + bRetval = false; + } + + /* check if file exists: config.ini */ + if (stat("/sdcard/config/config.ini", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W4) File /config/config.ini not found"); + bRetval = false; + } + + /* check if file exists: index.html */ + if (stat("/sdcard/html/index.html", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W5) File /html/index.html not found"); + bRetval = false; + } + + if (bRetval) + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder structure check successful"); + + return bRetval; +} \ No newline at end of file diff --git a/code/components/jomjol_helper/sdcard_check.h b/code/components/jomjol_helper/sdcard_check.h new file mode 100644 index 000000000..79638c756 --- /dev/null +++ b/code/components/jomjol_helper/sdcard_check.h @@ -0,0 +1,11 @@ +#pragma once + +#ifndef COMPONENTS_HELPER_SDCARD_CHECK_H +#define COMPONENTS_HELPER_SDCARD_CHECK_H + +#include "../../include/defines.h" + +int SDCardCheckRW(void); +bool SDCardCheckFolderStructure(void); + +#endif /* COMPONENTS_HELPER_SDCARD_CHECK_H */ diff --git a/code/main/main.cpp b/code/main/main.cpp index 622b2ad83..ab5a131ec 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -42,6 +42,7 @@ #endif //ENABLE_MQTT #include "Helper.h" #include "statusled.h" +#include "sdcard_check.h" #include "../../include/defines.h" //#include "server_GPIO.h" @@ -233,7 +234,19 @@ extern "C" void app_main(void) // SD card: basic RW check // ******************************************** - // TODO + int iSDCardStatus = SDCardCheckRW(); + if (iSDCardStatus < 0) { + if (iSDCardStatus <= -1 && iSDCardStatus >= -2) { // write error + StatusLED(SDCARD_CHECK, 2, false); + } + else if (iSDCardStatus <= -3 && iSDCardStatus >= -5) { // read error + StatusLED(SDCARD_CHECK, 3, false); + } + else if (iSDCardStatus == -6) { // delete error + StatusLED(SDCARD_CHECK, 4, false); + } + //return; // ??Stopp here, if yes -> blink infinite?? + } // Check for updates // ******************************************** @@ -249,7 +262,9 @@ extern "C" void app_main(void) // SD card: Check folder structure // ******************************************** - // TODO + if (!SDCardCheckFolderStructure()) { // check presence of some folders / files -> only warnings + StatusLED(SDCARD_CHECK, 5, false); + } // Check version information // ******************************************** From e5976c7bb0e56fad0e4cc46d197b17af04c64242 Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Sun, 26 Feb 2023 20:14:39 +0100 Subject: [PATCH 2/4] Default LED blink repeat 2x --- code/components/jomjol_helper/statusled.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/components/jomjol_helper/statusled.cpp b/code/components/jomjol_helper/statusled.cpp index 158e5f626..770eb20f8 100644 --- a/code/components/jomjol_helper/statusled.cpp +++ b/code/components/jomjol_helper/statusled.cpp @@ -26,7 +26,7 @@ void task_StatusLED(void *pvParameter) gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT); // Set the GPIO as a push/pull output gpio_set_level(BLINK_GPIO, 1);// LED off - for (int i=0; i<3; ) // Default: repeat 3 times + for (int i=0; i<2; ) // Default: repeat 2 times { if (!StatusLEDDataInt.bInfinite) ++i; From 9f53b46654c942411ab8d99849fe9b1063381039 Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Sun, 26 Feb 2023 20:15:08 +0100 Subject: [PATCH 3/4] Abort booting when SD basic R/W check failed --- code/main/main.cpp | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/code/main/main.cpp b/code/main/main.cpp index ab5a131ec..d55b07b45 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -206,15 +206,9 @@ extern "C" void app_main(void) return; // No way to continue without working SD card! } - // SD card: Create directories (if not already existing) + // SD card: Create log directories (if not already existing) // ******************************************** - bool bDirStatus = LogFile.CreateLogDirectories(); // needed for logging + image saving - bDirStatus = MakeDir("/sdcard/firmware"); // needed for firmware update - bDirStatus = MakeDir("/sdcard/img_tmp"); // needed for setting up alignment marks - bDirStatus = MakeDir("/sdcard/demo"); // needed for demo mode - if (!bDirStatus) { - StatusLED(SDCARD_CHECK, 1, false); - } + bool bDirStatus = LogFile.CreateLogDirectories(); // mandatory for logging + image saving // ******************************************** // Highlight start of logfile logging @@ -224,28 +218,38 @@ extern "C" void app_main(void) LogFile.WriteToFile(ESP_LOG_INFO, TAG, "==================== Start ======================"); LogFile.WriteToFile(ESP_LOG_INFO, TAG, "================================================="); - // Migrate parameter in config.ini to new naming (firmware 14.1 and newer) - // ******************************************** - migrateConfiguration(); - - // Init time (as early as possible, but SD card needs to be initialized) - // ******************************************** - setupTime(); // NTP time service: Status of time synchronization will be checked after every round (server_tflite.cpp) - - // SD card: basic RW check + // SD card: basic R/W check // ******************************************** int iSDCardStatus = SDCardCheckRW(); if (iSDCardStatus < 0) { if (iSDCardStatus <= -1 && iSDCardStatus >= -2) { // write error - StatusLED(SDCARD_CHECK, 2, false); + StatusLED(SDCARD_CHECK, 2, true); } else if (iSDCardStatus <= -3 && iSDCardStatus >= -5) { // read error - StatusLED(SDCARD_CHECK, 3, false); + StatusLED(SDCARD_CHECK, 3, true); } else if (iSDCardStatus == -6) { // delete error - StatusLED(SDCARD_CHECK, 4, false); + StatusLED(SDCARD_CHECK, 4, true); } - //return; // ??Stopp here, if yes -> blink infinite?? + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Device init aborted!"); + return; // Stopp here because of bad SD card condition + } + + // Migrate parameter in config.ini to new naming (firmware 15.0 and newer) + // ******************************************** + migrateConfiguration(); + + // Init time (as early as possible, but SD card needs to be initialized) + // ******************************************** + setupTime(); // NTP time service: Status of time synchronization will be checked after every round (server_tflite.cpp) + + // SD card: Create further mandatory directories (if not already existing) + // ******************************************** + bDirStatus = MakeDir("/sdcard/firmware"); // mandatory for OTA firmware update + bDirStatus = MakeDir("/sdcard/img_tmp"); // mandatory for setting up alignment marks + bDirStatus = MakeDir("/sdcard/demo"); // mandatory for demo mode + if (!bDirStatus) { + StatusLED(SDCARD_CHECK, 1, false); } // Check for updates From c3a1749f8af3cdf92e5f151a373dc9ba2354d8ef Mon Sep 17 00:00:00 2001 From: Slider0007 Date: Tue, 28 Feb 2023 09:19:26 +0100 Subject: [PATCH 4/4] SD R/W error+missing folder,file > load reduced UI --- code/components/jomjol_helper/Helper.h | 2 + .../components/jomjol_helper/sdcard_check.cpp | 74 ++++++++++++++++--- code/components/jomjol_helper/sdcard_check.h | 2 +- code/main/main.cpp | 36 +++++---- code/main/server_main.cpp | 11 ++- 5 files changed, 91 insertions(+), 34 deletions(-) diff --git a/code/components/jomjol_helper/Helper.h b/code/components/jomjol_helper/Helper.h index edb161fbe..86bade030 100644 --- a/code/components/jomjol_helper/Helper.h +++ b/code/components/jomjol_helper/Helper.h @@ -76,6 +76,8 @@ enum SystemStatusFlag_t { // One bit per error SYSTEM_STATUS_PSRAM_BAD = 1 << 0, // 1, Critical Error SYSTEM_STATUS_HEAP_TOO_SMALL = 1 << 1, // 2, Critical Error SYSTEM_STATUS_CAM_BAD = 1 << 2, // 4, Critical Error + SYSTEM_STATUS_SDCARD_CHECK_BAD = 1 << 3, // 8, Critical Error + SYSTEM_STATUS_FOLDER_CHECK_BAD = 1 << 4, // 16, Critical Error // Second Byte SYSTEM_STATUS_CAM_FB_BAD = 1 << (0+8), // 8, Flow still might work diff --git a/code/components/jomjol_helper/sdcard_check.cpp b/code/components/jomjol_helper/sdcard_check.cpp index ed06ec975..2b658f7dd 100644 --- a/code/components/jomjol_helper/sdcard_check.cpp +++ b/code/components/jomjol_helper/sdcard_check.cpp @@ -69,44 +69,98 @@ int SDCardCheckRW(void) } -bool SDCardCheckFolderStructure() +bool SDCardCheckFolderFilePresence() { struct stat sb; bool bRetval = true; - LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder structure check started..."); - /* check if path exists: config */ + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder/file presence check started..."); + /* check if folder exists: config */ if (stat("/sdcard/config", &sb) != 0) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W1) Folder /config not found"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /config not found"); bRetval = false; } - /* check if path exists: html */ + /* check if folder exists: html */ if (stat("/sdcard/html", &sb) != 0) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W2) Folder /html not found"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /html not found"); + bRetval = false; + } + + /* check if folder exists: firmware */ + if (stat("/sdcard/firmware", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /firmware not found"); + bRetval = false; + } + + /* check if folder exists: img_tmp */ + if (stat("/sdcard/img_tmp", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /img_tmp not found"); + bRetval = false; + } + + /* check if folder exists: log */ + if (stat("/sdcard/log", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /log not found"); + bRetval = false; + } + + /* check if folder exists: demo */ + if (stat("/sdcard/demo", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: Folder /demo not found"); bRetval = false; } /* check if file exists: wlan.ini */ if (stat("/sdcard/wlan.ini", &sb) != 0) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W3) File /wlan.ini not found"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /wlan.ini not found"); bRetval = false; } /* check if file exists: config.ini */ if (stat("/sdcard/config/config.ini", &sb) != 0) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W4) File /config/config.ini not found"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /config/config.ini not found"); bRetval = false; } /* check if file exists: index.html */ if (stat("/sdcard/html/index.html", &sb) != 0) { - LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Folder structure check: (W5) File /html/index.html not found"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/index.html not found"); + bRetval = false; + } + + /* check if file exists: ota.html */ + if (stat("/sdcard/html/ota_page.html", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/ota.html not found"); + bRetval = false; + } + + /* check if file exists: log.html */ + if (stat("/sdcard/html/log.html", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/log.html not found"); + bRetval = false; + } + + /* check if file exists: common.js */ + if (stat("/sdcard/html/common.js", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/common.js not found"); + bRetval = false; + } + + /* check if file exists: gethost.js */ + if (stat("/sdcard/html/gethost.js", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/gethost.js not found"); + bRetval = false; + } + + /* check if file exists: version.txt */ + if (stat("/sdcard/html/version.txt", &sb) != 0) { + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Folder/file check: File /html/version.txt not found"); bRetval = false; } if (bRetval) - LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder structure check successful"); + LogFile.WriteToFile(ESP_LOG_INFO, TAG, "Folder/file presence check successful"); return bRetval; } \ No newline at end of file diff --git a/code/components/jomjol_helper/sdcard_check.h b/code/components/jomjol_helper/sdcard_check.h index 79638c756..8bcf10f36 100644 --- a/code/components/jomjol_helper/sdcard_check.h +++ b/code/components/jomjol_helper/sdcard_check.h @@ -6,6 +6,6 @@ #include "../../include/defines.h" int SDCardCheckRW(void); -bool SDCardCheckFolderStructure(void); +bool SDCardCheckFolderFilePresence(void); #endif /* COMPONENTS_HELPER_SDCARD_CHECK_H */ diff --git a/code/main/main.cpp b/code/main/main.cpp index d55b07b45..e89b9b12c 100644 --- a/code/main/main.cpp +++ b/code/main/main.cpp @@ -208,7 +208,7 @@ extern "C" void app_main(void) // SD card: Create log directories (if not already existing) // ******************************************** - bool bDirStatus = LogFile.CreateLogDirectories(); // mandatory for logging + image saving + LogFile.CreateLogDirectories(); // mandatory for logging + image saving // ******************************************** // Highlight start of logfile logging @@ -223,16 +223,15 @@ extern "C" void app_main(void) int iSDCardStatus = SDCardCheckRW(); if (iSDCardStatus < 0) { if (iSDCardStatus <= -1 && iSDCardStatus >= -2) { // write error + StatusLED(SDCARD_CHECK, 1, true); + } + else if (iSDCardStatus <= -3 && iSDCardStatus >= -5) { // read error StatusLED(SDCARD_CHECK, 2, true); } - else if (iSDCardStatus <= -3 && iSDCardStatus >= -5) { // read error + else if (iSDCardStatus == -6) { // delete error StatusLED(SDCARD_CHECK, 3, true); } - else if (iSDCardStatus == -6) { // delete error - StatusLED(SDCARD_CHECK, 4, true); - } - LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Device init aborted!"); - return; // Stopp here because of bad SD card condition + setSystemStatusFlag(SYSTEM_STATUS_SDCARD_CHECK_BAD); // reduced web interface going to be loaded } // Migrate parameter in config.ini to new naming (firmware 15.0 and newer) @@ -244,13 +243,11 @@ extern "C" void app_main(void) setupTime(); // NTP time service: Status of time synchronization will be checked after every round (server_tflite.cpp) // SD card: Create further mandatory directories (if not already existing) + // Correct creation of these folders will be checked with function "SDCardCheckFolderFilePresence" // ******************************************** - bDirStatus = MakeDir("/sdcard/firmware"); // mandatory for OTA firmware update - bDirStatus = MakeDir("/sdcard/img_tmp"); // mandatory for setting up alignment marks - bDirStatus = MakeDir("/sdcard/demo"); // mandatory for demo mode - if (!bDirStatus) { - StatusLED(SDCARD_CHECK, 1, false); - } + MakeDir("/sdcard/firmware"); // mandatory for OTA firmware update + MakeDir("/sdcard/img_tmp"); // mandatory for setting up alignment marks + MakeDir("/sdcard/demo"); // mandatory for demo mode // Check for updates // ******************************************** @@ -258,16 +255,17 @@ extern "C" void app_main(void) CheckUpdate(); // Start SoftAP for initial remote setup - // Note: Start AP if no wlan.ini and/or config.ini available, e.g. SD empty; function does not exit anymore until reboot + // Note: Start AP if no wlan.ini and/or config.ini available, e.g. SD card empty; function does not exit anymore until reboot // ******************************************** #ifdef ENABLE_SOFTAP CheckStartAPMode(); #endif - // SD card: Check folder structure + // SD card: Check presence of some mandatory folders / files // ******************************************** - if (!SDCardCheckFolderStructure()) { // check presence of some folders / files -> only warnings - StatusLED(SDCARD_CHECK, 5, false); + if (!SDCardCheckFolderFilePresence()) { + StatusLED(SDCARD_CHECK, 4, true); + setSystemStatusFlag(SYSTEM_STATUS_FOLDER_CHECK_BAD); // reduced web interface going to be loaded } // Check version information @@ -483,12 +481,12 @@ extern "C" void app_main(void) TFliteDoAutoStart(); } else if (isSetSystemStatusFlag(SYSTEM_STATUS_CAM_FB_BAD) || // Non critical errors occured, we try to continue... - isSetSystemStatusFlag(SYSTEM_STATUS_NTP_BAD)) { + isSetSystemStatusFlag(SYSTEM_STATUS_NTP_BAD)) { LogFile.WriteToFile(ESP_LOG_WARN, TAG, "Initialization completed with errors! Starting flow task ..."); TFliteDoAutoStart(); } else { // Any other error is critical and makes running the flow impossible. Init is going to abort. - LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Initialization failed. Flow task start aborted!"); + LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "Initialization failed. Flow task start aborted. Loading reduced web interface..."); } } diff --git a/code/main/server_main.cpp b/code/main/server_main.cpp index 54b519854..c2a0d781f 100644 --- a/code/main/server_main.cpp +++ b/code/main/server_main.cpp @@ -215,7 +215,10 @@ esp_err_t hello_main_handler(httpd_req_t *req) if (filetosend == "/sdcard/html/index.html") { if (isSetSystemStatusFlag(SYSTEM_STATUS_PSRAM_BAD) || // Initialization failed with crritical errors! - isSetSystemStatusFlag(SYSTEM_STATUS_CAM_BAD)) { + isSetSystemStatusFlag(SYSTEM_STATUS_CAM_BAD) || + isSetSystemStatusFlag(SYSTEM_STATUS_SDCARD_CHECK_BAD) || + isSetSystemStatusFlag(SYSTEM_STATUS_FOLDER_CHECK_BAD)) + { LogFile.WriteToFile(ESP_LOG_ERROR, TAG, "We have a critical error, not serving main page!"); char buf[20]; @@ -228,13 +231,13 @@ esp_err_t hello_main_handler(httpd_req_t *req) } } - message += "
Please check jomjol.github.io/AI-on-the-edge-device-docs/Error-Codes for more information!"; + message += "
Please check logs with log viewer and/or jomjol.github.io/AI-on-the-edge-device-docs/Error-Codes for more information!"; message += "

"; message += " "; message += " "; message += " "; - httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, message.c_str()); - return ESP_FAIL; + httpd_resp_send(req, message.c_str(), message.length()); + return ESP_OK; } else if (isSetupModusActive()) { ESP_LOGD(TAG, "System is in setup mode --> index.html --> setup.html");