diff --git a/wled00/const.h b/wled00/const.h
index 645859e8d..71c3cd5dd 100644
--- a/wled00/const.h
+++ b/wled00/const.h
@@ -157,7 +157,10 @@
#define AP_BEHAVIOR_NO_CONN 1 //Open when no connection (either after boot or if connection is lost)
#define AP_BEHAVIOR_ALWAYS 2 //Always open
#define AP_BEHAVIOR_BUTTON_ONLY 3 //Only when button pressed for 6 sec
-#define AP_BEHAVIOR_BOOT_NO_CONN_5MIN 4 //Open AP when no connection after boot but only for 5min
+#define AP_BEHAVIOR_TEMPORARY 4 //Open AP when no connection after boot but only temporary
+#ifndef WLED_AP_TIMEOUT
+ #define WLED_AP_TIMEOUT 300000 //Temporary AP timeout
+#endif
//Notifier callMode
#define CALL_MODE_INIT 0 //no updates on init, can be used to disable updates
diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm
index b4a20d314..e4a6676d8 100644
--- a/wled00/data/settings_wifi.htm
+++ b/wled00/data/settings_wifi.htm
@@ -190,7 +190,7 @@
-
+
AP IP: Not active
Experimental
diff --git a/wled00/wled.cpp b/wled00/wled.cpp
index b6f7a4c8d..f5fe63ad3 100644
--- a/wled00/wled.cpp
+++ b/wled00/wled.cpp
@@ -913,17 +913,18 @@ void WLED::handleConnection()
initConnection();
}
if (!apActive && now - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) {
- if (!(apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000)) {
+ if (!(apBehavior == AP_BEHAVIOR_TEMPORARY && now > WLED_AP_TIMEOUT)) {
DEBUG_PRINTLN(F("Not connected AP."));
initAP(); // start AP only within first 5min
}
- } if (apActive && apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000 && stac == 0) { // disconnect AP after 5min if no clients connected
+ }
+ if (apActive && apBehavior == AP_BEHAVIOR_TEMPORARY && now > WLED_AP_TIMEOUT && stac == 0) { // disconnect AP after 5min if no clients connected
// if AP was enabled more than 10min after boot or if client was connected more than 10min after boot do not disconnect AP mode
- if (now < 600000) {
+ if (now < 2*WLED_AP_TIMEOUT) {
dnsServer.stop();
WiFi.softAPdisconnect(true);
apActive = false;
- DEBUG_PRINTLN(F("Access point disabled (after 5min)."));
+ DEBUG_PRINTLN(F("Temporary AP disabled."));
}
}
} else if (!interfacesInited) { //newly connected