Welcome!

@DevOpsSummit Authors: Zakia Bouachraoui, Pat Romanski, Liz McMillan, Elizabeth White, 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
The current environment of Continuous Disruption requires companies to transform how they work and how they engineer their products. Transformations are notoriously hard to execute, yet many companies have succeeded. What can we learn from them? Can we produce a blueprint for a transformation? This presentation will cover several distinct approaches that companies take to achieve transformation. Each approach utilizes different levers and comes with its own advantages, tradeoffs, costs, risks, and outcomes.
Contino is a global technical consultancy that helps highly-regulated enterprises transform faster, modernizing their way of working through DevOps and cloud computing. They focus on building capability and assisting our clients to in-source strategic technology capability so they get to market quickly and build their own innovation engine.
DevOpsSUMMIT at CloudEXPO will expand the DevOps community, enable a wide sharing of knowledge, and educate delegates and technology providers alike. Recent research has shown that DevOps dramatically reduces development time, the amount of enterprise IT professionals put out fires, and support time generally. Time spent on infrastructure development is significantly increased, and DevOps practitioners report more software releases and higher quality. Sponsors of DevOpsSUMMIT at CloudEXPO will benefit from unmatched branding, profile building and lead generation opportunities.
You want to start your DevOps journey but where do you begin? Do you say DevOps loudly 5 times while looking in the mirror and it suddenly appears? Do you hire someone? Do you upskill your existing team? Here are some tips to help support your DevOps transformation. Conor Delanbanque has been involved with building & scaling teams in the DevOps space globally. He is the Head of DevOps Practice at MThree Consulting, a global technology consultancy. Conor founded the Future of DevOps Thought Leaders Debate. He regularly supports and sponsors Meetup groups such as DevOpsNYC and DockerNYC.
Modern software design has fundamentally changed how we manage applications, causing many to turn to containers as the new virtual machine for resource management. As container adoption grows beyond stateless applications to stateful workloads, the need for persistent storage is foundational - something customers routinely cite as a top pain point. In his session at @DevOpsSummit at 21st Cloud Expo, Bill Borsari, Head of Systems Engineering at Datera, explored how organizations can reap the benefits of the cloud without losing performance as containers become the new paradigm.