gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] Polling for GPS data using python3 API


From: pisymbol .
Subject: Re: [gpsd-users] Polling for GPS data using python3 API
Date: Mon, 12 Aug 2019 15:46:12 -0400



On Mon, Aug 12, 2019 at 2:52 PM Greg Troxel <address@hidden> wrote:
"pisymbol ." <address@hidden> writes:

> What my polling process does is in effect this:
>
> trimble = gps.gps(host, port)
> while True:
>    trimble.read()
>    nmea = trimble.data()
>    if nmea:
>        parse_nmeas(nmea) # Extract RMC/GGA
>    time.sleep(0.1) # Trimble set to 10Hz for RMC and GGA strings
>
> This seems to work with the caveat that I'm seeing a lag issue, i.e. after
> X number of minutes  (!?) the points start to have large gaps between them.
> And I'm wondering if the above code is somehow causing this? I just want to
> make sure I'm using the gpsd API correctly.

I am not familiar with the code you are using, but that example is
making some assumptions:

  trimble.read() will read exactly NMEA one sentence (perhaps true)

  doing the processing and sleeping 0.1s will take exactly 0.1s, and
  that will match the exactly 0.1s that the receiver uses for 10 Hz

the second one is almost certainly wrong :-)

Second what exactly?


I would ask: why are you sleeping?  What does trimble.read() do if you
call it before data arrives?  Wait until a sentence appears?  Return
EWOULDBLOCK?

I get a lot of duplicate entries if I don't sleep(0.1). I think Gary's comment is quite relevant here (the 3.9 shipped under 16.04 is really old, let me upgrade that and see what happens).

-aps

reply via email to

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