[time-nuts] Raspberry PI 3 NTP server with GPS time data.

David J Taylor david-taylor at blueyonder.co.uk
Mon Apr 25 03:06:09 EDT 2016


-----Original Message----- 
From: jan hugo prins
Sent: Sunday, April 24, 2016 7:51 PM
To: time-nuts at febo.com
Subject: [time-nuts] Raspberry PI 3 NTP server with GPS time data.

Hi,

To get a more stable NTP source into our production network I have
started exprerimenting with a Raspberry PI 3 with a GPS head. GPS data
is coming in fine, but the time is jumping around like a wild horse. The
result is that the only thing I get out of this experiment so far is a
more stable PPS signal in my NTP config but after some time both the GPS
time and the PPS are marked a false ticker and the only thing left is
the external reference clocks from outside our own network.

Parts used:
Raspberry PI 3
Adafruit GPS head: ADA-2324
External GPS antenna with 5 meter cable.

My NTP config looks like this:

logfile /var/log/ntpd.log
logconfig = all
driftfile /var/lib/ntp/ntp.drift
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 127.127.22.0 minpoll 4 maxpoll 4 prefer
fudge 127.127.22.0 refid PPS flag3 1
server 127.127.28.0 minpoll 4 maxpoll 4 iburst
fudge 127.127.28.0 refid GPS time1 +0.550 flag1 1 stratum 4
server ntp0.nl.uu.net
server chime6.surfnet.nl
server chime5.surfnet.nl
server ntp1.virtu.nl

Now I got the idea that I might be able to use a DCF77 receiver to get a
stable timesource, but on the other hand, if the cause of my problem is
internal to the Raspberry PI setup then I might have exactly the same
problem with the DCF77 receiver.

The average on the NTP clocksource is close to 0.
root at raspberrypi:/var/log/ntpstats# cat peerstats |grep 127.127.28.0
|awk '{print $5}'| tail -n 1500 | awk 'NR == 1 { max=$1; min=$1; sum=0 }
{ if ($1>max) max=$1; if ($1<min) min=$1; sum+=$1;} END {printf "Min:
%d\tMax: %d\tAverage: %f\n", min, max, sum/NR}'
Min: 0    Max: 0    Average: 0.001101

Could anyone give me some advice on how to get this working? Or is my
idea to use a GPS clock to create a stable NTP setup the wrong way to go?

Thanks for any advice.
Jan Hugo Prins
===================================

Jan Hugo,

I wrote up some notes on using a GPS/PPS source with the Raspberry Pi, 
including the RPi-3 here:

  http://www.satsignal.eu/ntp/Raspberry-Pi-quickstart.html

You can certainly get good enough performance if your antenna provides a 
good view of the GPS satellites, as shown in the plots here (all RPi-3):

  http://www.satsignal.eu/mrtg/raspi11_ntp.html
  http://www.satsignal.eu/mrtg/raspi12_ntp.html
  http://www.satsignal.eu/mrtg/raspi13_ntp.html
  http://www.satsignal.eu/mrtg/raspi14_ntp.html

and in summary here:

  http://www.satsignal.eu/mrtg/performance_ntp.php

Note that the sudden changes around 12 UTC and RasPi-11 and -12 are due to 
them being on an open bench which became sunlit around that time.  For best 
performance, an unheated cupboard is recommended.  All these have a puck 
antenna, indoors, but placed as near to a wall or window as possible.  You 
can see the  number of available and used GPS satellites here:

  http://www.satsignal.eu/mrtg/performance_gps.php

so temperature is the prime cause of the drift, not lack of satellites in 
view.  As you can see +/- 20 microseconds is relatively easy to achieve. 
The RPi-3 can serve thousands of clients.

I use this GPS:

  https://store.uputronics.com/index.php?route=product/product&path=60_64&product_id=81

which has the respected ublox MAX M8Q module.

Cheers,
David
-- 
SatSignal Software - Quality software written to your requirements
Web: http://www.satsignal.eu
Email: david-taylor at blueyonder.co.uk
Twitter: @gm8arv 



More information about the time-nuts mailing list