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: Greg Troxel
Subject: Re: [gpsd-users] Polling for GPS data using python3 API
Date: Mon, 12 Aug 2019 14:52:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (berkeley-unix)

"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 :-)

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?



reply via email to

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