gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH] HOWTO: calculate the average GPS offset


From: Beat Bolli
Subject: [gpsd-dev] [PATCH] HOWTO: calculate the average GPS offset
Date: Mon, 21 Oct 2013 23:29:21 +0200

---
 www/gpsd-time-service-howto.txt | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/www/gpsd-time-service-howto.txt b/www/gpsd-time-service-howto.txt
index 62aefda..c0592a3 100644
--- a/www/gpsd-time-service-howto.txt
+++ b/www/gpsd-time-service-howto.txt
@@ -459,6 +459,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
-- 
1.8.4.rc3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]