gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-users] JSON output


From: Eric S. Raymond
Subject: Re: [gpsd-users] JSON output
Date: Thu, 29 Aug 2013 23:01:12 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

IT1 Stuart Blake Tener, USNR <address@hidden>:
> Eric,
> 
> I was exchanging posts with Gary a few days back and had mentioned
> that the first 3 lines of output on a "gpspipe -r" were JSON and
> that I had to use grep "{" to dispose of them. He then very quickly
> stated that I had located a bug, which I did not even realize it
> was. Either way, that bug is easily surmountable with a grep, but if
> it was a bug I'd not mind to try to research it and apparently Gary
> was going to do so also (I did not rush so far to look at it, as he
> did mention he was going to also).
> 
> I had presumed that the JSON output was there to enunciate the type
> of device and such. But then, I realized, that probably there is a
> NMEA sentence way of doing that and maybe that output was a bug.

Actually, there isn't.  NMEA is a very stupid and weakly specified protocol;
those deficiencies are a major reason that GPSD exists in the first place.

> I also then noticed that the JSON was spitting out when you request
> binary output too, and that certainly made no sense (to have ASCII
> JSON when binary is expected for everything else).

What's actually going is that gpspipe isn't interpreting or filtering
the data gpsd ships to it.  gpsd ships some greeting lines of JSON when
the client connection is opened; that's what you're seeing.  Then gpsd 
sends it a mode switch and it begins to ship NMEA.

In theory this could be fixed by adding filtering logic to gspipe in -r 
mode that would ignore all data up to a leading $. I'm a little reluctant, 
though, as adding that complexity seems quite likely to spawn bugs in cases
we're not now anticipating.

Before I consider it any more seriously, I'd like to know why you're
using gpspipe at all rather than the regular client-side libraries.

> By the way Eric, with all your technical capabilities you would be a
> wonderful addition to the Amateur Radio Community should you decide
> to use the open source "hamexam" software to study for the license.
> :)

I've considered it.  But the last thing I need in my life is another hobby
that would be a major time sink...
-- 
                <a href="http://www.catb.org/~esr/";>Eric S. Raymond</a>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]