Welcome!

@DevOpsSummit Authors: Liz McMillan, Elizabeth White, David Linthicum, Zakia Bouachraoui, Yeshim Deniz

Related Topics: @DevOpsSummit, Java IoT, Agile Computing

@DevOpsSummit: Blog Post

How to Add a GPS Time Source to ntpd | @DevOpsSummit #DevOps

It's also possible to feed the time information to ntpd as a back-up time source or as a highly accurate time source

adding-gps-time-source-to-ntpd

How to Add a GPS Time Source to ntpd
by Jimmy Tang

USB GPS dongles have come down significantly in price in recent years and I picked one up to play with recently.

Apart from using a GPS module to report your latitude, longitude, altitude and time for mapping applications, it's also possible to feed the time information to ntpd as a back-up time source or as a highly accurate time source depending on the GPS module you end up getting.

The module that I use in this blog post is a Columbus v800 which was reasonably cheap (around 35USD of ebay), I had originally bought it for recording my GPS tracks on long haul flights on my laptop.

To add the USB GPS time source to ntpd, first install ntpd and the needed GPS related daemons and tools.

On a recent Ubuntu machine I did the following, this should work on a recent Debian machine as well.

apt-get install ntpd gpsd-clients gpsd gpsd-clients

Once the tools are installed, edit `/etc/default/gpsd` and modify the like that reads:

GPSD_OPTIONS=""

To this:

GPSD_OPTIONS="-n"

The above change will make the GPS look for satellites as soon as it starts up. Gpsd presents data to the user in a number of ways; in this case gpsd is already writing information out to a shared memory segment that ntpd understands as it usually follows the NMEA standard - some more information can be found herehttp://www.catb.org/gpsd/NMEA.html.

Once gpsd is restarted,  verify that you are receiving data by running the `cgps` command from a terminal window. If it works, this would be the type of output that is expected:

2015-07-27-162817_916x706_scrot

Hit ctrl-c and exit from this application. Once the GPS module is functioning as expected, ntpd must be configured to use GPS dongle as a time source.

Add the following to `/etc/ntp.conf`

# GPS Serial data reference
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.0 refid GPS

# GPS PPS reference
server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid PPS

The above adds two sources - the GPS time source from the serial data reference, a generic time source available on almost all GPS dongles; and the PPS reference, not always available on the cheaper GPS dongles but it is far more accurate if it is available. See http://www.catb.org/gpsd/hardware.html for a list of recommended GPS modules that have PPS output.

Once the above lines have been added to ntp.conf, ntpd should be restarted. To further understand the configuration see http://doc.ntp.org/4.2.6/drivers/driver28.html

To verify that the GPS module is indeed feeding ntpd, run the command `ntpq -p` in a terminal

2015-07-27-164615_916x706_scrot

Here the GPS time source is selected as the primary time source as it has a small offset and no delay. Over time the V800 GPS module introduces jitter which is either large or not consistent with the other time servers, ntpd then flags this particular time source as being a falseticker and as a result it is not used.

There is not much advantage of using this particular GPS device as a time source due to its lack of a PPS time source and high or random jitter. However if the network is unreliable and drops out the gps time source will be promoted back to a valid time source as the networked time servers are not accessible.

This may be useful for applications where having accurate time important and the network connection is either unreliable or non-existent.

More Stories By Trevor Parsons

Trevor Parsons is Chief Scientist and Co-founder of Logentries. Trevor has over 10 years experience in enterprise software and, in particular, has specialized in developing enterprise monitoring and performance tools for distributed systems. He is also a research fellow at the Performance Engineering Lab Research Group and was formerly a Scientist at the IBM Center for Advanced Studies. Trevor holds a PhD from University College Dublin, Ireland.

@DevOpsSummit Stories
CloudEXPO | DevOpsSUMMIT | DXWorldEXPO Silicon Valley 2019 will cover all of these tools, with the most comprehensive program and with 222 rockstar speakers throughout our industry presenting 22 Keynotes and General Sessions, 250 Breakout Sessions along 10 Tracks, as well as our signature Power Panels. Our Expo Floor will bring together the leading global 200 companies throughout the world of Cloud Computing, DevOps, IoT, Smart Cities, FinTech, Digital Transformation, and all they entail. As your enterprise creates a vision and strategy that enables you to create your own unique, long-term success, learning about all the technologies involved is essential. Companies today not only form multi-cloud and hybrid cloud architectures, but create them with built-in cognitive capabilities.
In today's always-on world, customer expectations have changed. Competitive differentiation is delivered through rapid software innovations, the ability to respond to issues quickly and by releasing high-quality code with minimal interruptions. DevOps isn't some far off goal; it's methodologies and practices are a response to this demand. The demand to go faster. The demand for more uptime. The demand to innovate. In this keynote, we will cover the Nutanix Developer Stack. Built from the foundation of software-defined infrastructure, Nutanix has rapidly expanded into full application lifecycle management across any infrastructure or cloud .Join us as we delve into how the Nutanix Developer Stack makes it easy to build hybrid cloud applications by weaving DBaaS, micro segmentation, event driven lifecycle operations, and both financial and cloud governance together into a single unified st...
For far too long technology teams have lived in siloes. Not only physical siloes, but cultural siloes pushed by competing objectives. This includes informational siloes where business users require one set of data and tech teams require different data. DevOps intends to bridge these gaps to make tech driven operations more aligned and efficient.
Daniel Jones is CTO of EngineerBetter, helping enterprises deliver value faster. Previously he was an IT consultant, indie video games developer, head of web development in the finance sector, and an award-winning martial artist. Continuous Delivery makes it possible to exploit findings of cognitive psychology and neuroscience to increase the productivity and happiness of our teams.
Hackers took three days to identify and exploit a known vulnerability in Equifax’s web applications. I will share new data that reveals why three days (at most) is the new normal for DevSecOps teams to move new business /security requirements from design into production. This session aims to enlighten DevOps teams, security and development professionals by sharing results from the 4th annual State of the Software Supply Chain Report -- a blend of public and proprietary data with expert research and analysis.Attendees can join this session to better understand how DevSecOps teams are applying lessons from W. Edwards Deming (circa 1982), Malcolm Goldrath (circa 1984) and Gene Kim (circa 2013) to improve their ability to respond to new business requirements and cyber risks.