From 30c2c8e1969556561b9000fcee4c8202f0488f4b Mon Sep 17 00:00:00 2001 From: Mateusz Date: Fri, 23 Oct 2026 11:37:46 +0200 Subject: [PATCH] more retries --- ygg_wifi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ygg_wifi.c b/ygg_wifi.c index 363a01f..638e9f4 100644 --- a/ygg_wifi.c +++ b/ygg_wifi.c @@ -22,7 +22,7 @@ void ygg_wifi_event_handler(void* arg, esp_event_base_t event_base, if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_START) { esp_wifi_connect(); } else if (event_base == WIFI_EVENT && event_id == WIFI_EVENT_STA_DISCONNECTED) { - if (s_retry_num < 5) { + if (s_retry_num < 20) { esp_wifi_connect(); s_retry_num++; ESP_LOGI(TAG, "Resuming connection to AP..."); @@ -48,6 +48,7 @@ void ygg_wifi_init_sta(void) wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); + ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE)); esp_event_handler_instance_t instance_any_id; esp_event_handler_instance_t instance_got_ip;