debug: use minimal web root for LilyGO bringup
This commit is contained in:
@@ -27,3 +27,6 @@
|
||||
|
||||
// Bring-up safety: keep AP stable while validating LilyGO hardware.
|
||||
#define WIFI_STA_AUTOCONNECT_ENABLED 0
|
||||
|
||||
// Bring-up safety: serve a tiny root page to avoid AP client/browser heap crashes.
|
||||
#define LILYGO_BRINGUP_MINIMAL_WEB 1
|
||||
|
||||
@@ -4111,7 +4111,17 @@ void setup() {
|
||||
lastStaReconnectAttempt = millis() - STA_RECONNECT_INTERVAL_MS;
|
||||
|
||||
server.on("/", 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'>"
|
||||
"<title>Overland Controller</title></head><body>"
|
||||
"<h1>Overland Controller</h1>"
|
||||
"<p>LilyGO bring-up mode is active.</p>"
|
||||
"<p>Try <a href='/api/v1/health'>/api/v1/health</a> or <a href='/api/v1/status'>/api/v1/status</a>.</p>"
|
||||
"</body></html>");
|
||||
#else
|
||||
server.send_P(200, "text/html", INDEX_HTML);
|
||||
#endif
|
||||
});
|
||||
server.on("/ota", HTTP_GET, handleOtaPage);
|
||||
server.on(API_V1("/system/ota"), HTTP_POST, handleOtaUploadDone, handleOtaUploadStream);
|
||||
@@ -4178,6 +4188,12 @@ void setup() {
|
||||
server.on("/bms/scan", HTTP_POST, handleBleScan);
|
||||
server.on("/bms/select", HTTP_POST, handleSelectBms);
|
||||
|
||||
server.onNotFound([]() {
|
||||
Serial.print("HTTP 404: ");
|
||||
Serial.println(server.uri());
|
||||
server.send(404, "application/json", "{\"ok\":false,\"error\":\"not_found\"}");
|
||||
});
|
||||
|
||||
|
||||
server.begin();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user