- Mon Jul 13, 2015 12:21 am
#23111
I am presuming that when you receive the event that you have been allocated an IP address you are doing various "startup" functions in your logic. However, as you note, when you are informed "You have an IP" ... that is probably a true statement but it may also be an early statement ... meaning you "JUST" got the IP address. Instead of doing your app startup routines then and there, maybe setup a timer to fire a few seconds AFTER you get your IP address by which time your environment will be stable.
If we assume that only AFTER you get an IP address can a request be made to a time server and that request will take some time (10msecs - 1000msecs?) to get a response back .... if the "you have just been given an IP address" event happens at the moment the system recognizes that you have an IP, it will have been too early for a response to have been sent and received from the time server.
Free ESP8266 book available for download
here.