gpsd-users
[Top][All Lists]
Advanced

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

Re: [gpsd-users] 1PPS not working with RPi 3 B+ and Stretch


From: Chris Smith
Subject: Re: [gpsd-users] 1PPS not working with RPi 3 B+ and Stretch
Date: Fri, 20 Jul 2018 07:58:37 -0400

Had to re-send this one because I apparently don't compress my images enough,,,

----


Gary! (and others!)

Ok, here we go.

Where can we see the specs for that board? 
Can you confirm the PPS pin?


Here's the manufacturer page for my module:

http://www.unicorecomm.com/en/product/content_965.html

Here's the PDF specs sheet:

http://www.unicorecomm.com/en/files/PDF/UM220-III%20NL_En-mail.pdf

Here's a great write up that has detailed chip pinouts:

https://download.atlantis-press.com/article/25841961/pdf

(Here's the extracted detail image...)






Here's my mapping of the 1PPS out from the chip to the pin header on the board (orange circles):






The board uses a SP3232EEN TTL-to-RS232 level converter.  Here's that datasheet:

https://www.exar.com/ds/sp3222e_sp3232e.pdf

After some deep research, I have determined that only the DATA (TX/RX) lines need to be converted to RS232 voltages (-3VDC to -25VDC for a "1" bit). 

https://www.electronics-notes.com/articles/connectivity/serial-data-communications/rs232-signal-voltage-levels.php

This shows that DCD PPS assert can be driven by +3.3VDC directly from the UM220 - III NL chip.

On the bottom of the board, I have soldered a bread tie (with insulation, not shown) from the 1PPS pin to the DCD pin of the DB9 connector.




After the soldering was done, I connected a DB9 "non-null-modem" extension cable from the GPS module to the serial port on my workstation.

I have everything working on my CentOS 7 machine with 1PPS with this exact device. It keeps time to +/- 5uS.

Additionally, for the Raspberry Pi, I have electrically connected, from before the 3.3VDC-to-RS232 level conversion, jumper wires that feed TTL (+3.3VDC, not +5VDC) serial to the RPi. The 1PPS is provided over GPIO18.

Ok, that should cover the 1PPS (and GPIO serial) info.

Moving on to /boot/config.txt and /boot/cmdline.txt...

Can you confirm the contests of your /boot/config.txt and
/boot/cmdline.txt?  Just to see the script set them properly? 


address@hidden:~ $ cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=tty1 root=PARTUUID=bff404cd-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles nohz=off

address@hidden:~ $ tail /boot/config.txt
# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

#Timeserver customizations begin here
dtoverlay=pi3-disable-bt
enable_uart=1
gpu_mem=0
dtoverlay=pps-gpio,gpiopin=18

The contents match per the NTPsec.org clockmaker how-to.

Can you confirm that /dev/pps0 got created on boot?

address@hidden:~ $ ls -l /dev/pps0
crw------- 1 root root 243, 0 Jul 19 16:00 /dev/pps0

Can you confirm that /dev/pps0 is working? 

address@hidden:~ $ 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 1532031771.961960159, sequence: 1315 - clear  0.000000000, sequence: 0
source 0 - assert 1532031772.961926789, sequence: 1316 - clear  0.000000000, sequence: 0
source 0 - assert 1532031773.961898281, sequence: 1317 - clear  0.000000000, sequence: 0
source 0 - assert 1532031774.961867604, sequence: 1318 - clear  0.000000000, sequence: 0
source 0 - assert 1532031775.961835851, sequence: 1319 - clear  0.000000000, sequence: 0

How did you start your gpsd?

As root, I issue, from "/home/pi" and let it run, printing to stdout:


address@hidden:/home/pi# ./gpsd/gpsd -n -N -D4 /dev/gpsd0

Changing fonts here and I'm too lazy to try to fix it, sorry :)

I then start a new PuTTY session and then try to run "ntpshmmon" as downloaded/built by the clockwork script...

address@hidden:/home/pi# ./gpsd/ntpshmmon
ntpshmmon version 1
#      Name Seen@                Clock                Real                 L Prec

No output is observed.

Can you verify gpsd is running now?

Sure, here:

address@hidden:/home/pi# pstree -paul | fgrep gpsd
  |   |                       `-gpsd,1035,nobody /dev/gpsd0 -n -N -D4
  |   |                           `-{gpsd},1036
  |                           |-grep,1041 -F gpsd


Also...

gpsd:PROG: KPPS:/dev/pps0 assert  1532034832.977119719, sequence: 2151, clear   0.000000000, sequence: 0 - using: assert
gpsd:PROG: KPPS:/dev/pps0 Assert cycle: 1000028, duration:       0 @  1532034832.977119719
gpsd:PROG: PPS:/dev/pps0 Assert cycle: 1000028, duration:       0 @  1532034832.977119719
gpsd:PROG: PPS:/dev/pps0 Assert ignored missing last_fixtime <- where does this value "last_fixtime" come from?
gpsd:PROG: GNRMC sentence timestamped 211353.00.
gpsd:PROG: GNRMC starts a reporting cycle.
gpsd:PROG: GNGGA sentence timestamped 211353.00.
gpsd:PROG: GNGLL sentence timestamped 211353.00.
gpsd:PROG: GNGLL ends a reporting cycle.
gpsd:PROG: xxGSA sets mode 3 (*notice in the below example that these lines are different?)
gpsd:PROG: xxGSA sets mode 3
gpsd:PROG: Partial satellite data (1 of 3).
gpsd:PROG: Partial satellite data (2 of 3).
gpsd:INFO: PRN=  5 az=254 el=79 (-0.183417, -0.052594, 0.981627)
gpsd:INFO: PRN=  6 az= 67 el=25 (0.834261, 0.354123, 0.422618)
gpsd:INFO: PRN=  9 az= 43 el= 9 (0.673602, 0.722350, 0.156434)
gpsd:INFO: PRN= 12 az=232 el=42 (-0.585606, -0.457526, 0.669131)
gpsd:INFO: PRN= 13 az=163 el=16 (0.281046, -0.919259, 0.275637)
gpsd:INFO: PRN= 17 az=131 el= 6 (0.750575, -0.652465, 0.104528)
gpsd:INFO: PRN= 19 az=125 el=27 (0.729870, -0.511060, 0.453990)
gpsd:INFO: PRN= 25 az=287 el=31 (-0.819713, 0.250611, 0.515038)
gpsd:INFO: PRN= 29 az=318 el=15 (-0.646331, 0.717823, 0.258819)
gpsd:INFO: PRN=172 az=322 el=36 (-0.498081, 0.637514, 0.587785)
gpsd:INFO: Sats used (10):




Additional observations from my CentOS 7 box (using traditional DCD 1PPS, not a Raspberry Pi device)

For troubleshooting purposes, since I have this same exact GPS module connected (electrically, in parallel) to a working CentOS 7 build, here's what I'm seeing on that machine:

address@hidden ~]# 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 1532033338.000090419, sequence: 120036 - clear  1532033337.500140435, sequence: 120041
source 0 - assert 1532033338.000090419, sequence: 120036 - clear  1532033338.500133654, sequence: 120042
source 0 - assert 1532033339.000100062, sequence: 120037 - clear  1532033338.500133654, sequence: 120042
source 0 - assert 1532033339.000100062, sequence: 120037 - clear  1532033339.500136275, sequence: 120043
source 0 - assert 1532033340.000094034, sequence: 120038 - clear  1532033339.500136275, sequence: 120043
source 0 - assert 1532033340.000094034, sequence: 120038 - clear  1532033340.500138263, sequence: 120044
source 0 - assert 1532033341.000101164, sequence: 120039 - clear  1532033340.500138263, sequence: 120044
source 0 - assert 1532033341.000101164, sequence: 120039 - clear  1532033341.500130643, sequence: 120045

Notice in this configuration (using the serial port) that I get both an assert at .000 and a clear at .500. This fits well with my observations when I O-scoped the 1PPS line that the pulse is 500ms wide. I can also be certain that the PPS Vmin = 0VDC and PPS Vmax=+3.3VDC.

Further, here is the output from gpsd on that machine using the same runtime options:

gpsd:PROG: KPPS assert 1532033843.000096500, sequence: 36 - clear  1532033843.500164488, sequence: 36
gpsd:PROG: KPPS data: using clear
gpsd:PROG: KPPS cycle:  999997 uSec, duration:  500067 uSec @ 1532033843.500164488
gpsd:PROG: PPS edge: 0, cycle:  999996 uSec, duration:  500093 uSec @ 1532033843.500214217
gpsd:PROG: Partial satellite data (1 of 3).
gpsd:PROG: Partial satellite data (2 of 3).
gpsd:PROG: KPPS assert 1532033844.000144000, sequence: 37 - clear  1532033843.500164488, sequence: 36
gpsd:PROG: KPPS data: using assert
gpsd:PROG: KPPS cycle: 1000047 uSec, duration:  499979 uSec @ 1532033844.000144000
gpsd:PROG: PPS edge: 1, cycle: 1000046 uSec, duration:  499953 uSec @ 1532033844.000168078
gpsd:INFO: PPS hooks called with accepted 1532033844.000144000 offset -0.000144000
gpsd:PROG: PPS edge accepted 1532033844.000144000 offset -0.000144000
gpsd:PROG: GNRMC sentence timestamped 205724.00.
gpsd:PROG: GNRMC starts a reporting cycle.
gpsd:PROG: GNGGA sentence timestamped 205724.00.
gpsd:PROG: GNGLL sentence timestamped 205724.00.
gpsd:PROG: GNGLL ends a reporting cycle.
gpsd:PROG: GPGSA sets mode 3*
gpsd:PROG: GPGSA sets mode 3


What I find interesting is that on the CentOS 7 box, /dev/pps0 only gets created when gpsd is running. On the RPi, /dev/pps0 is created by, I am assuming, the "pps-gpio" module, yes? (I don't want to digress here, just providing complete observations. I know serial port DCD PPS is very different than how pps_gpio does its thing.)


The only other thing I can think of is that I've run into gpsd issues before with this module when using a really old version of Fedora 18. I think I remember that gpsd couldn't get either a 3D fix or a valid time value because of my additional Beidou and GLONASS messages (but this appears to have been fixed for CentOS 6/7). Again, I don't know how to disable these on this GPS module, but am open to testing stuff out; I have two of them and don't mind sacrificing one of them for research purposes.

Just for comparison purposes, here is the output from the two different gpsd instances for the same second interval per the GNRMC message:

RaspberryPi using pps_gpio

gpsd:PROG: KPPS:/dev/pps0 assert  1532035041.981374587, sequence: 2360, clear   0.000000000, sequence: 0 - using: assert
gpsd:PROG: KPPS:/dev/pps0 Assert cycle: 1000013, duration:       0 @  1532035041.981374587
gpsd:PROG: PPS:/dev/pps0 Assert cycle: 1000013, duration:       0 @  1532035041.981374587
gpsd:PROG: PPS:/dev/pps0 Assert ignored missing last_fixtime
gpsd:PROG: GNRMC sentence timestamped 211722.00.
gpsd:PROG: GNRMC starts a reporting cycle.
gpsd:PROG: GNGGA sentence timestamped 211722.00.
gpsd:PROG: GNGLL sentence timestamped 211722.00.
gpsd:PROG: GNGLL ends a reporting cycle.
gpsd:PROG: xxGSA sets mode 3
gpsd:PROG: xxGSA sets mode 3
gpsd:PROG: Partial satellite data (1 of 3).
gpsd:PROG: Partial satellite data (2 of 3).
gpsd:INFO: PRN=  5 az=262 el=80 (-0.171958, -0.024167, 0.984808)
gpsd:INFO: PRN=  6 az= 69 el=24 (0.852868, 0.327385, 0.406737)
gpsd:INFO: PRN=  9 az= 42 el= 8 (0.662619, 0.735913, 0.139173)
gpsd:INFO: PRN= 12 az=230 el=41 (-0.578141, -0.485118, 0.656059)
gpsd:INFO: PRN= 13 az=163 el=17 (0.279596, -0.914519, 0.292372)
gpsd:INFO: PRN= 17 az=132 el= 5 (0.740317, -0.666584, 0.087156)
gpsd:INFO: PRN= 19 az=127 el=26 (0.717809, -0.540908, 0.438371)
gpsd:INFO: PRN= 25 az=285 el=31 (-0.827960, 0.221851, 0.515038)
gpsd:INFO: PRN= 29 az=318 el=17 (-0.639893, 0.710673, 0.292372)
gpsd:INFO: PRN=172 az=322 el=37 (-0.491689, 0.629333, 0.601815)
gpsd:INFO: Sats used (10):


Dell Precision T3600 using (K?)PPS on DCD of Serial port

gpsd:PROG: KPPS assert 1532035041.000078710, sequence: 22 - clear  1532035041.500105289, sequence: 22
gpsd:PROG: KPPS data: using clear
gpsd:PROG: KPPS cycle: 1000036 uSec, duration:  500026 uSec @ 1532035041.500105289
gpsd:PROG: PPS edge: 0, cycle: 1000025 uSec, duration:  500046 uSec @ 1532035041.500154088
gpsd:PROG: Partial satellite data (2 of 3).
gpsd:PROG: KPPS assert 1532035042.000058694, sequence: 23 - clear  1532035041.500105289, sequence: 22
gpsd:PROG: KPPS data: using assert
gpsd:PROG: KPPS cycle:  999979 uSec, duration:  499953 uSec @ 1532035042.000058694
gpsd:PROG: PPS edge: 1, cycle:  999986 uSec, duration:  499940 uSec @ 1532035042.000094332
gpsd:INFO: PPS hooks called with accepted 1532035042.000058694 offset -0.000058694
gpsd:PROG: PPS edge accepted 1532035042.000058694 offset -0.000058694
gpsd:PROG: GNRMC sentence timestamped 211722.00.
gpsd:PROG: GNRMC starts a reporting cycle.
gpsd:PROG: GNGGA sentence timestamped 211722.00.
gpsd:PROG: GNGLL sentence timestamped 211722.00.
gpsd:PROG: GNGLL ends a reporting cycle.
gpsd:PROG: GPGSA sets mode 3
gpsd:PROG: GPGSA sets mode 3
gpsd:PROG: Partial satellite data (1 of 3).




Thanks for the interest and help folks! Let me know if any of the images don't make it through.



reply via email to

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