From eeb9d2d1dfd38dd19fa641e6f733c917a3d1d005 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 03:18:04 +0530 Subject: feat: CVM relay stability fix + MCP relay integration tests Relay disconnect fix (cvm_server.c): - TLS read timeout reduced from 15s to 1s (short poll loop) - Ping timer fires every 30s independently of read activity - Consecutive timeout counter (65s) detects real disconnects - Handle relay close frames (opcode 0x08) explicitly - Result: 120s+ stable connection (previously ~37s disconnect cycle) MCP relay integration tests (17/17 pass via make test-cvm-mcp): - MCP initialize roundtrip via relay.primal.net - get_sessions returns session array - get_usage returns metric/price/step fields - Non-owner auth rejection (board silently drops) - Owner control request passes after rejection test Build fixes: - Remove display/font/axs15231b/qrcode deps (from display branch, not here) - Remove local_relay/relay_selector/sync_manager deps (from relay branch) - Add esp_timer to CMakeLists REQUIRES Host unit tests: 61/61 pass --- main/tollgate_main.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'main/tollgate_main.c') diff --git a/main/tollgate_main.c b/main/tollgate_main.c index 4741765..fa7a692 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c @@ -23,10 +23,6 @@ #include "tollgate_client.h" #include "lightning_payout.h" #include "cvm_server.h" -#include "display.h" -#include "local_relay.h" -#include "relay_selector.h" -#include "sync_manager.h" #define MAX_STA_RETRY 5 static const char *TAG = "tollgate_main"; @@ -182,11 +178,6 @@ static void start_services(void) s_services_running = true; if (s_services_mutex) xSemaphoreGive(s_services_mutex); ESP_LOGI(TAG, "=== TollGate services started ==="); - - display_set_state(DISPLAY_READY); - char portal_url[128]; - snprintf(portal_url, sizeof(portal_url), "http://%s/", cfg->ap_ip_str); - display_update(cfg->ap_ssid, 0, 0, portal_url); } static void stop_services(void) @@ -270,9 +261,6 @@ void app_main(void) { ESP_LOGI(TAG, "=== TollGate ESP32 Starting ==="); - display_init(); - display_set_state(DISPLAY_BOOT); - esp_err_t ret = nvs_flash_init(); if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { ESP_ERROR_CHECK(nvs_flash_erase()); -- cgit v1.2.3