Updated setup script to be cleaner

This commit is contained in:
Jono Targett 2023-05-26 10:50:44 +09:30
parent 269e96e0b8
commit 588d4709a4
11 changed files with 708 additions and 112 deletions

View File

@ -5,7 +5,7 @@ This repository is a demo - it isn't a fully fleshed out system and isn't intend
# Getting started
- Use a debian-based 64-bit system (x86). No way around it; this project is not cross-platform until some efforts gets put into making it that way.
- Install the SDRPlay device driver & install the project dependencies.
- `./setup`
- `./setup.sh`
- Follow the prompts, there is some audience participation getting the driver installed.
- Beyond that it should be mostly unattended. SoapySDR & plugins will be installed in the system directories.
- Run the demos. The demo code is provided by SoapySDR and required minimal modification.

596
data/fm-stations.json Normal file
View File

@ -0,0 +1,596 @@
[
{
"Callsign": "5AA",
"Area served": "Adelaide",
"Frequency": "1395",
"Band": "AM",
"On-air ID": "FIVEaa",
"Purpose": "Commercial",
"Site": "http://www.fiveaa.com.au/"
},
{
"Callsign": "5ABCFM",
"Area served": "South Australia",
"Frequency": "various",
"Band": "FM",
"On-air ID": "ABC Classic FM",
"Purpose": "National",
"Site": "http://www.abc.net.au/classic/"
},
{
"Callsign": "5ABCRN",
"Area served": "South Australia",
"Frequency": "various",
"Band": "FM",
"On-air ID": "ABC Radio National",
"Purpose": "National",
"Site": "http://www.abc.net.au/rn/"
},
{
"Callsign": "5ABCRR",
"Area served": "South Australia",
"Frequency": "various",
"Band": "FM",
"On-air ID": "ABC Local Radio",
"Purpose": "National",
"Site": "http://www.abc.net.au/local/"
},
{
"Callsign": "5ACR",
"Area served": "Remote Aboriginal communities<ref name=5ACR>Consists of four separately licensed stations using the same callsign: [[Amata, South Australia",
"Frequency": "Amata]] 106.1, [[Pukatja, South Australia",
"Band": "Ernabella]] 106.1, [[Kaltjiti",
"On-air ID": "Fregon]] 106.1, and Indulkana 106.1.</ref>",
"Purpose": "various<ref name=5ACR/>",
"Site": "FM"
},
{
"Callsign": "5ADD",
"Area served": "Adelaide",
"Frequency": "102.3",
"Band": "FM",
"On-air ID": "Mix 102.3",
"Purpose": "Commercial",
"Site": "http://www.mix1023.com.au/"
},
{
"Callsign": "5ADL",
"Area served": "Adelaide",
"Frequency": "<span style=\"color:white;\">0</span>91.9",
"Band": "FM",
"On-air ID": "Nova 91.9",
"Purpose": "Commercial",
"Site": "http://www.nova919.com.au/"
},
{
"Callsign": "5ALX",
"Area served": "[[Goolwa, South Australia",
"Frequency": "Goolwa]]",
"Band": "<span style=\"color:white;\">0</span>96.3",
"On-air ID": "FM",
"Purpose": "Alex FM",
"Site": "Community"
},
{
"Callsign": "5AN",
"Area served": "Adelaide",
"Frequency": "<span style=\"color:white;\">0</span>891",
"Band": "AM",
"On-air ID": "ABC Adelaide",
"Purpose": "National",
"Site": "http://www.abc.net.au/adelaide/"
},
{
"Callsign": "5AU",
"Area served": "[[Port Augusta, South Australia",
"Frequency": "Port Augusta]]",
"Band": "1242",
"On-air ID": "AM",
"Purpose": "5AU",
"Site": "Commercial"
},
{
"Callsign": "5AUU",
"Area served": "Spencer Gulf North",
"Frequency": "105.9",
"Band": "FM",
"On-air ID": "Magic 105.9",
"Purpose": "Commercial",
"Site": "http://www.magic1059.com.au/"
},
{
"Callsign": "5BBB",
"Area served": "Barossa Valley",
"Frequency": "<span style=\"color:white;\">0</span>89.1",
"Band": "FM",
"On-air ID": "Triple B",
"Purpose": "Community",
"Site": "http://www.bbbfm.com/"
},
{
"Callsign": "5CC",
"Area served": "[[Port Lincoln, South Australia",
"Frequency": "Port Lincoln]]",
"Band": "<span style=\"color:white;\">0</span>765",
"On-air ID": "AM",
"Purpose": "5CC",
"Site": "Commercial"
},
{
"Callsign": "5CCC",
"Area served": "[[Port Lincoln, South Australia",
"Frequency": "Port Lincoln]]",
"Band": "<span style=\"color:white;\">0</span>89.9",
"On-air ID": "FM",
"Purpose": "Magic 89.9",
"Site": "Commercial"
},
{
"Callsign": "5CCR",
"Area served": "[[Ceduna, South Australia",
"Frequency": "Ceduna]]",
"Band": "<span style=\"color:white;\">0</span>94.5",
"On-air ID": "FM",
"Purpose": "CCR FM",
"Site": "Community"
},
{
"Callsign": "5CK",
"Area served": "[[Port Pirie, South Australia",
"Frequency": "Port Pirie]]",
"Band": "<span style=\"color:white;\">0</span>639",
"On-air ID": "AM",
"Purpose": "ABC North and West",
"Site": "National"
},
{
"Callsign": "5CS",
"Area served": "[[Port Pirie, South Australia",
"Frequency": "Port Pirie]]",
"Band": "1044",
"On-air ID": "AM",
"Purpose": "5CS",
"Site": "Commercial"
},
{
"Callsign": "5CST",
"Area served": "[[Adelaide",
"Frequency": "Adelaide South West Suburbs]]",
"Band": "<span style=\"color:white;\">0</span>88.7",
"On-air ID": "FM",
"Purpose": "Coast FM",
"Site": "Community"
},
{
"Callsign": "5DDD",
"Area served": "Adelaide",
"Frequency": "<span style=\"color:white;\">0</span>93.7",
"Band": "FM",
"On-air ID": "Three D Radio",
"Purpose": "Community",
"Site": "http://www.threedradio.com/"
},
{
"Callsign": "5DN",
"Area served": "Adelaide",
"Frequency": "1323",
"Band": "AM",
"On-air ID": "Cruise 1323",
"Purpose": "Commercial",
"Site": "http://www.cruise1323.com.au/"
},
{
"Callsign": "5DUS",
"Area served": "[[Coober Pedy, South Australia",
"Frequency": "Coober Pedy]]",
"Band": "104.5",
"On-air ID": "FM",
"Purpose": "Dusty Radio",
"Site": "Community"
},
{
"Callsign": "5EBI",
"Area served": "Adelaide",
"Frequency": "103.1",
"Band": "FM",
"On-air ID": "5EBI",
"Purpose": "Community",
"Site": "http://www.5ebi.com.au/"
},
{
"Callsign": "5EFM",
"Area served": "[[Victor Harbor, South Australia",
"Frequency": "Victor Harbor]]",
"Band": "<span style=\"color:white;\">0</span>89.3",
"On-air ID": "FM",
"Purpose": "Fleurieu FM",
"Site": "Community"
},
{
"Callsign": "5EZY",
"Area served": "[[Murray Bridge, South Australia",
"Frequency": "Murray Bridge]]",
"Band": "<span style=\"color:white;\">0</span>98.7",
"On-air ID": "FM",
"Purpose": "Power FM",
"Site": "Commercial"
},
{
"Callsign": "5FBI",
"Area served": "Adelaide",
"Frequency": "<span style=\"color:white;\">0</span>92.7",
"Band": "FM",
"On-air ID": "Fresh 92.7",
"Purpose": "Community",
"Site": "http://www.fresh927.com.au/"
},
{
"Callsign": "5GFM",
"Area served": "Yorke Peninsula",
"Frequency": "<span style=\"color:white;\">0</span>89.3",
"Band": "FM",
"On-air ID": "Gulf FM",
"Purpose": "Community",
"Site": "http://www.gulffm.com.au/"
},
{
"Callsign": "5GSFM",
"Area served": "[[Victor Harbor, South Australia",
"Frequency": "Victor Harbor]]",
"Band": "<span style=\"color:white;\">0</span>90.1",
"On-air ID": "FM",
"Purpose": "Great Southern FM",
"Site": "Community"
},
{
"Callsign": "5GTR",
"Area served": "[[Mount Gambier, South Australia",
"Frequency": "Mount Gambier]]",
"Band": "100.1",
"On-air ID": "FM",
"Purpose": "5GTR",
"Site": "Community"
},
{
"Callsign": "5JJJ",
"Area served": "South Australia",
"Frequency": "various",
"Band": "FM",
"On-air ID": "Triple J",
"Purpose": "National",
"Site": "http://www.abc.net.au/triplej/"
},
{
"Callsign": "5KIX",
"Area served": "Kangaroo Island",
"Frequency": "<span style=\"color:white;\">0</span>90.7",
"Band": "FM",
"On-air ID": "KIX FM",
"Purpose": "Community",
"Site": "http://5kixfm.com.au/"
},
{
"Callsign": "5LC",
"Area served": "[[Leigh Creek, South Australia",
"Frequency": "Leigh Creek]]",
"Band": "1602",
"On-air ID": "AM",
"Purpose": "ABC North and West",
"Site": "National"
},
{
"Callsign": "5LCM",
"Area served": "[[Mount Barker, South Australia",
"Frequency": "Mount Barker]]",
"Band": "<span style=\"color:white;\">0</span>88.9",
"On-air ID": "FM",
"Purpose": "Lofty 88.9",
"Site": "Community"
},
{
"Callsign": "5LFM",
"Area served": "Riverland",
"Frequency": "100.7",
"Band": "FM",
"On-air ID": "Riverland Life FM",
"Purpose": "Community",
"Site": "https://riverlandlife.org.au/"
},
{
"Callsign": "5LN",
"Area served": "[[Port Lincoln, South Australia",
"Frequency": "Port Lincoln]]",
"Band": "1485",
"On-air ID": "AM",
"Purpose": "ABC Eyre Peninsula and West Coast",
"Site": "National"
},
{
"Callsign": "5MBS",
"Area served": "[[Adelaide",
"Frequency": "Adelaide Foothills]]",
"Band": "<span style=\"color:white;\">0</span>99.9",
"On-air ID": "FM",
"Purpose": "5MBS",
"Site": "Community"
},
{
"Callsign": "5CCJ",
"Area served": "[[Adelaide",
"Frequency": "Adelaide Foothills]]",
"Band": "<span style=\"color:white;\">0</span>88",
"On-air ID": "FM",
"Purpose": "Easy FM 88",
"Site": "Narrowcast"
},
{
"Callsign": "5JAJ",
"Area served": "[[Normanville, South Australia",
"Frequency": "Normanville]]",
"Band": "<span style=\"color:white;\">0</span>87.6",
"On-air ID": "FM",
"Purpose": "Radio 876",
"Site": "Narrowcast"
},
{
"Callsign": "5MG",
"Area served": "[[Mount Gambier, South Australia",
"Frequency": "Mount Gambier]]",
"Band": "1476",
"On-air ID": "AM",
"Purpose": "ABC South East SA",
"Site": "National"
},
{
"Callsign": "5MMM",
"Area served": "Adelaide",
"Frequency": "104.7",
"Band": "FM",
"On-air ID": "Triple M",
"Purpose": "Commercial",
"Site": "http://www.triplem.com.au/adelaide/"
},
{
"Callsign": "5MU",
"Area served": "[[Murray Bridge, South Australia",
"Frequency": "Murray Bridge]]",
"Band": "1125",
"On-air ID": "AM",
"Purpose": "5MU",
"Site": "Commercial"
},
{
"Callsign": "5MV",
"Area served": "Riverland",
"Frequency": "1062",
"Band": "AM",
"On-air ID": "ABC Riverland",
"Purpose": "National",
"Site": "http://www.abc.net.au/riverland/"
},
{
"Callsign": "5PA",
"Area served": "[[Naracoorte, South Australia",
"Frequency": "Naracoorte]]",
"Band": "1161",
"On-air ID": "AM",
"Purpose": "ABC South East SA",
"Site": "National"
},
{
"Callsign": "5PB",
"Area served": "South Australia",
"Frequency": "various",
"Band": "AM",
"On-air ID": "ABC NewsRadio",
"Purpose": "National",
"Site": "http://www.abc.net.au/newsradio/"
},
{
"Callsign": "5PBA",
"Area served": "[[Salisbury, South Australia",
"Frequency": "Salisbury]]",
"Band": "<span style=\"color:white;\">0</span>89.7",
"On-air ID": "FM",
"Purpose": "PBA FM",
"Site": "Community"
},
{
"Callsign": "5PNN",
"Area served": "South Australia",
"Frequency": "various",
"Band": "FM",
"On-air ID": "ABC NewsRadio",
"Purpose": "National",
"Site": "http://www.abc.net.au/newsradio/"
},
{
"Callsign": "5RAM",
"Area served": "Adelaide",
"Frequency": "107.9",
"Band": "FM",
"On-air ID": "Life FM",
"Purpose": "Community",
"Site": "https://web.archive.org/web/20110426052754/http://www.life.on.net/"
},
{
"Callsign": "5RCB",
"Area served": "[[Mount Gambier, South Australia",
"Frequency": "Mount Gambier]]",
"Band": "104.9",
"On-air ID": "FM",
"Purpose": "Lime FM",
"Site": "Community"
},
{
"Callsign": "5RIV",
"Area served": "Riverland",
"Frequency": "<span style=\"color:white;\">0</span>93.1",
"Band": "FM",
"On-air ID": "Magic 93.1",
"Purpose": "Commercial",
"Site": "http://www.magic931.com.au/"
},
{
"Callsign": "5RM",
"Area served": "Riverland",
"Frequency": "<span style=\"color:white;\">0</span>801",
"Band": "AM",
"On-air ID": "5RM",
"Purpose": "Commercial",
"Site": "http://www.5rm.com/"
},
{
"Callsign": "5RN",
"Area served": "South Australia",
"Frequency": "various",
"Band": "AM",
"On-air ID": "ABC Radio National",
"Purpose": "National",
"Site": "http://www.abc.net.au/rn/"
},
{
"Callsign": "5RRR",
"Area served": "[[Woomera, South Australia",
"Frequency": "Woomera]]",
"Band": "107.3",
"On-air ID": "FM",
"Purpose": "\"Rocket Range Radio' and 'Armed Forces Radio Australia' since 1 July 2021.",
"Site": "Community"
},
{
"Callsign": "5ROX",
"Area served": "[[Roxby Downs, South Australia",
"Frequency": "Roxby Downs]]",
"Band": "105.5",
"On-air ID": "FM",
"Purpose": "Rox FM",
"Site": "Community"
},
{
"Callsign": "5RPH",
"Area served": "Adelaide",
"Frequency": "1197",
"Band": "AM",
"On-air ID": "RPH Adelaide",
"Purpose": "Community",
"Site": "http://www.rphadelaide.org.au/"
},
{
"Callsign": "5SBSFM",
"Area served": "Adelaide",
"Frequency": "106.3",
"Band": "FM",
"On-air ID": "SBS Radio",
"Purpose": "National",
"Site": "http://www.sbs.com.au/radio/"
},
{
"Callsign": "5SE",
"Area served": "[[Mount Gambier, South Australia",
"Frequency": "Mount Gambier]]",
"Band": "<span style=\"color:white;\">0</span>963",
"On-air ID": "AM",
"Purpose": "5SE",
"Site": "Commercial"
},
{
"Callsign": "5SEF",
"Area served": "[[Mount Gambier, South Australia",
"Frequency": "Mount Gambier]]",
"Band": "<span style=\"color:white;\">0</span>96.1",
"On-air ID": "FM",
"Purpose": "Star FM",
"Site": "Commercial"
},
{
"Callsign": "5SSA",
"Area served": "Adelaide",
"Frequency": "107.1",
"Band": "FM",
"On-air ID": "SAFM",
"Purpose": "Commercial",
"Site": "http://www.hit107.com/"
},
{
"Callsign": "5SY",
"Area served": "[[Streaky Bay, South Australia",
"Frequency": "Streaky Bay]]",
"Band": "<span style=\"color:white;\">0</span>693",
"On-air ID": "AM",
"Purpose": "ABC Eyre Peninsula and West Coast",
"Site": "National"
},
{
"Callsign": "5TCB",
"Area served": "[[Bordertown, South Australia",
"Frequency": "Bordertown]]",
"Band": "106.1",
"On-air ID": "FM",
"Purpose": "5TCB",
"Site": "Community"
},
{
"Callsign": "5THE",
"Area served": "[[Millicent, South Australia",
"Frequency": "Millicent]]",
"Band": "107.7",
"On-air ID": "FM",
"Purpose": "5THE",
"Site": "Community"
},
{
"Callsign": "5TRX",
"Area served": "[[Port Pirie, South Australia",
"Frequency": "Port Pirie]]",
"Band": "105.1",
"On-air ID": "FM",
"Purpose": "Trax FM",
"Site": "Community"
},
{
"Callsign": "5UMA",
"Area served": "[[Port Augusta, South Australia",
"Frequency": "Port Augusta]]",
"Band": "<span style=\"color:white;\">0</span>89.1",
"On-air ID": "FM",
"Purpose": "Umeewarra Radio",
"Site": "Community"
},
{
"Callsign": "5UV",
"Area served": "Adelaide",
"Frequency": "101.5",
"Band": "FM",
"On-air ID": "Radio Adelaide",
"Purpose": "Community",
"Site": "https://web.archive.org/web/20010924022716/http://radio.adelaide.edu.au/"
},
{
"Callsign": "5WM",
"Area served": "[[Woomera, South Australia",
"Frequency": "Woomera]]",
"Band": "1584",
"On-air ID": "AM",
"Purpose": "ABC North and West",
"Site": "National"
},
{
"Callsign": "5WOW",
"Area served": "Port Adelaide",
"Frequency": "100.5",
"Band": "FM",
"On-air ID": "WOW FM",
"Purpose": "Community",
"Site": "http://wowfm.org/"
},
{
"Callsign": "5YYY",
"Area served": "[[Whyalla, South Australia",
"Frequency": "Whyalla]]",
"Band": "107.7",
"On-air ID": "FM",
"Purpose": "Triple Y",
"Site": "Community"
}
]

View File

@ -1,94 +0,0 @@
#! /bin/bash
set -eux
echo "Beginning project setup for SDRPlay interface." > build.log
date >> build.log
# Install build dependencies
# Debian:
sudo apt-get install -y \
git build-essential automake cmake \
libpulse-dev libgtk-3-dev \
freeglut3 freeglut3-dev
# RedHat:
#sudo dnf install pulseaudio-libs-devel gtk3-devel freeglut-devel
# These are necessary for building the python bindings for SoapySDR.
# These must be installed before building SoapySDR for the python
# bindings to be available on the system.
sudo apt-get install -y python-dev swig
# These are required for building Soapy RTL-SDR
sudo apt-get install -y rtl-sdr librtlsdr-dev
# Build SoapySDR
if ! [ -d SoapySDR ]; then
git clone https://github.com/pothosware/SoapySDR.git
pushd SoapySDR
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
sudo make install
sudo ldconfig
SoapySDRUtil --info #test SoapySDR install
popd
popd
fi
# Build SoapySDRPlay plugin
if ! [ -d SoapySDRPlay ]; then
git clone https://github.com/pothosware/SoapySDRPlay.git
pushd SoapySDRPlay
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
sudo make install
popd
popd
fi
# Build SoapyRTLSDR plugin
if ! [ -d SoapyRTLSDR ]; then
git clone https://github.com/pothosware/SoapyRTLSDR.git
pushd SoapyRTLSDR
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
sudo make install
popd
popd
fi
# SoapySDRPlay plugin can overwrite some of the installed files for SoapySDR with older
# versions - re-run the installer for SoapySDR base to ensure we have the latest ones.
pushd SoapySDR/build
sudo make install
popd
# Build liquid-dsp
if ! [ -d liquid-dsp ]; then
git clone https://github.com/jgaeddert/liquid-dsp
pushd liquid-dsp
./bootstrap.sh
CFLAGS="-march=native -O3" ./configure --enable-fftoverride
make -j
sudo make install
sudo ldconfig
popd
fi
# Get mediamtx (no system package available)
mkdir -p mediamtx
pushd mediamtx
wget https://github.com/aler9/mediamtx/releases/download/v0.22.2/mediamtx_v0.22.2_linux_amd64.tar.gz
tar -xzvf mediamtx_v0.22.2_linux_amd64.tar.gz
popd
echo "Setup completed." >> build.log
date >> build.log
exit 0

18
requirements.apt Normal file
View File

@ -0,0 +1,18 @@
automake
build-essential
cmake
curl
ffmpeg
git
libpulse-dev
librtlsdr-dev
portaudio19-dev
python-is-python3
python3
python3-pip
python3-all-dev
python3-dev
rtl-sdr
sox
swig
wget

15
scripts/get_liquid-dsp.sh Normal file
View File

@ -0,0 +1,15 @@
#! /bin/bash
set -eux
# Build liquid-dsp
if ! [ -d liquid-dsp ]; then
git clone https://github.com/jgaeddert/liquid-dsp
pushd liquid-dsp
./bootstrap.sh
CFLAGS="-march=native -O3" ./configure --enable-fftoverride
make -j
sudo make install
sudo ldconfig
popd
fi

10
scripts/get_mediamtx.sh Normal file
View File

@ -0,0 +1,10 @@
#! /bin/bash
set -eux
# Get mediamtx (no system package available)
mkdir -p mediamtx
pushd mediamtx
wget https://github.com/aler9/mediamtx/releases/download/v0.22.2/mediamtx_v0.22.2_linux_amd64.tar.gz
tar -xzvf mediamtx_v0.22.2_linux_amd64.tar.gz
popd

52
scripts/get_soapy.sh Normal file
View File

@ -0,0 +1,52 @@
#! /bin/bash
# Use sudo?
sudo=$(which sudo)
set -eux
# Build SoapySDR
if ! [ -d SoapySDR ]; then
git clone https://github.com/pothosware/SoapySDR.git
pushd SoapySDR
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
$sudo make install
$sudo ldconfig
SoapySDRUtil --info #test SoapySDR install
popd
popd
fi
# Build SoapySDRPlay plugin
if ! [ -d SoapySDRPlay ]; then
git clone https://github.com/pothosware/SoapySDRPlay.git
pushd SoapySDRPlay
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
$sudo make install
popd
popd
fi
# Build SoapyRTLSDR plugin
if ! [ -d SoapyRTLSDR ]; then
git clone https://github.com/pothosware/SoapyRTLSDR.git
pushd SoapyRTLSDR
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j
$sudo make install
popd
popd
fi
# SoapySDRPlay plugin can overwrite some of the installed files for SoapySDR with older
# versions - re-run the installer for SoapySDR base to ensure we have the latest ones.
pushd SoapySDR/build
$sudo make install
popd

17
setup
View File

@ -1,17 +0,0 @@
#! /bin/bash
sudo apt-get update
sudo apt install -y \
rtl-sdr \
sox \
portaudio19-dev \
python3-all-dev \
ffmpeg
pip install -r requirements.txt
pushd dependencies
./SDRplay_RSP_API-Linux-3.07.1.run
./build_dependencies
popd

16
setup.sh Executable file
View File

@ -0,0 +1,16 @@
#! /bin/bash
set -eux
# Get system packages
sudo apt-get update
sudo xargs apt-get install -y < requirements.apt
sudo pip install -r requirements.pip
# Install device driver
./scripts/SDRplay_RSP_API-Linux-3.07.1.run
# Get project dependencies
bash ./scripts/get_soapy.sh
bash ./scripts/get_liquid-dsp.sh
bash ./scripts/get_mediamtx.sh