From cd85c78177c383281af9eab2b27f4a2061fc4834 Mon Sep 17 00:00:00 2001 From: iranl Date: Fri, 22 Nov 2024 12:33:38 +0100 Subject: [PATCH] Fix AP not opening --- src/networkDevices/WifiDevice.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/networkDevices/WifiDevice.cpp b/src/networkDevices/WifiDevice.cpp index 58c76bc..11fe21e 100644 --- a/src/networkDevices/WifiDevice.cpp +++ b/src/networkDevices/WifiDevice.cpp @@ -63,16 +63,7 @@ void WifiDevice::initialize() String(F(" and channel: ")) + String(WiFi.channel(i))); } - if ((_connectOnScanDone && _foundNetworks > 0) || _preferences->getBool(preference_find_best_rssi, false)) - { - connect(); - } - else if (_connectOnScanDone) - { - Log->println("No networks found, restarting scan"); - scan(false, true); - } - else if (_openAP) + if (_openAP) { openAP(); } @@ -127,6 +118,15 @@ void WifiDevice::initialize() return; } } + else if ((_connectOnScanDone && _foundNetworks > 0) || _preferences->getBool(preference_find_best_rssi, false)) + { + connect(); + } + else if (_connectOnScanDone) + { + Log->println("No networks found, restarting scan"); + scan(false, true); + } } });