Yesterday I came across this interesting video of Eric S. Raymond giving a talk. About 40 minutes in He talks of a fascinating project to develop and have produced a USB GPS dongle with PPS (Pulse per second) support to provide a decent Timing reference for use with NTP.
Eric ‘ESR’ Raymond presenting to the Philadelphia Area Java Users’ Group from April 18, 2012
This then lead me to a couple of blog posts by ESR
This caused me to take another look at GPSD in the context of feeding NTP and also prompted me to try a USB – serial adapter with one of my PPS enabled GPS units.
The results were really good and it was simple to set-up on fedora 16. To get it working it’s just a matter of ensuring GPSD starts up and adding 4 lines to the ntp.conf
server 127.127.28.0 minpoll 4 maxpoll 4
fudge 127.127.28.0 time1 0.420 refid GPS
server 127.127.28.1 minpoll 4 maxpoll 4 prefer
fudge 127.127.28.1 refid PPS
This got me thinking about a cheap little GPS dongle that I had on my desk. according to dmesg it uses the prolific pl-2303hx USB to serial bridge controller and this chip does support the DSR line.
Time to take it apart..
All the fun stuff is under the antenna and the tin can.
To find the PPS output of the GPS module I needed to fit a temporary antenna connection since once the can is removed so is the on-board antenna.
With this done it’s time to locate the PPS output with a scope. It turned out to be on my module, the second pin from the left on the USB side of the GPS module.
The DSR pin was located from the PL-2303HX data-sheet, It turned out that this board had a little 4k7 resistor in place to pull this line high. This would have to be removed and as a bonus this left me with a nice place to connect the blue wire.
At this point I tested again and saw that GPSD was feeding good looking PPS data to ntpd.
Time to put it back together
The end result is that the GPS stick still provides navigation data and now has a high quality PPS output as well.
Nice work =) Who is your USB GPS dongle made by?
I don’t know for certan. it was a real cheap one.
It says ND-100 on it
I suspect it’s identical to this one.
An extremely similar unit (same case markings) is on sale here, identified as a “GlobalSat ND-100”. I don’t know enough about GPS to know whether GlobalSat are a widely regarded manufacturer, but there’s a lot of other GlobalSat equipment, not all cheap, in that catalogue.
It looks like the same one for a ‘nice ‘ markup. Most of the GPS chipsets supply PPS internaly but not all of the TLL to USB converters supoprt DTR.
The PL2303 does but there are some ‘clones’ that reportedly don’t.
The only real way to find out if it will work is to take it apart..
There will be a low cost commercal PPS dongle along soon anyway so it may just mase sense to wait for that ?
I bought one the ND-100 dongles from dealextreame.com. It is the same board used in the article. I removed the antenna and shield and got cold feet when I saw the size of the resistor that needs to be removed. What equipment did you use to connect the wire? A microscope?
A pair of cheap reading glasses(Binocular magnification..) , some solder wick and a small soldering iron. The trick with SMT rework is not to worry too much about the ‘well-being’ of what you wish to remove..
Adding some solder to the resistor then removing the resistor and excess solder with the wick will leave nice clean pads to work with for the blue wire bit of the mod.
Great post! I was glad to see this done on these particular dongles, as I already have several of the GlobalSat ND-100 dongles. I’ve only gotten to one so far, but according to TAC32 in Windows, the PPS is working great. I have a project that requires purchasing a few more and so I did a quick search on Amazon and saw there appears to be a new version out (http://www.amazon.com/GlobalSat-ND-100S-USB-GPS-Dongle/dp/B003WNHGAO/). I can’t really tell what has changed with the new version aside from a darker case and a pretty “S”, but do you think this PPS mod will still work?
Also, can you confirm the accuracy of the PPS signal after it has been transmitted via USB? My only experience has been with PPS over a serial connection. Thanks!
I have not played with the newer version so no idea if the same mod will work, however if the layout is different you can probably work it out from the data-sheet for the USB driver chip.
If you need a lot of these you may wish to see if there was ever any follow-up on the Units that ESR was hoping to have produced commercially since this is such a simple production line mod.
Under linux the PPS over USB accuracy is very good, significantly better the hardware serial port on the machine I tested with and certainly good enough for the operating system to be the limitation, but that’s just one data point and of course different GPS units between serial and USB.
freeBSD does a lot better than Linux for High performance NTP timekeeping but I have not tried this stick on a BSD based system yet.
BSD based systems can be very good indeed, I have built a couple of these over the years
However a lot will depend on operating system drivers and I have no idea how good/bad the windows ones will be in this regard.
I’d be most interested in hearing of your results.
PPS over USB is terrible. Something is very wrong if the PPS was better over USB than serial. Do you know if the serial port was a real serial port or one of those kludgy serial port over usb bus abominations? How did you measure the accuracy of the PPS signal?
How many of febo’s ntp servers have you built? All of his mods or just a soekris with a gps?
I have built 2 of them, both with the full suite of modifications.
In testing, on a modern general purpose linux kernel (.e tickless) the modified USB stick performed significantly better than PPS over serial, Both were ‘adequate’ considering base NTP performance on a standard linux kernel.
I never did get around to trying it on BSD, but hey, feel free to try it yourself, these sticks are not expensive 😉
Can you post your ntpq billboard? I am curious to see how the device performs.
Happy to, sometime when it’s not dark and raining outside. The USB stick does not have an external antenna socket, is not weatherproof and needless to say indoor performance is rubbish.
For folks with the ND-100S, things are quite a bit more difficult to work with… the GPS has been replaced with a very small SiRF Star III e/LP hidden under a second layer of shield. Unless you’re very comfortable working with extremely small pins it’s best to just avoid it.
Very cool! I started digging around for the ND-100 and came across something that might be a bit better for those with less-steady hands:
Adafruit has a small board using the MTK3339 chipset that already has the PPS pin available. It also has a uFL antenna connector (as well as the standard patch antenna) to make it a bit easier to get a reasonable sky view. The downside is that you’ll need a serial port and potentially a level shifter (3.3 V device with 5 V “level safe” inputs are described). It apparently will run off 5 V supplies.
It looks like ntpd generally expects clocks to send the pps signal on the DCD (data carrier detect) pin rather than the DSR (data set ready) pin. I could easily be wrong though.