-->
Page 1 of 2

NTP client doesn't work after ESP is reconnected

PostPosted: Sun Oct 11, 2015 10:40 am
by Atlantis
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?

Re: NTP client doesn't work after ESP is reconnected

PostPosted: Sun Oct 11, 2015 3:49 pm
by kolban
Can you try at the latest SDK (1.4) and see if the problem is still present?

Re: NTP client doesn't work after ESP is reconnected

PostPosted: Mon Oct 12, 2015 12:01 am
by Atlantis
I tried new SDK - issue is still present.
Is it worth to switch to the 1.4 anyway? Is it stable?

Re: NTP client doesn't work after ESP is reconnected

PostPosted: Mon Oct 12, 2015 8:03 am
by kolban
Personally, I have switched to 1.4 and switch to the latest SDK every time a new one comes out. There are pains associated with it ... APIs change, things that used to work ... work differently (not necessarily broken ... just different).