GNU Radio

Instructions on how to install gr-radio-astro (contains set of GNU Radio modules required for DSPIRA GNU Radio Projects) & stand alone USB Flash Drive with preinstalled software & installing on a Raspberry PI

The following is an extract from the WVURAIL/gr-radio-astro Github repository giving installing instructions for this important pre-requisite needed to use DSPIRA GNU Radio GRC flow-graphs. I have also included instructions for installing DSPIRA software on stand-alone bootable USB drive and on Raspberry PI.

Releases: WVURAIL/gr-radio_astro

gr-radio_astro

This package provides GNUradio OOT modules and grc flowgraphs that fascilates Radio Astronomy Observations with software defined radio devices.

There are two flavors of this projects:

  1. NSF Integrate and Detect softwares that allow for HI measurements and also event detections from cosmic ray detections, developed by Dr. Glen Langston. See here and the lightwork memo series for more details.
  2. DSPIRA software developed for and by High School Teachers part of the NSF funded RET program called Digital Signal Processing in Radio Astronomy (DSPIRA) at WVU university from the summers of 2017 to 2021. For more details visit the webpage and the companion website called dspira-lessons that has lessons, guides and more material help one to use radio astronomy in a high school classroom. This material is designed by the High School teachers part of this program.

Installing from Source

  1. Install GNUradio
  2. Install gnuradio external python dependencies and SDR drivers by typing the following and hit enter:
  3. sudo apt install gnuradio gr-osmosdr airspy python3-h5py python3-ephem git cmake liborc-0.4-dev -y
  4. To clone the repository:

git clone https://github.com/WVURAIL/gr-radio_astro.git

  Switch to the gr-radio_astro directory: cd gr-radio_astro

  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:

  1. Edit your .bashrc file and add this to the bottom to set Python path: export PYTHONPATH=/usr/local/lib/python3/dist-packages:/usr/local/lib/python3.8/dist-packages:$PYTHONPATH
  2. Additionally you can create appropriate symbolic links
    1. Check which python is the installed version of GNURadio by opening gnuradio-companion in a terminal window and click on Help –> About and noting the python version on the dialog box that opens.
    2. Go to the following by typing: cd /usr/local/lib/python3.8/dist-packages or cd /usr/local/lib/python3.9/dist-packages for the appropriate python version.
    3. Type ln -s /usr/local/lib/python3/dist-packages/radio_astro

Running from a bootable USB Flash Drive with preinstalled software:

Instructions to set up a persistant USB flash with preinstalled software drive are here (and also at end of this message)

Installng on a Raspberry Pi.

Supported Raspberry Pi Devices

All devices must have RAM greater than 4GB

  1. Raspberry Pi 4 Model B
  2. Raspberry Pi 400

Installing Ubuntu image with radio astronomy preinstalled on a Raspberry Pi

This image requires a minimum of 16GB of space on the SD card.

  1. Download the image here
  2. Unzip the .zip file.
  3. Use Raspberry Pi Imager to install this image.
    1. Insert SD card into your card reader on your computer
    2. Open Raspberry Pi imager.
    3. Click Choose OS, and choose Use Custom.
    4. Select the correct image file downloaded in step 1 and 2 from your system.
    5. Click Choose storage and select your inserted SD card.
    6. Click write.
    7. More info here and a video
  4. Insert SD card to Raspberry Pi and power it up.
  5. The default user name is pi, with password raspberry. Change the password after first boot.

Tested Package for GNURadio 3.8 – August 2020 release

Aug 6, 2020

Download

From links below or clone at this tag git clone -b v2020.08-gr38 https://github.com/WVURAIL/gr-radio_astro.git

Use your existing repository with latest Version

git fetch –tags

git checkout $(git describe –tags `git rev-list –tags –max-count=1`)

FOR Ubuntu 20.04 (on a Fresh install of OS)

  1. Install GNURadio

Install Guide

  1. Download and unzip the source code from below and go to gr-XXX folder create a build folder

mkdir build

  1. Change directory into the build folder

cd build

  1. run the following commands

cmake ..

sudo make

sudo make install

sudo ldconfig

Additional Steps for setting the proper Python environment:

  1. Open a terminal window.
  2. Make sure you are at the home directory (type cd ); type gedit .bashrc. This opens the bashrc file in an editor.
  3. Scroll to the very bottom of this file, add a space, and then copy and paste the following code:

export PYTHONPATH=/usr/local/lib/python3/dist-packages:/usr/local/lib/python3.8/dist-packages:$PYTHONPATH

  1. Save and close (x in upper right corner).
  2. Go to the folder by typing: cd /usr/local/lib/python3.8/dist-packages
  3. Type ls
  4. If the folder radio_astro exists, delete it by typing sudo rm -rf radio_astro.
  5. Check for proper installment by opening a new terminal window and starting Gnuradio (gnuradio-companion)
  6. Run spectrometer_w_cal.grc. If no error occurs, installation was a success!
  7. Run GNU Radio Companion to check if the modules were installed.

Installing Ubuntu 22.04 with spectrometer_w_cal.grc on Bootable Flashdrive

Aug 7, 2020 | 2 minute read

Image the Flashdrive:

  1. Before starting, you will need the program balenaEtcher, which is an easy-to-use cross-platform tool for burning images to SD cards, USB drives and other removable devices. It can be downloaded from https://www.balena.io/etcher/.
  2. Download the file ubuntu_radio_astro08_2022_2.zip while in either Windows 10 or 11 or Ubuntu 22.04 or higher. This file will create a self contained persistent UBUNTU 22.04 computer environment.
  3. If you wish to create a self contained persistent UBUNTU 24.04 computer environment, then download the file ubuntu_radio_astro2025.zip
  4. Unzip this file in a folder of your choice.
  5. Install a 32 GB flash drive for the UBUNTU 22.04 file or a 128 GB flash drive for the UBUNTU 24.04 file in your usb port. [We recommend a Samsung FIT Plus flash drive.]
  6. Run balenaEtcher. Choose the file ubuntu_radio_astro08_2022_2.img or ubuntu_radio_astro2025.img as the image and the flash drive as the target.
  7. The Ubuntu with spectrometer_w_cal.grc image should now be on this bootable flashdrive.

How to Run Gnuradio and the spectrometer_w_cal.grc program from the flashdrive.

  1. To run Gnuradio and the spectrometer_w_cal.grc program, place the bootable flash drive in a USB port.
  2. Start or reboot the computer. While it is starting, hold down the bootable key (F12) to pull up a menu of boot options.
  3. Scroll down to the flashdrive and hit enter.
  4. On the first installation screen, choose run Ubuntu persistent live (the choice at the top). IT MAY TAKE A FEW MINUTES FOR THE SYSTEM TO BOOT UP, DEPENDING ON THE FLASHDRIVE USED. BE PATIENT!
  5. Open a Terminal by selecting the terminal icon on the left menu bar.
  6. Type and enter gnuradio-companion at the prompt.
  7. The spectrometer_w_cal.grc program should open.
  8. Before you hit the Play button at the top of the program window, you will need to adjust the gains for the AIRSpy in the OSMOCOM block. The nominal gain values for the AIRSpy are 17 12 10.
  9. NOTE: When the save/write to file buttons are hit, the data files are written to the Spectra folder. Before you run GNURadio, you will need to create the Spectra folder. Click on the Files icon on the left side of the screen. Create the Spectra folder at this level.
  10. NOTE: The system clock time defaults to UTC/London. Change it if needed.
  11. Enjoy radio astronomy observations!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.