[time-nuts] In search of ways to improve Raspberry Pi stratum 1 server

Neil Green ncguk at hotmail.co.uk
Mon Jan 12 07:30:43 EST 2015

Hi all,

This is my first post to the list. I have a Raspberry Pi B+ and a HAB Supplies U-Blox Max-M8Q set in stationary mode connected to a Virgin Media Superhub (broadband router) by a 0.5m cat7 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 (Linux raspberrypi 3.12.35 #1 PREEMPT Sun Jan 11 17:40:22 GMT 2015 armv6l GNU/Linux) rebuilt to disable tickless, enable PHY timestamping and enable all appropriate PPS options, and has NTP 4.2.8p1-beta5 compiled with:

./configure --enable-linuxcaps --enable-ATOM --enable-NMEA --disable-ipv6 --disable-all-clocks --disable-parse-clocks --disable-debugging

and with my ntp.conf file set up thus:

logfile /var/log/ntp.log
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats protostats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
filegen protostats file protostats type day enable
leapfile /home/time/leap-seconds.3629404800

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

server mode 17 minpoll 4 maxpoll 4 prefer
fudge flag1 0 flag2 0 flag3 0 flag4 0 time1 0.00000 time2 0.1137

server minpoll 4 maxpoll 4
fudge refid PPS time1 0.000 flag2 0 flag3 1

restrict default limited kod nomodify notrap nopeer


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

associd=0 status=011d leap_none, sync_pps, 1 event, kern,
version="ntpd 4.2.8p1-beta5 at 1.3265-o Sun Jan 11 19:10:22 UTC 2015 (1)",
processor="armv6l", system="Linux/3.12.35", leap=00, stratum=1,
precision=-19, rootdelay=0.000, rootdisp=1.015, refid=PPS,
reftime=d85e39b2.e1489c74  Mon, Jan 12 2015 12:16:50.880,
clock=d85e39b4.0ea565be  Mon, Jan 12 2015 12:16:52.057, peer=4258, tc=4,
mintc=3, offset=-0.000466, frequency=-17.209, sys_jitter=0.001907,
clk_jitter=0.001, clk_wander=0.000, tai=35, leapsec=201507010000,
     remote           refid      st t when poll reach   delay   offset  jitter
*    .GPS.            0 l    3   16  377    0.000   -1.066   2.801
o127.127.22.0    .PPS.            0 l    2   16  377    0.000    0.000   0.002
-     2 u   34   64  377   29.758    8.186   0.977
-     3 u   14   64  377   17.783    1.952   0.580
+    2 u    7   64  377   15.947    4.033   0.814
+    2 u   15   64  377   10.319    1.873   0.553  .INIT.          16 u    - 1024    0    0.000    0.000   0.000
ntp_gettime() returns code 0 (OK)
  time d85e39b4.49e7c8d4  Mon, Jan 12 2015 12:16:52.288, (.288693882),
  maximum error 2000 us, estimated error 1 us, TAI offset 35
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset 0.000 us, frequency -17.209 ppm, interval 256 s,
  maximum error 2000 us, estimated error 1 us,
  time constant 4, precision 0.001 us, tolerance 500 ppm,
  pps frequency -17.207 ppm, stability 0.004 ppm, jitter 0.507 us,
  intervals 73, jitter exceeded 45, stability exceeded 0, errors 0.
associd=0 status=0000 no events, clk_unspec,
device="PPS Clock Discipline", timecode=, poll=828, noreply=0,
badformat=0, baddata=0, stratum=16, refid=, flags=4

I've tried using Banana Pi and Beaglebone Black SBCs and have also used u-blox Max-7Q and Trimble Copernicus II GPS breakout boards with no improvement (The Banana Pi is the best but is stuck on the Allwinner 3.4 kernel, which I'm not thrilled about), leading me to believe the roadblock to a more precise clock lies in my less than ideal antenna setup, but my questions are: can I improve upon this and, if so, how? Have I made any obvious errors? I'm relatively new to this and would appreciate any advice I can get.


More information about the time-nuts mailing list