Skip to content

NTP sync first time #8032

Answered by henk1311
henk1311 asked this question in Q&A
May 15, 2021 · 5 comments · 2 replies
Discussion options

You must be logged in to vote

Thnx for your fast answer: sntp_init() didn't help.

Yesterday I found a solution:
Forcing the sntp_startup_delay to zero was strangely not the solution, but reducing sntp_update_delay to 15 seconds (RFC minimum) was.
After the first ntp response I set this value back to the default value (1 hour):

Sketch change:
uint32_t sntp_update_delay_MS_rfc_not_less_than_15000 ()
{
// //info_sntp_update_delay_MS_rfc_not_less_than_15000_has_been_called = true;
if (FirstDNS) {
FirstDNS = false;
return 15000; // min = 15000 = 15s
} else
return 3600000; // 1 hour
}

gr henk

Replies: 5 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@adam-ah
Comment options

Answer selected by henk1311
Comment options

You must be logged in to vote
1 reply
@adam-ah
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants