debug: add AP DNS server for client join probes

This commit is contained in:
2026-06-30 00:19:00 -06:00
parent 60bf141d53
commit e590f15548
@@ -1,6 +1,7 @@
#include <WiFi.h> #include <WiFi.h>
#include <esp_heap_caps.h> #include <esp_heap_caps.h>
#include <WebServer.h> #include <WebServer.h>
#include <DNSServer.h>
#include <Preferences.h> #include <Preferences.h>
#include <esp_wifi.h> #include <esp_wifi.h>
#include <esp_system.h> #include <esp_system.h>
@@ -1459,6 +1460,7 @@ setInterval(load,3000);
)rawliteral"; )rawliteral";
WebServer server(80); WebServer server(80);
DNSServer dnsServer;
#define API_V1(path) "/api/v1" path #define API_V1(path) "/api/v1" path
@@ -1635,6 +1637,9 @@ void restartAccessPoint() {
heapCheckpoint("before:startAccessPoint"); heapCheckpoint("before:startAccessPoint");
startAccessPoint(); startAccessPoint();
heapCheckpoint("after:startAccessPoint"); heapCheckpoint("after:startAccessPoint");
dnsServer.start(53, "*", WiFi.softAPIP());
Serial.println("DNS Server Started");
} }
void sendSimpleJsonError(int status, const char* error, const char* detail) { void sendSimpleJsonError(int status, const char* error, const char* detail) {
@@ -4276,6 +4281,7 @@ void setup() {
} }
void loop() { void loop() {
dnsServer.processNextRequest();
server.handleClient(); server.handleClient();
#if DASHBOARD_UART_ENABLED #if DASHBOARD_UART_ENABLED
pollDashboardUart(); pollDashboardUart();