Re: The call to esp_sntp_setservername does not seem to work.
Posted: Fri Jan 02, 2026 3:58 pm
MicroController's suggestion
was not tested by him. The following warning appeared during code compilation:
and subsequently, the error message occurred at runtime:
Setting NTP servers via the call esp_sntp_setservername after executing the call esp_netif_sntp_init leads to the output
I have the feeling that workarounds are being suggested here for a bug, but they all lead nowhere.
I will have to "live" with using only one NTP server!
Given the way this discussion is going, I've decided to end it!
Code: Select all
esp_sntp_config_t sntp_config = ESP_NETIF_SNTP_DEFAULT_CONFIG_MULTIPLE(
3,
ESP_SNTP_SERVER_LIST( NULL, NULL, NULL ) );
Code: Select all
/home/mick/Projects/ESP-IDF/eve/components/wifi/wifi.c: In function 'wifi_init':
/home/mick/Projects/ESP-IDF/eve/components/wifi/wifi.c:653:49: warning: excess elements in array initializer
653 | esp_sntp_config_t sntp_config = ESP_NETIF_SNTP_DEFAULT_CONFIG_MULTIPLE(3,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/mick/Projects/ESP-IDF/eve/components/wifi/wifi.c:653:49: note: (near initialization for 'sntp_config.servers')
/home/mick/Projects/ESP-IDF/eve/components/wifi/wifi.c:653:49: warning: excess elements in array initializer
/home/mick/Projects/ESP-IDF/eve/components/wifi/wifi.c:653:49: note: (near initialization for 'sntp_config.servers')
Code: Select all
E (3287) esp_netif_sntp: sntp_init_api(48): Tried to configure more servers than enabled in lwip. Please update CONFIG_SNTP_MAX_SERVERS
E (3297) esp_netif_sntp: esp_netif_sntp_init(119): Failed initialize SNTP service
Code: Select all
I (3307) WIFI: NTP server no. 0 : <NULL>
I (3307) WIFI: NTP server no. 1 : <NULL>
I will have to "live" with using only one NTP server!
Given the way this discussion is going, I've decided to end it!