Page 1 of 1

esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Posted: Wed Jul 02, 2025 4:31 pm
by Gaston1980
Hi to all,
I got this peacec of code working under esp-idf 5.3.1 without any errors:

Code: Select all

    esp_netif_get_ip_info(my_staif, &ipInfo.ip);
    ESP_LOGW(TAG4,"My IPV4: " IPSTR "\n", IP2STR(&ipInfo.ip));
but now under esp-idf 5.4.1 i got error message:

Code: Select all

error: passing argument 2 of 'esp_netif_get_ip_info' from incompatible pointer type [-Wincompatible-pointer-types]
   84 |     esp_netif_get_ip_info(my_staif, &ipInfo.ip);
      |                                     ^~~~~~~~~~
      |                                     |
      |                                     esp_ip4_addr_t * {aka struct esp_ip4_addr *}
      note: expected 'esp_netif_ip_info_t *' but argument is of type 'esp_ip4_addr_t *' {aka 'struct esp_ip4_addr *'}
  463 | esp_err_t esp_netif_get_ip_info(esp_netif_t *esp_netif, esp_netif_ip_info_t *ip_info);
but the variables are defined like this:

Code: Select all

esp_netif_ip_info_t ipInfo;
esp_netif_t *my_staif ;
how do properly use esp_netif_get_ip_info under esp-idf 5.4.1?

Regards
Gastón

Re: esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Posted: Wed Jul 02, 2025 4:53 pm
by MicroController
how do properly use esp_netif_get_ip_info

Code: Select all

esp_netif_get_ip_info(my_staif, &ipInfo);

Re: esp-idf 5.3.1 vs 5.4.1 and esp_netif_get_ip_info

Posted: Wed Jul 02, 2025 6:09 pm
by Gaston1980
thanks for your help. Cheers