8000 Modified bootWiFi2 method to call m_wifi.connectAP forever or until i… · breadchris/esp32-snippets@b87e0ad · GitHub
[go: up one dir, main page]

Skip to content

Commit b87e0ad

Browse files
committed
Modified bootWiFi2 method to call m_wifi.connectAP forever or until it successfully connects
1 parent a60e6de commit b87e0ad

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

networking/bootwifi/BootWiFi.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ void BootWiFi::bootWiFi2() {
285285
connectionInfo.ipInfo.gw.addr,
286286
connectionInfo.ipInfo.netmask.addr
287287
);
288-
m_wifi.connectAP(connectionInfo.ssid, connectionInfo.password); // Connect to the access point.
288+
289+
// Connect to the access point.
290+
while(!m_wifi.connectAP(connectionInfo.ssid, connectionInfo.password)){
291+
ESP_LOGE(LOG_TAG, "Unable to connect to access point \"%s\" - trying again...", connectionInfo.ssid);
292+
};
289293

290294
} else {
291295
// We do NOT have connection information. Let us now become an access

0 commit comments

Comments
 (0)
0