Garmin GPS Handheld Receivers


Address: 127.127.45.u
Reference ID: GPS
Serial Port: /dev/gpsu; 9600 bps, 8-bits, no parity

Features: (none)


NTP clock driver for Garmin GPS handheld receivers using the Garmin proprietary protocol. It is based on both documented and undocumented aspects of the Garmin proprietary protocol.

To use this driver, your Garmin GPS handheld receiver must be configured to use Garmin protocol interface mode, not NMEA.

This driver has been written and tested using a Linux based system. To achieve the best quality results, turn off serial port FIFOs and enable low latency tty driver processing. In Linux, this is accomplished using the setserial application (e.g. setserial /dev/gpsu uart 16550 low_latency). Even better results are obtained with kernel timestamps on received characters. This is what I have been using for most of my tests.

This is a "sloppy" clock but I believe it is possible to recover sub-millisecond results with a good clock filter. Without an accurate reference clock, I am unable to provide more quantitative performance results at this time (sample loopstats).

I suspect that earlier versions of firmware may not return the undisciplined oscillator count as part of a date/time response. This information is needed to recover the higher accuracy results. Without this undocumented field, the driver will only achieve sub-second accuracy. I welcome technical support from the manufacturer to achieve universal support for the entire range of models and firmware versions.

This driver has been testing with the following units. I need feedback from users to populate this list! Check for updates to this list, driver, and other related software at at NTP Drivers for Garmin GPS Handheld Receivers

Fudge Factors

time1 time
Specifies the time offset calibration factor, in seconds and fraction, with default 0.0.
time2 time
Not used by this driver.
stratum number
Specifies the driver stratum, in decimal from 0 to 15, with default 0.
refid string
Specifies the driver reference identifier, an ASCII string from one to four characters, with default GPS.
flag1 0 | 1
Not used by this driver.
flag2 0 | 1
Not used by this driver.
flag3 0 | 1
Not used by this driver.
flag4 0 | 1
Not used by this driver.


Current Patches

The following patch was created against the ntp-4.2.0a+stable Debian package that is part of the Debian 3.1 release (Sarge).

In this version, the Garmin GPS driver is clock type 45 (Driver Version 1.4).
ntp-4.2.0a-garmin.patch (patch file only)

Here is the steps to create Debian ntp packages with the patch:

Old Patches

In these versions, the Garmin GPS driver is clock type 40 (Driver Version 1.3).
ntp-4.1.1-garmin.patch (patch file only)
ntp-4.1.0-garmin.patch (patch file only)
ntp-4.0.99m-rc3-garmin.patch (patch file only)
ntp-4.0.99k23-garmin.patch (patch file only)

In this version, the Garmin GPS driver is clock type 38 (Driver Version 1.2).
ntp-4.0.99k-garmin.patch (patch file only)

Patch for ntp3-5.93 distribution. Turn on flag1 for averaging of the samples that pass the recursive median filter. This averaging is done by default in the ntp4 daemon.

In this version, the Garmin GPS driver is clock type 38 (Driver Version 1.2).
xntp3-5.93-garmin.patch (patch file only)

Driver Versions

Version 1.4 of the refclock_garmin driver sets the unitptr to NULL when the device is closed.

Version 1.3 of the refclock_garmin driver file fixes 64 bit issues. I have it running on a DEC Alpha now.

Version 1.2 of the refclock_garmin driver file that attempts to be compatible with more Garmin models in the lower accuracy mode and switches to a higher accuracy mode if it detects the features seen on the Garmin GPS 12 firmware version 4.54. Thanks to Joe Stella for his help in resolving this problem and testing the solution.

Version 1.1 of the refclock_garmin driver file with a bug fix for double precision alignment on big endian RISC processors (i.e. SPARC). Thanks to Jeff Woolsey for his help in resolving this problem and testing the solution.

Version 1.0 of the refclock_garmin driver file.

Support Utilities

A standalone test application that implements the functionality of the NTP driver. This is useful for analyzing how other models and firmware versions behave.

kernel serial port timestamp module for Linux

Bob Lindell (