This commit is contained in:
2026-09-12 03:40:10 +02:00
parent 029ceee69a
commit 8ac465229c
20 changed files with 220 additions and 422 deletions

View File

@@ -32,10 +32,9 @@ static void wifi_event_handler(void *arg, esp_event_base_t base, int32_t id, voi
esp_wifi_connect();
} else if (base == WIFI_EVENT && id == WIFI_EVENT_STA_DISCONNECTED) {
strncpy(s_sta_ip, "No Wi-Fi", sizeof(s_sta_ip));
xEventGroupClearBits(s_wifi_group, WIFI_CONNECTED_BIT);
if (s_retry_count < WIFI_RETRY_MAX) {
ESP_LOGW(TAG, "disconnected (%d), retrying in %d ms", s_retry_count, WIFI_RECONNECT_DELAY_MS);
xEventGroupClearBits(s_wifi_group, WIFI_CONNECTED_BIT);
vTaskDelay(pdMS_TO_TICKS(WIFI_RECONNECT_DELAY_MS));
ESP_LOGW(TAG, "disconnected (%d), reconnecting...", s_retry_count);
esp_wifi_connect();
s_retry_count++;
}