What's new

USB GPS instead of NTP

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

It's the clients that are generally not RAD hardened - but if we get to that place, NTP is likely not our main concern...
Without GPS, the US military wouldn't be able to put a bomb on a target or do an extraction, and their UAVs would fall out of the sky. That's why I said it's impossible, it will never happen. For me, the WWV radio is a good plan B.
 
Last edited:
This might be of interest for some - Stratum 1 NTP server using Raspberry Pi

(there's also a lot of good technical info that can be used for other platforms here as well)

http://www.satsignal.eu/ntp/Raspberry-Pi-NTP.html
I did something like this to one of my Raspberry Pi's. Had a Garmin GPS18x puc, hooked up over USB including the PPS. Had to compile a newer version of ntpd (stock Raspbian version to old to support PPS).
It's now part of the North American ntp pool, Stratum 1.
Fun side project!
 
Interesting that so many of us AB-Solution users (probably -Merlin folk) are R Pi users, ntp fans, 60 kHz time nuts. I'd have a 60 kHz clock going if I could see a need on top of the GPS clock already going. Hmm, what else could I set running on my AB-S enhanced, -Merlinized router :)
 
Pi's are useful for projects like this - a bit more memory and storage, along with newer kernel and the debian software repos provide options...
 
i have my router doing it instead, it has a lot more computing power and resources than a raspberry pi.

But that's not a typical router ;)

Where the Pi shines - Pi3 is comparable in compute performance to the RT-AC68U -- the BCM2710@1.2GHz performs about the same as the BCM4708 -- and has the benefit of the GPIO pins which are handy for projects like this.

The dual core 4708/4709's are good performers, but if one is running processor intensive tasks that are single threaded (PPoE and OpenVPN come to mind), resources left for other apps can suffer, and it can be useful to run those apps off the router, and on to something that is a decent performance (when comparing MIPS per Watt per Dollar spent).

So for Media Serving, or Download Manager (e.g. BitTorr3nt) - it's a good choice to offload things from the main router.

I run a Pi3 as a mini-server - it's not super fast, but fast enough - and with RealVNC Connect (Raspbian comes with a free 5 seat license), one can use it as a jumpbox with a GUI without opening any ports to the outside world, and that's a fair amount of usefulness..

If a Pi3 isn't fast enough, there's always the Tinkerboard from Asus, which is a pretty big step up from the Pi3 - in the same form factor as the Pi, but the price of entry does go up a bit - $59USD on Amazon...

tinkerboard.jpeg



Tinkerboard uses the Rockchip 3288, which is ARMv7-A, but it's a "big core" in that space - Cortex-A17, which we see in many Chromebooks, it's a stout chip... it's roughly twice as fast as the Pi3, and runs pretty close to the Alpine Chips that we see from some of the consumer router vendors on the high end.
  • High performance Quad Core ARM SOC 1.8GHz with 2GB of RAM
  • Non shared GBit LAN, Shielded Wi-Fi with upgradable antenna support
Tinkerboard doesn't have the kind of community support that the Pi does -- yet...

That being said - it's a strong complement to any Asus Consumer Router/AP - and for the enthusiast group, we can grow the community from there - lot's of able coders/scripters/users here on SNB.
 
its not really a question of speed, rather a question of latency. While my router is fast it still gets GPS via usb which is not ideal.

Upon searching both the ASUS thinkerboard and the odroid xu4 offer a better option, even the odroid c2 because of more ram. The raspberry pi has 1GB of ram so if you run too much stuff on it and it lags, the time could shift (big problem with windows server too). What these solutions can offer is to use the low latency IOs that they come with compared to usb. USB is fast but has overhead and latency. If you're going to use usb for gps you might as well use it on your router.

So what you need is a decent board capable of supplying 5v and 3.3V (some odroids cant do this) with decent amount of computing resources, a GPS chip module that uses these IO and GPS antenna. Make sure the GPS chip/module can use the 5V or 3.3V as well (some can go as low as 1.8V which odroids can use).

I would recommend udoo though despite costing more mainly because they come with a lot more computing power (especially their newer x86 based ones). You get a lot more ram and the IO is shared with the arduino chip too but both the main CPU and the arduino chip can listen to the same pin at the same time, its an ideal platform to build your high accuracy stratum 1 NTP server using the IO straight to the CPU and use gigabit ethernet for better throughput and latency. The x86 variant also has sata which is useful if you want to make it a file server or even a media center for internet/ISP TV and such.

Its easy to make a stratum 1 NTP server but its not easy to make it as close as possible. The one on my CCR for example is 0.8 seconds behind when compared to time.is because i underclocked the CPU a little bit and it is through USB (router USB latency isnt great). The time keeping is accurate, just with a constant time delay. When comparing with time.is though they do update their time differently than the PC so the accuracy could be so much better if the same problem affects winbox (i see the GPS update in console for the seconds to be slightly earlier than winbox time in mikrotik which shows the time on the router). When building your stratum-1 NTP server you must make sure that the difference in time is always constant so dont use windows server or windows in general for this.
 
its not really a question of speed, rather a question of latency. While my router is fast it still gets GPS via usb which is not ideal.

way back in the day - GPS via USB or Serial - it was just as accurate as CDMA system time - and this means much as we sync'ed laptops via GPS to the CDMA devices to track air interface events.

NTP with GPS and PPS support is spot-on accurate... serial or otherwise for most purposes. That's why I recommended using GPS w/PPS support along with NTP. One can always go deeper with the WWV and other long wave radio sources, but NTP is pretty accurate none the less...

The SBC's - Tinkerboard/Pi3 - they're fun solutions, and they work well enough for an application like this - along with others. They also have the strong option of building locally rather than doing a cross-compile, which is a big win if a package is not available upstream.
 
way back in the day - GPS via USB or Serial - it was just as accurate as CDMA system time - and this means much as we sync'ed laptops via GPS to the CDMA devices to track air interface events.

NTP with GPS and PPS support is spot-on accurate... serial or otherwise for most purposes. That's why I recommended using GPS w/PPS support along with NTP. One can always go deeper with the WWV and other long wave radio sources, but NTP is pretty accurate none the less...

The SBC's - Tinkerboard/Pi3 - they're fun solutions, and they work well enough for an application like this - along with others. They also have the strong option of building locally rather than doing a cross-compile, which is a big win if a package is not available upstream.
true, but every bit you can do to reduce latency helps, from getting the data from the GPS, to the CPU architecture and ram in being low latency and passing the data on via the ntp server. So even having gigabit ethernet helps a little in latency compared to 100Mb/s, and not having programs fully use up ram and CPU is also important in keeping that high accuracy. Even the OS choice is important.

If your setup is accurate, the difference in time will be constant compared to other time sources too (best to have less than 1 second difference than a site like time.is).
 
true, but every bit you can do to reduce latency helps, from getting the data from the GPS, to the CPU architecture and ram in being low latency and passing the data on via the ntp server. So even having gigabit ethernet helps a little in latency compared to 100Mb/s, and not having programs fully use up ram and CPU is also important in keeping that high accuracy. Even the OS choice is important.

If your setup is accurate, the difference in time will be constant compared to other time sources too (best to have less than 1 second difference than a site like time.is).

Time geeks are going to do what they're going to do... not that much different that AudioPhile paying $10K for the golden ethernet cable...

I'm used to data centers and keeping things synced up...
 
Time geeks are going to do what they're going to do... not that much different that AudioPhile paying $10K for the golden ethernet cable...

I'm used to data centers and keeping things synced up...
that ethernet cable is going to perform the same as a few $ ones. What i was saying is that using ways that can help reduce latency. Things like the computer architecture picked (i heard ARM A9 memory isnt very fast for example), the busses use and so on. I suppose i should compare usb1 and GPIO latency.
 
I wish China makes a USB DCF77 receiver, it would be my plan B. Now, a North Korea DoS attack on a constellation of GPS satellites, that's something to bragg about. It will never happen, it's impossible.

It doesn't have to be satellite, Ft. Collins CO, xmits signals too. WWV, JJY, CHU, etc. are all time signals. They were there B4 the days of GPS.
 
Out of curiosity, whats the hype of having such an accurate clock on your router, or is it just one of those "because I can" situations which I totally understand :p
A few years back our outfit lost the broadband for about three weeks.
In that time a piece of equipment powered down, and on restart refused to complete the boot sequence, because it could not get the time, it reverted to unix time zero.
Manual intervention was impossible, but a GPS based ntpd was setup which solved the problem.
Moral of the story, don't put all your ntp eggs into one basket :)
 
the other solution is to use both your own atomic clock and GPS, so you get reference time whenever you boot up and accurate time keeping without relying on satellites.

however its a good question on who has the reference clock the world follows and how far are we from it.
 
Without GPS, the US military wouldn't be able to put a bomb on a target or do an extraction, and their UAVs would fall out of the sky. That's why I said it's impossible, it will never happen. For me, the WWV radio is a good plan B.

GPS for military is restricted. Commercial version is not as accurate.... I always listen to WWV because it has message for propagation info.
 
This is great idea - I love it.
Thank you for sharing.

I am getting reply bellow
in line "read NMEA_DATA <$GPS_DEVICE"

$GPZDA,,,,,00,00*48
$GPZDA,,,,,00,00*48
$GPZDA,,,,,00,00*48
$GPZDA,,,,,00,00*48

Any idea?
 
That it does not see the satellites. In my case, it has to have view to the sky. :/

Place your stick near a window. Borrow a sauce pan from wife's kitchen. Put the stick on the pan (itself upside down). You could easily get overwhelmed like this:

l5Qhzeo.png
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top