@@ -86,6 +86,9 @@ void menuWiFi()
8686 systemPrint (" a) Configure device via WiFi Access Point or connect to WiFi: " );
8787 systemPrintf (" %s\r\n " , settings.wifiConfigOverAP ? " AP" : " WiFi" );
8888
89+ systemPrint (" m) Captive Portal: " );
90+ systemPrintf (" %s\r\n " , settings.enableCaptivePortal ? " Enabled" : " Disabled" );
91+
8992 systemPrint (" m) MDNS: " );
9093 systemPrintf (" %s\r\n " , settings.mdnsEnable ? " Enabled" : " Disabled" );
9194
@@ -115,7 +118,10 @@ void menuWiFi()
115118 settings.wifiConfigOverAP ^= 1 ;
116119 restartWiFi = true ;
117120 }
118-
121+ else if (incoming == ' c' )
122+ {
123+ settings.enableCaptivePortal ^= 1 ;
124+ }
119125 else if (incoming == ' m' )
120126 {
121127 settings.mdnsEnable ^= 1 ;
@@ -371,7 +377,7 @@ void wifiUpdate()
371377 }
372378
373379 // Process DNS when we are in AP mode for captive portal
374- if (WiFi.getMode () == WIFI_AP)
380+ if (WiFi.getMode () == WIFI_AP && settings. enableCaptivePortal )
375381 {
376382 dnsServer.processNextRequest ();
377383 }
@@ -416,7 +422,7 @@ void wifiStop()
416422 MDNS.end ();
417423
418424 // Stop the DNS server if we were using the captive portal
419- if (WiFi.getMode () == WIFI_AP)
425+ if (WiFi.getMode () == WIFI_AP && settings. enableCaptivePortal )
420426 dnsServer.stop ();
421427
422428 // Stop the other network clients and then WiFi
0 commit comments