I might be slowly making progress..
I've now connected two serial-ports, one for the serial data stream from the F9T (as previously), and a new one with the electrical 1PPS connected to DCD.
Then through much googling I found how to create a pps-device with "ldattach PPS /dev/ttyUSB1"
Now ppstest and ppswatch work:
$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1570384096.000150158, sequence: 4853 - clear 1570384095.100165092, sequence: 4853
source 0 - assert 1570384096.000150158, sequence: 4853 - clear 1570384096.100178407, sequence: 4854
$ sudo ppswatch /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
timestamp: 1570384123, sequence: 4881, offset: 99547497
timestamp: 1570384124, sequence: 4882, offset: 99560566
I have tried to make it use the 'assert' edge instead of the 'clear' edge, but this doesn't seem to do anything:
$ sudo ppsctl -fa /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
(ppswatch and ppstest still give similar results as above, where offset corresponds to the 100ms long pps-pulse, since it seems to trigger on clear)
Now, starting gpsd with
$ sudo gpsd -D 5 -N -n /dev/pps0 /dev/ttyUSB0
I get output like so:
gpsd:INFO: PPS:/dev/pps0 Assert hooks called clock: 1570384257.000356140 real: 1570384257.000000000: accepted
gpsd:PROG: PPS:/dev/pps0 Assert accepted @ 1570384257.000356140 offset -0.000356140
gpsd:PROG: KPPS:/dev/pps0 assert 1570384257.000356140, sequence: 5014, clear 1570384257.100358775, sequence: 5015 - using: clear
gpsd:PROG: KPPS:/dev/pps0 Clear cycle: 1000012, duration: 100002 @ 1570384257.100358775
gpsd:PROG: PPS:/dev/pps0 Clear cycle: 1000012, duration: 100002 @ 1570384257.100358775
gpsd:PROG: PPS:/dev/pps0 Clear ignored 1Hz trailing edge
(maybe that is all OK?)
modifying /etc/ntp.conf to used shared memory drivers also seems to work: (I have used fudge, to correct for the 100ms long pps-pulse)
$ ntpq -np
remote refid st t when poll reach delay offset jitter
==============================================================================
127.127.28.0 .GPS. 0 l - 8 377 0.000 0.188 0.408
127.127.28.1 .PPS. 0 l 7 8 377 0.000 3.361 0.242
However I still don't get a PPS JSON message, connecting with e.g. cgps, or a simple python script (below).
the JSON classes I see are: RAW, TOFF, TPV
(SKY has disappeared, for some reason..)
I don't understand how the WATCH-bitmask works, since I'm trying to enable WATCH_TIMING, but the JSON WATCH message shows false.
thanks,
Anders
--python test client--------------------------
session = gps.gps()
session.stream(gps.WATCH_ENABLE | gps.WATCH_TIMING | gps.WATCH_PPS)
try:
for report in session:
print(report['class'])
if report['class']=="WATCH" or report['class']=="VERSION" or report['class']=="TOFF" or report['class']=="D
EVICES":
print report
------------------output------------------
$ python test_gps.py
VERSION
<dictwrapper: {u'release': u'3.19.1~dev', u'proto_major': 3, u'rev': u'release-3.19-661-g66c711e09', u'class': u'VERSION', u'proto_minor': 14}>
DEVICES
<dictwrapper: {u'class': u'DEVICES', u'devices': [{u'path': u'/dev/pps0', u'driver': u'PPS', u'class': u'DEVICE', u'activated': u'2019-10-06T17:52:52.000Z'}, {u'parity': u'N', u'activated': u'2019-10-06T17:56:34.104Z', u'driver': u'u-blox', u'subtype': u'SW EXT CORE 1.00 (264600),HW 00190000,ROM BASE 0x118B2060,FWVER=TIM 2.00,PROTVER=29.00,MOD=ZED-F9T,GPS;GLO;GAL;BDS,SBAS;QZSS', u'bps': 115200, u'flags': 1, u'stopbits': 1, u'path': u'/dev/ttyUSB0', u'cycle': 1.0, u'class': u'DEVICE', u'native': 1}]}>
WATCH
<dictwrapper: {u'pps': True, u'enable': True, u'scaled': False, u'raw': 0, u'json': True, u'nmea': False, u'timing': False, u'class': u'WATCH', u'split24': False}>
RAW
TOFF
<dictwrapper: {u'clock_sec': 1570384595, u'class': u'TOFF', u'device': u'/dev/ttyUSB0', u'real_sec': 1570384595, u'clock_nsec': 109164451, u'real_nsec': 249441}>
TPV
--------------------------