gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] gpsd as gpsd client, error "Unrecognized request"


From: B.W. Guffey
Subject: Re: [gpsd-users] gpsd as gpsd client, error "Unrecognized request"
Date: Wed, 28 Jun 2017 10:22:15 -0400

Patch worked on Arch (client) and Arch Arm (server), many thanks for
the effort Larry!

This bug has been around awhile and reported here occasionally without
resolution.  I hope the developers will consider adding the patch to
source for downstream distribution.


On Wed, 2017-06-28 at 09:29 -0400, Larry Boyd wrote:
> This fixes the problem by forcing it to stick around and read the
> rest of the request.
> 
> On Wed, Jun 28, 2017 at 8:59 AM, Larry Boyd <address@hidden>
> wrote:
> > Ah, its not entirely a problem on the client side gpsd. I think the
> > problem comes in at line 2339 and 2343 of the server side. If recv
> > returns with just the "?" at line 2339, then a '\n' is appended to
> > the buffer at line 2343 and the buffer is then handed off to
> > handle_gpsd_request to be processed.
> > 
> > The reason why recv sometimes returns with just the '?' is visible
> > in the client gpsd log, which shows TWO "IO" lines for the request.
> > I guess that if the time between the first and the second is just a
> > little bit too long, the server side reads it as two requests.
> > 
> > On Tue, Jun 27, 2017 at 5:53 PM, Larry Boyd <address@hidden>
> > wrote:
> > > I'm running 3.16 on a raspberry pi zero w with adafruit gps hat
> > > as a gps server, and also 3.16 on a laptop running fedora 25 with
> > > gpsd as a client to the rpi's gpsd.
> > > 
> > > On both I've compiled from source.
> > > 
> > > On the rpi I'm running with the following;
> > > address@hidden:~/gpsd-3.16 $ ./gpsd -N -n -D 4 -G /dev/ttyAMA0
> > > 
> > > On fedora, I'm, running with this;
> > > address@hidden gpsd-3.16]$ ./gpsd -N -D 5 gpsd://pizwcam.local
> > > 
> > > pizwcam.local, of course, resolves to the ip address of the rpi.
> > > 
> > > When I start gpsmon on the fedora laptop, it gives me this
> > > output, MOST of the time;
> > > //////////////////////////////////
> > > tcp://localhost:2947          JSON slave driver>
> > > (82)
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11
> > > }
> > > (119)
> > > {"class":"DEVICES","devices":[{"class":"DEVICE","path":"gpsd://pi
> > > zwcam.local","a
> > > ctivated":"2017-06-27T21:40:05.560Z"}]}
> > > (122)
> > > {"class":"WATCH","enable":true,"json":false,"nmea":false,"raw":2,
> > > "scaled":false,
> > > "timing":false,"split24":false,"pps":true}
> > > (114)
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":1
> > > 1,"remote":"gpsd://pizwcam.local"}
> > > (53) {"class":"ERROR","message":"Unrecognized request ''"}
> > > //////////////////////////////////
> > > 
> > > At the same time, gpsd ON FEDORA, gives me this;
> > > //////////////////////////////////
> > > gpsd:CLIENT: => client(0):
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11}\x0d\x0a
> > > gpsd:PROG: checking client(0)
> > > gpsd:CLIENT: <= client(0): ?WATCH={"raw":2,"pps":true}\x0d\x0a
> > > gpsd:PROG: no /etc/gpsd/device-hook present, skipped running
> > > ACTIVATE hook
> > > gpsd:INFO: opening remote gpsd feed at pizwcam.local, port 2947.
> > > gpsd:INFO: gpsd_activate(2): activated GPS (fd 7)
> > > gpsd:IO: => GPS: ?
> > > gpsd:IO: => GPS: WATCH={"raw":2,"pps":true}\x0d\x0a
> > > gpsd:CLIENT: => client(0):
> > > {"class":"DEVICES","devices":[{"class":"DEVICE","path":"gpsd://pi
> > > zwcam.local","activated":"2017-06-
> > > 27T21:40:05.560Z"}]}\x0d\x0a{"class":"WATCH","enable":true,"json"
> > > :false,"nmea":false,"raw":2,"scaled":false,"timing":false,"split2
> > > 4":false,"pps":true}\x0d\x0a
> > > gpsd:PROG: switching to match packet type 18:
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11}
> > > gpsd:PROG: switch_driver(JSON slave driver) called...
> > > gpsd:PROG: selecting JSON slave driver driver...
> > > gpsd:INFO: gpsd://pizwcam.local identified as type JSON slave
> > > driver, 0 sec @ 0bps
> > > gpsd:IO: <= GPS:
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11}
> > > gpsd:PROG: JSON, passing through
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11,"remote":"gpsd://pizwcam.local"}
> > > gpsd:PROG: device 0 (fd=7, path gpsd://pizwcam.local) already
> > > active.
> > > gpsd:CLIENT: => client(0):
> > > {"class":"VERSION","release":"3.16","rev":"3.16","proto_major":3,
> > > "proto_minor":11,"remote":"gpsd://pizwcam.local"}\x0d\x0a
> > > gpsd:IO: <= GPS: {"class":"ERROR","message":"Unrecognized request
> > > ''"}
> > > gpsd:PROG: JSON, passing through
> > > {"class":"ERROR","message":"Unrecognized request ''"}
> > > gpsd:CLIENT: => client(0):
> > > {"class":"ERROR","message":"Unrecognized request ''"}\x0d\x0a
> > > //////////////////////////////////
> > > 
> > > And gpsd on the rpi gives this;
> > > //////////////////////////////////
> > > gpsd:CLIENT: <= client(0): ?\x0a
> > > gpsd:ERROR: ERROR response:
> > > {"class":"ERROR","message":"Unrecognized request ''"}\x0d\x0a
> > > gpsd:CLIENT: => client(0):
> > > {"class":"ERROR","message":"Unrecognized request ''"}\x0d\x0a
> > > gpsd:PROG: checking client(0)
> > > gpsd:CLIENT: <= client(0): WATCH={"raw":2,"pps":true}\x0d\x0a
> > > gpsd:CLIENT: => client(0): =
> > > //////////////////////////////////
> > > 
> > > But very occasionally, if I restart gpsmon several times, then on
> > > the rpi, I will get this instead;
> > > //////////////////////////////////
> > > gpsd:CLIENT: <= client(0): ?WATCH={"raw":2,"pps":true}\x0d\x0a
> > > //////////////////////////////////
> > > ... and then, of course, gpsmon will work as expected. Note that
> > > there is nothing different visible on the output from gpsd or
> > > gpsmon on the fedora laptop up to that point, including the '?'
> > > and 'WATCH' appearing on separate lines.
> > > 
> > > So clearly, somewhere between the gpsd's running on fedora and
> > > the rpi, there is a line break being added after the '?'
> > > character. Since I can consistently run '?WATCH=....' via telnet,
> > > it appears to be in the client code running on the fedora
> > > machine.
> 
> 



reply via email to

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