[ntp:questions] Re: Nanokernel and "ntptime -N"

Ulrich Windl Ulrich.Windl at RZ.Uni-Regensburg.DE
Tue Aug 26 12:05:08 UTC 2003


shoppa at trailing-edge.com (Tim Shoppa) writes:

> I just hooked up a Trimble SV6 that I bought a few years ago for $25
> with PPS coming out on the DCD conductor (stretched by
> a 74LS123 one shot).  Applied the
> latest PPSkit (PPSkit-2.1.1) to the linux 2.4.20 source, configured PPS
> on in the kernel build, built the kernel, installed and booted it.
> 
> uname -a now says "Linux nomad 2.4.20-NANO #10 Fri May 23 21:06:49 EDT
> 2003 i686 unknown" so I know I built and am running the nanokernel.
> 
> I was confused by section 4) of the PPSkit install instructions, as
> it talks about timepps.h which is nowhere to be found.  But I went ahead
> and linked

/usr/src/linux/include/linux I think. Or "grep timepps\.h patch-2.4.20"

> 
>   /usr/include/asm/timex.h to /usr/src/linux-2.4.20/include/asm-i386/timex.h
>   /usr/include/sys/timex.h to /usr/src/linux-2.4.20/include/linux/timex.h
>   /usr/include/linux/timex.h to /usr/src/linux-2.4.20/include/linux/timex.h
> 
> Again, that's not what the INSTALL file says - it doesn't mention
> /usr/include/sys or /usr/include/asm, but it seemed to be
> the right thing to do since those files were patched.
> 
> I built the ntp-4.1.1 with ./configure --enable-TRIMTAIP --enable-ATOM
> and installed it.
> 
> Running ./ppsctl -ta -m -p/dev/ttyS1 gives output like
> 
> assert 33096 time 1053949352.999996024 delta 1.000000163 jitter -131
> assert 33097 time 1053949353.999994448 delta 0.999998424 jitter -1739
> assert 33098 time 1053949354.999994735 delta 1.000000287 jitter 1863
> assert 33099 time 1053949355.999995014 delta 1.000000279 jitter -8
> assert 33100 time 1053949356.999995131 delta 1.000000117 jitter -162
> assert 33101 time 1053949357.999995525 delta 1.000000394 jitter 277
> assert 33102 time 1053949358.999995838 delta 1.000000313 jitter -81
> assert 33103 time 1053949359.999996124 delta 1.000000286 jitter -27
> 
> which I take to mean that the kernel is within 5 or 10 microseconds
> of the PPS and jitter is a few microseconds too.  Maybe if I didn't
> run the PPS over 200 feet of RS-232 cabling the jitter would be less -
> I'm going to upgrade to differential drivers/receivers when the parts
> come from Digikey.  I don't expect a world of difference since the
> Trimble specs say the PPS is only good to a microsecond anyway.
> 
> Running ntpq -c peers says I can see the Trimble TAIP just fine, jitter is
> about 1 ms, not too shabby for a 4800 bps connection I assume.  Offset
> is about 32 ms, this must be the skew between the serial data stream and
> the DCD line.  I can run ntpq -c 'cv 39140' (where 39140 is the
> association ID of the Trimble TAIP) and see the ASCII stream
> from the TAIP and count the number of satellites, etc.  Real cool.
> 
> So everything appears to be working.  My question now is the output
> of ntptime, which looks like:
> 
> bash-2.05a# /usr/local/bin/ntptime   
> ntp_gettime() returns code 0 (OK)
>   time c27c7cc2.4d885000  Mon, May 26 2003  7:45:06.302, (.302861),
>   maximum error 3113 us, estimated error 1877 us, TAI offset 0
> ntp_adjtime() returns code 0 (OK)
>   modes 0x0 (),
>   offset 4.000 us, frequency -128.627 ppm, interval 256 s,
>   maximum error 3113 us, estimated error 1877 us,
>   status 0x107 (PLL,PPSFREQ,PPSTIME,PPSSIGNAL),

You are not running NANO, maybe because you forgot to remove config.cache?

>   time constant 2, precision 1.000 us, tolerance 496 ppm,
>   pps frequency -128.627 ppm, stability 0.010 ppm, jitter 1.000 us,
>   intervals 353, jitter exceeded 75, stability exceeded 8, errors 4.
> 
> I don't see "NANO" in the status, even though I'm running with the
> nanokernel.

Correct.

> 
> If I add the "-N" flag to the ntptime invocation I get
> 
> ntp_gettime() returns code 0 (OK)
>   time c27c7cee.b1c20000  Mon, May 26 2003  7:45:50.694, (.694366),
>   maximum error 3212 us, estimated error 2326 us, TAI offset 0
> ntp_adjtime() returns code 0 (OK)
>   modes 0x2000 (NANO),
>   offset 5.015 us, frequency -128.615 ppm, interval 256 s,
>   maximum error 3212 us, estimated error 2326 us,
>   status 0x2107 (PLL,PPSFREQ,PPSTIME,PPSSIGNAL,NANO),
>   time constant 2, precision 0.280 us, tolerance 496 ppm,
>   pps frequency -128.615 ppm, stability 0.010 ppm, jitter 0.906 us,
>   intervals 354, jitter exceeded 75, stability exceeded 8, errors 4.
> 
> and the "-N" seems to take hold because subsequent invocations without
> the "-N" still show "NANO".  I look around at past posts to
> comp.protocols.time.ntp and I see that everyone else with a nanokernel
> always gets "NANO" and they don't seem to run ntptime -N.
> Did I do something wrong in building ntptime and/or my kernel
> and/or setting up the include files?
> 
> I'm pretty sure the maximum and estimated errors are really in the
> few microseconds range, not the thousands of microseconds as
> reported by ntptime.  Again, something seems to be out of whack with
> my ntptime reports with regard to nanoseconds vs microseconds.
> 
> If someone can give me some hints about diagnosing ntptime, I promise
> to write a new README for PPSkit that doesn't talk about timepps.h
> and tells the novice to ignore "enable_pps.c" :-)
> 
> Tim.

Regards,
Ulrich



More information about the questions mailing list