summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorBeat Bolli <bbolli@ewanet.ch>2013-10-21 23:29:21 +0200
committerEric S. Raymond <esr@thyrsus.com>2013-10-22 13:45:43 -0400
commitc01b8f571c0b6b9d8db27f6e11304bf259a01b7e (patch)
tree47705b9df6c0ae6168e7120b2f4269b139fa4635 /www
parent653e45624182b11bc349fe5f1c4d70690b1edbf5 (diff)
downloadgpsd-c01b8f571c0b6b9d8db27f6e11304bf259a01b7e.tar.gz
HOWTO: calculate the average GPS offset
Diffstat (limited to 'www')
-rw-r--r--www/gpsd-time-service-howto.txt30
1 files changed, 30 insertions, 0 deletions
diff --git a/www/gpsd-time-service-howto.txt b/www/gpsd-time-service-howto.txt
index 6bdc7c36..fc793050 100644
--- a/www/gpsd-time-service-howto.txt
+++ b/www/gpsd-time-service-howto.txt
@@ -528,6 +528,36 @@ If the offset is positive, reduce the time1 value and vice versa.
A more detailed description of the output is available at
<<NTPQ-OUTPUT>>.
+In order to determine the correct GPS offset, do the following:
+
+1. Add these lines to ntp.conf:
+
+-----------------------------------------------------------------------------
+statsdir /var/log/ntpstats/
+statistics peerstats
+filegen peerstats file peerstats type day enable
+-----------------------------------------------------------------------------
+
+This enables logging of the peer server statistics.
+
+2. Start ntpd and let it run for at least four hours.
+
+3. Calculate the average GPS offset:
+
+-----------------------------------------------------------------------------
+awk '
+ /127\.127\.28\.0/ { sum += $5 * 1000; cnt++; }
+ END { print sum / cnt; }
+' </var/log/ntpstats/peerstats
+-----------------------------------------------------------------------------
+
+This prints the average offset.
+
+5. Adjust the "time1" value in ntp.conf by subtracting the average
+ offset from step 4.
+
+6. Restart ntpd.
+
== Providing public NTP service ==
<<NTP-FAQ>> has good advice on things to be sure you have done - and