Because people do in fact drop money in my PayPal and Patreon accounts, I think a a decent respect to the opinions of mankind requires that I occasionally update everyone on where the money goes. First in an occasional series,
Recently I’ve been buying Raspberry Pi GPS HATs (daughterboards with a GPS and real-time clock) to go with the Raspberry PI 3 Dave Taht dropped on me. Yesterday morning a thing called an Uputronics GPS Extension Board arrived from England. A few hours ago I ordered a cheap Chinese thing obviously intended to compete with the Adafruit GPS HAT I bought last week.
The reason is that I’m working up a very comprehensive HOWTO on how to build a Stratum 1 timeserver in a box. Not content to merely build one, I’m writing a sheaf of recipes that includes all three HATs I’ve found and (at least) two revisions of the Pi.
What makes this HOWTO different from various build pages on this topic scattered around the Web? In general, the ones I’ve found are well-intended but poorly written. They make too many assumptions, they’re tied to very specific hardware types, they skip “obvious” steps, they leave out diagnostic details about how to tell things are going right and what to do when things go wrong.
My goal is to write a HOWTO that can be used by people who are not Linux and NTP experts – basically, my audience is anyone who could walk into a hackerspace and not feel utterly lost.
Also, my hope is that by not being tightly tied to one parts list this HOWTO will help people develop more of a generative understanding of how you compose a build recipe, and develop their own variations.
I cover everything, clear down to how to buy a case that will fit a HAT. And this work has already had some functional improvements to GPSD as a side effect.
I expect it might produce some improvements in NTPsec as well – our program manager, A&D regular Mark Atwood, has been smiling benignly on this project. Mark’s plan is to broadcast this thing to a hundred hackerspaces and recruit the next generation of time-service experts that way.
Three drafts have already circulated to topic experts. Progress will be interrupted for a bit while I’m off at Penguicon, but 1.0 is likely to ship within two weeks or so.
And it will ship with the recipe variations tested. Because that’s what I do with your donations. If this post stimulates a few more, I’ll add an Odroid C2 (Raspberry Pi workalike with beefier hardware) to the coverage; call it a stretch goal.
Speaking as a (very small) Patreon donor: Awesome! I’m glad my support is going to this sort of thing. (Especially the knowing-when-pass *and* knowing-when-fail sections highlighted above.)
I would be happy to do hackerspace-side testing for you at i3Detroit; we have been working on getting a Nortel GPSDO online there as both a 10MHz standard and for NTP.
>I would be happy to do hackerspace-side testing for you at i3Detroit; we have been working on getting a Nortel GPSDO online there as both a 10MHz standard and for NTP.
We should talk about this at Penguicon.
BTW, does your hackerspace have any uses for oldish but quite serviceable tower PCs? I’m decomissioning three – the bastion server that got replaced by a fanless mini-ITX box and two others I had taking up space.
I have quietly wondered, but never bothered to look, into the issue of whether NTP demons assume that GPS is always perfect, or if they sanity check it in case it departs. Is GPS the only thing steering a stratum 1 server for which it is the clock? Or is it actually the internal clock of the device, which pi’s don’t have as I understand it?
Yes, I know, those are probably questions I ought already know the answer to.
This is cool, from snark two weeks ago about Rasberry Pi’s not keeping time to a hardware agnostic set of instructions on making a Pi into a real time service.
Raspberry Pi is made by SJWs. If you get one, buy one used.
Raspberry Pi is made by SJWs.
And?
If you get one, buy one used.
I wasn’t aware that you had to sign your soul over to the great god SJWzilla (who identifies as a ferret) in order to purchase a product. TIL.
I don’t think this is really a change of heart. I’d wager strongly that Eric still doesn’t want to have to go through all this just to stand up a mail server.
>I’d wager strongly that Eric still doesn’t want to have to go through all this just to stand up a mail server.
No.
It made a real difference when I learned that GPS HATs have RTCs.
As a programmer, sys admin and ham radio guy, I’m very interested in accurate time. One of the projects I’m following that might tweak your interest due to the nature of the open software/hardware is the KiwiSDR, a wide-band SDR + GPS cape on the BeagleBone Black. http://kiwisdr.com/KiwiSDR/index.html
It’s within the reach of amateurs to do some interesting research on HF/VHF/UHF once you combine Linux, SDR, and GPS. With an extremely accurate clock you can gain insight into propagation and time-of-flight plus condition your oscillator frequency.
@Astro Jetson:
No, the long-time regulars here know this is the sort of project that has been simmering for years. All that really happened was somebody sending Eric a package that effectively said, “Make as thou will….”
I have a technical question for you Eric. As you know GPS works by having a couple of dozen sets of atomic clocks orbiting the earth, then, by reading the time from three or four of them you can estimate the distance you are from each based on the different times they are showing — since the received time is the sent time plus the signal travel time. And from that and a table of orbital parameters you can calculated your position.
However, if you are setting up a stratum one time server don’t you also have to deal with the fact that the time signal you receive includes travel time? I’m sure it is properly dealt with, I am just curious to know how it works.
@Jessica Once you have a GPS lock you can calculate the satellites’ distance from you, and then divide by c to get latency. Your GPS receiver should handle this transparently. There’s a bit of additional latency in getting from the receiver to your CPU’s interrupt pin, and this you do need to calculate (based on cable length) and manually configure.
> However, if you are setting up a stratum one time server don’t you also have to deal
> with the fact that the time signal you receive includes travel time? I’m sure it is
> properly dealt with, I am just curious to know how it works.
You have to deal with it, but you know where the balls are, and the time difference tells you where YOU are in relation to those Sats are, so you know the distance to them, and you know the speed of light (and if you REALLY want to get picky there are formulas for calculating diffraction through the atmosphere), so you know how long that signal took to get to you.
@ William O. B’Livion
> you know where the balls are
Between the thighs?
@Jessica:
> by reading the time from three or four of them…
You need four at least…
>…However, if you are setting up a stratum one time server don’t you also have to deal with the fact that the time signal you receive includes travel time?
…and this is why. You need a time signal from a satellite for each unknown variable (x, y, z, t).
>You need four at least…
Only for 3D. 3 will do for a 2D fix.
> and if you REALLY want to get picky there are formulas for calculating diffraction through the atmosphere
Actually, you also must adjust for GR effects, not just SR. It’s really annoying.
Is differential GPS correction (a fixed[1] station relaying by radio corrections calculated from difference between GPS and their real position) useful for GPS as the time source?
BTW. for those not believing in special relativity – GPS includes relativistic corrections (I don’t think general relativity ones are needed, though).
[1] disregarding Earth crust movement… which phase-lock GPS can measure; well, at least glacier movements.
> (I don’t think general relativity ones are needed, though)
45.9 µs fast a day, at those altitudes, from GR; but 7.2 µs slow from SR. Enough to notice, except they fiddle with the clocks so they run at the correct rate as seen from the surface, so receivers don’t have to care. Accuracy is about 1ns/day, so the difference is huge.
Ooh, do those GPS receiver sticks include PPS output? I picked up a couple of the adafruit units a while back, intending to play with them towards building a car music/navigation/APRS/remote start computer. Never occurred to me to see if they could support timekeeping.
ESR, just out of curiosity, do you have any interest in timekeeping beyond gpsd/ntp? When I was active in the bitcoin community, I talked for a while with one of the guys about building a zero-trust distributed ticker using radio noise as proof. We didn’t have the drive to follow through on it, but every now and then I get the itch to try it.
@Jakub Narebski According to wikipedia general relativity does have an effect – in the opposite direction and much greater magnitude than the SR effect. Both are compensated for by programming the clocks on the satellites to tick at a different rate in their own frame of reference than the nominal one.
@EMF I couldn’t easily find any more information – are there any relativity-based effects that vary cyclically with the satellites’ orbits and therefore couldn’t be compensated for by a fixed adjustment of the tick frequency?
Another source of inexpensive GPS receivers is NavSpark. I have built a GPSDO using one of their receivers as the timing reference.
NavSpark a Taiwan company that build an Arduino based GPS board. You can use it off the shelf or use their SPARC Arduino tool chain to program it. I use the GPS + GLONASS board, which sells for $25. A GPS only version that cannot be programmed is $6. They also have precision timing reference and DGPS boards for $50-$80.
As far as I can tell, their main business is making the GPS chip that is at the core of these gadgets.
They are at http://navspark.mybigcommerce.com/ .
> are there any relativity-based effects that vary cyclically with the satellites’ orbits and therefore couldn’t be compensated for by a fixed adjustment of the tick frequency?
Not GR ones, but there are SR ones; the Earth is 42.6 ms wide, so there’s a big difference there. (Also, the satellites are 67 ms high, so that has to be compensated for.)
> Not GR ones, but there are SR ones; the Earth is 42.6 ms wide, so there’s a big difference there. (Also, the satellites are 67 ms high, so that has to be compensated for.)
Er… it sounds like you’re talking about speed of light delay. I was wondering more like a doppler effect, where it moving toward you vs away from you makes a difference. I don’t consider speed of light delay to be a SR effect (it’d, for one thing, be likewise present and identical in a hypothetical pure-newtonian-physics universe where radio signals just happen to travel at a finite speed)
> Between the thighs?
Between the skies.
No doppler effect; they move at a negligible fraction of c. (12 hr orbital period, so 42 ms in 6 hours isn’t really much of a Doppler shift; good thing too, or the frequencies would go wrong.) And SOL delays are inconsistent with Galilean relativity and only two polarizations of light. (Spin-n massive particles have 2n+1 polarizations; spin-n massless particles have two polarizations only, unless that spin is 0 [in which case only one polarization].)