-->
Page 1 of 1

NTP strange behaviour?

PostPosted: Thu Dec 10, 2015 1:46 am
by peridot
I was obtaining NTP time periodically and I found that when I disconnected my WAN from my network ie. NO Internet I was still obtaining an incrementing time from time(), how can this be? Now I am not sure what I am looking at?

Re: NTP strange behaviour?

PostPosted: Thu Dec 10, 2015 1:56 am
by TassyJim
I think I have it right this time.

The module uses NTP to set it's clock when it first starts up and connects to the internet and also when ever you run the timesetup() command.
In between time, it uses an internal clock to keep the time. It may also run NTP periodical but I haven't seen that happen after monitoring my module for a few hours.

I am not sure how precise the internal clock is.

Jim

Re: NTP strange behaviour?

PostPosted: Thu Dec 10, 2015 3:38 am
by peridot
Jim, thanks for that..
Oh Oh dear , Yes that was exactly the conclusion I was coming to but I did not want to say it, Claytons NTP unfortunately. I came across it only because I was looking for a way to tell if the internet was live or not (in code) , the usual trick is to request a page from somewhere like Google and look for a failed connection but I couldn't get that to work with wget() so then I thought ah ah I will use an NTP check and imagine my surprise when I still got the time!
OK I will look for other solutions.

Mike