gpsd-users
[Top][All Lists]
Advanced

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

[gpsd-users] Shared Memory: PPS timestamps not set?


From: Guido Gavilanes
Subject: [gpsd-users] Shared Memory: PPS timestamps not set?
Date: Thu, 4 Jul 2019 16:03:32 +0200

Hello gpsd-users,
I have been working with gpsd with the socket export for some time. Now I am required to bring timign information from our receivers, so I configured a serial-based GNSS receiver + PPS wiring to my imx6 board. I configured pps input through pps-gpio linux module. both serial and PPS sources are configured in my gpsd DEVICES and ntp is currently taking information from SHM exports generated by gpsd for synchronization. 

The program I am working on (using socket export) has been accessing positioning information. Since the host is doing other stuff, timings between JSON-socket and my application are variable, due to the networking stack activity, so positioning information is not received always with the same period of gps samples; instead 2 or 3 samples (samples are produced at 10Hz) are received together, and this messes up other applications. 

So I decided to use shared-memory export, since sample transfer time between receiver and my application are far much stable. In fact it works for positioning information and samples can be read regularly.  Here comes the problem, when reading the PPS objects, the member "clock" timestamp is set to the time when pps was asserted (according to documentation); but when I read it  with the socket export I can read it with seconds and nanosecond resolution; instead with shared memory export, I always read invalid values ( I mean values with the tv_sec=0 or less tan zero) by using exactly the same program (attached). By commenting/uncommenting the 16th/17th line I change from shared memory to socket export and viceversa.

with Socket Export I get (clocks compatible with fix times):

 PPS clk: 1562247898.884325242
 PPS rea: 1562247898.799999952
--- GNSS - last sample elapsed time: -0.000002 1562247898800

 PPS clk: 1562247898.884325242
 PPS rea: 1562247898.799999952
--- GNSS - last sample elapsed time: -0.000002 1562247898800

instead with Shared Memory I got (clocks not compatible with fix times):

 PPS clk: 0.1077805056
 PPS rea: 0.1090546784
--- GNSS - last sample elapsed time: -0.000003 1562247940000

 PPS clk: 0.1077805056
 PPS rea: 0.1090546784
--- GNSS - last sample elapsed time: -0.000003 1562247940000

Does this mean that shared memory export does not export PPS information? Am I forgetting something that avoids to access PPS information?
I need to access PPS timings since it allows me to keep my application synchronized directly with the receiver and I can tell the user how much time has passed since the pps was triggered.
I trust that you know much more gpsd than me and you can help me.
Thank you.

Gyver

Attachment: testgps.c
Description: Text Data


reply via email to

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