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 10:46:55 -0400

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]