Yo Jim!
On Thu, 29 Jul 2021 18:21:46 +0000 (UTC)
Jim Pennino <
penninojim@yahoo.com> wrote:
>
>
> On Thursday, July 29, 2021, 10:51:19 AM PDT, Gary E. Miller
> <
gem@rellim.com> wrote:
>
> > Using Ubuntu 20.04.2 and gpsd 3.20.
>
> 3,20 is a tad old, and has a fatal bug appearing on October 23, 2021
>
>
> That is the current Ubuntu release.
Still bad. And it will break in October 2021.
> > I replaced the long running USB GPS with a RS-232 device,
> > reconfigured and rebooted.
>
> Would be nice to know how you reconfigured. The devil is in the
> details.
>
> USBAUTO="false"
> DEVICES="/dev/ttyS4 "
> GPSD_OPTIONS="-n -b -s9600 "
> GPSD_SOCKET=/var/run/gpsd.socket
Better, still have no idea why you use the Bluetooth option, but unrelated.
As I said, because the gpsd documentation says it mean read only. It does NOT say it is read only for USB and/or bluetooth.
> > NMEA data is just fine and ppscheck works but gpsd is not processing
> > the PPS signal on CTS.
>
> Did you use "-D 4" with gpsd? That is the best way to debug PPS.
> As gpsd only logs to syslog, I did not do that as setting syslog to
> debug will fill with messages from everything on the system. IMHO
> gpsd should have an option to set the logging facility to something
> quieter such as usr1.
Where it logs too is configurable by your logging system. I only need
a minutes worth.
No, where a program logs to is determined by which facility is compiled in absent a switch to change it at run time. gpsd is obviously compiled to log to LOG_SYSLOG. The issue is that putting gpsd in debug mode is only part of it. You also have to set the log level of the syslog file to a level of LOG_DEBUG which means EVERYTHING on the system is writing huge piles of information to the syslog file. If you could change the facility to one LOG_LOCAL0 through LOG_LOCAL7 that would not be an issue as few, if any, other things use those facilities.
> > ppstest and ppswatch fail
>
> Fail how?
>
> ppstest /dev/pps0
> trying PPS source "/dev/pps0"
> found PPS source "/dev/pps0"
> ok, found 1 source(s), now start fetching data...
> time_pps_fetch() error -1 (Connection timed out)
That sure looks like a broken pps. As root or not root?
As root.
> ^C
>
> ppswatch /dev/pps0
> trying PPS source "/dev/pps0"
> found PPS source "/dev/pps0"
> time_pps_fetch() error -1 (Connection timed out)
> time_pps_fetch() error -1 (Connection timed out)
> ^C
That sure looks like a broken pps. As root or not root?
As root.
> Verify by runnng gpsdebuginfo from here:
>
>
https://gpsd.io/gpsdebuginfo> Will do that later; send the output to who exactly?
Send it to the list here. It is not long. Without it we'll play
20-questions for the rest of the week.
> > # Other options you want to pass to gpsd
> > GPSD_OPTIONS="-n -b -s9600 "
>
> Why -b? You are not running on bluetooth.
> Because the gpsd documentation says it is read-only mode, not that it
> is read-only mode only for USB and bluetooth.
Actually, the doc says:
"Broken-device-safety mode, "
Is your receiver broken? Otherwise, bad idea.
What the man page really says is:
Broken-device-safety mode, otherwise known as read-only mode. A few bluetooth and USB receivers lock up or become totally inaccessible when probed or reconfigured; see the hardware compatibility list on the GPSD project website for details. This switch prevents gpsd from writing to a receiver.
It does NOT say that This switch prevents gpsd from writing to only USB or bluetooth receivers.
> > Now I have no clue where to go next...
>
> Shoot systemd(umber) in the head.
> Who is going to pay me to rewrite Ubuntu?
Devuan already did. Many alternatives to Ubuntu that do not use
systemd(umbest).
Changing to another OS is not an option and you so far have not shown systemd has anything to do with the issue.
The only viable option I have right now is to dump gpsd and just use the type 20 driver.
Here is the script output.
+ id -u
+ [ 0 != 0 ]
+ id
uid=0(root) gid=0(root) groups=0(root)
+ uname -a
Linux gonzo.specsol.net 5.4.0-80-generic #90-Ubuntu SMP Fri Jul 9 22:49:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
+ cat /etc/lsb-release /etc/os-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
NAME="Ubuntu"
VERSION="20.04.2 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.2 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
+ command -v gpsd
/usr/sbin/gpsd
+ gpsd -V
gpsd: 3.20 (revision 3.20)
+ gpsd -h
+ grep ^#.*enabled
# Socket export enabled.
# Shared memory export enabled.
# DBUS export enabled
+ command -v sockstat
+ command -v lsof
/usr/bin/lsof
+ lsof -iTCP:2947 -s TCP:LISTEN
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 115u IPv6 1650045 0t0 TCP localhost:gpsd (LISTEN)
systemd 1 root 117u IPv4 1648535 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 4u IPv6 1650045 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 5u IPv4 1648535 0t0 TCP localhost:gpsd (LISTEN)
+ lsof -c gpsd
+ sed -nE 1p;/CHR|LISTEN/p
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gpsd 55519 gpsd 0u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 1u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 2u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 4u IPv6 1650045 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 5u IPv4 1648535 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 7r CHR 4,68 0t0 94 /dev/ttyS4
gpsd 55519 gpsd 8u CHR 247,0 0t0 651 /dev/pps0
gpsdebugi 60705 root 0u CHR 136,1 0t0 4 /dev/pts/1
+ ps ax
+ sed -nE 1p;/gpsd/p
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
Output information may be incomplete.
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
gpsd 55519 gpsd 0u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 1u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 2u CHR 1,3 0t0 6 /dev/null
gpsd 55519 gpsd 4u IPv6 1650045 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 5u IPv4 1648535 0t0 TCP localhost:gpsd (LISTEN)
gpsd 55519 gpsd 7r CHR 4,68 0t0 94 /dev/ttyS4
gpsd 55519 gpsd 8u CHR 247,0 0t0 651 /dev/pps0
gpsdebugi 60705 root 0u CHR 136,1 0t0 4 /dev/pts/1
+ ps ax
+ sed -nE 1p;/gpsd/p
PID TTY STAT TIME COMMAND
55519 ? S<sl 0:06 /usr/sbin/gpsd -n -b -s9600 /dev/ttyS4
60704 pts/1 S+ 0:00 sudo bin/gpsdebuginfo
60705 pts/1 S+ 0:00 /bin/sh bin/gpsdebuginfo
60718 pts/1 S+ 0:00 sed -nE 1p;/gpsd/p
+ command -v gpspipe
/usr/bin/gpspipe
+ gpspipe -V
gpspipe: 3.20 (revision 3.20)
+ gpspipe -w -n 2 -x 20
{"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14}^M
{"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyS4","driver":"u-blox","subtype":"Unknown","activated":"2021-07-29T18:24:45.207Z","flags":1,"native":1,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00,"mincycle":0.25}]}^M
+ command -v ipcs
/usr/bin/ipcs
+ ipcs -m
+ sed -nE /key/p;/KEY/p;/0x4e5450/p
key shmid owner perms bytes nattch status
0x4e545030 0 root 600 96 2
0x4e545031 1 root 600 96 2
0x4e545032 2 root 666 96 1
0x4e545033 3 root 666 96 1
0x4e545034 4 root 666 96 1
0x4e545035 5 root 666 96 1
0x4e545036 6 root 666 96 1
0x4e545037 7 root 666 96 1
+ command -v ntpshmmon
/usr/bin/ntpshmmon
+ ntpshmmon -V
ntpshmmon: version 3.20 (revision 3.20)
+ ntpshmmon -n 6 -t 10
ntpshmmon: version 3.20
# Name Seen@ Clock Real L Prc
sample NTP0 1627583085.425001954 1627583084.999063900 1627583084.999836904 0 -20
sample NTP0 1627583085.999787799 1627583085.999505478 1627583085.999835768 0 -20
sample NTP0 1627583087.000613920 1627583087.000026746 1627583086.999834633 0 -20
sample NTP0 1627583088.000620213 1627583088.000080653 1627583087.999833498 0 -20
sample NTP0 1627583089.000058150 1627583088.999728310 1627583088.999832362 0 -20
sample NTP0 1627583089.999925204 1627583089.999856580 1627583089.999831227 0 -20
+ ls -l /dev/pps0 /dev/tty[AU]*
ls: cannot access '/dev/tty[AU]*': No such file or directory
crw------- 1 root root 247, 0 Jul 29 09:35 /dev/pps0
+ command -v lsusb
/usr/bin/lsusb
+ lsusb
Bus 001 Device 007: ID 0bda:b812 Realtek Semiconductor Corp.
Bus 001 Device 005: ID 046d:081b Logitech, Inc. Webcam C310
Bus 001 Device 003: ID 0bda:5411 Realtek Semiconductor Corp. 4-Port USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 003: ID 04f2:0939 Chicony Electronics Co., Ltd USB Optical Mouse
Bus 005 Device 002: ID 1a2c:4b61 China Resource Semico Co., Ltd USB Keyboard
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 19ff:0239 Dynex BCM20702A0
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
+ echo PYTHONPATH
PYTHONPATH
+ command -v gpscat
/usr/bin/gpscat
+ command -v gpscat
+ head -n 1 /usr/bin/gpscat
#! /usr/bin/python3
+ command -v python
/usr/bin/python
+ python -V
Python 2.7.18
+ 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.10
+ python3 -c import gps;print(gps.__version__)
3.20
+ command -v systemctl
/bin/systemctl
+ cat /etc/default/gpsd
# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
START_DAEMON="false"
# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="false"
#DEVICES="/dev/ttyS4 /dev/pps0"
DEVICES="/dev/ttyS4 "
# Other options you want to pass to gpsd
GPSD_OPTIONS="-n -b -s9600 "
GPSD_SOCKET=/var/run/gpsd.socket
+ systemctl cat gpsd.service
# /lib/systemd/system/gpsd.service
[Unit]
Description=GPS (Global Positioning System) Daemon
Requires=gpsd.socket
# Needed with chrony SOCK refclock
After=chronyd.service
[Service]
Type=forking
EnvironmentFile=-/etc/default/gpsd
ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES
[Install]
WantedBy=multi-user.target
Also=gpsd.socket
+ systemctl cat gpsd.socket
# /lib/systemd/system/gpsd.socket
[Unit]
Description=GPS (Global Positioning System) Daemon Sockets
[Socket]
ListenStream=/var/run/gpsd.sock
ListenStream=[::1]:2947
ListenStream=127.0.0.1:2947
# To allow gpsd remote access, start gpsd with the -G option and
# uncomment the next two lines:
# ListenStream=[::1]:2947
# ListenStream=0.0.0.0:2947
SocketMode=0600
[Install]
WantedBy=sockets.target
+ systemctl status gpsd.service
● gpsd.service - GPS (Global Positioning System) Daemon
Loaded: loaded (/lib/systemd/system/gpsd.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-07-29 09:35:48 PDT; 1h 49min ago
TriggeredBy: ● gpsd.socket
Process: 55517 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
Main PID: 55519 (gpsd)
Tasks: 2 (limit: 4565)
Memory: 1.6M
CGroup: /system.slice/gpsd.service
└─55519 /usr/sbin/gpsd -n -b -s9600 /dev/ttyS4
Jul 29 09:35:48 gonzo.specsol.net systemd[1]: Starting GPS (Global Positioning System) Daemon...
Jul 29 09:35:48 gonzo.specsol.net systemd[1]: Started GPS (Global Positioning System) Daemon.
+ systemctl status gpsd.socket
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
Loaded: loaded (/lib/systemd/system/gpsd.socket; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-07-29 09:35:48 PDT; 1h 49min ago
Triggers: ● gpsd.service
Listen: /run/gpsd.sock (Stream)
[::1]:2947 (Stream)
127.0.0.1:2947 (Stream)
Tasks: 0 (limit: 4565)
Memory: 40.0K
CGroup: /system.slice/gpsd.socket
Jul 29 09:35:48 gonzo.specsol.net systemd[1]: Listening on GPS (Global Positioning System) Daemon Sockets.
+ journalctl -u gpsd.service --since today
-- Logs begin at Tue 2021-01-12 16:11:58 PST, end at Thu 2021-07-29 11:24:45 PDT. --
Jul 29 08:26:50 gonzo.specsol.net systemd[1]: Stopping GPS (Global Positioning System) Daemon...
Jul 29 08:26:50 gonzo.specsol.net systemd[1]: gpsd.service: Succeeded.
Jul 29 08:26:50 gonzo.specsol.net systemd[1]: Stopped GPS (Global Positioning System) Daemon.
Jul 29 08:27:10 gonzo.specsol.net systemd[1]: Starting GPS (Global Positioning System) Daemon...
Jul 29 08:27:10 gonzo.specsol.net systemd[1]: Started GPS (Global Positioning System) Daemon.
Jul 29 09:08:11 gonzo.specsol.net systemd[1]: Stopping GPS (Global Positioning System) Daemon...
Jul 29 09:08:11 gonzo.specsol.net systemd[1]: gpsd.service: Succeeded.
Jul 29 09:08:11 gonzo.specsol.net systemd[1]: Stopped GPS (Global Positioning System) Daemon.
Jul 29 09:35:48 gonzo.specsol.net systemd[1]: Starting GPS (Global Positioning System) Daemon...
Jul 29 09:35:48 gonzo.specsol.net systemd[1]: Started GPS (Global Positioning System) Daemon.
+ command -v aa-status
/usr/sbin/aa-status
+ aa-status
apparmor module is loaded.
74 profiles are loaded.
69 profiles are in enforce mode.
/snap/core/11420/usr/lib/snapd/snap-confine
/snap/core/11420/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/usr/bin/evince
/usr/bin/evince-previewer
/usr/bin/evince-previewer//sanitized_helper
/usr/bin/evince-thumbnailer
/usr/bin/evince//sanitized_helper
/usr/bin/lxc-start
/usr/bin/man
/usr/lib/cups/backend/cups-pdf
/usr/lib/snapd/snap-confine
/usr/lib/snapd/snap-confine//mount-namespace-capture-helper
/usr/lib/telepathy/mission-control-5
/usr/lib/telepathy/telepathy-*
/usr/lib/telepathy/telepathy-*//pxgsettings
/usr/lib/telepathy/telepathy-*//sanitized_helper
/usr/lib/telepathy/telepathy-ofono
/usr/sbin/cups-browsed
/usr/sbin/cupsd
/usr/sbin/cupsd//third_party
/usr/sbin/mysqld
/usr/sbin/named
/usr/sbin/ntpd
/usr/sbin/tcpdump
ippusbxd
libreoffice-senddoc
libreoffice-soffice//gpg
libreoffice-xpdfimport
lsb_release
lxc-container-default
lxc-container-default-cgns
lxc-container-default-with-mounting
lxc-container-default-with-nesting
man_filter
man_groff
nvidia_modprobe
nvidia_modprobe//kmod
snap-update-ns.chromium
snap-update-ns.code
snap-update-ns.core
snap-update-ns.ffmpeg
snap-update-ns.gnome-system-monitor
snap-update-ns.lxd
snap-update-ns.snap-store
snap.chromium.chromedriver
snap.chromium.chromium
snap.chromium.hook.configure
snap.core.hook.configure
snap.ffmpeg.ffmpeg
snap.ffmpeg.ffplay
snap.ffmpeg.ffprobe
snap.gnome-system-monitor.gnome-system-monitor
snap.gnome-system-monitor.hook.configure
snap.lxd.activate
snap.lxd.benchmark
snap.lxd.buginfo
snap.lxd.check-kernel
snap.lxd.daemon
snap.lxd.hook.configure
snap.lxd.hook.install
snap.lxd.hook.remove
snap.lxd.lxc
snap.lxd.lxc-to-lxd
snap.lxd.lxd
snap.lxd.migrate
snap.snap-store.hook.configure
snap.snap-store.snap-store
snap.snap-store.ubuntu-software
snap.snap-store.ubuntu-software-local-file
5 profiles are in complain mode.
/usr/sbin/gpsd
libreoffice-oopslash
libreoffice-soffice
snap.code.code
snap.code.url-handler
7 processes have profiles defined.
6 processes are in enforce mode.
/usr/sbin/cups-browsed (29294)
/usr/sbin/cupsd (29292)
/usr/lib/cups/notifier/dbus (29330) /usr/sbin/cupsd
/usr/sbin/mysqld (2558)
/usr/sbin/named (1596)
/usr/sbin/ntpd (55559)
1 processes are in complain mode.
/usr/sbin/gpsd (55519)
0 processes are unconfined but have a profile defined.
+ set +x
Please send the entire, untouched output.