gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] Unrecognized request '?POLL'


From: Attila Brájer
Subject: Re: [gpsd-users] Unrecognized request '?POLL'
Date: Wed, 14 Mar 2012 00:23:26 +0100


On Fri, 2012-03-09 at 02:23 -0500, Eric S. Raymond wrote:

> You should make sure you're actually running with the right GPSD binary
> rather than some stale version off in a corner.  POLL is working here, I
> just tested it - and that response looks like it's from an old version
> of the daeon that lacks POLL support. 

gpsd -V returns
gpsd: 3.4 (revision 3.4)

Interestingly, 

echo '?POLL;' | nc localhost 2947

does not produce the error, so I think the problem is in the perl
module.

However the line in GPSD3.pm that sends the poll request is just:

$self->socket->send(qq(?POLL;\n));

which looks fine to me and indeed seems equivalent to the echo test.

To solve the immediate problem I've written a workaround: a script that
uses watch() until the first tpv, then dies returning the results. This
emulates polling well enough for my immediate uses but isn't ideal.

Thanks -

Andy
--------------------------------

Hy,

I also faced this problem recently. However, I've to mention that I used gpsfake instead of gpsd, when the problem occured. I'm using (under Ubuntu)
gpsd 3.4, GPSD3-0.18 in a Perl programme what needs GPS fix. I tried many ways to avoid POLL error, and finally in telnet after sending a ?WATCH={"enable":true},
?POLL finally worked (something like above, using watch().)
Based on that, I inserted a line into the original source GPSD3.pm, at poll function:

...
sub poll {
my $self=shift;
$self->socket->send(qq(?WATCH={"enable":true};\n)); # NEW COMMAND
$self->socket->send(qq(?DEVICES;\n)) unless $self->cache->DEVICES;
$self->socket->send(qq(?POLL;\n));
my $object;
do { #Reads and caches VERSION and DEVICES
...

After that, the gpsd3->poll works fine. Forgive me, it's far not the best solution, I'm quite newbie to gpsd, also to perl, but it does the job. Hope helps to
someone else too.

BR,
Attila

reply via email to

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