Răsfoiți Sursa

add sensor status, show special index/setup page in case of a critical error (#1560)

* add sensor status, show special index/setup page in case of a critical error

* Added Reboot

* .

* added more buttons

Co-authored-by: CaCO3 <caco@ruinelli.ch>
Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com>
CaCO3 3 ani în urmă
părinte
comite
434e268d42
2 a modificat fișierele cu 9 adăugiri și 5 ștergeri
  1. 5 5
      code/components/jomjol_helper/Helper.h
  2. 4 0
      code/main/server_main.cpp

+ 5 - 5
code/components/jomjol_helper/Helper.h

@@ -70,13 +70,13 @@ string getMac(void);
    Make sure it matches https://github.com/jomjol/AI-on-the-edge-device/wiki/Error-Codes */
 enum SystemStatusFlag_t {          // One bit per error
     // First Byte
-    SYSTEM_STATUS_PSRAM_BAD         = 1 << 0, //  4, Critical Error
-    SYSTEM_STATUS_HEAP_TOO_SMALL    = 1 << 1, //  8, Critical Error
-    SYSTEM_STATUS_CAM_BAD           = 1 << 2, //  1, Critical 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
 
     // Second Byte
-    SYSTEM_STATUS_CAM_FB_BAD        = 1 << (0+8), //  2, Flow still might work
-    SYSTEM_STATUS_NTP_BAD           = 1 << (1+8), // 16, Flow will work but time will be wrong
+    SYSTEM_STATUS_CAM_FB_BAD        = 1 << (0+8), //  8, Flow still might work
+    SYSTEM_STATUS_NTP_BAD           = 1 << (1+8), //  9, Flow will work but time will be wrong
 };
 
 void setSystemStatusFlag(SystemStatusFlag_t flag);

+ 4 - 0
code/main/server_main.cpp

@@ -246,6 +246,10 @@ esp_err_t hello_main_handler(httpd_req_t *req)
             }
 
             message += "<br>Please check <a href=\"https://github.com/jomjol/AI-on-the-edge-device/wiki/Error-Codes\" target=_blank>github.com/jomjol/AI-on-the-edge-device/wiki/Error-Codes</a> for more information!";
+            message += "<br><br><button onclick=\"window.location.href='/reboot';\">Reboot</button>";
+            message += "&nbsp;<button onclick=\"window.open('/ota_page.html');\">OTA Update</button>";
+            message += "&nbsp;<button onclick=\"window.open('/log.html');\">Log Viewer</button>";
+            message += "&nbsp;<button onclick=\"window.open('/info.html');\">Show System Info</button>";
             httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, message.c_str());
             return ESP_FAIL;
         }