[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ntp-hackers
Subject:    [ntp:hackers] GPSD client clock
From:       juergen perlinger <juergen.perlinger () t-online ! de>
Date:       2014-02-17 19:38:33
Message-ID: 53026539.2090206 () t-online ! de
[Download RAW message or body]

Hello NTPD and GPS (GPSD?) users,

I have implemented a new clock driver for NTPD, using the GPSD client
protocol to talk to GPSD.

This is clock type 46; rudimentary documentation is currently available
in te HTML section of the tarball available at

   
http://support.ntp.org/people/perlinger/for_discussion/ntp4-4.2.7p421-gpsd.tar.bz2

for those who want to have a look. (Note: The tarball extracts to a
directory named 'ntp4-4.2.7p421' due to some limitations in the
Makefile.) The source file is 'refclock_gpsdjson.c'.

I consider this to be a work in progress; it currently features:

  * support for several GPS devices
  * automatic (re)connect to GPSD
  * set precision according to error estimation of GPSD
  * evaluation of PPS information from GPSD (REQUIRED to work!)


The configuration is rather simple, since there are no mode bits right
now, and the only fudge factor supported is the PPS correction as fudge
time 1. The device names are the same as the ones used by the NMEA
driver ('/dev/gps[0..n]'), so there is no need to create new symlinks
for a try if you have been using the NMEA driver already. (As GPSD and
NTPD must not access the same physical device at the same time, this
should cause no problems.) Simply use the symlink as device name for
GPSD, and everything should work.

The driver uses the GPSD JSON line protocol directly. The reason is that
the GPSD client library uses an internal IO model that does not
integrate well with NTPDs event driven / multiplexed IO handling; using
the GPSD client lib would require threading or polling. I will not use
polling, and I don't want to go into threading unless unavoidable.

Suggestions, comments & review welcome!

Cheers,
    Juergen 'Pearly' Perlinger
_______________________________________________
hackers mailing list
hackers@lists.ntp.org
http://lists.ntp.org/listinfo/hackers
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic