diff --git a/components/control_plane/src/runtime/control_plane_runtime_workers.c b/components/control_plane/src/runtime/control_plane_runtime_workers.c index c60ed57..eebfec1 100644 --- a/components/control_plane/src/runtime/control_plane_runtime_workers.c +++ b/components/control_plane/src/runtime/control_plane_runtime_workers.c @@ -111,7 +111,7 @@ #endif #if CONFIG_TQ_NETWORK_AUTO_REASSOCIATION_ENABLE -#define CONTROL_PLANE_NETWORK_FAILURE_REASSOC_THRESHOLD 2U +#define CONTROL_PLANE_NETWORK_FAILURE_REASSOC_THRESHOLD 1U #endif #if !defined(CONFIG_TQ_PTT_MODE_HOLD_TO_TALK) && !defined(CONFIG_TQ_PTT_MODE_CLICK_TO_TALK) @@ -1815,7 +1815,7 @@ static void control_plane_wifi_state_task(void *arg) #if CONFIG_TQ_NETWORK_AUTO_REASSOCIATION_ENABLE if (connected && control_plane_consume_wifi_reassociation_request()) { ESP_LOGW(TAG, - "Network recovery experiment: controlled STA reassociation started after %u HTTPS connection failures", + "Network recovery: controlled STA reassociation started after %u HTTPS connection failure", (unsigned)CONTROL_PLANE_NETWORK_FAILURE_REASSOC_THRESHOLD); domain_runtime_behavior_set_keep_awake(true); esp_err_t reassoc_err = domain_runtime_wifi_portal_reconnect_sta( @@ -1823,7 +1823,7 @@ static void control_plane_wifi_state_task(void *arg) domain_runtime_behavior_set_keep_awake(false); connected = control_plane_is_sta_connected(); ESP_LOGW(TAG, - "Network recovery experiment: controlled STA reassociation result=%s connected=%d", + "Network recovery: controlled STA reassociation result=%s connected=%d", esp_err_to_name(reassoc_err), connected ? 1 : 0); if (reassoc_err == ESP_OK && connected) { diff --git a/components/platform/src/runtime/platform_https_client.c b/components/platform/src/runtime/platform_https_client.c index 2f19ecf..bf63968 100644 --- a/components/platform/src/runtime/platform_https_client.c +++ b/components/platform/src/runtime/platform_https_client.c @@ -36,7 +36,10 @@ #endif #define PLATFORM_HTTPS_DEFAULT_TIMEOUT_MS 10000 -#define PLATFORM_HTTPS_DNS_RETRY_COUNT 2 +/* lwIP getaddrinfo() already performs bounded DNS retransmission internally and + * can block for roughly 14 seconds on a stale STA data path. Retrying the same + * lookup here only duplicates that delay before control-plane recovery runs. */ +#define PLATFORM_HTTPS_DNS_RETRY_COUNT 1 #define PLATFORM_HTTPS_DNS_RETRY_DELAY_MS 500 #define PLATFORM_HTTPS_HOST_MAX_LEN 256 #if CONFIG_TQ_NETWORK_DIAGNOSTICS_ENABLE diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index 5f201ab..9d61a4c 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -173,13 +173,14 @@ menu "Example Configuration" config TQ_NETWORK_AUTO_REASSOCIATION_ENABLE bool "Enable automatic Wi-Fi reassociation after HTTPS failures" - default n + default y help - After two consecutive multimodal HTTPS connection failures, + After the first multimodal HTTPS connection failure, disconnect and reconnect the Wi-Fi station before retrying. This interrupts all device network traffic while reassociation - is in progress. Keep disabled unless field testing shows that - reconnecting only the multimodal transport is insufficient. + is in progress. Field testing confirmed that this recovers a + stale STA data path which remains associated but cannot reach + DNS, the gateway, or a cached HTTPS endpoint. config TQ_SYSTEM_EVENT_ENABLE bool "Enable control-plane system event task" diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 03f4dec..dd7d715 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -28,7 +28,7 @@ CONFIG_TQ_MEMORY_MONITOR_INTERNAL_WARN_BYTES=16384 CONFIG_TQ_MEMORY_MONITOR_DMA_LARGEST_WARN_BYTES=4096 CONFIG_TQ_NETWORK_DIAGNOSTICS_ENABLE=y CONFIG_TQ_MULTIMODAL_DIAGNOSTICS_ENABLE=y -# CONFIG_TQ_NETWORK_AUTO_REASSOCIATION_ENABLE is not set +CONFIG_TQ_NETWORK_AUTO_REASSOCIATION_ENABLE=y CONFIG_TQ_SYSTEM_EVENT_ENABLE=y CONFIG_TQ_SYSTEM_EVENT_QUEUE_LEN=32 CONFIG_TQ_SYSTEM_EVENT_TASK_STACK=4096