cargo: keep AP web UI available without STA WiFi

This commit is contained in:
2026-06-22 22:21:51 -06:00
parent fec60b057f
commit e0b56f42e9
2 changed files with 13 additions and 3 deletions
@@ -1998,8 +1998,10 @@ void connectStaWifi() {
WiFi.begin(staSsids[i].c_str(), staPasswords[i].c_str());
unsigned long start = millis();
while (WiFi.status() != WL_CONNECTED && millis() - start < 10000) {
delay(500);
while (WiFi.status() != WL_CONNECTED && millis() - start < 3000) {
server.handleClient();
oledLoop();
delay(100);
Serial.print(".");
}
@@ -4007,7 +4009,9 @@ void setup() {
startAccessPoint();
oledShowSetupPage();
connectStaWifi();
// Do not block setup on STA WiFi. Start the AP and web server first so the
// local Web UI/API remains available even when no saved WiFi networks exist.
lastStaReconnectAttempt = millis() - STA_RECONNECT_INTERVAL_MS;
server.on("/", HTTP_GET, []() {
server.send_P(200, "text/html", INDEX_HTML);