NTP on a local network

Discussion to talk about software related topics only.
Post Reply
Mathieu
Posts: 6
Joined: Mon May 26, 2008 2:46 am

NTP on a local network

Post 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?
hendrixj
Posts: 33
Joined: Thu Oct 23, 2008 11:39 am

Re: NTP on a local network

Post 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.
matthew.hutchins
Posts: 9
Joined: Mon Dec 15, 2008 11:05 pm

Re: NTP on a local network

Post 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
Post Reply