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: Sat, 21 Jul 2018 13:57:38 -0400

I took a look again at the build.txt file...

I did a "scons --clean" and then a "scons timeservice=yes nmea0183=yes fixed_port_speed=9600 fixed_stop_bits=1 pps=yes ntpshm=yes && scons check"

I am also seeing that "scons check" is failing for 3.18~dev, but is fine for 3.16-stable.

Here's the out put for 3.18~dev

Testing detection of invalid packets...
./test_packet | diff -u ./test/packet.test.chk -
--- ./test/packet.test.chk      2018-07-20 15:48:22.647842375 +0000
+++ -   2018-07-21 17:46:15.749684711 +0000
@@ -6,19 +6,19 @@
  5: NMEA packet with wrong checksum test succeeded.
  6: NMEA interspersed packet test succeeded.
  7: NMEA interrupted packet test succeeded.
- 8: SiRF WAAS version ID test succeeded.
- 9: SiRF WAAS version ID with 3 chars of leading garbage test succeeded.
+ 8: SiRF WAAS version ID test FAILED (packet type -1 wrong).
+ 9: SiRF WAAS version ID with 3 chars of leading garbage test FAILED (packet type -1 wrong).
 10: SiRF WAAS version ID with wrong checksum test succeeded.
 11: SiRF WAAS version ID with bad length test succeeded.
-12: Zodiac binary 1000 Geodetic Status Output Message test succeeded.
-13: EverMore status packet 0x20 test succeeded.
-14: EverMore packet 0x04 with 0x10 0x10 sequence test succeeded.
-15: EverMore packet 0x04 with 0x10 0x10 sequence, some noise before packet data test succeeded.
-16: EverMore packet 0x04, 0x10 and some other data at the beginning test succeeded.
-17: EverMore packet 0x04, 0x10 three times at the beginning test succeeded.
-18: RTCM104V3 type 1005 packet test succeeded.
+12: Zodiac binary 1000 Geodetic Status Output Message test FAILED (packet type -1 wrong).
+13: EverMore status packet 0x20 test FAILED (packet type -1 wrong).
+14: EverMore packet 0x04 with 0x10 0x10 sequence test FAILED (packet type -1 wrong).
+15: EverMore packet 0x04 with 0x10 0x10 sequence, some noise before packet data test FAILED (packet type -1 wrong).
+16: EverMore packet 0x04, 0x10 and some other data at the beginning test FAILED (packet type -1 wrong).
+17: EverMore packet 0x04, 0x10 three times at the beginning test FAILED (packet type -1 wrong).
+18: RTCM104V3 type 1005 packet test FAILED (packet type -1 wrong).
 19: RTCM104V3 type 1005 packet with 4th byte garbled test succeeded.
-20: RTCM104V3 type 1029 packet test succeeded.
+20: RTCM104V3 type 1029 packet test FAILED (packet type -1 wrong).
 === EOF with buffer nonempty test ===
 $GPVTG,308.74,T,,M,0.00,N,0.0,K*68
 $GPGGA,110534.994,4002.1425,N,07531.2585,W,0,00,50.0,172.7,M,-33.8,M,0.0,0000*7A
scons: *** [packet-regress] Error 1
scons: building terminated because of errors.

Chris

On Sat, Jul 21, 2018 at 12:47 PM, Chris Smith <address@hidden> wrote:
If ya'll are still with me and not thoroughly annoyed with the frequency of my e-mails, I appreciate your patience.

That said, here's my distilled findings.



Here's what is convincing to me that the 3.18~dev build of gpsd is buggy, at least when using my GPS module which is based upon the UM220-III NL chip.

I have purged my RPi 3 B+ of all official Raspbian gpsd and unofficical instances. It is running the latest official Jessie with kernel 4.4.21-v7+. "gpsd" does not exist on it's filesystem anywhere, no do any of the associated libraries that get built with it.

I have downloaded the gzip'd tarball for gpsd 3.16 stable from here: http://download-mirror.savannah.gnu.org/releases/gpsd/

I have extracted it to a folder called /home/pi/gpsd-3.16

I then do a git clone of 3.18~dev into a folder called /home/pi/gpsd

I then move /home/pi/gpsd to /home/pi/gpsd-3.18-dev

I then build them the same way found here using scons (http://www.catb.org/gpsd/gpsd-time-service-howto.html).

scons timeservice=yes nmea0183=yes fixed_port_speed=9600 fixed_stop_bits=1 pps=yes ntpshm=yes

I do not install them into the OE as services, they are simply compiled binaries at the moment that are not found in my PATH variable.

This configuration allows me to cd into either /home/pi/gpsd-3.16 or /home/pi/gpsd-3.18-dev and chose which gpsd version I wish to start.

Here is what I can say with certainty:

If I start gpsd version 3.18~dev (as root, no sudo) and then run the ntpshmmon that was build with it (as root, no sudo), I do not see any output. I do see, however, that ipcs -m shows two processes (gpsd and ntpshmmon) are attached to the 8 SHM ranges that gpsd uses.

Now, here's the interesting test.

If I shutdown the previous gpsd instance and then start gpsd version 3.16-stable (as root, no sudo) and then run (as root, no sudo) the ntpshmmon binary that was built with the 3.18~dev version, I see output from NTP0 and NTP2.

Additionally, with 3.16-stable, I see 1PPS assert accepts from gpsd. In 3.18~dev, I see "gpsd:PROG: PPS:/dev/pps0 Assert ignored missing last_fixtime". I don't know why we're ignoring this symptom.

That makes me believe that the gpsd binary for 3.18~dev itself is the culprit.

I observe these results on both the latest version of Jessie and Stretch.

Do you guys know what the development environment for 3.18~dev looked like? What release, kernel, library versions, etc..?

Are there any build requirements that differ between 3.16-stable and 3.18~dev?

Thanks,

Chris

On Sat, Jul 21, 2018 at 10:46 AM, Chris Smith <address@hidden> wrote:
Here's one other way to look at the /dev/shm question...

Here's "ipcs -m" before gpsd is started (not after a fresh boot...)

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest
0x4e545030 294915     root       600        80         0
0x4e545031 327684     root       600        80         0
0x4e545032 360453     root       666        80         0
0x4e545033 393222     root       666        80         0
0x4e545034 425991     root       666        80         0
0x4e545035 458760     root       666        80         0
0x4e545036 491529     root       666        80         0
0x4e545037 524298     root       666        80         0

Here is with gpsd 3.18~dev running...

address@hidden:/home/pi/gpsd# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest
0x4e545030 294915     root       600        80         1
0x4e545031 327684     root       600        80         1
0x4e545032 360453     root       666        80         1
0x4e545033 393222     root       666        80         1
0x4e545034 425991     root       666        80         1
0x4e545035 458760     root       666        80         1
0x4e545036 491529     root       666        80         1
0x4e545037 524298     root       666        80         1


And here's what ipcs -m looks like with ntpshmmon running as root while gpsd 3.18~dev is running...

address@hidden:/home/pi/gpsd# ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest
0x4e545030 294915     root       600        80         2
0x4e545031 327684     root       600        80         2
0x4e545032 360453     root       666        80         2
0x4e545033 393222     root       666        80         2
0x4e545034 425991     root       666        80         2
0x4e545035 458760     root       666        80         2
0x4e545036 491529     root       666        80         2
0x4e545037 524298     root       666        80         2

I think this shows that gpsd and ntpshmmon are all working as expected, yes?

Chris


On Sat, Jul 21, 2018 at 10:19 AM, Chris Smith <address@hidden> wrote:
Ok, same thing but as root this time, using my correct serial device (/dev/ttyAMA0 vs /dev/ttyS0) and including /dev/pps0... whoops! Still looks like /dev/shm is trying to be used, yes?

address@hidden:/home/pi/gpsd# ./gpsd -nND 4 /dev/ttyAMA0 /dev/pps0 |& fgrep -i SHM
gpsd:PROG: NTP: shmat(294915,0,0) succeeded, segment 0
gpsd:PROG: NTP: shmat(327684,0,0) succeeded, segment 1
gpsd:PROG: NTP: shmat(360453,0,0) succeeded, segment 2
gpsd:PROG: NTP: shmat(393222,0,0) succeeded, segment 3
gpsd:PROG: NTP: shmat(425991,0,0) succeeded, segment 4
gpsd:PROG: NTP: shmat(458760,0,0) succeeded, segment 5
gpsd:PROG: NTP: shmat(491529,0,0) succeeded, segment 6
gpsd:PROG: NTP: shmat(524298,0,0) succeeded, segment 7
gpsd:INFO: PPS:/dev/ttyAMA0 ntpshm_link_activate: 1
gpsd:INFO: PPS:/dev/pps0 ntpshm_link_activate: 0


I think the best way to see SHM usage is "ipcs"...

I have stopped and disabled ntpd before this test.

from a fresh boot, and before starting gpsd 3.18~dev

address@hidden:~/gpsd $ sudo ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest


after starting gpsd 3.18~dev

address@hidden:~/gpsd $ sudo ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest
0x4e545030 294915     root       600        80         1
0x4e545031 327684     root       600        80         1
0x4e545032 360453     root       666        80         1
0x4e545033 393222     root       666        80         1
0x4e545034 425991     root       666        80         1
0x4e545035 458760     root       666        80         1
0x4e545036 491529     root       666        80         1
0x4e545037 524298     root       666        80         1


and after stopping gpsd 3.18~dev

address@hidden:~/gpsd $ sudo ipcs -m

------ Shared Memory Segments --------
key        shmid      owner      perms      bytes      nattch     status
0x00000000 163840     pi         600        524288     2          dest
0x00000000 196609     pi         600        393216     2          dest
0x00000000 262146     pi         600        524288     2          dest
0x4e545030 294915     root       600        80         0
0x4e545031 327684     root       600        80         0
0x4e545032 360453     root       666        80         0
0x4e545033 393222     root       666        80         0
0x4e545034 425991     root       666        80         0
0x4e545035 458760     root       666        80         0
0x4e545036 491529     root       666        80         0
0x4e545037 524298     root       666        80         0





On Sat, Jul 21, 2018 at 9:44 AM, Chris Smith <address@hidden> wrote:
address@hidden:~/gpsd $ pwd <-where am I?
/home/pi/gpsd <-directory made from git clone of gpsd.git from nongnu.org
address@hidden:~/gpsd $ ./gpsd -V <- I want to run the gpsd version in my cwd
./gpsd: 3.18~dev (revision release-3.17-157-g5e95e79)
address@hidden:~/gpsd $ which gpsd <- where does the gpsd binary reside that the system sees in my PATH?
/usr/sbin/gpsd
address@hidden:~/gpsd $ gpsd -V <-What's that look like?
gpsd: 3.11 (revision 3.11-3)
address@hidden:~/gpsd $ ./gpsd -nND 4 /dev/ttyS0 |& fgrep -i SHM <-Running latest dev build, and we can be sure of that
gpsd:PROG: NTP: shmat(360453,0,0) succeeded, segment 2
gpsd:PROG: NTP: shmat(393222,0,0) succeeded, segment 3
gpsd:PROG: NTP: shmat(458760,0,0) succeeded, segment 4
gpsd:PROG: NTP: shmat(491529,0,0) succeeded, segment 5
gpsd:PROG: NTP: shmat(524298,0,0) succeeded, segment 6
gpsd:PROG: NTP: shmat(557067,0,0) succeeded, segment 7
gpsd:INFO: PPS:/dev/ttyS0 ntpshm_link_activate: 1
^C
address@hidden:~/gpsd $ gpsd -nND 4 /dev/ttyS0 |& fgrep -i SHM <- running official Raspbian build
gpsd:PROG: NTPD shmat(360453,0,0) succeeded, segment 2
gpsd:PROG: NTPD shmat(393222,0,0) succeeded, segment 3
gpsd:PROG: shmat() succeeded, segment 425991
gpsd:INFO: NTPD ntpshm_link_activate: 1
^C
address@hidden:~/gpsd $ gpsd -nND 4 /dev/ttyS0 |& fgrep -i SHM <- just double checking the output...
gpsd:PROG: NTPD shmat(360453,0,0) succeeded, segment 2
gpsd:PROG: NTPD shmat(393222,0,0) succeeded, segment 3
gpsd:PROG: shmat() succeeded, segment 425991
(::probably missing  ntpshm_link_activate: 1 on this go because I quickly restarted the program::)
^C
address@hidden:~/gpsd $ ps -ef | grep gps <- making sure I haven't left anything running...
pi       13329  7982  0 13:31 pts/1    00:00:00 grep --color=auto gps
address@hidden:~/gpsd $ apt purge gpsd <- ok, let's get rid of the apt installed gpsd incase there's linked libraries somewhere or something...
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? <- whoops
address@hidden:~/gpsd $ sudo apt purge gpsd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  gpsd*
0 upgraded, 0 newly installed, 1 to remove and 337 not upgraded.
After this operation, 126 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 121128 files and directories currently installed.)
Removing gpsd (3.11-3) ... <- there we go
Purging configuration files for gpsd (3.11-3) ...
Processing triggers for man-db (2.7.0.2-5) ...
address@hidden:~/gpsd $ pwd <- confirm where I am
/home/pi/gpsd
address@hidden:~/gpsd $ ./gpsd -V <-confim the binary in that file is the same as it was before the apt purge
./gpsd: 3.18~dev (revision release-3.17-157-g5e95e79)
address@hidden:~/gpsd $ gpsd -V <- double check there is no gpsd binary in /usr/sbin/gpsd
-bash: /usr/sbin/gpsd: No such file or directory
address@hidden:~/gpsd $ which gpsd <- does not return anything indicating that there is a gpsd binary in my PATH
address@hidden:~/gpsd $ ./gpsd -nND 4 /dev/ttyS0 |& fgrep -i SHM <- let's start up 3.18~dev again, ensuring that the SHM output is the same before the apt purge...
gpsd:PROG: NTP: shmat(360453,0,0) succeeded, segment 2
gpsd:PROG: NTP: shmat(393222,0,0) succeeded, segment 3
gpsd:PROG: NTP: shmat(458760,0,0) succeeded, segment 4
gpsd:PROG: NTP: shmat(491529,0,0) succeeded, segment 5
gpsd:PROG: NTP: shmat(524298,0,0) succeeded, segment 6
gpsd:PROG: NTP: shmat(557067,0,0) succeeded, segment 7
gpsd:INFO: PPS:/dev/ttyS0 ntpshm_link_activate: 1
^C

Also,

address@hidden:~/gpsd $ mount | grep shm
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)



Chris


On Fri, Jul 20, 2018 at 10:45 PM, Gary E. Miller <address@hidden> wrote:
Yo Chris!

> Lets check that your SHM works:
>
> # gpsd -nND 4 /dev/ttyS0 |& fgrep SHM
> gpsd:PROG: shmget(0x47505344, 9008, 0666) for SHM export succeeded
> gpsd:PROG: shmat() for SHM export succeeded, segment 262152

A better test for SHM:

 # gpsd -nND 4 /dev/ttyS0 |& fgrep -i SHM
gpsd:PROG: NTP: shmat(0,0,0) succeeded, segment 0
gpsd:PROG: NTP: shmat(32769,0,0) succeeded, segment 1
gpsd:PROG: NTP: shmat(65538,0,0) succeeded, segment 2
gpsd:PROG: NTP: shmat(98307,0,0) succeeded, segment 3
gpsd:PROG: NTP: shmat(131076,0,0) succeeded, segment 4
gpsd:PROG: NTP: shmat(163845,0,0) succeeded, segment 5
gpsd:PROG: NTP: shmat(196614,0,0) succeeded, segment 6
gpsd:PROG: NTP: shmat(229383,0,0) succeeded, segment 7
gpsd:PROG: shmget(0x47505344, 9008, 0666) for SHM export succeeded
gpsd:PROG: shmat() for SHM export succeeded, segment 262152
gpsd:INFO: PPS:/dev/ttyS0 ntpshm_link_activate: 1




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin






reply via email to

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