New GPSD protocol is ready for beta use

View: New views
3 Messages — Rating Filter:   Alert me  

New GPSD protocol is ready for beta use

by Eric Raymond-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

After two months of hard (but very rewarding) work, the new JSON-based
GPSD command protocol is in a stable and apparently working state.  It is
ready for experimentation and beta-testing.

I am very pleased to be able to report that despite the extended
capabilities of the new protocol, the new client-side API is actually
*simpler* than the old, no longer requiring you to stuff bits of
the wire protocol into gps_query() argument strings.

I've written a transition document that explains the changes and
gives tips for client developers here:

      http://gpsd.berlios.de/protocol-transition.html

The GPS reports in the new protocol are fully supported by libgps, and
most of the test clients in the distribution (xgps, xgpsspeed,
gpxlogger, lcdgps) actually use them now.  (Actually, libgps will
recognize either protocol.)

Known issues:

* The ?DEVICE invocations corresponding to old B, C, and N still need
  testing on live devices.

* The Python and C++ client libraries presently speak only old protocol.

* gpsmon's client mode still relies on old protocol (that's my problem)

* cgps.c still relies on old protocol (that's Jeff Francis's problem).

* While gpsd will ship AIS JSON when attached to a transceiver, the C
  client library doen't unpack the JSON into the C structs defined in
  gps.h as yet. This should be a relatively simple coding job, maybe two
  man-days of work counting time to build the unit tests.

* RTCM2 is still dumped in the idiosyncratic Sager protocol rather
  than JSON.  I've written a JSON-RTCM2 dumper but have no parser
  yet; that should be even easier than the AIS job.

* RTCM3 support is nonexistent due to a lack of suitable test loads.
  (We have binary RTCM3; what we need it a *pair* of files, one that
  is binary RTCM3 and the other that is the identical content dumped
  in some sort of readable textual format.)

Known pre-2.40 issues unrelated to new protocol:

* We've had a report that trunk gpsd eats the processor in some
  situations, apparently due to spinning in a repeating open-close
  loop on some devices.  I've never seen this; the person who
  reported the bug mentined it on #gpsd but has since gone silent.

* The tendency of SiRF chips to lag real-time by 15 seconds or so
  under some (unexplained) circumstances is still...unexplained. Or,
  rather, we have several different possible explanations and have
  not been able to verify any of them.
--
                <a href="http://www.catb.org/~esr/">Eric S. Raymond</a>

You need only reflect that one of the best ways to get yourself a
reputation as a dangerous citizen these days is to go about repeating
the very phrases which our founding fathers used in the great struggle
for independence. -- Attributed to Charles Austin Beard (1874-1948)
_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users

Re: New GPSD protocol is ready for beta use

by Jan Veninga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-08-26 at 23:50 -0400, Eric S. Raymond wrote:

First of all, I like the changes outlined in your transition document. I
think it is the right way to go.

> It is
> ready for experimentation and beta-testing.

Ok, I gave it a try today. It is not a live test, but I use an old trace
via gpsfake. The data comes from an AIS transponder. I have some things
that don't seem right:

------------

If I start

$ gpsfake ais.nmea

and then make a connection via

$ telnet localhost 2947

I ask information about devices

?DEVICES;
Connection closed by foreign host.

The connection is closed and can not be opened

I might have something to do with not being a real device?

------------

If I start

$ gpsfake ais.nmea

and then make a connection via

$ telnet localhost 2947

Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
{"class":"VERSION","release":"2.40dev","rev":"$Id: gpsd.c 5957
2009-08-23 15:45:54Z esr $","api_major":3,"api_minor":1}

I turn on streaming

?WATCH={"enable":true};
{"class":"DEVICE","device":"/dev/pts/9","activated":1251538712.85}
{"class":"WATCH","enable":true,"raw":-1,"buffer_policy":0,"scaled":false}
{"class":"TPV","tag":"RMC","device":"/dev/pts/9","time":1249156168.000,"ept":0.005,"lat":52.699955000,"lon":5.292744833,"track":0.0000,"speed":0.003,"mode":2}
{"class":"AIS","type":1,"repeat":0,"mmsi":"000000004","status":15,"turn":-128,"speed":1023,"accuracy":0,"lon":108600000,"lat":54600000,"course":3600,"heading":511,"second":60,"maneuver":0,"raim":0,"radio":266630}
{"class":"AIS","type":18,"repeat":0,"mmsi":"244630386","reserved":0,"speed":0,"accuracy":0,"lon":3175648,"lat":31619973,"course":0,"heading":511,"second":29,"regional":0,"cs":1,"display":0,"dsc":1,"band":1,"msg22":1,"raim":0,"radio":917510}

I get 1 gps (TPV) report. After the first AIS report I only get AIS
reports.


If I also turn on "raw"

?WATCH={"enable":true,"raw":1};
{"class":"DEVICE","device":"/dev/pts/9","activated":1251538942.12}
{"class":"WATCH","enable":true,"raw":1,"buffer_policy":0,"scaled":false}
$GPRMC,194928.00,A,5241.99730,N,00517.56469,E,0.005,,010809,,,A*77
{"class":"TPV","tag":"RMC","device":"/dev/pts/9","time":1249156168.000,"ept":0.005,"lat":52.699955000,"lon":5.292744833,"track":0.0000,"speed":0.003,"mode":2}
$GPGBS,194928.00,3.0,1.9,4.2,,,,*43
!AIVDO,1,1,,,B3aC3LP00063ag7RNpD03wf5sP06,0*37
{"class":"AIS","type":1,"repeat":0,"mmsi":"000000004","status":15,"turn":-128,"speed":1023,"accuracy":0,"lon":108600000,"lat":54600000,"course":3600,"heading":511,"second":60,"maneuver":0,"raim":0,"radio":266630}
$GPRMC,194929.00,A,5241.99738,N,00517.56482,E,0.002,,010809,,,A*7C
$GPGBS,194929.00,3.0,1.9,4.2,,,,*42
!AIVDO,1,1,,,B3aC3LP00063ah7RNpD03wfUsP06,0*58
{"class":"AIS","type":18,"repeat":0,"mmsi":"244630386","reserved":0,"speed":0,"accuracy":0,"lon":3175648,"lat":31619973,"course":0,"heading":511,"second":29,"regional":0,"cs":1,"display":0,"dsc":1,"band":1,"msg22":1,"raim":0,"radio":917510}
{"class":"AIS","type":1,"repeat":0,"mmsi":"211315540","status":7,"turn":-128,"speed":1023,"accuracy":0,"lon":108600000,"lat":54600000,"course":3600,"heading":511,"second":63,"maneuver":0,"raim":0,"radio":307520}
$GPRMC,194930.00,A,5241.99745,N,00517.56492,E,0.006,,010809,,,A*7B
$GPGBS,194930.00,3.0,1.9,4.2,,,,*4A

then I see the raw gps data and still nog processed gps responses.


I hope this input helps. If you need the test data I can send it to you.

--

Jan Veninga


_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users

Parent Message unknown Re: New GPSD protocol is ready for beta use

by Jan Veninga :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sat, 2009-08-29 at 09:20 -0400, Eric S. Raymond wrote:

> Jan Veninga <veninga@...>:
> > If I start
> >
> > $ gpsfake ais.nmea
> >
> > and then make a connection via
> >
> > $ telnet localhost 2947
> >
> > I ask information about devices
> >
> > ?DEVICES;
> > Connection closed by foreign host.
> >
> > The connection is closed and can not be opened
> >
> > I might have something to do with not being a real device?
>
> No, that probably means a segfault in the code for processing ?DEVICES.
> If you'll ship me your test data, I'll run it through under gdb and see.
> But tere may be something odd about your envieronment that I can't reproduce;
> anything involving serial-device handling tends to be dodgy that way.
>
> If you want to try this yourself, run gpsfake with the the -g option. This
> spawns gpsd under gdb control; you'll get a control window for gdb.  
> If you tell it 'r' to run, it will process packets from gpsfake as usual.

Ok, tried that. This is what remains in the gdb window:


+--gpsd_json.c--------------------------------------------------------------+
   |238                        device->gpsdata.dev.driver_mode,
|
   |239                        (int)gpsd_get_speed(&device->ttyset),
|
   |240                        (int)device->gpsdata.dev.parity,
|
   |241                        device->gpsdata.dev.stopbits,
|
   |242                        device->gpsdata.dev.cycle);
|
  >|243         if (device->device_type->rate_switcher != NULL)
|
   |244             (void)snprintf(reply+strlen(reply),
replylen-strlen(reply),|
   |245                            ",\"mincycle\":%2.2f",
|
   |246                            device->device_type->min_cycle);
|
   |247         (void)strlcat(reply, "}", replylen);
|
   |248     }
|
   |249
|
   |250     int json_watch_read(const char *buf,
|

+---------------------------------------------------------------------------+
multi-thre Thread 0x7ffb9 In: json_device_dump    Line: 243  PC:
0x7ffb955b35c6
[Thread debugging using libthread_db enabled]
[New Thread 0x7ffb959ce700 (LWP 734)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffb959ce700 (LWP 734)]
0x00007ffb955b35c6 in json_device_dump (device=0x617720,
    reply=0x7fff9556a7be "{\"class\":\"DEVICE\",\"path\":\"/dev/pts/12
\",\"activ
---Type <return> to continue, or q <return> to quit---


>
> > I get 1 gps (TPV) report. After the first AIS report I only get AIS
> > reports.
>
> That, on te other hand, should be easy to reproduce with your test data.

I will send the test data to you directly.

--

Jan Veninga


_______________________________________________
Gpsd-users mailing list
Gpsd-users@...
https://lists.berlios.de/mailman/listinfo/gpsd-users