Dear all
I used SNTP to synchronize time.
In my application I allow three time servers. Initially the project was created in ESP-IDF 4.4. There I could use
sntp_getreachability()
to determine which server was actually used for the synchronization. After having updated to ESP-IDF 5.1 sntp_getreachability() does no longer exist.
My customer wants to know which server was used. Is there a mechanism in 5.1 to find the answer?
Kind regards
Chris
Which SNTP Server was used to synchronize IDF 5.1 and newer
Re: Which SNTP Server was used to synchronize IDF 5.1 and newer
Ok, for who ever is intersted...
If you call esp_sntp_getserver(u8_t idx), all servers but the one that time was retrived from, return a 0 for IP address.
I could not find documentation... it's not for granted, that it works reliably.
If you call esp_sntp_getserver(u8_t idx), all servers but the one that time was retrived from, return a 0 for IP address.
I could not find documentation... it's not for granted, that it works reliably.
-
- Posts: 69
- Joined: Thu Nov 01, 2018 8:32 am
Re: Which SNTP Server was used to synchronize IDF 5.1 and newer
Hi chruge,
I'm sorry, this is actually an omission from our side.
To workaround this problem, you can include these sntp headers, in this order exactly:
Then you can use the original lwip's `sntp_getreachability()` function as in previous releases. This is also thread safe.
We'll fix this soon and apply the fix to the release branches. Sorry for the inconvenience.
I'm sorry, this is actually an omission from our side.
To workaround this problem, you can include these sntp headers, in this order exactly:
Code: Select all
#include "esp_sntp.h"
#undef SNTP_OPMODE_POLL
#include "lwip/apps/sntp.h"
We'll fix this soon and apply the fix to the release branches. Sorry for the inconvenience.
Who is online
Users browsing this forum: ccrause and 239 guests