gpsd-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: COEX GPS (model UBX-M8030 IC) on Raspberry Pi 4 Model B 2018 connect


From: Aranza Shaccid Leon
Subject: Re: COEX GPS (model UBX-M8030 IC) on Raspberry Pi 4 Model B 2018 connection issues
Date: Thu, 22 Jul 2021 16:04:33 -0700

Hello!

26ac:0012  is the flight controller. And yes, when I said I only plugged the GPS with a USB to the Raspberry Pi and disconnected the GPS from the flight controller.

I've disconnected the gpsd and gpsd socket from system d again, but I'm not sure there is much difference between the first gpsdebug I send and this one (this one has connected GPS via USB, disconnected from the flight controller).

+ id -u
+ [ 0 != 0 ]
+ id
uid=0(root) gid=0(root) groups=0(root)
+ uname -a
Linux clover-1060 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU                                                                                        /Linux
+ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
+ command -v gpsd
/usr/sbin/gpsd
+ gpsd -V
gpsd: 3.17 (revision 3.17)
+ gpsd -h
+ grep ^#.*enabled
# Socket export enabled.
# Shared memory export enabled.
# DBUS export enabled
# Time service features enabled.
# PPS enabled.
+ command -v sockstat
+ command -v lsof
/usr/bin/lsof
+ lsof -iTCP:2947 -s TCP:LISTEN
+ lsof -c gpsd
+ sed -nE 1p;/CHR|LISTEN/p
COMMAND    PID USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
gpsdebugi 1053 root    0u   CHR  136,0      0t0     3 /dev/pts/0
gpsdebugi 1053 root    1u   CHR  136,0      0t0     3 /dev/pts/0
gpsdebugi 1053 root    2u   CHR  136,0      0t0     3 /dev/pts/0
+ ps ax
+ sed -nE 1p;/gpsd/p
  PID TTY      STAT   TIME COMMAND
 1053 pts/0    S+     0:00 /bin/sh ./gpsdebuginfo
 1066 pts/0    S+     0:00 sed -nE 1p;/gpsd/p
+ command -v gpspipe
/usr/bin/gpspipe
+ gpspipe -V
gpspipe: 3.17 (revision 3.17)
+ gpspipe -w -n 2 -x 20
gpspipe: invalid option -- 'x'
Usage: gpspipe [OPTIONS] [server[:port[:device]]]

-d Run as a daemon.
-o [file] Write output to file.
-h Show this help.
-r Dump raw NMEA.
-R Dump super-raw mode (GPS binary).
-w Dump gpsd native data.
-S Set scaled flag.
-2 Set the split24 flag.
-l Sleep for ten seconds before connecting to gpsd.
-t Time stamp the data.
-T [format] set the timestamp format (strftime(3)-like; implies '-t')
-u usec time stamp, implies -t. Use -uu to output sec.usec
-s [serial dev] emulate a 4800bps NMEA GPS on serial port (use with '-r').
-n [count] exit after count packets.
-v Print a little spinner.
-p Include profiling info in the JSON.
-P Include PPS JSON in NMEA or raw mode.
-V Print version and exit.

You must specify one, or more, of -r, -R, or -w
You must use -o if you use -d.
+ 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        80         0
0x4e545031 1          root       600        80         0
0x4e545032 2          root       666        80         0
0x4e545033 3          root       666        80         0
0x4e545034 4          root       666        80         0
0x4e545035 5          root       666        80         0
0x4e545036 6          root       666        80         0
0x4e545037 7          root       666        80         0
+ command -v ntpshmmon
/usr/bin/ntpshmmon
+ ntpshmmon -V
ntpshmmon: version 3.17 (revision 3.17)
+ ntpshmmon -n 6 -t 10
ntpshmmon version 1
#      Name Seen@                Clock                Real                 L Pre                                                                                        c
+ ls -l /dev/pps* /dev/ttyACM0 /dev/ttyACM1 /dev/ttyAMA0
ls: cannot access '/dev/pps*': No such file or directory
crw-rw---- 1 root dialout 166,  0 Jul 22 03:17  /dev/ttyACM0
crw-rw---- 1 root dialout 166,  1 Jul 22 03:17  /dev/ttyACM1
crw-rw---- 1 root dialout 204, 64 Jul 22 03:17  /dev/ttyAMA0
+ command -v lsusb
/usr/bin/lsusb
+ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 26ac:0012
Bus 001 Device 003: ID 1546:01a8 U-Blox AG [u-blox 8]
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
+ echo PYTHONPATH
PYTHONPATH
+ command -v gpscat
/usr/bin/gpscat
+ command -v gpscat
+ head -n 1 /usr/bin/gpscat
#! /usr/bin/python
+ 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>
AttributeError: 'module' object has no attribute '__version__'
+ command -v python3
/usr/bin/python3
+ python3 -V
Python 3.7.3
+ 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
/usr/bin/systemctl
+ cat /etc/default/gpsd /etc/init.d/gpsd
# Default settings for the gpsd init script and the hotplug wrapper.

# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Use USB hotplugging to add new USB devices automatically to the daemon
USBAUTO="true"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyGPS"

# Other options you want to pass to gpsd
GPSD_OPTIONS=""
#!/bin/sh
### BEGIN INIT INFO
# Provides:          gpsd
# Required-Start:    $remote_fs $syslog $network
# Should-Start:      bluetooth dbus udev
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Start-Before:    ntp
# Short-Description: GPS (Global Positioning System) daemon
# Description:       The gpsd service daemon is able to monitor one or
#                    more GPS devices connected to a host computer, making
#                    all data on the location and movements of the sensors
#                    available to be queried on TCP port 2947.
### END INIT INFO

# Author: Bernd Zeimetz <bzed@debian.org>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
RUNDIR=/run/gpsd
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="GPS (Global Positioning System) daemon"
NAME=gpsd
DAEMON=/usr/sbin/$NAME
PIDFILE=$RUNDIR/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

if [ -z "$GPSD_SOCKET" ] && [ -z "$DEVICES" ]; then
        GPSD_SOCKET=/var/run/gpsd.sock
fi

if [ -n "$GPSD_SOCKET" ]; then
        GPSD_OPTIONS="$GPSD_OPTIONS -F $GPSD_SOCKET"
fi

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        # Return
        #   0 if daemon has been started
        #   1 if daemon was already running
        #   2 if daemon could not be started

        mkdir -p $RUNDIR || return 2

        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
                || return 1
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
                $GPSD_OPTIONS -P $PIDFILE $DEVICES \
                || return 2
}

#
# Function that stops the daemon/service
#
do_stop()
{
        # Return
        #   0 if daemon has been stopped
        #   1 if daemon was already stopped
        #   2 if daemon could not be stopped
        #   other if a failure occurred
        start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
        RETVAL="$?"
        [ "$RETVAL" = 2 ] && return 2
        # Many daemons don't delete their pidfiles when they exit.
        rm -f $PIDFILE
        return "$RETVAL"
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
        #
        # If the daemon can reload its configuration without
        # restarting (for example, when it is sent a SIGHUP),
        # then implement that here.
        #
        start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
        return 0
}

case "$1" in
  start)
        if [ "$START_DAEMON" = "true" ]; then
                [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
                do_start
                case "$?" in
                        0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                        2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
                esac
        else
                [ "$VERBOSE" != no ] && \
                        log_daemon_msg "Not starting $DESC" "$NAME" && \
                        log_end_msg 0
        fi
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        case "$?" in
                0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
                2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
        esac
        ;;
  status)
       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
       ;;
  reload|force-reload)
        log_daemon_msg "Reloading $DESC" "$NAME"
        do_reload
        log_end_msg $?
        ;;
  restart)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        case "$?" in
          0|1)
                do_start
                case "$?" in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
        exit 3
        ;;
esac

:
+ 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
SocketMode=0600

[Install]
WantedBy=sockets.target
+ systemctl status gpsd.service
● gpsd.service - GPS (Global Positioning System) Daemon
   Loaded: loaded (/lib/systemd/system/gpsd.service; disabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2021-07-22 04:40:45 BST; 1min 36s ago
 Main PID: 429 (code=exited, status=0/SUCCESS)

Jul 22 04:38:11 clover-1060 systemd[1]: Starting GPS (Global Positioning System) Daemon...
Jul 22 04:38:13 clover-1060 systemd[1]: Started GPS (Global Positioning System) Daemon.
Jul 22 04:40:45 clover-1060 systemd[1]: Stopping GPS (Global Positioning System) Daemon...
Jul 22 04:40:45 clover-1060 systemd[1]: gpsd.service: Succeeded.
Jul 22 04:40:45 clover-1060 systemd[1]: Stopped GPS (Global Positioning System) Daemon.
+ systemctl status gpsd.socket
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
   Loaded: loaded (/lib/systemd/system/gpsd.socket; disabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2021-07-22 04:41:17 BST; 1min 4s ago
   Listen: /var/run/gpsd.sock (Stream)
           [::1]:2947 (Stream)
           127.0.0.1:2947 (Stream)

Jul 22 04:38:10 clover-1060 systemd[1]: Listening on GPS (Global Positioning System) Daemon Sockets.
Jul 22 04:41:17 clover-1060 systemd[1]: gpsd.socket: Succeeded.
Jul 22 04:41:17 clover-1060 systemd[1]: Closed GPS (Global Positioning System) Daemon Sockets.
+ journalctl -u gpsd.service --since today
-- Logs begin at Thu 2019-02-14 10:11:59 GMT, end at Thu 2021-07-22 04:41:59 BST. --
Jul 22 04:38:11 clover-1060 systemd[1]: Starting GPS (Global Positioning System) Daemon...
Jul 22 04:38:13 clover-1060 systemd[1]: Started GPS (Global Positioning System) Daemon.
Jul 22 04:40:45 clover-1060 systemd[1]: Stopping GPS (Global Positioning System) Daemon...
Jul 22 04:40:45 clover-1060 systemd[1]: gpsd.service: Succeeded.
Jul 22 04:40:45 clover-1060 systemd[1]: Stopped GPS (Global Positioning System) Daemon.
+ command -v aa-status
+ command -v apparmor_status
+ set +x
Please send the entire, untouched output.


How should I get gpsd to run without using system d?

Thank you for your time and consideration.

Sincerely,
Leon



On Thu, Jul 22, 2021 at 1:20 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Aranza!

On Thu, 22 Jul 2021 15:00:24 -0700
Aranza Shaccid Leon <leon18@pnw.edu> wrote:

> I used udev rules in order to connect my GPS when I had it on a
> separate USB connection (had to disconnect from the flight controller
> for this to work though) and in the rules, I named it ttyGPS.

That standard symlink name is "/dev/gps0".  Yours works, just adds
a bit of confusion.

> The gpsdebuginfo above is with the gpsd socket/gpsd disabled and with
> the GPS plugged into only the flight controller.

Which, of course, is not the configuration you could not get to work
and raised an issue about.

> This is the gpsdebuginfo with the gpsd socket/gpsd enabled (is this
> what you mean be get gpsd running?)

No.  I have always, firmly, railed aginst enabling gpsd under
systemd(umb).  Which is why you were instructed to turn it off, and did
in fact urn it off.


> and the GPS plugged into only the USB.

I take that to mean NOT also plugged into the flight controller, so
once again NOT the configuration you want and that we were trying to debug?

> /usr/bin/lsof
> + lsof -iTCP:2947 -s TCP:LISTEN
> COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
> systemd   1 root   70u  IPv6  16942    0t0  TCP localhost:gpsd (LISTEN)
> systemd   1 root   75u  IPv4  16944    0t0  TCP localhost:gpsd (LISTEN)
> gpsd    735 gpsd    4u  IPv6  16942    0t0  TCP localhost:gpsd (LISTEN)
> gpsd    735 gpsd    5u  IPv4  16944    0t0  TCP localhost:gpsd (LISTEN)

That is very odd.  Somehow systemd(roll) and gpsd both have port 2947 open?
Which is why I don't do systemd(umber).

> + lsof -c gpsd
> + sed -nE 1p;/CHR|LISTEN/p
> COMMAND    PID USER   FD   TYPE     DEVICE SIZE/OFF  NODE NAME
> gpsd       735 gpsd    0u   CHR        1,3    0t0     5 /dev/null
> gpsd       735 gpsd    1u   CHR        1,3    0t0     5 /dev/null
> gpsd       735 gpsd    2u   CHR        1,3    0t0     5 /dev/null
> gpsd       735 gpsd    4u  IPv6      16942    0t0   TCP localhost:gpsd (LISTEN)
> gpsd       735 gpsd    5u  IPv4      16944    0t0   TCP localhost:gpsd (LISTEN)
> gpsdebugi 1005 root    0u   CHR      136,0    0t0     3 /dev/pts/0

Notice that gpsd is NOT conencted to your GPS.  Your systemd(umber)
config is broken.  But I can't help you there since I do not do
systemd(umbest).

> + ps ax
> + sed -nE 1p;/gpsd/p
>   PID TTY      STAT   TIME COMMAND
>   735 ?        S<s    0:00 /usr/sbin/gpsd /dev/ttyGPS

You tried to get it to open /dev/ttyGPS, but it failed.  See above.

Since you used a non-standard name, the debug output is less helpful.

> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 001 Device 003: ID 26ac:0012

You still did not answer my question on what 26ac:0012 is, it is
not obeying the USB standard...

> Bus 001 Device 004: ID 1546:01a8 U-Blox AG [u-blox 8]

At least the u-blox is plugged in.

But I can't help you when systemd(umpkopf) is controlling gpsd.


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
CAUTION: This email originated from outside of the PNW environment. Do not click links or open attachments unless you recognize the sender and know the content is safe.


reply via email to

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