From e0f07e52e22762157c04bd1f60a79b2cb6258790 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 6 Jul 2019 17:13:46 +0200 Subject: [PATCH] minor changes to web layout --- lib/MyESP/MyESP.cpp | 30 ++++++++++++++++++++++-------- lib/MyESP/MyESP.h | 2 +- src/version.h | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/lib/MyESP/MyESP.cpp b/lib/MyESP/MyESP.cpp index f36384a7d..16c1a6879 100644 --- a/lib/MyESP/MyESP.cpp +++ b/lib/MyESP/MyESP.cpp @@ -511,7 +511,7 @@ void MyESP::_ota_setup() { _progOld = _prog; } }); - + ArduinoOTA.onError([this](ota_error_t error) { if (error == OTA_AUTH_ERROR) myDebug_P(PSTR("[OTA] Auth Failed")); @@ -1982,8 +1982,22 @@ void MyESP::_webRootPage() { strlcat(s, "", sizeof(s)); strlcat(s, "

System stats:
", sizeof(s)); - strlcat(s, isMQTTConnected() ? " MQTT is connected\n" : " MQTT is disconnected\n", sizeof(s)); - strlcat(s, "
", sizeof(s)); + + if (isAPmode()) { + strlcat(s, " Device is in Wifi Access Point mode with SSID ", sizeof(s)); + strlcat(s, jw.getAPSSID().c_str(), sizeof(s)); + strlcat(s, "", sizeof(s)); + } else { + char buf[4]; + strlcat(s, " Connected to wireless network ", sizeof(s)); + strlcat(s, _getESPhostname().c_str(), sizeof(s)); + strlcat(s, " with signal strength ", sizeof(s)); + strlcat(s, itoa(getWifiQuality(), buf, 10), sizeof(s)); + strlcat(s, "%", sizeof(s)); + } + + strlcat(s, isMQTTConnected() ? "
MQTT is connected\n" : " MQTT is disconnected\n", sizeof(s)); + strlcat(s, "
", sizeof(s)); // uptime char buffer[200]; @@ -1993,14 +2007,14 @@ void MyESP::_webRootPage() { uint32_t rem = t % 3600L; uint8_t m = rem / 60; uint8_t sec = rem % 60; - sprintf(buffer, " System uptime: %d days %d hours %d minutes %d seconds
", d, h, m, sec); + sprintf(buffer, " System uptime: %d days %d hours %d minutes %d seconds", d, h, m, sec); strlcat(s, buffer, sizeof(s)); // memory - uint32_t total_memory = _getInitialFreeHeap(); - uint32_t free_memory = ESP.getFreeHeap(); - sprintf(buffer, " Memory: %d bytes free (%2u%%)
", free_memory, 100 * free_memory / total_memory); - strlcat(s, buffer, sizeof(s)); + //uint32_t total_memory = _getInitialFreeHeap(); + //uint32_t free_memory = ESP.getFreeHeap(); + //sprintf(buffer, " Memory: %d bytes free (%2u%%)
", free_memory, 100 * free_memory / total_memory); + //strlcat(s, buffer, sizeof(s)); strlcat(s, "

", sizeof(s)); if (_web_callback) { diff --git a/lib/MyESP/MyESP.h b/lib/MyESP/MyESP.h index 330a3b7f2..d2c8cdf3f 100644 --- a/lib/MyESP/MyESP.h +++ b/lib/MyESP/MyESP.h @@ -208,7 +208,7 @@ const char webCommonPage_start[] = "" "body {background-color: #FFA500;font: normal 18px Verdana, Arial, sans-serif;} "; -const char webCommonPage_start_refresh[] = ""; +const char webCommonPage_start_refresh[] = ""; const char webCommonPage_start_body[] = ""; diff --git a/src/version.h b/src/version.h index 6eb8a81cf..a5bd2e845 100644 --- a/src/version.h +++ b/src/version.h @@ -6,5 +6,5 @@ #pragma once #define APP_NAME "EMS-ESP" -#define APP_VERSION "1.8.1b13" +#define APP_VERSION "1.8.1b14" #define APP_HOSTNAME "ems-esp"