"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