NTP client doesn't work after ESP is reconnected
Posted: Sun Oct 11, 2015 10:40 am
I noticed one curious thing. I am writing code for my newest project (Nixie clock controlled by ESP-12).
I am using SNTP client, implemented in SDK 1.11. Everything is working fine, until something interrupt connection between ESP an my AP (for example when I power off my router for a moment). STA reconnects automatically, and sntp is reinitialized (by function executed in wifi event callback) but from that moment sntp_get_current_timestamp() returns 0.
I discovered, that problem doesn't occur, when at least one NTP server is defined not by its name (sntp_setservername funcion) but IP number (sntp_setserver).
What is the main cause of my problem?
I am using SNTP client, implemented in SDK 1.11. Everything is working fine, until something interrupt connection between ESP an my AP (for example when I power off my router for a moment). STA reconnects automatically, and sntp is reinitialized (by function executed in wifi event callback) but from that moment sntp_get_current_timestamp() returns 0.
I discovered, that problem doesn't occur, when at least one NTP server is defined not by its name (sntp_setservername funcion) but IP number (sntp_setserver).
What is the main cause of my problem?