From 2363160c7247aff637639a8e0cf396f7b0c1e2a6 Mon Sep 17 00:00:00 2001 From: William McKeehan Date: Wed, 3 Sep 2025 08:43:05 -0400 Subject: [PATCH 1/2] Updating rtl-sdr drivers to version 4 --- scripts/install-sdr-tools.sh | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/scripts/install-sdr-tools.sh b/scripts/install-sdr-tools.sh index 8bb01ad..efc195e 100755 --- a/scripts/install-sdr-tools.sh +++ b/scripts/install-sdr-tools.sh @@ -10,3 +10,43 @@ apt install \ rtl-sdr \ librtlsdr-dev \ -y + +. ./env.sh + +APP=rtl-sdr +REPO_SRC_DIR="${ET_SRC_DIR}/${APP}" + +[[ ! -e ${ET_SRC_DIR} ]] && mkdir ${ET_SRC_DIR} + +CWD_DIR=`pwd` + +et-log "Installing ${APP} build dependencies..." +apt purge ^librtlsdr -y +rm -rvf /usr/lib/librtlsdr* /usr/include/rtl-sdr* /usr/local/lib/librtlsdr* /usr/local/include/rtl-sdr* /usr/local/include/rtl_* /usr/local/bin/rtl_* + +apt-get install \ + libusb-1.0-0-dev \ + git \ + cmake \ + pkg-config \ + -y + +et-log "Cloning ${APP} repository..." +if [[ ! -e ${REPO_SRC_DIR} ]]; then + cd ${ET_SRC_DIR} && git clone ${REPO} +fi + +cd ${REPO_SRC_DIR} + +et-log "Building ${APP}..." +mkdir build +cd build +cmake ../ -DINSTALL_UDEV_RULES=ON +make +make install +cp ../rtl-sdr.rules /etc/udev/rules.d/ +ldconfig + +echo 'blacklist dvb_usb_rtl28xxu' | tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf + +cd ${CWD_DIR} From 1b1a4b38a8f5f659c2cb95cb205871f693f83c36 Mon Sep 17 00:00:00 2001 From: William McKeehan Date: Thu, 4 Sep 2025 08:58:20 -0400 Subject: [PATCH 2/2] Updating rtl-sdr v4 support --- overlay/etc/skel/.conkyrc | 1 + overlay/etc/udev/rules.d/99-et-sdr.rules | 2 ++ overlay/opt/emcomm-tools/bin/et-system-info | 10 +++++++++ scripts/install-sdr-tools.sh | 25 +++++++++++++-------- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/overlay/etc/skel/.conkyrc b/overlay/etc/skel/.conkyrc index 9e70168..5b55577 100644 --- a/overlay/etc/skel/.conkyrc +++ b/overlay/etc/skel/.conkyrc @@ -36,6 +36,7 @@ ${font DejaVu Sans Mono:size=11}${color yellow}Radio: ${execpi 10 et-system-info CAT : ${execpi 10 et-system-info et-cat} GPS : ${execpi 10 et-system-info et-gps} Audio: ${execpi 10 et-system-info et-audio} +${if_existing /dev/et-sdr}SDR : ${execpi 10 et-system-info et-sdr}${endif} ${font DejaVu Sans:bold:size=10}${color #8d5133}${alignc}OPERATOR ${font DejaVu Sans Mono:size=11}${color yellow}Callsign: ${execpi 10 et-system-info callsign} diff --git a/overlay/etc/udev/rules.d/99-et-sdr.rules b/overlay/etc/udev/rules.d/99-et-sdr.rules index e32cdfd..be4a9b8 100644 --- a/overlay/etc/udev/rules.d/99-et-sdr.rules +++ b/overlay/etc/udev/rules.d/99-et-sdr.rules @@ -13,3 +13,5 @@ KERNEL=="swradio0", \ GROUP="dialout", MODE="0660", SYMLINK+="et-sdr" + +SUBSYSTEM=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="2838", GROUP="dialout", MODE="0660", SYMLINK+="et-sdr" diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index 416c79d..ba43e7a 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -15,6 +15,7 @@ function usage() { echo " et-gps - Show state of GPS interface" echo " et-time - Show if time is synched via GPS" echo " et-mode - Show current mode" + echo " et-sdr - Show state of SDR interface" echo " grid - Current grid square defined by user" echo " ip - System IP address" echo " release - EmComm Tools release" @@ -127,6 +128,15 @@ case $1 in fi ;; + et-sdr) + # 1. Check if the symlink was created by the udev rules + if [ -e /dev/et-sdr ]; then + echo "Connected"; + else + echo "Not connected"; + fi + + ;; et-gps) # 1. Check if the symlink was created by the udev rules diff --git a/scripts/install-sdr-tools.sh b/scripts/install-sdr-tools.sh index efc195e..1623f9c 100755 --- a/scripts/install-sdr-tools.sh +++ b/scripts/install-sdr-tools.sh @@ -6,14 +6,10 @@ set -e et-log "Installing SDR tools..." -apt install \ - rtl-sdr \ - librtlsdr-dev \ - -y - . ./env.sh APP=rtl-sdr +REPO=https://github.com/osmocom/rtl-sdr REPO_SRC_DIR="${ET_SRC_DIR}/${APP}" [[ ! -e ${ET_SRC_DIR} ]] && mkdir ${ET_SRC_DIR} @@ -29,24 +25,35 @@ apt-get install \ git \ cmake \ pkg-config \ + debhelper \ -y et-log "Cloning ${APP} repository..." if [[ ! -e ${REPO_SRC_DIR} ]]; then - cd ${ET_SRC_DIR} && git clone ${REPO} + mkdir ${REPO_SRC_DIR} + cd ${REPO_SRC_DIR} && git clone ${REPO} src fi -cd ${REPO_SRC_DIR} +cd ${REPO_SRC_DIR}/src et-log "Building ${APP}..." -mkdir build +if [[ ! -e build ]]; then + mkdir build +fi + cd build cmake ../ -DINSTALL_UDEV_RULES=ON make make install -cp ../rtl-sdr.rules /etc/udev/rules.d/ ldconfig echo 'blacklist dvb_usb_rtl28xxu' | tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf +cd .. +dpkg-buildpackage -b --no-sign +cd .. + +dpkg -i librtlsdr0_* +dpkg -i librtlsdr-dev_* + cd ${CWD_DIR}