<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.Code, li.Code, div.Code
        {mso-style-name:Code;
        mso-style-link:"Code Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Courier New";}
span.CodeChar
        {mso-style-name:"Code Char";
        mso-style-link:Code;
        font-family:"Courier New";}
span.EmailStyle19
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m attempting to use LinuxPPS with GPSD. My hardware environment is an embedded device with a u-blox NEO-M8T GPS module connected to a Xilinx Zynq FPGA, which contains, in part, logic equivalent to a 16550 UART. The (inverted) output of the GPS module’s PPS pin (TIMEPULSE) is connected, via programmable logic, to the DCDn input of the UART. The width of the GPS module’s PPS output pulse is 100 ms. The UART driver is the standard Linux 8250 module.<o:p></o:p></p><p class=MsoNormal>The OS is Ubuntu 14.04 LTS. <o:p></o:p></p><p class=MsoNormal>My kernel (4.4) configuration looks like this in menuconfig:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-*- PPS support<o:p></o:p></p><p class=MsoNormal>[*]          PPS debugging messages<o:p></o:p></p><p class=MsoNormal>                *** PPS clients support ***<o:p></o:p></p><p class=MsoNormal>                <M>      Kernel timer client (Testing client, use for debug)<o:p></o:p></p><p class=MsoNormal>                <M>      PPS line discipline<o:p></o:p></p><p class=MsoNormal>                <M>      PPS client using GPIO<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>(I added the GPIO client selection while trying to debug things – it’s not really necessary).<o:p></o:p></p><p class=MsoNormal>When I run GPSD as a foreground application, as root, with this command line<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>gpsd -D 2 -N -n /dev/ttyS0<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I get output like this:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>root@device# gpsd -D 2 -N -n /dev/ttyS0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: launching (Version 3.9)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: listening on port gpsd<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:ERROR: unable to connect to the DBUS system bus<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: NTPD ntpd_link_activate: 1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: stashing device /dev/ttyS0 at slot 0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: opening GPS data source type 2 at '/dev/ttyS0'<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: speed 115200, 8N1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: speed 9600, 8O1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS checking /sys/devices/virtual/pps/pps0/path, /dev/ttyS0<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS caps 1133<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: KPPS kernel PPS will be used<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: -13577253, duration: -13577253 @ 1504801908.118491036<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: PPS cycle: -13577121, duration: -13577121 @ 1504801908.118623<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: -13477257, duration:   99996 @ 1504801908.218487449<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999985, duration:  899989 @ 1504801909.118475719<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999987, duration:   99997 @ 1504801909.218473536<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: speed 115200, 8N1<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: gpsd_activate(): activated GPS (fd 5)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: device /dev/ttyS0 activated<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: running with effective group ID 20<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: running with effective user ID 65534<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: startup at 2017-09-07T16:31:49.000Z (1504801909)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: /dev/ttyS0 identified as type Generic NMEA (0.004399 sec @ 115200bps)<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PASH inv format*28\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PGRM inv format*2A\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PSRF inv format*35\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PFEC inv format*32\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PTNL inv format*24\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999984, duration:  899986 @ 1504801910.118459378<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999984, duration:   99997 @ 1504801910.218456853<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PFEC inv format*32\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PASH inv format*28\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: unknown sentence: "$GNTXT,01,01,01,PMTK inv format*20\x0d\x0a"<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999990, duration:  899993 @ 1504801911.118449218<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999988, duration:   99994 @ 1504801911.218444104<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999987, duration:  899992 @ 1504801912.118435452<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999994, duration:  100002 @ 1504801912.218437502<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999985, duration:  899983 @ 1504801913.118419919<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: PPS TIOCMIWAIT returns unchanged state, ppsmonitor sleeps 10<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: 10999840, duration:       0 @ 1504801923.218276895<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: 10999844, duration:  899987 @ 1504801924.118263110<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999993, duration:  100005 @ 1504801924.218269096<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999991, duration:  899985 @ 1504801925.118253627<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999982, duration:   99996 @ 1504801925.218250340<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999985, duration:  899988 @ 1504801926.118238127<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999985, duration:   99996 @ 1504801926.218234810<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999980, duration:  899983 @ 1504801927.118217500<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999983, duration:   99999 @ 1504801927.218217300<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: PPS TIOCMIWAIT returns unchanged state, ppsmonitor sleeps 10<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: 10999855, duration:       0 @ 1504801938.118072112<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle: 10999852, duration:   99996 @ 1504801938.218068912<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999986, duration:  899989 @ 1504801939.118057146<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999989, duration:  100000 @ 1504801939.218057402<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999987, duration:  899986 @ 1504801940.118043148<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999981, duration:   99994 @ 1504801940.218037971<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999988, duration:  899993 @ 1504801941.118030528<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999994, duration:  100000 @ 1504801941.218031252<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:INFO: KPPS cycle:  999986, duration:  899985 @ 1504801942.118016036<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>gpsd:WARN: PPS TIOCMIWAIT returns unchanged state, ppsmonitor sleeps 10<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The expected duration is, of course, 100 ms, and every second KPPS cycle report matches that expectation. But in between the expected duration reports are reports claiming a 900 ms duration, and then the TIOCMIWAIT warnings, which suggest that GPSD is using user-space PPS instead of KPPS.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>While GPSD is running, I can cat the pps assert and clear sysfs files, which seem to return reasonable values.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-family:"Courier New"'>root@device:/sys/devices/virtual# while true; do date; cat pps/pps0/assert pps/pps0/clear; sleep 1; done<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802767.106082242#321<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802767.206077443#321<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:07 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802767.106082242#321<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802767.206077443#321<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:08 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802768.106068935#322<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802768.206063338#322<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:09 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802769.106056216#323<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802769.206048951#323<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:10 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802770.106042567#324<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802770.206030037#324<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:11 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802771.106029770#325<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802771.206027917#325<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:12 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802772.106015086#326<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802772.206013074#326<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:13 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802773.105998013#327<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802773.205995257#327<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:14 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802774.105984688#328<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802774.205984140#328<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>Thu Sep  7 16:46:15 UTC 2017<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802775.105970223#329<o:p></o:p></span></p><p class=MsoNormal><span style='font-family:"Courier New"'>1504802775.205972660#329<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>When I kill GPSD (SIGINT, via <ctrl>-c), the KPPS sysfs files disappear. I’m not sure if that’s significant, and it isn’t a problem.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>My first question, then, is – does it appear that KPPS is functioning correctly? If yes, I’ll try the GPSD guys next. If no, then I will need some help in troubleshooting. <o:p></o:p></p><p class=MsoNormal>Thanks in advance,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-Nick<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>