Now logging the SSID of the network to connect to in all error logs (about wifi)

This commit is contained in:
Blue Fox 2023-05-29 17:53:46 +02:00
parent 65dad99900
commit 1c455ac177

View File

@ -22,11 +22,11 @@ bool connectWiFi() { // connect to the wifi with the above defined credentials
while(WiFi.status() != WL_CONNECTED) {
delay(2000); Serial.printf(".");
if(WiFi.status() == WL_NO_SSID_AVAIL) {
Serial.println("\n[WiFi] Failed to connect to WiFi. Reason: WL_NO_SSID_AVAIL");
Serial.printf("\n[WiFi] Failed to connect to WiFi \"%s\". Reason: WL_NO_SSID_AVAIL\n", wiFiSSID);
blinkLED(LED_ON_WIFI_ERROR);
return false;
} else if(WiFi.status() == WL_CONNECT_FAILED) {
Serial.println("\n[WiFi] Failed to connect to WiFi. Reason: WL_CONNECT_FAILED");
Serial.printf("\n[WiFi] Failed to connect to WiFi \"%s\". Reason: WL_CONNECT_FAILED\n", wiFiSSID);
blinkLED(LED_ON_WIFI_ERROR);
return false;
}