Add disconnect popup GUI

This commit is contained in:
fvanroie 2020-05-25 19:51:29 +02:00
parent aa7115bef1
commit 503f0eb1f7

View File

@ -4,7 +4,7 @@
#include "hasp_conf.h"
#if HASP_USE_WIFI>0
#if HASP_USE_WIFI > 0
#include "hasp_debug.h"
#include "hasp_config.h"
@ -45,6 +45,7 @@ void wifiConnected(IPAddress ipaddress)
{
Log.notice(F("WIFI: Received IP address %s"), ipaddress.toString().c_str());
Log.verbose(F("WIFI: Connected = %s"), WiFi.status() == WL_CONNECTED ? PSTR("yes") : PSTR("no"));
haspProgressVal(255);
// if(isConnected) {
// mqttReconnect();
@ -57,7 +58,9 @@ void wifiConnected(IPAddress ipaddress)
void wifiDisconnected(const char * ssid, uint8_t reason)
{
wifiReconnectCounter++;
if(wifiReconnectCounter > 45) {
haspProgressVal(wifiReconnectCounter * 3);
haspProgressMsg(F("Wifi Disconnected"));
if(wifiReconnectCounter > 33) {
Log.error(F("WIFI: Retries exceed %u: Rebooting..."), wifiReconnectCounter);
dispatchReboot(false);
}