From e241321abc0d2048b13a95068e0698ba46ccda4e Mon Sep 17 00:00:00 2001 From: Petr Kracik Date: Thu, 5 Mar 2026 23:36:28 +0100 Subject: [PATCH] Use AutoAP --- src/LoRa_APRS_iGate.cpp | 4 +++- src/wifi_utils.cpp | 19 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/LoRa_APRS_iGate.cpp b/src/LoRa_APRS_iGate.cpp index 5a60d22..14fbe23 100644 --- a/src/LoRa_APRS_iGate.cpp +++ b/src/LoRa_APRS_iGate.cpp @@ -102,7 +102,9 @@ void setup() { Serial.begin(115200); networkManager = new NetworkManager(); networkManager->setup(); - networkManager->setAPTimeout(Config.wifiAutoAP.timeout * 60 * 1000); // Convert minutes to milliseconds + if (Config.wifiAutoAP.enabled) { + networkManager->setAPTimeout(Config.wifiAutoAP.timeout * 60 * 1000); // Convert minutes to milliseconds + } networkManager->setHostName("iGATE-" + Config.callsign); POWER_Utils::setup(); Utils::setupDisplay(); diff --git a/src/wifi_utils.cpp b/src/wifi_utils.cpp index 1393e96..620f6d6 100644 --- a/src/wifi_utils.cpp +++ b/src/wifi_utils.cpp @@ -96,8 +96,11 @@ namespace WIFI_Utils { } if (!hasNetworks) { - Serial.println("WiFi SSID not set! Starting Auto AP"); - startAutoAP(); + Serial.println("WiFi SSID not set!"); + if (Config.wifiAutoAP.enabled) { + Serial.println("Starting AP fallback..."); + startAutoAP(); + } return; } @@ -114,10 +117,14 @@ namespace WIFI_Utils { Serial.println(networkManager->getWiFimacAddress()); displayShow("", " Connected!!", "" , " loading ...", 1000); } else { - Serial.println("\nNot connected to WiFi! Starting Auto AP"); - displayShow("", " WiFi Not Connected!", "" , " loading ...", 1000); - - startAutoAP(); + Serial.println("\nNot connected to WiFi!"); + if (Config.wifiAutoAP.enabled) { + Serial.println("Starting AP fallback..."); + displayShow("", " WiFi Not Connected!", "" , " loading ...", 1000); + startAutoAP(); + } else { + displayShow("", " WiFi Not Connected!", "" , " loading ...", 1000); + } } }