From f3db838ae186f96ebbe6dc0c64642ac9c33ec33c Mon Sep 17 00:00:00 2001 From: Shawn A Date: Sun, 18 Feb 2018 10:39:35 -0600 Subject: [PATCH] fix info page and adds esp32 aphostname --- WiFiManager.cpp | 11 +++++++++-- strings_en.h | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/WiFiManager.cpp b/WiFiManager.cpp index f3f196c..a9f7e51 100644 --- a/WiFiManager.cpp +++ b/WiFiManager.cpp @@ -963,7 +963,7 @@ void WiFiManager::handleInfo() { F("autoconx") }; - for(int i=0; i<25;i++){ + for(int i=0; i<27;i++){ if(infoids[i] != NULL) page += getInfoData(infoids[i]); } page += F(""); @@ -988,6 +988,7 @@ void WiFiManager::handleInfo() { F("wifihead"), F("apip"), F("apmac"), + F("aphost"), F("apssid"), F("apbssid"), F("staip"), @@ -1000,7 +1001,7 @@ void WiFiManager::handleInfo() { F("autoconx") }; - for(int i=0; i<19;i++){ + for(int i=0; i<23;i++){ if(infoids[i] != NULL) page += getInfoData(infoids[i]); } page += F(""); @@ -1137,6 +1138,12 @@ String WiFiManager::getInfoData(String id){ p = FPSTR(HTTP_INFO_apmac); p.replace(FPSTR(T_1),(String)WiFi.softAPmacAddress()); } + #ifdef ESP32 + else if(id==F("aphost")){ + p = FPSTR(HTTP_INFO_aphost); + p.replace(FPSTR(T_1),WiFi.softAPgetHostname()); + } + #endif else if(id==F("apssid")){ p = FPSTR(HTTP_INFO_apssid); p.replace(FPSTR(T_1),(String)WiFi_SSID()); diff --git a/strings_en.h b/strings_en.h index 968bfff..b198ecb 100644 --- a/strings_en.h +++ b/strings_en.h @@ -114,7 +114,8 @@ const char HTTP_JS[] PROGMEM = #ifdef ESP32 const char HTTP_INFO_esphead[] PROGMEM = "

esp32


"; const char HTTP_INFO_chiprev[] PROGMEM = "
Chip Rev
{1}
"; - const char HTTP_INFO_lastreset[] PROGMEM = "
Last reset reason
CPU0: {1}
CPU1: {2}
"; + const char HTTP_INFO_lastreset[] PROGMEM = "
Last reset reason
CPU0: {1}
CPU1: {2}
"; + const char HTTP_INFO_aphost[] PROGMEM = "
Acccess Point Hostname
{1}
"; #else const char HTTP_INFO_esphead[] PROGMEM = "

esp8266


"; const char HTTP_INFO_flashsize[] PROGMEM = "
Real Flash Size
{1} bytes
";