From 77ee57eb83ebf4a7decff17b31e1537938230d5a Mon Sep 17 00:00:00 2001 From: Harald Barth Date: Tue, 2 Nov 2021 17:50:32 +0100 Subject: [PATCH] give up eventually --- WifiESP32.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WifiESP32.cpp b/WifiESP32.cpp index 56765ba..c907448 100644 --- a/WifiESP32.cpp +++ b/WifiESP32.cpp @@ -77,6 +77,7 @@ bool WifiESP::setup(const char *SSid, bool havePassword = true; bool haveSSID = true; bool wifiUp = false; + uint8_t tries = 40; // tests // enableCoreWDT(1); @@ -92,8 +93,9 @@ bool WifiESP::setup(const char *SSid, WiFi.mode(WIFI_STA); WiFi.setAutoReconnect(true); WiFi.begin(SSid, password); - while (WiFi.status() != WL_CONNECTED) { + while (WiFi.status() != WL_CONNECTED && tries) { Serial.print('.'); + tries--; delay(500); } if (WiFi.status() == WL_CONNECTED) {