diff --git a/overlay/etc/udev/rules.d/99-et-sdr.rules b/overlay/etc/udev/rules.d/99-et-sdr.rules new file mode 100644 index 0000000..e32cdfd --- /dev/null +++ b/overlay/etc/udev/rules.d/99-et-sdr.rules @@ -0,0 +1,15 @@ +# Author : Gaston Gonzalez +# Date : 7 June 2025 +# Purpose : udev rules for supported SDRs +# +# Supported Devices +# 1. RTL-SDR Blog v2 +# +# Preconditions: +# 1. SDR connected via USB cable +# +# Postconditions: +# 1. /dev/et-sdr created + +KERNEL=="swradio0", \ + GROUP="dialout", MODE="0660", SYMLINK+="et-sdr" diff --git a/overlay/opt/emcomm-tools/bin/et-aircraft b/overlay/opt/emcomm-tools/bin/et-aircraft index f5a9ee9..75234f4 100755 --- a/overlay/opt/emcomm-tools/bin/et-aircraft +++ b/overlay/opt/emcomm-tools/bin/et-aircraft @@ -2,21 +2,21 @@ # # Author : Gaston Gonzalez # Date : 4 June 2025 -# Update : 5 June 2025 +# Update : 7 June 2025 # Purpose : Wrapper script around dump1090 # # Preconditions: -# 1. RTL-SDR is connected and detected +# 1. RTL-SDR v2 is connected and detected # # Postconditions: # 1. dump1099 is launched # 2. A map is launched -# TODO: Increse size of aircraft -# TODO: Research why RTL-SDR v4 does not work -# TODO: Check for RTL-SDR device # TODO: Add a systemd user service to start dump1090 # TODO: Use icon and add to launcher +# TODO: Increse size of aircraft +# TODO: Research why RTL-SDR v4 does not work +# TODO: Test RTL-SDR v3 # TODO: Use local new ETC offline map engine source /opt/emcomm-tools/bin/et-common @@ -24,6 +24,8 @@ source /opt/emcomm-tools/bin/et-common DUMP1090_CONF_DIR="${HOME}/.local/share/emcomm-tools/dump1090" DUMP1090_MAP_HTML="${DUMP1090_CONF_DIR}/gmap.html" +exit-if-no-sdr + if [[ ! -e ${DUMP1090_MAP_HTML} ]]; then et-log "Map HTML not found: ${DUMP1090_MAP_HTML}" notify-user "Map HTML not found: ${DUMP1090_MAP_HTML}" @@ -54,7 +56,7 @@ fi CMD="dump1090 --net --net-http-port 1090" et-log "Starting dump1090 in ${DUMP1090_CONF_DIR} with: ${CMD}" -${CMD} +${CMD} if [[ $? -ne 0 ]]; then notify-user "RTL-SDR not detected. Please connect it and retry." diff --git a/overlay/opt/emcomm-tools/bin/et-common b/overlay/opt/emcomm-tools/bin/et-common index d14f2f9..5ebdee5 100755 --- a/overlay/opt/emcomm-tools/bin/et-common +++ b/overlay/opt/emcomm-tools/bin/et-common @@ -1,9 +1,15 @@ #!/bin/bash # Author : Gaston Gonzalez # Date : 1 February 2025 -# Updated : 5 June 2025 +# Updated : 7 June 2025 # Purpose : Common environment variables and functions +# Standardized device paths for supported hardware +export ET_DEVICE_AUDIO="/dev/et-audio" +export ET_DEVICE_CAT="/dev/et-cat" +export ET_DEVICE_GPS="/dev/et-gps" +export ET_DEVICE_SDR="/dev/et-sdr" + export ESC="\x1B" export RED="${ESC}[1;31m" export BLUE="${ESC}[1;34m" @@ -22,3 +28,10 @@ show-err-dialog() { notify-user() { notify-send -t 5000 --app-name="EmComm Tools" "$1" } + +exit-if-no-sdr() { + if [[ ! -e ${ET_DEVICE_SDR} ]]; then + et-log "No ${ET_DEVICE_SDR} detected." + exit 1 + fi +}