[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GPS Mac OS challenges
From: |
Gary E. Miller |
Subject: |
Re: GPS Mac OS challenges |
Date: |
Thu, 9 Dec 2021 16:13:40 -0800 |
Yo Marc!
On Thu, 9 Dec 2021 17:54:19 -0600
Marc Rosen <marc.rosen@mac.com> wrote:
> 14” MBP M1 Pro running Mac OS v12.0
My Mac Mini died, so I have not tested on Mac in a while.
> Marcs-2020-MacBook-Pro-2:Cellar marc$ ls gpsd/
> 3.23.1
Good.
> Marcs-2020-MacBook-Pro-2:Cellar marc$ ls ntp
> 4.2.8p15
Better to use NTPsec, but should be OK.
> when I run this command and retry gpsd ( after removing existing
> segments) that error goes away
>
> sudo sysctl -w kern.sysv.shmseg=32
> kern.sysv.shmseg: 8 -> 32
Huh. That is new, and stupid of them.
> there are now 9 shared memory segments present ( running gpsd as
> root)
Yes, 9 is normal.
> When I restart the laptop - the shmem change reverts
On linux you can put persistend changes in /etc/sysctl.d/
Dunno how you do it on macOS.
> when I run gpsd as root - I get a warning to run it as user from user
> space/login
Odd, gpsd needs root for several features. Like using SHM(0) and
SHM(1) for talking to ntpd.
> when I run it as user - it opens 7 shared memory segments, then
> running ntpd as root opens 2 more
Yes, because gpsd can not open SHM(0) or SHM(1) when not root. That
leaves 6 SHM(x) and the control segment.
> either way I get a permission denied error running ntpshmmon ( either
> as user or root)
Weird. On Linux that is usually caused by borked SELinux or AppArmor.
> there was one time when I did not see this error - not sure what was
> different
I never saw anything like it when my mini was running.
> Marcs-2020-MacBook-Pro-2:ntp marc$ ntpshmmon
> WARNING: could not open SHM(0): Permission denied(13)
> WARNING: could not open SHM(1): Permission denied(13)
That is normal when not run as root.
> * Running ntpshmmon as root gives this error:
>
> Marcs-2020-MacBook-Pro-2:bin marc$ sudo ntpshmmon
> Password:
RUnning things under sudo is not the same as running as root.
Here is one way to become root: "sudo su -". Don't forget the
dash.
> *************************** gpsdebuginfo (gpsd as user, ntpd as root,
> started from rebooted Mac with shared mem segs increased to 32
>
> ++ id -u
> + '[' 0 '!=' 0 ']'
> + id
> uid=0(root) gid=0(wheel)
Run as root.
> + ps ax
> + sed -nE '1p;/gpsd/p'
> PID TT STAT TIME COMMAND
> 958 s000 S+ 0:00.13 gpsd -n /dev/cu.usbmodem1203 -ND4 -F
> /opt/homebrew/var/gpsd.sock
Odd to run gpsd with both a hard coded serial port, and -F. But nothing
wrong with it if you also intend to hotplug other GPS receivers.
> /usr/bin/ipcs
> + ipcs -m
> + sed -nE '/key/p;/KEY/p;/0x4e5450/p'
> T ID KEY MODE OWNER GROUP
> m 65536 0x4e545032 --rw-rw-rw- marc staff
> m 65537 0x4e545033 --rw-rw-rw- marc staff
> m 65538 0x4e545034 --rw-rw-rw- marc staff
> m 65539 0x4e545035 --rw-rw-rw- marc staff
> m 65540 0x4e545036 --rw-rw-rw- marc staff
> m 65541 0x4e545037 --rw-rw-rw- marc staff
> m 65543 0x4e545030 --rw------- root wheel
> m 65544 0x4e545031 --rw------- root wheel
That shows SHM(2) to SHM(7) are present and correct. But gpsd does
not seem to be using SHM(2) as expeccted.
I see indication that your device is outputting PPS. In that
configuration, gpsd should be writing serial time to SHM(2), but there
is no evidence of that.
What does the first 60 seconds of the gpsd logging look like?
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
gem@rellim.com Tel:+1 541 382 8588
Veritas liberabit vos. -- Quid est veritas?
"If you can't measure it, you can't improve it." - Lord Kelvin
pgpLYMf_m8BWS.pgp
Description: OpenPGP digital signature
- GPS Mac OS challenges, Marc Rosen, 2021/12/06
- Re: GPS Mac OS challenges, Gary E. Miller, 2021/12/06
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/09
- Re: GPS Mac OS challenges,
Gary E. Miller <=
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/09
- Re: GPS Mac OS challenges, Gary E. Miller, 2021/12/09
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/10
- Re: GPS Mac OS challenges, Gary E. Miller, 2021/12/10
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/10
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/10
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/10
- Re: GPS Mac OS challenges, Gary E. Miller, 2021/12/10
- Message not available
- Re: GPS Mac OS challenges, Gary E. Miller, 2021/12/10
- Re: GPS Mac OS challenges, Marc Rosen, 2021/12/10