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 17:44:22 -0700

Hello!

Just as a quick clarification of my current situation:
1) I have the GPS connected to the flight controller with a UART connection and the flight controller is connected to my RPi via a USB. This is how I'm supposed to have it connected.

2) I disconnected the GPS from the flight controller, connected it to the RPi with a USB and inserted one line of udev rules in order for this connection to work. If I have the GPS connected to both the flight controller (UART connection) and the RPi (USB connection) the program will not run.

Using gpsd -n /dev/ttyACM1 and then cgps in root did start the program and it did gather data. This is the resulting gpsdebuginfo from it:
+ 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
COMMAND PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
systemd   1 root   58u  IPv6  11908      0t0  TCP localhost:gpsd (LISTEN)
systemd   1 root   59u  IPv4  14690      0t0  TCP localhost:gpsd (LISTEN)
gpsd    427 gpsd    4u  IPv6  11908      0t0  TCP localhost:gpsd (LISTEN)
gpsd    427 gpsd    5u  IPv4  14690      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      427 gpsd    0u   CHR        1,3      0t0     5 /dev/null
gpsd      427 gpsd    1u   CHR        1,3      0t0     5 /dev/null
gpsd      427 gpsd    2u   CHR        1,3      0t0     5 /dev/null
gpsd      427 gpsd    4u  IPv6      11908      0t0   TCP localhost:gpsd (LISTEN)
gpsd      427 gpsd    5u  IPv4      14690      0t0   TCP localhost:gpsd (LISTEN)
gpsd      427 gpsd    8u   CHR      166,0      0t0   378 /dev/ttyACM0
gpsdebugi 965 root    0u   CHR      136,0      0t0     3 /dev/pts/0
gpsdebugi 965 root    1u   CHR      136,0      0t0     3 /dev/pts/0
gpsdebugi 965 root    2u   CHR      136,0      0t0     3 /dev/pts/0
+ ps ax
+ sed -nE 1p;/gpsd/p
  PID TTY      STAT   TIME COMMAND
  427 ?        S<s    0:00 /usr/sbin/gpsd /dev/ttyGPS
  965 pts/0    S+     0:00 /bin/sh ./gpsdebuginfo
  978 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         1
0x4e545031 1          root       600        80         1
0x4e545032 2          root       666        80         1
0x4e545033 3          root       666        80         1
0x4e545034 4          root       666        80         1
0x4e545035 5          root       666        80         1
0x4e545036 6          root       666        80         1
0x4e545037 7          root       666        80         1
+ 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 Prec
+ 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 04:40  /dev/ttyACM0
crw-rw---- 1 root dialout 166,  1 Jul 22 04:38  /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: active (running) since Thu 2021-07-22 04:38:13 BST; 5min ago
  Process: 402 ExecStart=/usr/sbin/gpsd $GPSD_OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
 Main PID: 427 (gpsd)
    Tasks: 1 (limit: 3737)
   CGroup: /system.slice/gpsd.service
           └─427 /usr/sbin/gpsd /dev/ttyGPS

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:17 clover-1060 gpsd[427]: gpsd:ERROR: SER: device open of /dev/ttyACM0 failed: Device or resource busy - retrying read-only
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: SER: read-only device open of /dev/ttyACM0 failed: Device or resource busy
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: /dev/ttyACM0: device activation failed.
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: /dev/ttyACM0: activation failed, freeing device
+ systemctl status gpsd.socket
● gpsd.socket - GPS (Global Positioning System) Daemon Sockets
   Loaded: loaded (/lib/systemd/system/gpsd.socket; disabled; vendor preset: enabled)
   Active: active (running) since Thu 2021-07-22 04:38:10 BST; 5min ago
   Listen: /var/run/gpsd.sock (Stream)
           [::1]:2947 (Stream)
           127.0.0.1:2947 (Stream)
    Tasks: 0 (limit: 3737)
   CGroup: /system.slice/gpsd.socket

Jul 22 04:38:10 clover-1060 systemd[1]: Listening on 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:40:17 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:17 clover-1060 gpsd[427]: gpsd:ERROR: SER: device open of /dev/ttyACM0 failed: Device or resource busy - retrying read-only
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: SER: read-only device open of /dev/ttyACM0 failed: Device or resource busy
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: /dev/ttyACM0: device activation failed.
Jul 22 04:40:17 clover-1060 gpsd[427]: gpsd:ERROR: /dev/ttyACM0: activation failed, freeing device
+ command -v aa-status
+ command -v apparmor_status
+ set +x
Please send the entire, untouched output.

On Thu, Jul 22, 2021 at 2:24 PM Gary E. Miller <gem@rellim.com> wrote:
Yo Steve!

On Thu, 22 Jul 2021 16:18:18 -0500
Steve Bourland <sbourland@swri.org> wrote:

>    If I am reading the above paragraph correctly, it sounds like you
> have two configurations:
>
> A)  Your desired configuration, the GPS's USB is connected to the
> flight controller.

No.  His initial design was the GPS USB to the RasPi4, and the GPS Serial
to the flight controller.

> B)  The configuration you have sent gpsdebuginfo data for, the GPS's
> USB is plugged into the Raspberry Pi's USB.

Yes, but he does not even have gpsd trying to use it, so his current
problem is more basic.

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]