Add rx_tools and soapysdr support

Signed-off-by: Daniel Ekman <knegge@gmail.com>
pull/145/head
Daniel Ekman 2023-01-14 13:13:50 +01:00
rodzic 90b95f81e1
commit 43ccf61661
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: C0EB15798C02AE70
5 zmienionych plików z 51 dodań i 6 usunięć

Wyświetl plik

@ -4,8 +4,12 @@ MAINTAINER sa2kng <knegge@gmail.com>
RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \ RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recommends \
cmake \ cmake \
build-essential \ build-essential \
ca-certificates \
git \
libusb-1.0-0-dev \ libusb-1.0-0-dev \
libatlas-base-dev &&\ libatlas-base-dev \
libsoapysdr-dev \
soapysdr-module-all &&\
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# install everything in /target and it will go in to / on destination image. symlink make it easier for builds to find files installed by this. # install everything in /target and it will go in to / on destination image. symlink make it easier for builds to find files installed by this.
@ -17,10 +21,12 @@ RUN cd /horusdemodlib &&\
cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\ cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
cmake --build build --target install cmake --build build --target install
COPY docker_single.sh \ RUN git clone --depth 1 https://github.com/rxseger/rx_tools.git &&\
docker_dual_4fsk.sh \ cd rx_tools &&\
docker_dual_rtty_4fsk.sh \ cmake -B build -DCMAKE_INSTALL_PREFIX=/target/usr -DCMAKE_BUILD_TYPE=Release &&\
/target/usr/bin/ cmake --build build --target install
COPY scripts/* /target/usr/bin/
# to support arm wheels # to support arm wheels
RUN echo '[global]\nextra-index-url=https://www.piwheels.org/simple' > /target/etc/pip.conf RUN echo '[global]\nextra-index-url=https://www.piwheels.org/simple' > /target/etc/pip.conf
@ -37,7 +43,8 @@ RUN apt-get -y update && apt -y upgrade && apt-get -y install --no-install-recom
sox \ sox \
bc \ bc \
rtl-sdr \ rtl-sdr \
libatlas3-base &&\ libatlas3-base \
soapysdr-module-all &&\
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN pip install --system --no-cache-dir --prefer-binary horusdemodlib RUN pip install --system --no-cache-dir --prefer-binary horusdemodlib

Wyświetl plik

@ -0,0 +1,38 @@
#!/usr/bin/env bash
#
# Horus Binary RTLSDR Helper Script
#
# Uses rtl_fm to receive a chunk of spectrum, and passes it into horus_demod.
#
# Calculate the SDR tuning frequency
SDR_RX_FREQ=$(echo "$RXFREQ - $RXBANDWIDTH/2 - 1000" | bc)
# Calculate the frequency estimator limits
FSK_LOWER=1000
FSK_UPPER=$(echo "$FSK_LOWER + $RXBANDWIDTH" | bc)
echo "Using SDR Centre Frequency: $SDR_RX_FREQ Hz."
echo "Using FSK estimation range: $FSK_LOWER - $FSK_UPPER Hz"
BIAS_SETTING=""
if [ "$BIAS" = "1" ]; then
echo "Enabling Bias Tee."
BIAS_SETTING=" -T"
fi
GAIN_SETTING=""
if [ "$GAIN" = "0" ]; then
echo "Using AGC."
GAIN_SETTING=""
else
echo "Using Manual Gain"
GAIN_SETTING=" -g $GAIN"
fi
# Start the receive chain.
# Note that we now pass in the SDR centre frequency ($SDR_RX_FREQ) and 'target' signal frequency ($RXFREQ)
# to enable providing additional metadata to Habitat / Sondehub.
rx_fm $SDR_EXTRA -M raw -F9 -s 48000 -p $PPM $GAIN_SETTING$BIAS_SETTING -f $SDR_RX_FREQ | $DECODER -q --stats=5 -g -m binary --fsk_lower=$FSK_LOWER --fsk_upper=$FSK_UPPER - - | python3 -m horusdemodlib.uploader --freq_hz $SDR_RX_FREQ --freq_target_hz $RXFREQ $@