Skip to content

Commit 8a989a0

Browse files
committed
wait in network adapter
1 parent dc692d0 commit 8a989a0

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Wippersnapper.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -915,7 +915,7 @@ void Wippersnapper::runNetFSM() {
915915
case FSM_NET_ESTABLISH_NETWORK:
916916
// WS_DEBUG_PRINTLN("FSM_NET_ESTABLISH_NETWORK");
917917
// Attempt to connect to wireless network
918-
maxAttempts = 2;
918+
maxAttempts = 5;
919919
while (maxAttempts >= 0) {
920920
setStatusLEDColor(LED_NET_CONNECT);
921921
WS.feedWDT();
@@ -925,10 +925,9 @@ void Wippersnapper::runNetFSM() {
925925
if (networkStatus() == WS_NET_CONNECTED)
926926
break;
927927
setStatusLEDColor(BLACK);
928-
delay(500);
929928
maxAttempts--;
930929
}
931-
// Validate connection OK
930+
// Validate connection
932931
if (networkStatus() == WS_NET_CONNECTED) {
933932
fsmNetwork = FSM_NET_CHECK_NETWORK;
934933
break;
@@ -949,7 +948,7 @@ void Wippersnapper::runNetFSM() {
949948
break;
950949
}
951950
setStatusLEDColor(BLACK);
952-
delay(500;)
951+
delay(500);
953952
}
954953
if (fsmNetwork == FSM_NET_CHECK_MQTT) {
955954
break;

src/network_interfaces/Wippersnapper_ESP32.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ class Wippersnapper_ESP32 : public Wippersnapper {
181181
delay(100);
182182
WiFi.begin(_ssid, _pass);
183183
_status = WS_NET_DISCONNECTED;
184-
delay(1000);
184+
delay(100);
185185
}
186186

187-
/* // wait for a connection to be established
187+
// wait for a connection to be established
188188
long startRetry = millis();
189189
while (WiFi.status() != WL_CONNECTED && millis() - startRetry < 10000) {
190190
// do nothing, busy loop during the timeout
191-
} */
191+
}
192192
}
193193

194194
/**************************************************************************/

0 commit comments

Comments
 (0)