fix for numretries not bailing

This commit is contained in:
tablatronix
2021-03-18 16:56:25 -05:00
parent c47fc907a9
commit 8bfc228695
+1 -1
View File
@@ -909,7 +909,7 @@ uint8_t WiFiManager::connectWifi(String ssid, String pass) {
if(_cleanConnect) WiFi_Disconnect(); // disconnect before begin, in case anything is hung, this causes a 2 seconds delay for connect
// @todo find out what status is when this is needed, can we detect it and handle it, say in between states or idle_status
while(retry <= _connectRetries){
while(retry <= _connectRetries && (connRes!=WL_CONNECTED)){
if(_connectRetries > 1){
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(F("Connect Wifi, ATTEMPT #"),(String)retry+" of "+(String)_connectRetries);