GPS - Adjusted approach for managing GPS

This commit is contained in:
Gaston Gonzalez
2024-10-06 06:52:57 -07:00
parent 8a2ec1aa3d
commit 8a8f07a22d
7 changed files with 83 additions and 14 deletions
+13 -1
View File
@@ -1,4 +1,16 @@
START_DAEMON="true"
# Author : Gaston Gonzalez
# Date : 4 October
# Purpose : GPS configuration for EmComm Tools
# Prevent starting automatically by systemd
START_DAEMON="false"
# Prevent the default udev rules from starting gpsd.
# Custom ET udev rules trigger gpsd
USBAUTO="false"
# Always use
DEVICES="/dev/et-gps"
# -n should be used when using GPS as a reference clock
GPSD_OPTIONS="-n"
+4 -3
View File
@@ -1,6 +1,6 @@
# Author : Gaston Gonzalez
# Date : 28 September 2024
# Updated : 30 September 2024
# Updated : 5 October 2024
# Purpose : udev rules for the Icom IC-705
#
# Preconditions:
@@ -21,11 +21,12 @@ KERNEL=="ttyACM[0-9]*", SUBSYSTEM=="tty", ATTRS{product}=="IC-705", \
# Create consistent device name/path for the CAT serial device
ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="00", \
ACTION=="add", \
ENV{ET_SUBDEVICE}="CAT" GROUP="dialout", MODE="0660", SYMLINK+="et-cat"
ENV{ET_SUBDEVICE}="CAT", GROUP="dialout", MODE="0660", SYMLINK+="et-cat"
# Create consistent device name/path for the GPS serial device
ENV{ET_DEVICE}=="IC-705", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="02", \
ACTION=="add", \
ENV{ET_SUBDEVICE}="GPS" GROUP="dialout", MODE="0660", SYMLINK+="et-gps"
ENV{ET_SUBDEVICE}="GPS", GROUP="dialout", MODE="0660", SYMLINK+="et-gps", \
RUN+="/opt/emcomm-tools/sbin/wrapper-gpsd.sh start"
# TODO: Add rules for sound card
+4 -3
View File
@@ -1,7 +1,7 @@
# Author : Gaston Gonzalez
# Author : William McKeehan (https://github.com/mckeehan)
# Date : 30 September 2024
# Updated : 1 October 2024
# Updated : 5 October 2024
# Purpose : udev rules for the Icom IC-7100
#
# Preconditions:
@@ -21,12 +21,13 @@ KERNEL=="ttyUSB[0-9]*", SUBSYSTEM=="tty", ATTRS{serial}=="IC-7100*", \
ENV{ET_DEVICE}=="IC-7100", SUBSYSTEMS=="usb", ATTRS{serial}=="IC-7100*A", \
ACTION=="add", \
ENV{SYSTEMD_WANTS}="", \
ENV{ET_SUBDEVICE}="CAT" GROUP="dialout", MODE="0660", SYMLINK+="et-cat"
ENV{ET_SUBDEVICE}="CAT", GROUP="dialout", MODE="0660", SYMLINK+="et-cat"
# Create consistent device name/path for the GPS serial device
ENV{ET_DEVICE}=="IC-7100", SUBSYSTEMS=="usb", ATTRS{serial}=="IC-7100*B", \
ACTION=="add", \
ENV{ET_SUBDEVICE}="GPS" GROUP="dialout", MODE="0660", SYMLINK+="et-gps"
ENV{ET_SUBDEVICE}="GPS", GROUP="dialout", MODE="0660", SYMLINK+="et-gps", \
RUN+="/opt/emcomm-tools/sbin/wrapper-gpsd.sh start"
# TODO: Add rules to trigger rigctld
# TODO: Add rules for ACTION="remove"
+6 -3
View File
@@ -1,9 +1,12 @@
# Author : Gaston Gonzalez
# Date : 30 September 2024
# Updated : 5 October 2024
# Purpose : udev rules for U-blox GPS
#
# Supported Devices
# 1. VK-162 G-Mouse USB GPS Dongle - https://amzn.to/3XQqmYj
# 1. VK-162 G-Mouse USB GPS - https://amzn.to/3XQqmYj
# 2. VK-172 G-Mouse USB GPS - https://amzn.to/3Ya7Viu
# 3. VFAN UG-353 - https://amzn.to/3XL2lSo
#
# Preconditions:
# 1. GPS connected via USB cable
@@ -15,6 +18,6 @@
SUBSYSTEM=="tty", ATTRS{product}=="u-blox*" ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", \
ACTION=="add", \
ENV{ET_DEVICE}="UBLOX", ENV{ET_SUBDEVICE}="GPS", \
GROUP="dialout", MODE="0660", SYMLINK+="et-gps"
GROUP="dialout", MODE="0660", SYMLINK+="et-gps", \
RUN+="/opt/emcomm-tools/sbin/wrapper-gpsd.sh start"
+41
View File
@@ -0,0 +1,41 @@
#!/bin/bash
#
# Author : Gaston Gonzalez
# Date : 4 October 2024
# Purpose : Wrapper startup/shutdown script around systemd/gpsd
WAIT=5
start() {
et-log "Waiting to start gpsd for ${WAIT} seconds..."
sleep ${WAIT}
/usr/bin/systemctl restart gpsd
}
stop() {
et-log "Waiting to stop gpsd for ${WAIT} seconds..."
sleep ${WAIT}
/usr/bin/systemctl stop gpsd
}
usage() {
echo "usage: $(basename $0) <cmd>"
echo " <cmd> [start|stop]"
}
if [ $# -ne 1 ]; then
usage
exit 1
fi
case $1 in
start)
start
;;
stop)
stop
;;
*)
usage
;;
esac
+13 -2
View File
@@ -2,11 +2,22 @@
#
# Author : Gaston Gonzalez
# Date : 16 March 2024
# Updated : 17 May 2024
# Updated : 4 October 2024
# Purpose : Install base tools
set -e
et-log "Installing message of the day"
et-log "Installing environment variables"
grep ET_TEMP_DIR /etc/environment
if [ $? -ne 0 ]; then
echo "ET_TEMP_DIR=/tmp/et" >> /etc/environment
fi
grep ET_LOG_FILE /etc/environment
if [ $? -ne 0 ]; then
echo "ET_LOG_FILE=/tmp/et/et.log" >> /etc/environment
fi
et-log "Installing message of the day
cp -v ../overlay/etc/motd /etc/
et-log "Installing base packages"
+2 -2
View File
@@ -22,8 +22,8 @@ et-log "Updating gpsd systemd script..."
cp ../overlay/lib/systemd/system/gpsd.service /lib/systemd/system/
systemctl daemon-reload
et-log "Enabling gpsd..."
systemctl enable gpsd
et-log "Disable automatic start of gpsd..."
systemctl disable gpsd
et-log "Updating chronyd to support GPS as a time source..."
echo "# ET: Enable GPS as a time source" >> /etc/chrony/chrony.conf