fix: dhcp desactivation

This commit is contained in:
catvayor 2025-03-06 13:45:13 +01:00
parent fdedea352d
commit eec9e7938c
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -122,7 +122,8 @@ void wifi_init_sta(void)
{
s_wifi_event_group = xEventGroupCreate();
esp_netif_create_default_wifi_sta();
esp_netif_t* sta_netif = esp_netif_create_default_wifi_sta();
assert(sta_netif);
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
@ -132,12 +133,12 @@ void wifi_init_sta(void)
ESP_ERROR_CHECK(esp_event_handler_instance_register(WIFI_EVENT,
ESP_EVENT_ANY_ID,
&event_handler,
NULL,
sta_netif,
&instance_any_id));
ESP_ERROR_CHECK(esp_event_handler_instance_register(IP_EVENT,
IP_EVENT_STA_GOT_IP,
&event_handler,
NULL,
sta_netif,
&instance_got_ip));
wifi_config_t wifi_config = {