time-nuts@lists.febo.com

Discussion of precise time and frequency measurement

View all threads

GPS for Nixie Clock

MS
Mark Sims
Wed, Jul 13, 2016 7:17 PM

Lady Heather can now work with GPSD...  it is one of the simpler "receivers" that it works with.  It took about 500 lines of code (about the same as NMEA)  to interface GPSD to Lady Heather.  Most receivers with binary messages take around 1000 lines,  but they usually support more features.  Parsing the GPSD JSON formatted messages is quite a bit more complex than NMEA if you want to do it "properly".  Lady Heather uses a bit of a hack to simplify things quite a bit.

Do you know about the GPSD project?  Lots of good info, including code.

Lady Heather can now work with GPSD... it is one of the simpler "receivers" that it works with. It took about 500 lines of code (about the same as NMEA) to interface GPSD to Lady Heather. Most receivers with binary messages take around 1000 lines, but they usually support more features. Parsing the GPSD JSON formatted messages is quite a bit more complex than NMEA if you want to do it "properly". Lady Heather uses a bit of a hack to simplify things quite a bit. ------------------------ > Do you know about the GPSD project? Lots of good info, including code.
GE
Gary E. Miller
Wed, Jul 13, 2016 9:01 PM

Yo Mark!

On Wed, 13 Jul 2016 19:17:54 +0000
Mark Sims holrum@hotmail.com wrote:

Most
receivers with binary messages take around 1000 lines,  but they
usually support more features.

gpsd GPS drivers in C run from 432 to 1843 LOC.  And likely a number of
features are missing, but few that anyone misses.

Parsing the GPSD JSON formatted
messages is quite a bit more complex than NMEA if you want to do it
"properly".

If you grab the gpsd JSON feed, and you have a decnet JSON parsing
library then the parser should be short.

The cgps client does it in 847 lines including curses ouput, and parses
a lot of odd stuff.

That said, the NTPsec driver in C for gpsd JSON is almost 2200 lines.
But that is not a shining example of code...

You only need to write one parser for gpsd JSON.  If you try to do NMEA
directly you will find a ton of variants.  Likely all you would need is to
connect and then parse the PPS sentence (TOFF):  That looks like this:

{"class":"TOFF","device":"GPS0","real_sec":1428001514, "real_nsec":1000000,"clock_sec":1428001513,"clock_nsec":999999999}

RGDS
GARY

Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com  Tel:+1 541 382 8588

Yo Mark! On Wed, 13 Jul 2016 19:17:54 +0000 Mark Sims <holrum@hotmail.com> wrote: > Most > receivers with binary messages take around 1000 lines, but they > usually support more features. gpsd GPS drivers in C run from 432 to 1843 LOC. And likely a number of features are missing, but few that anyone misses. > Parsing the GPSD JSON formatted > messages is quite a bit more complex than NMEA if you want to do it > "properly". If you grab the gpsd JSON feed, and you have a decnet JSON parsing library then the parser should be short. The cgps client does it in 847 lines including curses ouput, and parses a lot of odd stuff. That said, the NTPsec driver in C for gpsd JSON is almost 2200 lines. But that is not a shining example of code... You only need to write one parser for gpsd JSON. If you try to do NMEA directly you will find a ton of variants. Likely all you would need is to connect and then parse the PPS sentence (TOFF): That looks like this: {"class":"TOFF","device":"GPS0","real_sec":1428001514, "real_nsec":1000000,"clock_sec":1428001513,"clock_nsec":999999999} RGDS GARY --------------------------------------------------------------------------- Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703 gem@rellim.com Tel:+1 541 382 8588