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));