diff --git a/src/OTA.cpp b/src/OTA.cpp index 2b281f15..1b1ea4d3 100644 --- a/src/OTA.cpp +++ b/src/OTA.cpp @@ -25,8 +25,8 @@ namespace fabomatic void configModeCallback(WiFiManager *myWiFiManager) { ESP_LOGI(TAG, "Entering portal config mode"); - ESP_LOGD(TAG, "%s", WiFi.softAPIP().toString().c_str()); - ESP_LOGD(TAG, "%s", myWiFiManager->getConfigPortalSSID().c_str()); + ESP_LOGD(TAG, "IP: %s", WiFi.softAPIP().toString().c_str()); + ESP_LOGD(TAG, "SSID: %s", myWiFiManager->getConfigPortalSSID().c_str()); Board::logic.changeStatus(Status::PortalStarting); } diff --git a/src/main.cpp b/src/main.cpp index c24491a9..c4f501c1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -466,6 +466,14 @@ void setup() fabomatic::startMQTTBrocker(); #endif + if (!WiFi.isConnected()) + { + if (!logic.getServer().connectWiFi()) + { + ESP_LOGI(TAG, "WiFi connection failed."); + } + } + fabomatic::setupOTA(); if (!hw_init) @@ -480,7 +488,7 @@ void setup() logic.blinkLed(64, 0, 0); logic.changeStatus(fabomatic::BoardLogic::Status::ErrorHardware); fabomatic::Tasks::delay(1s); - ESP_LOGE(TAG, "Hardware failed, waiting for OTA"); + ESP_LOGE(TAG, "Hardware failed, waiting for OTA on IP %s", WiFi.localIP().toString().c_str()); } }