-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD_SDRplay
executable file
·147 lines (113 loc) · 4.45 KB
/
BUILD_SDRplay
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#! /bin/tcsh
# Script to build support for SDR Play
##########################################################################################
# Goto SDRplay website and download driver from sdrplay.com ....
# wget command should take care of this for us now!
# Soapy support for latest driver has lagged behind and still isn't quite right.
# That was OK with Mint 18.3 since we could just downgrade but not with Mint 19.3. Things seem ok in Mint 20 & 21
#set VER=2.11
#set VER=2.13
set VER=3.12 # Was 3.07
set SUBVER=2
set ARCH="Linux"
###set ARCH="ARM32" # Shoudlnt need this anymore
set ARCH="ARM64" # 64-bit API is under ARM & is version 1
set SUBVER=1 # Only works for true 64-bit OS, not hybrid nonsense that RPi defaults to!!
set ARCH="NONE" # Do this to skip download from SDRPlay
if( $ARCH == "Linux")then
echo "Installing SDRPlay driver version ${ARCH}-$VER ..."
mkdir -p ~/AA2IL/SDR/SDRplay
pushd ~/AA2IL/SDR/SDRplay
pwd
chmod 755 ./SDRplay_RSP_API-${ARCH}-${VER}.1.run
./SDRplay_RSP_API-${ARCH}-${VER}.1.run
popd
sudo reboot
exit
else if( ( $ARCH == "ARM32" ) || ( $ARCH == "ARM64" ) )then
echo "Installing SDRPlay driver version ${ARCH}-$VER ..."
mkdir -p ~/AA2IL/SDR/SDRplay
pushd ~/AA2IL/SDR/SDRplay
pwd
# They've changed the naming convention so I just did thismanually on the RPi
# Get it from the website instead?
#wget https://www.sdrplay.com/software/SDRplay_RSP_API-${ARCH}-${VER}.${SUBVER}.run
ls -alhrt
chmod 755 ./SDRplay_RSP_API-${ARCH}-${VER}.${SUBVER}.run
./SDRplay_RSP_API-${ARCH}-${VER}.${SUBVER}.run
# Note: To start and stop the API service, use the following commands...
# sudo systemctl start sdrplay
# sudo systemctl stop sdrplay
# Should now be able to see the device if it is plugged in
lsusb
# Didn't need the reboot on RPi bulleye
popd
#sudo reboot
exit
endif
# Well, do we have what we need already?
# Seems like we need a to do little more work for the SDRplay
if( 0 )then
which SoapySDRUtil
SoapySDRUtil --info
SoapySDRUtil --find
SoapySDRUtil --probe="driver=sdrplay"
exit
endif
##########################################################################################
# SoapySDRPlay
if( 1 )then
echo "\n------------------------------------ Installing SoapySDR for SDRPlay ...\n"
cd ~/Dev
sudo rm -rf SoapySDRPlay
#if( $VER == 3.07 )then
if( $VER == 3.12 )then
# The current Soapy seems to work with the newer driver
echo "Cloning Soapy SDRPlay stuff ..."
pwd
git clone https://github.com/pothosware/SoapySDRPlay.git ./SoapySDRPlay
else if( 0 )then
# There is a problem with the older SoapySDRplay and the 2.13 version of the driver.
# Just use what worked before for now
#cp -r /media/joea/0090ec56-66df-4bdd-a4cb-106cae0fbdb7/home/joea/Dev/SoapySDRPlay .
#tar cvf OLD_SoapySDRPlay.tar SoapySDRPlay
tar xvf OLD_SoapySDRPlay.tar
# not sure the pothos SoapySDRplay works with API 3 yet, try with the SDRPlay devs repo.
#https://github.com/SDRplay/SoapySDRPlay
else
# Not sure what this was, perhaps for RPi?
echo "I dont know what I am doing here!"
exit
#tar xzvf SoapySDRPlay-soapy-sdrplay-0.1.0.tar.gz
#ln -s SoapySDRPlay-soapy-sdrplay-0.1.0 SoapySDRPlay
endif
# For a 64-bit operating system on a Raspberry Pi 4:
#setenv CXXFLAGS "-O3 -mtune=cortex-a72"
#setenv CFLAGS "-O3 -mtune=cortex-a72"
# Build it
echo "Building Soapy Support for SDRPlay ..."
cd ~/Dev/SoapySDRPlay
sudo rm -rf build
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
# Permissions were a real problem when trying to get this to
# work on the RPi.
sudo chmod -R go+rx /usr/local/lib/SoapySDR
sudo chmod -R go+rx /usr/local/share/cmake
sudo chmod -R go+rx /usr/local/lib/aarch64-linux-gnu/SoapySDR
# Need to rehash to find new stuff
rehash
echo " "
echo "Testing Soapy SDRplay Driver ... "
echo SoapySDRUtil --find
SoapySDRUtil --find
echo " "
echo SoapySDRUtil --probe="driver=sdrplay"
SoapySDRUtil --probe="driver=sdrplay"
#echo --- If we are getting permission errors here, try rebooting ---
exit
endif