From 8ea85254a05c0213cf88248d541d13833be2e33b Mon Sep 17 00:00:00 2001
From: Siwat Sirichai
Date: Mon, 7 Oct 2024 15:08:12 +0700
Subject: [PATCH] add uptime feature
---
.../lib/ESPMegaPRO/ESPMegaCommon.hpp | 2 +-
.../lib/ESPMegaPRO/ESPMegaWebServer.cpp | 1 +
.../lib/ESPMegaPRO/html/ota.html | 19 +-
ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ota_html.h | 898 ++++++++++--------
4 files changed, 503 insertions(+), 417 deletions(-)
diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaCommon.hpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaCommon.hpp
index 3988dbc..59e98d2 100644
--- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaCommon.hpp
+++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaCommon.hpp
@@ -1,3 +1,3 @@
#pragma once
-#define SDK_VESRION "2.9.4"
\ No newline at end of file
+#define SDK_VESRION "2.9.5"
\ No newline at end of file
diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.cpp
index d4791b7..00f6b31 100644
--- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.cpp
+++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ESPMegaWebServer.cpp
@@ -482,6 +482,7 @@ void ESPMegaWebServer::getDeviceInfoHandler(AsyncWebServerRequest *request) {
doc["software_version"] = SW_VERSION;
doc["sdk_version"] = SDK_VESRION;
doc["idf_version"] = IDF_VER;
+ doc["uptime"] = esp_timer_get_time() / 1000000; // Uptime in seconds
char buffer[512];
serializeJson(doc, buffer);
request->send(200, "application/json", buffer);
diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.html b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.html
index 51fc30a..a9fc9da 100644
--- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.html
+++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/html/ota.html
@@ -14,6 +14,10 @@
MAC Address
Loading ...
+
+ Uptime
+ Loading ...
+
Model
Loading ...
@@ -60,7 +64,7 @@
SIWAT SYSTEM 2023