GPS derived Pulse per Second for GTA04A5
Introduction
The GTA04A5 hardware uses an Wi2Wi W2SG0084 GPS module which provides a PPS (Pulse per Second) time reference impulse. This is connected to some GPIO (only on GTA04; GTA04A3 and GTA04A4 don't have this feature and most other Letux supported devices don't have GPS at all).
The latest letux-kernels starting with 4.13-rc2 have added Device Tree configs and defconfig so that it works.
How to use
open /dev/ttyGPS0 by e.g. gpsd or some other background process like
cat /dev/ttyGPS0 >/dev/null &
so that the GPS module becomes powered on.
Then run:
ppstest /dev/pps0
As long as there is no antenna available or too weak reception, there will be the message:
time_pps_fetch() error -1 (Connection timed out)
If GPS has good enough signals, we will see e.g.:
root@letux:~# ppstest /dev/pps0 </dev/ttyGPS0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1502827151.007645478, sequence: 69 - clear 0.000000000, sequence: 0
source 0 - assert 1502827152.007654824, sequence: 70 - clear 0.000000000, sequence: 0
source 0 - assert 1502827153.007420053, sequence: 71 - clear 0.000000000, sequence: 0
source 0 - assert 1502827154.007612516, sequence: 72 - clear 0.000000000, sequence: 0
source 0 - assert 1502827155.007621895, sequence: 73 - clear 0.000000000, sequence: 0
source 0 - assert 1502827156.007631285, sequence: 74 - clear 0.000000000, sequence: 0
source 0 - assert 1502827157.007610169, sequence: 75 - clear 0.000000000, sequence: 0
source 0 - assert 1502827158.007589063, sequence: 76 - clear 0.000000000, sequence: 0
^C
root@letux:~# date
As you can see, the precision is in sub-milliseconds.
What it is good for
Originally PPS is intended to provide precise timing for Servers (ntpd can be synchronized).
In a mobile device there are other use cases:
- precise time measurements
- AGPS
- synchronize multiple mobile devices for acoustic events
- and I am sure you find others