From c74a0501c1730e3014fbf9d8e86410885f294953 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Thu, 6 Nov 2025 13:22:46 +0100 Subject: [PATCH] Move esp_netif_create_default_wifi_sta() before initializing Wi-Fi to align with the ESP-IDF recommended order --- firmware/esp32/main/wifi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/esp32/main/wifi.cpp b/firmware/esp32/main/wifi.cpp index f30f31f..cb258d0 100644 --- a/firmware/esp32/main/wifi.cpp +++ b/firmware/esp32/main/wifi.cpp @@ -44,9 +44,9 @@ void wifi_init_sta(void) { ESP_ERROR_CHECK(esp_event_loop_create_default()); + esp_netif_create_default_wifi_sta(); wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT(); ESP_ERROR_CHECK(esp_wifi_init(&cfg)); - esp_netif_create_default_wifi_sta(); ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT, ESP_EVENT_ANY_ID, &wifi_event_handler, NULL, NULL)); ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &wifi_event_handler, NULL, NULL));