gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] Fixes coming too late (great lag)


From: Lisandro Damián Nicanor Pérez Meyer
Subject: [gpsd-users] Fixes coming too late (great lag)
Date: Tue, 31 Jan 2017 12:11:25 -0300
User-agent: KMail/5.2.3 (Linux/4.8.0-2-amd64; KDE/5.28.0; x86_64; ; )

Hi! I have just hitted a strange issue using Debian's gpsd 3.16-4, although 
I'm pretty sure I am the culprit.

The issue is the following: I am using gpsd trough libgps. My GPS device is 
sending data @10Hz (please take a look at the notes below). If I use xgps or 
gpsmon I can see the data comming and the apps updating the information as 
they should, ie, if I move lat and long get changed as expected.

Now on my app I use:

result = gps_open("localhost", 37455, &mGPSData);
[check result...]
result = gps_stream(&mGPSData,WATCH_ENABLE|WATCH_JSON, NULL);
[check result...]

And with a timer I check every 80 ms for a fix:

    if(gps_waiting(&mGPSData, 500))
    {
        int result = gps_read(&mGPSData);

        if(result == -1)
        {
            [handle this]
        }
    }
    else
    {
            [handle this]
    }

Now if I start to move I need to wait like 60 seconds to see the coordinates 
changing. In other words, I have a great lag. But I can't reproduce this with 
xpgs nor gpsmon, so I must be doing something wrong here.

Notes: I'm receiving data trough CAN but not using NMEA200 because I receive 
other info there, so the data gets consumed by a muxer and then sent to and 
UDP port in which gpsd listens. It clearly works because I then attach xgps 
and gpsmon there and get the expected result.

So, what am I doing wrong here?

Thanks a lot in advance!

-- 
8: Si un archivo ha pasado a la "Papelera de Reciclaje"
    * Ud tiene una carpeta llamada "Papelera de Reciclaje"
    Damian Nadales
    http://mx.grulic.org.ar/lurker/message/20080307.141449.a70fb2fc.es.html

Lisandro Damián Nicanor Pérez Meyer
http://perezmeyer.com.ar/
http://perezmeyer.blogspot.com/

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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