Skip to content
Snippets Groups Projects
Commit ffb1b302 authored by Alex Myczko's avatar Alex Myczko
Browse files

surely must be handshake

parent 5ac248f4
No related branches found
No related tags found
No related merge requests found
How to build a stratum 1 NTP server with GPS time reference
===========================================================
Since a reliable time reference is crucial to any network, we were looking for replacement hardware for our failing time servers which were strata 2+ anyway. Nowadays GPS synchronized NTPs are the way to go, and as GPS receivers have become reasonably cheap, we decided to follow this route too. For the GPS receiver, we chose the [Garmin GPS 18x LVC](https://buy.garmin.com/shop/shop.do?cID=158&pID=27594) since it sports the highly precise PPS signal and a serial interface. In Switzerland it can be ordered at http://www.gps-shop.ch/ with the usual premium profit margin compared to other countries (CHF 145.- vs. USD 60.-). Our original idea was to use a [alix2c3](http://pcengines.ch/alix2c3.htm) board from [PC Engines](http://pcengines.ch/) for the time server, but it turned out that the AMD Geode companion chip on this device does not implement the RS232 handshare lines we need for the PPS signal. We then settled on the [alix1c](http://pcengines.ch/alix1c.htm) that we have come to love in [earlier projects](http://nic.phys.ethz.ch/news/1204219612/index_html) and that also has a fully equipped serial port.
Since a reliable time reference is crucial to any network, we were looking for replacement hardware for our failing time servers which were strata 2+ anyway. Nowadays GPS synchronized NTPs are the way to go, and as GPS receivers have become reasonably cheap, we decided to follow this route too. For the GPS receiver, we chose the [Garmin GPS 18x LVC](https://buy.garmin.com/shop/shop.do?cID=158&pID=27594) since it sports the highly precise PPS signal and a serial interface. In Switzerland it can be ordered at http://www.gps-shop.ch/ with the usual premium profit margin compared to other countries (CHF 145.- vs. USD 60.-). Our original idea was to use a [alix2c3](http://pcengines.ch/alix2c3.htm) board from [PC Engines](http://pcengines.ch/) for the time server, but it turned out that the AMD Geode companion chip on this device does not implement the RS232 handshake lines we need for the PPS signal. We then settled on the [alix1c](http://pcengines.ch/alix1c.htm) that we have come to love in [earlier projects](http://nic.phys.ethz.ch/news/1204219612/index_html) and that also has a fully equipped serial port.
There's a nice [website](http://time.qnan.org/) explaining in detail how to connect the GPS to the serial port. The author suggests an LED to indicate the presence of the PPS signal. This is a great idea, but we would like to show the PPS not on a hardware level, but directly from the SHM (shared memory) where ntpd fetches it from. We therefore connected two transistor-driven LEDs to the alix GPIO port (pins 13 and 14, GP21 and 22) and use a small C daemon to read the SHM and control the LEDs: `gpsheartbeat.c` - compile it with `gcc -o gpsheartbeat gpsheartbeat.c` and copy it to `/usr/local/bin/`
```c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment