NTP GPS Time Server

From Hack Sphere Labs Wiki
Revision as of 22:14, 9 February 2013 by Webdawg (talk | contribs) (Objective)

Jump to: navigation, search

Objective

NTP to read time from GPS and serv it. I am having a problem where if I do not have a networked based time server added it will not pull information from gpsd. If I add a network server it does. Think it is some type of polling bug or some shit.

Hardware

  • Garmin GPS18x USB
  • Raspberry Pie

Config

  • Install Archlinux ARM on the pi
  • Update Archlinux
  • Install gpsd
cp /usr/lib/systemd/system/gpsd.service /etc/systemd/system/
nano /etc/systemd/system/gpsd.service
  • Change a Line
ExecStart=/usr/sbin/gpsd -N -n /dev/ttyUSB0
  • Save
systemctl reenable gpsd.service
systemctl restart gpsd.service
  • You have have to enable at some point too
  • Test
cgps
  • Install ntpd (openntpd something about linux no work)
pacman -Sv ntp
  • Does not Support PPS?

Looks like the usb gps 18x does not support PPS which sends a pulse that enables ntpd to sync more accurately. (I think - This is what the tech specs say) This means this time server will be limited.

/etc/ntp.conf
Template error: are you trying to use the = sign? Visit Help:Template#Escape template-breaking characters for workarounds.

PPS

It looks like the USB version of the GPS-18x does not support PPS output.

Be sure to get the -LVC version of GPS-18x. The other two versions, -PC and -USB, do not have a PPS output line and cannot be used for time synchronization.

GPS-18x must be connected to a physical COM (RS-232) port, a USB-to-serial adapter cannot be used in this application.

Solder a DB-9 femail connector to the bare wire terminals of GPS-18x LVC as shown in Table 1.

GPS-18x requires a 5V power supply. The +5V voltage may be obtained from a USB port on the PC, as shown in the table, or from a separate power supply.

Some more reference from the Garmin Manual:

4.4 4.4.1 MEASUREMENT PULSE OUTPUT (GPS 18x LVC & 18x-5Hz ONLY) One-Pulse-Per-Second (PPS) Output (GPS 18x LVC Only) The highly accurate one-pulse-per-second (PPS) output is provided for applications requiring precise timing measurements. After the initial position fix has been calculated, the PPS signal is generated and continues until the unit is powered down. The rising edge of the signal is aligned to the start of each GPS second within 1 μs for all conditions in which the re ceiver has reported a valid and accurate position for at least the previous 4 seconds. The NMEA 0183 sentences that follow each rising edge of the PPS signal tell when you were and where you were at that previous rising edge of the PPS signal, beginning with the GPRMC sentence as the lead sentence in any particular NMEA 0183 record. Regardless of the selected baud rate, the information transmitted by the GPS 18x series products is referenced to the pulse immediately preceding the NMEA 0183 RMC sentence. The accuracy of the one-pulse-per-second output is maintained only while the GPS receiver is computing a valid position fix. To obtain the most accurate results, the one-pulse-per-second output should be calibrated against a local time reference to compensate for cable and internal receiver delays and the local time bias. The default pulse width is 100 ms, however; it may be programmed in 20 ms increments between 20 ms and 980 ms as described in $PGRMC section 4.1.2 Sensor Initialization Information (PGRMI), field <13>. 4.4.2 Five-Pulse-Per-Second Output (GPS 18x-5Hz Only) The highly accurate five-pulse-per-second output is provided for applications requiring precise timing measurements. After the initial position fix has been calculated, the GPS 18x-5Hz generates the pulse signal, which continues until power down. The rising edge of the signal is aligned to the start of each GPS second within 1 μs for all conditions in which the receiver has reported a valid and accurate position for at least the previous 4 seconds. The NMEA 0183 sentences that follow each rising edge of the Measurement Pulse Output signal tell when and where you were at that previous rising edge of the Measurement Pulse Output signal, beginning with the GPRMC sentence as the lead sentence in any particular NMEA 0183 record. Regardless of the selected baud rate, the information transmitted by the GPS 18x-5Hz is referenced to the preceding five times per-second output pulse. The accuracy of the five-pulse-per-second output is maintained only while the GPS 18x-5Hz can compute a valid position fix. To obtain the most accurate results, the five-pulse-per-second output should be calibrated against a local time reference to compensate for cable and internal receiver delays and the local time bias. The default pulse width is 100 ms, however; it may be programmed in 20 ms increments between 20 ms and 180 ms as described in $PGRMC section 4.1.2 Sensor Initialization Information (PGRMI), field <13>.

Commands and Utils

gpspipe -r
ntpq -p

http://gpsd.berlios.de/gpsctl.html

Notes

There is talk here of PPS over usb:

RPie Info:

Garmin Info:

GPSD:

gpsd and serial and config

THE MOST IMPORTANT POST YET(WHAT IS ALL THIS NTP CONFIG BS?)