Tuesday, February 23, 2016

Replacing a commercial NTP server with a Raspberry Pi

This past week, my rack-mount, commercial GPS NTP box suffered a failure. Apparently, the GPS receiver was unable to make sense of an extended week count number, rolled over, and now thinks it's 1996. There's a firmware patch for it, but mine didn't seem to like it (the manufacturer has been very helpful and we are working through it.)

While I'd certainly like to think it's now 1996 again (let's see, buy some silver, some Bitcoin, sell Lucent stock...) it's not, and having your network clock so far off isn't the best thing for time-sensitive signed certificates.

In steps the Raspberry Pi. While there have been a number of ways to use a Pi as a NTP server, such as this guide, the hardware they rely on can sometimes be difficult to get, especially if a few years have passed since the article was written.

That guide did show a link to a piece of hardware that is still available in an updated form.

This board is designed to drop directly on top of a Raspberry Pi + or 2, and provides, according to the vendor, an adequate enough service for a Pi-based NTP server, as well as stationary mode and PPS output. I take that to mean that it's not going to be as good as say, a US$5000 unit, but is going to be much better than trying to sync from internet-based time clocks, especially if you want all of your local devices to be very close in reported time. They even provide a helpful how-to guide for setting up a stratum-1 NTP server.

You can order one of these boards from habsupplies' online store. I currently have a board + antenna on order, when I can get it installed I'll do a quick write-up of my experiences.

Note: The original problem was older Trimble GPS units rolled over at week 1024, taking the date back to 1996. The firmware patch corrects this by, I assume, making the attached computer think it's year+20. The original device is now working again - I had to get special instructions from the manufacturer of the NTP box regarding disabling certain watchdogs to allow the firmware update to complete.