[time-nuts] NTP Servers - RPi, NTP-Sec, Teensy 4.1, and one on the way from eBay
Ben Hall
kd5byb at gmail.com
Sun Jan 10 16:30:52 UTC 2021
Good morning all,
Several weeks ago, my Raspberry Pi (RPi) based GPS/NTP server quit
working. I really can't complain, I want to say that it's been up,
operational, and serving network time to my network for at least two years.
I immediately rebuilt the installation from scratch on a new micro-SD
card following the instructions here using an older Adafruit "Ultimate
GPS" module.
<https://weberblog.net/ntp-server-via-gps-on-a-raspberry-pi/>
It didn't seem to be working, so I started looking around at other
sources of NTP for my network...used one from the e-place, new ones from
the e-place, and recalling the posts here about the Teensy 4.1 based
GPS/NTP server, I put one of those on order from PJRC.
In the mean time, I found that NTPSec.org had a similar how-to for an
RPi NTP server, but built around NTP-Sec:
<https://www.ntpsec.org/white-papers/stratum-1-microserver-howto/>
I found another RPi banging around and a uBlox module (NEO-M8, I think)
so I built up another RPi GPS NTP install based on the NTP-Sec
instructions. There are some minor issues with the instructions dealing
with file locations / path names, but in the end I got it together and
working.
NTP-Sec notes that: "We have improved the accuracy of time stepping
with real hardware by x10. When NTP was originally written, computer
clocks only delivered microsecond precision. Now they deliver nanosecond
precision (though not all of that precision is accurate). By changing
some internal representations we have made NTPsec able to use the full
precision of modern clocks, which results in a factor 10 or more of
accuracy improvement with real hardware such as GPSDOs and dedicated
time radios."
I can't verify that claim, but output from ntpq (as well as the Meinberg
NTP monitor on my Win10 box) do show displays with additional precision.
On the standard NTP server, there are three decimal places of precision
in delay, offset, and jitter, IE:
delay offset jitter
======================
0.076 1.180 0.487
0.396 0.872 0.726
0.329 1.649 0.457
(I tried to cut-n-paste the whole ntpq output, but it wraps the text
oddly, so I cut it back to just delay, offset, and jitter.)
While on the NTP-Sec server, on the output of ntpq, there are at least four:
delay offset jitter
======================
0.0000 0.0740 0.0027
85.4951 -1.7276 11.7616
40.9579 -1.9249 13.8848
25.7753 -0.5499 16.9417
The windows Meinberg NTP monitor shows three decimal places of precision
monitoring the normal NTP RPi server, but ***SIX*** on the NTP-Sec RPi
server:
delay offset jitter
===============================
0.000000 0.065740 0.005841
84.038857 -0.854786 0.000954
(etc)
Is this just trickery or is that real precision? I don't know.
During the work-week, the Teensy 4.1 shipment from PRJC.com arrived.
After re-installing Arduino, needed libraries, and the Teensyduino
loader, I was able to load the code by ddrown as described in the post
below:
<https://forum.pjrc.com/threads/61581-Teensy-4-1-NTP-server>
(the thread contains links to the GitHub repositories for the code and
needed libraries)
While the Win10 box has yet to reach the Teensy 4.1-based NTP server,
the RPi has no issues, likes what it sees, and uses it for time-sync
without problem:
delay offset jitter
=======================
0.076 1.180 0.261
So I'm very pleased with the Teensy and ddrown's code - it all just
hooked up, compiled, and worked right the first time! :)
I've also got an NTP module on order from eBay, shipping from China. It
appears to be very similar to the unit described here:
<https://fc-ntp-100.toimii.fi/>
Oddly, it took it only five days to get from China to "Arrived at
Destination Hub - USA" but has now sat at the destination hub for five
days. You'd think that the USA part of the trip would be the fast part!
But nope...
I'll report back on how it goes when I receive it and get it set up.
thanks much and 73,
ben, kd5byb
More information about the Time-nuts_lists.febo.com
mailing list