Add new AP type to prevent user frustration.

This commit is contained in:
Blaz Kristan 2023-11-22 15:30:04 +01:00
parent 467f69f50e
commit 27532a4237
3 changed files with 10 additions and 7 deletions

View File

@ -156,6 +156,7 @@
#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
//Notifier callMode
#define CALL_MODE_INIT 0 //no updates on init, can be used to disable updates

View File

@ -186,10 +186,12 @@
Access Point WiFi channel: <input name="AC" type="number" class="xs" min="1" max="13" required><br>
AP opens:
<select name="AB">
<option value="0">No connection after boot</option>
<option value="1">Disconnected</option>
<option value="2">Always</option>
<option value="3">Never (not recommended)</option></select><br>
<option value="0">No connection after boot</option>
<option value="1">Disconnected</option>
<option value="2">Always</option>
<option value="3">Never (not recommended)</option>
<option value="4">No connection after boot (5min)</option>
</select><br>
AP IP: <span class="sip"> Not active </span><br>
<h3>Experimental</h3>
Disable WiFi sleep: <input type="checkbox" name="WS"><br>

View File

@ -885,11 +885,11 @@ void WLED::handleConnection()
initConnection();
}
if (!apActive && now - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) {
if (!(apBehavior == AP_BEHAVIOR_BOOT_NO_CONN && now > 300000)) {
if (!(apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000)) {
DEBUG_PRINTLN(F("Not connected AP."));
initAP(); // start AP only within first 5min
}
} if (apActive && apBehavior == AP_BEHAVIOR_BOOT_NO_CONN && now > 300000 && stac == 0) { // disconnect AP after 5min
} if (apActive && apBehavior == AP_BEHAVIOR_BOOT_NO_CONN_5MIN && now > 300000 && stac == 0) { // disconnect AP after 5min
dnsServer.stop();
WiFi.softAPdisconnect(true);
apActive = false;
@ -914,7 +914,7 @@ void WLED::handleConnection()
dnsServer.stop();
WiFi.softAPdisconnect(true);
apActive = false;
DEBUG_PRINTLN(F("Access point disabled (handle)."));
DEBUG_PRINTLN(F("Access point disabled (connected)."));
}
}
}