09 August 2011

Getting started with using GlobalSat ND-100S as a reference clock for NTP daemon.

# apt-get install gpsd ntp
# dpkg-reconfigure gpsd

Use options: GPSD_OPTIONS="-n" and DEVICES="/dev/ttyUSB0" (check /etc/default/gpsd). Then modify /etc/ntp.conf as follows.

server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS

Restart services and have a cup of coffee.

# /etc/init.d/gpsd restart
# /etc/init.d/ntp restart

After a couple of more cups of coffee, the synchronisation should be well under its way.
# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
*SHM(0) .GPS. 0 l 7 16 377 0.000 -9.734 1.985
# /usr/sbin/ntpdate -q localhost
server 127.0.0.1, stratum 1, offset -0.000012, delay 0.02568
9 Aug 23:31:55 ntpdate[19385]: adjust time server 127.0.0.1 offset -0.000012 sec

Note that the local box just became Stratum 1 time server. When compared with an industry heavy-weight, it is doing just fine.

# /usr/sbin/ntpdate -q time.asia.apple.com
server 17.83.253.7, stratum 2, offset -0.391850, delay 0.03418
server 17.82.253.7, stratum 2, offset -0.391019, delay 0.12320
9 Aug 23:35:31 ntpdate[19405]: adjust time server 17.83.253.7 offset -0.391850 sec

Done. Now what's next?

1 comment:

軽No.1のすずき said...

grate effort!