debug: handle captive portal probes during LilyGO bringup

This commit is contained in:
2026-06-29 23:26:44 -06:00
parent ca2fb901c8
commit 02b95db3f1
@@ -4111,6 +4111,7 @@ void setup() {
lastStaReconnectAttempt = millis() - STA_RECONNECT_INTERVAL_MS;
server.on("/", HTTP_GET, []() {
Serial.println("HTTP GET /");
#if LILYGO_BRINGUP_MINIMAL_WEB
server.send(200, "text/html",
"<!doctype html><html><head><meta name='viewport' content='width=device-width,initial-scale=1'>"
@@ -4126,6 +4127,32 @@ void setup() {
server.on("/ota", HTTP_GET, handleOtaPage);
server.on(API_V1("/system/ota"), HTTP_POST, handleOtaUploadDone, handleOtaUploadStream);
server.on("/generate_204", HTTP_GET, []() {
Serial.println("HTTP captive probe /generate_204");
server.send(204, "text/plain", "");
});
server.on("/gen_204", HTTP_GET, []() {
Serial.println("HTTP captive probe /gen_204");
server.send(204, "text/plain", "");
});
server.on("/hotspot-detect.html", HTTP_GET, []() {
Serial.println("HTTP captive probe /hotspot-detect.html");
server.send(200, "text/html", "<HTML><HEAD><TITLE>Success</TITLE></HEAD><BODY>Success</BODY></HTML>");
});
server.on("/library/test/success.html", HTTP_GET, []() {
Serial.println("HTTP captive probe /library/test/success.html");
server.send(200, "text/html", "Success");
});
server.on("/connecttest.txt", HTTP_GET, []() {
Serial.println("HTTP captive probe /connecttest.txt");
server.send(200, "text/plain", "Microsoft Connect Test");
});
server.on("/ncsi.txt", HTTP_GET, []() {
Serial.println("HTTP captive probe /ncsi.txt");
server.send(200, "text/plain", "Microsoft NCSI");
});
server.on(API_V1("/status"), handleStatus);
server.on(API_V1("/health"), HTTP_GET, handleHealth);
server.on(API_V1("/capabilities"), HTTP_GET, handleCapabilities);