-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Can't set sntp_update_delay #5938
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
lwip (selected in Tool's menu "lwIP-v1.4") is the legacy espressif patched version of original lwIP-v1.4RC2. The sntp code you mention is an espressif addition on lwIP-v1.4's sntp code. Now everything can be discussed. |
I knew it was an hour interval , but I'd like to shorten that for some environments and for testing. So it sounds like this is really a lwip sntp application API issue. In the mean time, I'm not understanding why I can't a create an extern declaration for sntp_set_update_delay() and call it like I can do for clock_gettime() which also is missing a declaration. As a fallback I guess I could run my own timeouts and call sntp_stop() and then reinitalize everything. Part of what I'm preparing for is some testing to see how things behave during power and network failures. |
fixed by #6373 |
Platform
Settings in IDE
I am doing some testing with time.c functions and ntp and I'd like to be able to set the sntp update delay. Is there anyway to do this?
There is (or at least used to be) a function to do this sntp_set_update_delay() in ntp.c but it does not seem to be available.
The declaration does not seem to be present in sntp.h which causes a compilation failure.
If I create the appropriate C external declaration in the sketch:
the sketch will compile but will fail to link with:
What also seems strange is that code down in ~/.arduino15/packages/esp8266/hardware/esp8266/2.5.0/tools/sdk/lwip/src/core/sntp.c does not seem to be used when building using the Arduino IDE but yet is included with the esp8266 package.
I don't understand the "lwip" vs "lwip2" stuff but it appears that lwip2 is being used by the Arduino core file sntp_lwip2.c
Was sntp_set_update_delay() dropped in lwip2 ?
It would be nice to be able to set the NTP poll/update interval.
Perhaps sntp_set_update_delay() could set the delay for all the servers, and sntp_setserver_update_delay() as described in issue #5879 could set the delay for individual servers.
The text was updated successfully, but these errors were encountered: