[ntp:questions] How to improve precision on stratum 1 Raspberry Pi

ncg uk ncguk at hotmail.co.uk
Thu Dec 11 12:53:02 UTC 2014

Hi all,

This is my first post to the list. I have a Raspberry Pi B+ and Adafruit Ultimate GPS connected to a Virgin Media Superhub (broadband router) by a 0.5m cat6 ethernet cable. The GPS is attached to the Pi's GPIO and has an external active antenna placed on an inside window sill. The Pi is running Raspbian on a fast Class10 microSD card and has a kernel rebuilt to disable tickless and enable all appropriate PPS options, and has NTP 4.2.7p483 compiled with:

./configure --enable-linuxcaps --enable-ATOM --enable-NMEA --disable-ipv6 --disable-all-clocks --disable-parse-clocks --disable-debugging --srcdir=/home/pi/ntp-dev-4.2.7p483

and with my ntp.conf file set up thus:

driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

server ntp0.catn.com iburst
server ntp2c.mcc.ac.uk iburst
server ntp1.luns.net.uk iburst
server ntp1.uk.uu.net iburst

server mode 17 prefer minpoll 4 maxpoll 4 iburst
fudge time2 0.400 flag1 1 flag2 0 flag3 1 flag4 0

restrict default limited kod nomodify notrap nopeer


After an hour or so, "ntpq -crv -pn; ntptime; ntpq -c clockvar" shows:

associd=0 status=041d leap_none, sync_uhf_radio, 1 event, kern,
version="ntpd 4.2.7p483 at 1.2483-o Thu Dec 11 09:04:07 UTC 2014 (1)",
processor="armv6l", system="Linux/3.12.33", leap=00, stratum=1,
precision=-19, rootdelay=0.000, rootdisp=1.210, refid=GPS,
reftime=d8341156.ff1da5ba  Thu, Dec 11 2014 12:49:26.996,
clock=d8341165.9d93d89e  Thu, Dec 11 2014 12:49:41.615, peer=39341, tc=4,
mintc=3, offset=-0.000519, frequency=-29.184, sys_jitter=0.001907,
clk_jitter=0.001, clk_wander=0.002
     remote           refid      st t when poll reach   delay   offset  jitter
o127.127.20.0    .GPS.            0 l   15   16  377    0.000   -0.001   0.002
-     2 u    1   64  377   29.582    7.636   1.092
+    3 u    -   64  377   17.822    3.209   0.636
+    2 u    4   64  377   15.857    3.992   1.545
*    2 u   15   64  377   10.594    1.805   0.851
ntp_gettime() returns code 0 (OK)
  time d8341165.d6c093d8  Thu, Dec 11 2014 12:49:41.838, (.838876471),
  maximum error 8500 us, estimated error 1 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 0.000 us, frequency -29.199 ppm, interval 256 s,
  maximum error 8500 us, estimated error 1 us,
  time constant 4, precision 0.001 us, tolerance 500 ppm,
  pps frequency -29.199 ppm, stability 0.021 ppm, jitter 0.930 us,
  intervals 34, jitter exceeded 13, stability exceeded 0, errors 0.
associd=0 status=0000 no events, clk_unspec,
device="NMEA GPS Clock",
poll=224, noreply=0, badformat=0, baddata=0, fudgetime2=400.000,
stratum=0, refid=GPS, flags=5

I've tried using Banana Pi and Beagleboard Black SBCs and have also used u-blox Max-7Q and Trimble Copernicus II GPS breakout boards with no improvement, leading me to believe the roadblock to a more precise clock is in the Pi, so my questions are: can I improve upon this and, if so, how? Have I made any obvious errors? I've seen Pi Stratum servers with a precision of -20 and would like to achieve that if at all possible (I know we're talking microseconds here, but the more precise the better, right?). Any help much appreciated, thank you. 		 	   		  

More information about the questions mailing list