On Monday 31 January 2011, Neil Jerram wrote: > Neil Jerram <[email protected]> writes: > > I'm looking at the fso-gpsd code now. It's quite simple, and - > > curiously - it looks as though it should already support the NMEA output > > that gpspipe wants. So maybe this is just a matter of debugging > > something (as opposed to writing significant new code)... > > The problem is in gpspipe. It doesn't emit the "r+" incantation that is > needed to get "old-style" gpsd servers - including fso-gpsd - to > generate NMEA. > > If you use nc to connect to fso-gpsd, and type in "r+", hey presto, > NMEA: > > ============== > root@om-gta02 ~ # nc localhost 2947 > r+ > GPSD,R=1 > $GPGGA,,,,,,0,00,,,,,,,*66 > $GPGSA,A,0,,,,,,,,,,,,,,,*1f > $GPGSV,1,1,00*79 > $GPRMC,,V,,,,,,,,,*31 > $GPGLL,,,,,,V*06 > $GPVTG,,,,,,,,*52 > $GPGGA,,,,,,0,00,,,,,,,*66 > $GPGSA,A,0,,,,,,,,,,,,,,,*1f > $GPGSV,1,1,00*79 > $GPRMC,,V,,,,,,,,,*31 > $GPGLL,,,,,,V*06 > $GPVTG,,,,,,,,*52 > ^C > ============== > > This points to a couple of possible solutions. > > 1. Someone with a SHR-T toolchain could change (in gpspipe.c) > > case 'r': > raw = true; > /* > * Yes, -r invokes NMEA mode rather than proper raw mode. > * This emulates the behavior under the old protocol. > */ > flags |= WATCH_NMEA; > > to > > case 'r': > raw = true; > /* > * Yes, -r invokes NMEA mode rather than proper raw mode. > * This emulates the behavior under the old protocol. > */ > flags |= WATCH_NMEA | WATCH_OLDSTYLE; > > and provide an updated gps-utils package. I will try to revive my > toolchain, but it'll probably take a while so it would be great if > someone else beats me to it!
Good catch. This should go upstream too since support for the old protocol is nominally present if deprecated. I'm assuming this fix doesn't break it for servers using the new protocol. > 2. Someone good with Python or shell script could modify BtGPS.py to use > "nc localhost 2947" instead of "gpspipe -r". The slightly tricky thing > about this is needing to feed "r+" as input. A simple echo doesn't work > for this, because nc exits when its stdin closes. I think it needs an > input pipe that stays open after providing "r+". Fixing gpspipe is better. There's another option too. Update fso-gpsd to speak the new gpsd protocol as support for the old one is due to disappear with the 3.0 release. _______________________________________________ Shr-User mailing list [email protected] http://lists.shr-project.org/mailman/listinfo/shr-user
