diff --git a/WiFiManager.cpp b/WiFiManager.cpp
index 1482c0c0b..f8fb0cc0b 100644
--- a/WiFiManager.cpp
+++ b/WiFiManager.cpp
@@ -2464,10 +2464,11 @@ void WiFiManager::handleClose(){
void WiFiManager::reportStatus(String &page){
// updateConxResult(WiFi.status()); // @todo: this defeats the purpose of last result, update elsewhere or add logic here
DEBUG_WM(DEBUG_DEV,F("[WIFI] reportStatus prev:"),getWLStatusString(_lastconxresult));
- DEBUG_WM(DEBUG_DEV,F("[WIFI] reportStatus current:"),getWLStatusString(WiFi.status()));
+ uint8_t current_status = WiFi.status();
+ DEBUG_WM(DEBUG_DEV,F("[WIFI] reportStatus current:"),getWLStatusString(current_status));
String str;
if (WiFi_SSID() != ""){
- if (WiFi.status()==WL_CONNECTED){
+ if (current_status==WL_CONNECTED){
str = FPSTR(HTTP_STATUS_ON);
str.replace(FPSTR(T_i),WiFi.localIP().toString());
str.replace(FPSTR(T_v),htmlEntities(WiFi_SSID()));
@@ -2475,24 +2476,35 @@ void WiFiManager::reportStatus(String &page){
else {
str = FPSTR(HTTP_STATUS_OFF);
str.replace(FPSTR(T_v),htmlEntities(WiFi_SSID()));
- if(_lastconxresult == WL_STATION_WRONG_PASSWORD){
+ if(current_status == WL_STATION_WRONG_PASSWORD){
// wrong password
str.replace(FPSTR(T_c),"D"); // class
str.replace(FPSTR(T_r),FPSTR(HTTP_STATUS_OFFPW));
}
- else if(_lastconxresult == WL_NO_SSID_AVAIL){
+ else if(current_status == WL_NO_SSID_AVAIL){
// connect failed, or ap not found
str.replace(FPSTR(T_c),"D");
str.replace(FPSTR(T_r),FPSTR(HTTP_STATUS_OFFNOAP));
}
- else if(_lastconxresult == WL_CONNECT_FAILED){
+ else if(current_status == WL_CONNECT_FAILED){
// connect failed
str.replace(FPSTR(T_c),"D");
str.replace(FPSTR(T_r),FPSTR(HTTP_STATUS_OFFFAIL));
}
+ else if(current_status == WL_CONNECTION_LOST){
+ // was reboot, initializing
+ str.replace(FPSTR(T_c),"D");
+ str.replace(FPSTR(T_r),FPSTR(HTTP_STATUS_CONNECTION_LOST));
+ }
+ else if(current_status == WL_IDLE_STATUS){
+ // was reboot, initializing
+ str.replace(FPSTR(T_c),"D");
+ str.replace(FPSTR(T_r),FPSTR(HTTP_STATUS_IDLE_STATUS));
+ }
else{
- str.replace(FPSTR(T_c),"");
- str.replace(FPSTR(T_r),"");
+ String s = F("код: ") + String(current_status);
+ str.replace(FPSTR(T_c),"D");
+ str.replace(FPSTR(T_r), s);
}
}
}
diff --git a/WiFiManager.h b/WiFiManager.h
index 26189b201..c0228fa3b 100644
--- a/WiFiManager.h
+++ b/WiFiManager.h
@@ -738,6 +738,7 @@ class WiFiManager
String getIpForm(String id, String title, String value);
public:
void getScanItemOut(String &page);
+ void reportStatus(String &page);
private:
void getStaticOut(String &page);
String getHTTPHead(const String &title);
@@ -749,7 +750,6 @@ class WiFiManager
String toStringIp(IPAddress ip);
boolean validApPassword();
String encryptionTypeStr(uint8_t authmode);
- void reportStatus(String &page);
String getInfoData(String id);
// flags
diff --git a/wm_strings_en.h b/wm_strings_en.h
index e6310b950..c529dcb0b 100644
--- a/wm_strings_en.h
+++ b/wm_strings_en.h
@@ -72,8 +72,11 @@ const char HTTP_FORM_SELECT[] PROGMEM = "";
const char HTTP_SCAN_LINK[] PROGMEM = "
Подключение...
При успешном подключении через 5–10 секунд погаснет светодиод.
" "Нажмите коротко на кнопку, чтобы Ватериус отправил показания на сайт.
" "Если не удалось подключиться, начните с начала.
" @@ -88,12 +91,47 @@ const char HTTP_STATUS_ON[] PROGMEM = "