Page 1 of 1

NTP on a local network

Posted: Fri Nov 28, 2008 7:59 am
by Mathieu
Hello,

I'd like to update my mod5282 module hour thanks to NTP but on a LAN. In this purpose I have activated the NTP server of my win XP (see http://www.pctools.com/guides/registry/detail/1117/). But it doesn't work, SetNTPTime keep returning 0.

Thanks to Mod5282FactoryDemo_APP I tried a ping between the mod5282 and my computer and my NB module can see my computer.
I've checked that the server is running and listening on UDP port 123.
I tried to use another NTPClient to retrieve the hour from the NTP server on my computer and it doesn't work because of a layer problem ("clock strata" problem) : it must access the server of a higher strata to be able to retrieve the time.
See http://en.wikipedia.org/wiki/Network_Time_Protocol for more details about clock strata.

So I would think that SetNTPTime fails because of a strata problem...?

I haven't found SetNTPTime source code, is it available in my Nburn install dir?

Re: NTP on a local network

Posted: Wed Dec 03, 2008 6:14 am
by hendrixj
I followed your steps and my MOD5270 was able to set its clock from my local pc. So, at least, you know that the windows NTP server should work for your board. I don't know enough about NTP strata, so I can't help you there. But I wonder if you don't have a firewall preventing the use of your NTP server?
Just a thought.

Re: NTP on a local network

Posted: Tue Dec 16, 2008 11:56 pm
by matthew.hutchins
Mathieu,

I tried your NTP setting tip on my Windows XP PC too, with a MOD5270. I am getting the same failure (although it worked a few times).

I found the source for SetNTPTime in Nburn/system/ntpclient.cpp

Stepping through this, the function GetNTPTime failes on the line:

Code: Select all

		 if(prNtp->Stratum==0) return 0;
So this is also a stratum problem, as reported by your other client. I'm guesing this is a feature of the Windows XP reply to the NTP request ... ?

Matthew