-->
Page 1 of 2

Time()

PostPosted: Sat May 13, 2017 2:07 pm
by ex-egll
Does the time() function get the time from the web every time that it is used, or does it get it at first use and maintain the the time locally? I suspect the former. I plan to use the 8266 to receive time stamped UDP messages and to check the time of the message against the current time (the UDP message sender has a habit of freezing up). The time function would be called every 20 seconds or so, which could result in a fair bit of network activity.

Re: Time()

PostPosted: Sun May 14, 2017 9:23 pm
by heckler
ex,
I believe that the esp module goes to the internet and gets time from an ntp server every time you execute the time() function. (but I am not certain ;) )

This would be a good place to use the wireshark tool (I believe it can do wifi also) to see what the esp module is doing when you do a time() get.

If you haven't heard... wireshark is a free opensource "excellent" network sniffing tool.
I have not used it a lot but it is pretty easy to filter on either a mac address or an ip address and then you could tell if the esp module was accessing the internet every time you do a time()

good luck
dwight

Re: Time()

PostPosted: Fri May 19, 2017 8:15 am
by ex-egll
Thanks Dwight, sorry for late reply it appears I am still on probation here, and for some reason my last response did not get posted.

In one of my Seniors moments I took the easy way out and asked on the forum instead of thinking the issue through and looking at the network traffic on the screen. Anyway, wireshark installed and the secrets of the net traffic are being revealed.

Re: Time()

PostPosted: Fri May 19, 2017 11:52 am
by heckler
ex-egll,

No problem on the late reply.

Please report back here what you find.
Many of us have the same questions.

I am working on a program that I would like to keep track of time and wonder when the esp module actually goes to the internet to update.

My assumption is every time it encounters a bla = time().

regards
dwight