Skip to content

Commit

Permalink
fix info page and adds esp32 aphostname
Browse files Browse the repository at this point in the history
  • Loading branch information
tablatronix committed Feb 18, 2018
1 parent 1d6a727 commit f3db838
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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("</dl>");
Expand All @@ -988,6 +988,7 @@ void WiFiManager::handleInfo() {
F("wifihead"),
F("apip"),
F("apmac"),
F("aphost"),
F("apssid"),
F("apbssid"),
F("staip"),
Expand All @@ -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("</dl>");
Expand Down Expand Up @@ -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());
Expand Down
3 changes: 2 additions & 1 deletion strings_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const char HTTP_JS[] PROGMEM =
#ifdef ESP32
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp32</h3><hr><dl>";
const char HTTP_INFO_chiprev[] PROGMEM = "<dt>Chip Rev</dt><dd>{1}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_lastreset[] PROGMEM = "<dt>Last reset reason</dt><dd>CPU0: {1}<br/>CPU1: {2}</dd>";
const char HTTP_INFO_aphost[] PROGMEM = "<dt>Acccess Point Hostname</dt><dd>{1}</dd>";
#else
const char HTTP_INFO_esphead[] PROGMEM = "<h3>esp8266</h3><hr><dl>";
const char HTTP_INFO_flashsize[] PROGMEM = "<dt>Real Flash Size</dt><dd>{1} bytes</dd>";
Expand Down

5 comments on commit f3db838

@gepd
Copy link

@gepd gepd commented on f3db838 Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last reset reason won't work until add #include <rom/rtc.h>

@tablatronix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes its documented and noted in code

@gepd
Copy link

@gepd gepd commented on f3db838 Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw the comment in the code, but I didn't found any reference in the documentation (Wiki)

@tablatronix
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that has not been made yet
#500

@gepd
Copy link

@gepd gepd commented on f3db838 Feb 19, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelent, now it make sense

Please sign in to comment.