This will install the spectrometer program spectrometer_w_cal.grc as well as other useful radio astronomy GNURadio programs onto a system using Ubuntu 20.04.
Complete the following steps:
-
Open a terminal window in Ubuntu.
- Install gnuradio external python dependencies and SDR drivers by typing the following and hit enter:
sudo apt install gnuradio gr-osmosdr airspy python3-h5py python3-ephem git cmake liborc-0.4-dev -y
-
To clone the repository: in the terminal, type and Enter:
git clone https://github.com/WVURAIL/gr-radio_astro.git
-
Switch to the gr-radio_astro directory:
cd gr-radio_astro
-
Switch to the gr-radio_astro 3.8 branch by typing:
git checkout gr38
-
Make a build directory:
mkdir build
, and then move to it:cd build
-
Then run the following in the build directory:
cmake .. sudo make sudo make install
Additional Steps for setting the proper Python environment:
-
Open a terminal window.
-
Make sure you are at the home directory (type and Enter
cd
). Then typegedit .bashrc
to open the .bashrc file in an editor. -
Scroll to the very bottom of this file, add a blank line, and then copy and paste the following code:
export PYTHONPATH=/usr/local/lib/python3/dist-packages:/usr/local/lib/python3.8/dist-packages:$PYTHONPATH
-
Save and close (x in upper right corner).
- Additionally you can create appropriate symbolic links
- Check which python is the installed version of GNURadio by opening
gnuradio-companion
in a terminal window and click onHelp --> About
and noting the python version on the dialog box that opens. - Go to the following by typing:
cd /usr/local/lib/python3.8/dist-packages
orcd /usr/local/lib/python3.9/dist-packages
for the appropriate python version. - Type
ln -s /usr/local/lib/python3/dist-packages/radio_astro
- Check which python is the installed version of GNURadio by opening
Check that the Installation was Successful
- Restart your terminal window. Run the program in Gnuradio:
- In a terminal window type
gnuradio-companion
-
Open the spectrometer_w_cal.grc program as follows:
File --> Open --> gr-radio_astros --> examples --> *spectrometer_w_cal.grc*
- Plug an Airspy radio, with the LNA attached, into the USB port. Run the program by hitting the start triangle (“execute the flowgraph”) on the menu bar at top. If no errors occur, you are all set!
- In a terminal window type
How to Update files from the gr-radio_astro gr38 Repository
-
Open the terminal window.
-
From your home directory (cd ), go to the gr-radio_astro folder:
cd gr-radio_astro
-
Type
git status
. Check the “On branch …” statement at the top. You want to be in the gr38 branch. To get there, typegit checkout gr38
. -
If a warning message shows up about local changes made that could overwrite files, type
git stash
. -
Type
git status
to check that you are “On branch gr38”. - Type
git pull
.- If a warning message shows up about local changes made that could overwrite files, type
git stash
. - Then type
git pull
again.
- If a warning message shows up about local changes made that could overwrite files, type
-
Change to the
build
directory:cd build
-
Type
rm -rf *
. NOTE: Make sure you are in thebuild
directory before typingrm -rf *
! - Then run the following:
cmake .. sudo make sudo make install
- The update is complete.
To Run the __spectrometer_w_cal.grc__ program in Gnuradio After Updating:
-
In a terminal window type
gnuradio-companion
. -
Close any previous version of
spectrometer_w_cal.grc
that might be open in Gnuradio. -
Open the new version of
spectrometer_w_cal.grc
from the folder/gr-radio_astro/examples/
- under
File
selectOpen
; - Navigate to the
gr-radio_astro
folder. - Under
examples
openDSPIRA
; then selectspectrometer_w_cal.grc
.
- under
-
Connect an Airspy SDR to a USB port, and start the program running (Hit the black triangle at the top middle ribbon bar.)