|
From: | Marc Rosen |
Subject: | Re: GPS Mac OS challenges |
Date: | Fri, 10 Dec 2021 15:42:40 -1000 |
Overview 1. Work w Gary's help to set up gpsd and ntp on my MBP laptop - this seems to work although hard to verify since ntpshmmon not succeeding yet 2. Original goal - have a reliable time source for off grid usage where accuracy to 0.5 secs is needed I'm using a ham radio digital mode which requires time sync. The program I'm using, WSJT-X, uses the Mac system time - identical to what is seen in the system date-time dialog and in the menu bar clock - upper right It appears that the system dialog uses an ntp server - time.apple.com to source the official time. My thought was to run ntp locally and then set the system dialog to use 127.0.0.1 as the source The local ntp server is listening to the GPS NMEA feed from a USB connected radio - although a better GPS source could be substituted Clearly there are easier ways to do this - but why not see if this could work 3. Next challenge seems to me to be how to test and prove it's working as expected Marc On Dec 10, 2021, at 2:12 PM, Marc Rosen <marc.rosen@mac.com> wrote: ok - now things are moving I think some of my issues in the last couple days were that I shifted positions by 8000km and did not let the GPS get a fix - which took an awful long time , over an hour now - GPS is tracking 7 SATs, I’ve started gpsd and ntpd using root ( sudo su -) started gpsd this time just as: gpsd -n /dev/cu.usbmodem1203 -ND4 The reason I had the -F before was that I misunderstood or merged 2 examples I saw The reason I have the hardcoded port - I don’t know how to make/use a generic gpsN port for the moment it just means I have to be aware of which physical USB-C port I plug the radio into
*** after all this I see the following Marcs-2020-MacBook-Pro-2:bin marc$ ntpq -p remote refid st t when poll reach delay offset jitter ============================================================================== us.pool.ntp.org .POOL. 16 p - 64 0 0.000 +0.000 0.001 *SHM(0) .GPS. 0 l 19 64 377 0.000 +0.701 9.466 SHM(1) .PPS. 0 l - 64 0 0.000 +0.000 0.000 *** when I run ntpshmmon ( as root), I get: Marcs-2020-MacBook-Pro-2:~ root# /opt/homebrew/bin/ntpshmmon WARNING: could not open SHM(0): Permission denied(13) WARNING: could not open SHM(1): Permission denied(13) ntpshmmon: version 3.23.1 # Name Seen@ Clock Real L Prc **************************************** output from gpsdebuginfo **************************************** Marcs-2020-MacBook-Pro-2:~ root# /opt/homebrew/bin/gpsdebuginfo ++ id -u + '[' 0 '!=' 0 ']' + id uid=0(root) gid=0(wheel) groups=0(wheel),1(daemon),2(kmem),3(sys),4(tty),5(operator),8(procview),9(procmod),12(everyone),20(staff),29(certusers),61(localaccounts),80(admin),33(_appstore),98(_lpadmin),100(_lpoperator),204(_developer),250(_analyticsusers),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh),400(com.apple.access_remote_ae) + uname -a Darwin Marcs-2020-MacBook-Pro-2.local 21.0.1 Darwin Kernel Version 21.0.1: Tue Sep 14 20:56:24 PDT 2021; root:xnu-8019.30.61~4/RELEASE_ARM64_T6000 arm64 + cat '/etc/*release' cat: /etc/*release: No such file or directory + command -v gpsd + command -v sockstat + command -v lsof /usr/sbin/lsof + lsof -iTCP:2947 -s TCP:LISTEN COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME gpsd 2687 nobody 3u IPv4 0xcbd0cf81bd32e3ab 0t0 TCP localhost:gpsd (LISTEN) gpsd 2687 nobody 4u IPv6 0xcbd0cf81c1ff9b93 0t0 TCP localhost:gpsd (LISTEN) + lsof -c gpsd + sed -nE '1p;/CHR|LISTEN/p' COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME gpsd 2687 nobody 0u CHR 16,0 0t1711826 1217 /dev/ttys000 gpsd 2687 nobody 1u CHR 16,0 0t1711826 1217 /dev/ttys000 gpsd 2687 nobody 2u CHR 16,0 0t1711826 1217 /dev/ttys000 gpsd 2687 nobody 3u IPv4 0xcbd0cf81bd32e3ab 0t0 TCP localhost:gpsd (LISTEN) gpsd 2687 nobody 4u IPv6 0xcbd0cf81c1ff9b93 0t0 TCP localhost:gpsd (LISTEN) gpsd 2687 nobody 5u CHR 9,1 0t405394 695 /dev/cu.usbmodem1203 + ps ax + sed -nE '1p;/gpsd/p' PID TT STAT TIME COMMAND 2687 s000 S<+ 0:01.18 /opt/homebrew/sbin/gpsd -n /dev/cu.usbmodem1203 -ND4 2750 s003 S+ 0:00.01 /bin/sh /opt/homebrew/bin/gpsdebuginfo 2761 s003 S+ 0:00.00 sed -nE 1p;/gpsd/p + command -v gpspipe + command -v ipcs /usr/bin/ipcs + ipcs -m + sed -nE '/key/p;/KEY/p;/0x4e5450/p' T ID KEY MODE OWNER GROUP m 65536 0x4e545030 --rw------- root wheel m 65537 0x4e545031 --rw------- root wheel m 65538 0x4e545032 --rw-rw-rw- root wheel m 65539 0x4e545033 --rw-rw-rw- root wheel m 65540 0x4e545034 --rw-rw-rw- root wheel m 65541 0x4e545035 --rw-rw-rw- root wheel m 65542 0x4e545036 --rw-rw-rw- root wheel m 65543 0x4e545037 --rw-rw-rw- root wheel + command -v ntpshmmon + ls -l '/dev/pps*' '/dev/tty[AU]*' ls: /dev/pps*: No such file or directory ls: /dev/tty[AU]*: No such file or directory + command -v lsusb + echo PYTHONPATH PYTHONPATH + command -v gpscat + command -v python /usr/bin/python + python -V Python 2.7.16 + python -c 'import gps;print(gps.__version__)' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named gps + command -v python3 /usr/bin/python3 + python3 -V Python 3.8.2 + python3 -c 'import gps;print(gps.__version__)' Traceback (most recent call last): File "<string>", line 1, in <module> ModuleNotFoundError: No module named 'gps' + command -v systemctl + command -v aa-status + command -v apparmor_status + set +x Please send the entire, untouched output. On Dec 10, 2021, at 10:46 AM, Marc Rosen <marc.rosen@mac.com> wrote: The load is all that is needed if you do it right the first time Otherwise unload and run load again after updating the plots text file Marc On Dec 10, 2021, at 9:08 AM, Gary E. Miller <gem@rellim.com> wrote: Yo Marc! On Fri, 10 Dec 2021 08:58:00 -1000 Marc Rosen <marc.rosen@mac.com> wrote: ( next looking for an open spot to get a GPS signal) Nice work. Even better if someone adds this to the INSTALL.adoc file in the macOS section. add a text file “plist" to /Library/LaunchDaemons WHy load and then unload? the text of the file I used ultimately is: Makes sense. Sort of. On Linux that would be one single line. 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 |
[Prev in Thread] | Current Thread | [Next in Thread] |