SNTP update at EVENT_STAMODE_GOT_IP
Posted: Sun Jun 14, 2015 9:02 am
I need to synchronize time when ESP8266 starts and connection is established.
I tried to do it by using EVENT_STAMODE_GOT_IP. Unfortunately sntp_get_current_timestamp() returns 0. I assume module is not yet ready to ask NTP server for time. Synchronization itself woks fine, when function is executed a little bit later by a timer handling periodic synchronization.
What I should to do, to get time synchronized at the beginning?
I tried to do it by using EVENT_STAMODE_GOT_IP. Unfortunately sntp_get_current_timestamp() returns 0. I assume module is not yet ready to ask NTP server for time. Synchronization itself woks fine, when function is executed a little bit later by a timer handling periodic synchronization.
What I should to do, to get time synchronized at the beginning?