Skip to content

Commit a02bf28

Browse files
author
Urs Weiss
committed
Ensure the WiFi Manager AP is disabled when not in Conf mode
1 parent 93e0fc3 commit a02bf28

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/WiFi_Manager.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ static bool connectToWiFi() {
173173

174174
if (WiFi.status() == WL_CONNECTED) {
175175
LOG_INFOF("WiFi connected - SSID: %s, IP: %s", WiFi.SSID().c_str(), WiFi.localIP().toString().c_str());
176+
177+
// Disable Access Point after successful WiFi connection
178+
// AP should only be active during configuration mode (when display shows "ConF")
179+
LOG_INFO("Disabling config portal AP");
180+
WiFi.mode(WIFI_STA);
181+
WiFi.softAPdisconnect(true);
182+
LOG_INFO("AP disabled, WiFi mode set to STA");
183+
176184
configureNTP();
177185
return true;
178186
}

0 commit comments

Comments
 (0)