From 88be5d55973c7c2055e1eca6f116f3faaa3f6a7c Mon Sep 17 00:00:00 2001 From: Forfelet <42919109+Forfelet@users.noreply.github.com> Date: Sat, 9 Aug 2025 14:48:08 +0200 Subject: [PATCH] Update wifi_mngt.cpp Network availability check removed before WiFi connection to support hidden SSID connections --- ESP32_PrusaConnectCam/wifi_mngt.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/ESP32_PrusaConnectCam/wifi_mngt.cpp b/ESP32_PrusaConnectCam/wifi_mngt.cpp index bc3e451..8b8b21b 100644 --- a/ESP32_PrusaConnectCam/wifi_mngt.cpp +++ b/ESP32_PrusaConnectCam/wifi_mngt.cpp @@ -7,6 +7,8 @@ Contact: miroslav.pivovarsky@gmail.com @bug: no know bug + + @update: Network availability check removed before WiFi connection to support hidden SSID connections */ #include "wifi_mngt.h" @@ -100,23 +102,19 @@ void WiFiMngt::Init() { //WiFi.setTxPower(WIFI_POWER_18_5dBm); if (config->CheckActifeWifiCfgFlag() == true) { - if (true == CheckAvailableWifiNetwork(WifiSsid)) { - WiFiStaConnect(); - log->AddEvent(LogLevel_Warning, "Connecting to WiFi: " + WifiSsid); + WiFiStaConnect(); + log->AddEvent(LogLevel_Warning, "Connecting to WiFi: " + WifiSsid); #if (WIFI_CLIENT_WAIT_CON == true) - while (WiFi.status() != WL_CONNECTED) { - delay(1000); - log->AddEvent(LogLevel_Verbose, "."); - } - WifiCfg.FirstConnected = true; - - /* Print ESP32 Local IP Address */ - log->AddEvent(LogLevel_Info, "WiFi network IP Address: http://" + WiFi.localIP().toString()); -#endif - } else { - log->AddEvent(LogLevel_Warning, "Wifi unavailable. Skip connecting to WiFi: " + WifiSsid); + while (WiFi.status() != WL_CONNECTED) { + delay(1000); + log->AddEvent(LogLevel_Verbose, "."); } + WifiCfg.FirstConnected = true; + + /* Print ESP32 Local IP Address */ + log->AddEvent(LogLevel_Info, "WiFi network IP Address: http://" + WiFi.localIP().toString()); +#endif } else { ScanWiFiNetwork(); } @@ -1071,4 +1069,5 @@ void WiFiMngt_WiFiEventApStaProbeReqRecved(WiFiEvent_t event, WiFiEventInfo_t in SystemLog.AddEvent(LogLevel_Info, F("WiFi AP STA receive probe request packet in soft-AP interface")); } -/* EOF */ \ No newline at end of file + +/* EOF */