From 56f30ca866613c94e6a83bc1c21bee0eb38c5b39 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 May 2026 23:50:55 +0530 Subject: 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. --- main/config.c | 4 +--- main/tollgate_main.c | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'main') diff --git a/main/config.c b/main/config.c index 6753f40..e810ede 100644 --- a/main/config.c +++ b/main/config.c @@ -53,9 +53,7 @@ esp_err_t tollgate_config_init(void) ESP_LOGW(TAG, "No config.json found, generating default"); const char *default_json = "{" "\"nsec\":\"a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2\"," - "\"wifi_networks\":[" - "{\"ssid\":\"c03rad0r\",\"password\":\"c03rad0r123\"}" - "]," + "\"wifi_networks\":[]," "\"ap_password\":\"\"," "\"mint_url\":\"https://testnut.cashu.space\"," "\"price_per_step\":21," 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, s_retry_count++; ESP_LOGW(TAG, "WiFi disconnected, retry %d/%d", s_retry_count, MAX_STA_RETRY); tollgate_client_on_sta_disconnected(); - if (s_services_running) stop_services(); if (s_retry_count < MAX_STA_RETRY) { esp_wifi_connect(); } else { -- cgit v1.2.3