upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/tollgate_main.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 23:50:55 +0530
committerYour Name <you@example.com>2026-05-18 23:50:55 +0530
commit56f30ca866613c94e6a83bc1c21bee0eb38c5b39 (patch)
tree8986b08bbfef98e8b0913b15b0baf6843d932145 /main/tollgate_main.c
parentf8a5cffd3fe9d07de52e1688bda9b2975adbb74d (diff)
fix: don't stop services on STA disconnect
Services (API server on 2121, captive portal on 80, DNS hijack, firewall) should stay running even when STA WiFi disconnects. Previously, every STA disconnect would tear down all services, making the board unreachable on its own AP. Also set default wifi_networks to empty since upstream WiFi config should be provisioned, not hardcoded.
Diffstat (limited to 'main/tollgate_main.c')
-rw-r--r--main/tollgate_main.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c
index f8998bd..dda4142 100644
--- a/main/tollgate_main.c
+++ b/main/tollgate_main.c
@@ -50,7 +50,6 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base,
50 s_retry_count++; 50 s_retry_count++;
51 ESP_LOGW(TAG, "WiFi disconnected, retry %d/%d", s_retry_count, MAX_STA_RETRY); 51 ESP_LOGW(TAG, "WiFi disconnected, retry %d/%d", s_retry_count, MAX_STA_RETRY);
52 tollgate_client_on_sta_disconnected(); 52 tollgate_client_on_sta_disconnected();
53 if (s_services_running) stop_services();
54 if (s_retry_count < MAX_STA_RETRY) { 53 if (s_retry_count < MAX_STA_RETRY) {
55 esp_wifi_connect(); 54 esp_wifi_connect();
56 } else { 55 } else {