Software-Defined Radio on Ubuntu

From Wiki
Jump to: navigation, search

For my HAB project I'll use a NTX2-434.650-10 to transmit data like time, location, temperature etc.
And that means you need a scanner or preferable a transceiver which does 70cm (UHF) and SSB (LSB, USB) modulation.

When you like me don't have 600€ to spent for a decent transceiver, SDR is actually a really nice thing.
You can actually turn your DVB-T dongle (20€) with SDR into a receiver which does UHF, SSB (LSB,USB) and more.

Hardware

You can use almost any DVB-T dongle based on the Realtek RTL2832U. You can check this list for supported dongles.
I bought myself an Logilink DVB-T at Conrad for only 16€.

VG0002A.jpg

Software

For Linux there are plenty of SDR related software available but my favorite one is Gqrx.
To get Gqrx working with RTL-SDR is not hard but it will take some time...

Install Gqrx

Step 1. Setup build environment

mkdir SDR
cd SDR

Some packages will need to be installed to compile everything.

sudo apt-get install cmake swig libcppunit-dev python-cheetah doxygen \
libboost-all-dev python-sphinx fftw3-dev python-numpy libqwt-dev \
libusb++-dev libusb-dev libusb-1.0-0-dev libgsl0-dev python-wxgtk2.8 \
qtcreator

Step 2. Install GNURadio

Clone the repo and enter its new directory.

git clone http://git.gnuradio.org/git/gnuradio.git
cd gnuradio

Now make a build directory, enter it, and create the build environment.

mkdir build
cd build
cmake ../

Now build and install GNURadio

make
sudo make install
sudo ldconfig

Step 3. Install rtl-sdr

Now go back to the SDR directory and clone the rtl-sdr repo

cd ../../
git clone git://git.osmocom.org/rtl-sdr.git

Now enter the directory, create the build directory, and create the rtl-sdr build environment.

cd rtl-sdr/
mkdir build
cd build
cmake ../

Time to build and install rtl-sdr

make
sudo make install
sudo make install-udev-rules
sudo ldconfig

Step 4. Test rtl-sdr

Just to make sure rtl-sdr works with your dongle, try to run the command rtl_test, and check the ouput

Found 1 device(s):
  0:  Dexatek DK DVB-T Dongle (Logilink VG0002A)

Using device 0: Dexatek DK DVB-T Dongle (Logilink VG0002A)
Found Fitipower FC0013 tuner
Supported gain values (23): -9.9 -7.3 -6.5 -6.3 -6.0 -5.8 -5.4 5.8 6.1 6.3 6.5 6.7 6.8 7.0 7.1 17.9 18.1 18.2 18.4 18.6 18.8 19.1 19.7 
Reading samples in async mode...

Step 5. Install gr-osmosdr

Now go back to the SDR directory and clone the gr-osmosdr repo

cd ../../
git clone git://git.osmocom.org/gr-osmosdr

Now enter the directory, create the build directory, and create the gr-osmosdr build environment.

cd gr-osmosdr/
mkdir build
cd build/
cmake ../ -Wno-dev

Time to build and install gr-osmosdr

make
sudo make install
sudo ldconfig

Step 6. Install gqrx

Now go back to the SDR directory and clone the gqrx repo

cd ../../
git clone https://github.com/csete/gqrx.git

Now enter the directory and load the project in qtcreator

cd gqrx
qtcreator ./gqrx.pro

To build the package click Build->Build All. After the build finishes plug in your SDR and go into the build directory to execute gqrx.

cd ../gqrx-build-desktop-Qt_4_8_1_in_PATH__System__Release/
./gqrx

You should be up and running now.

Install dl-fldigi

Dl Fldigi is an adapted version of the excellent free FLdigi soundcard decoding software. It takes the audio from your radio, decodes the balloon's signal, and then sends the telemetry it's found over the internet to a server running habitat, which plots the payloads position on to the SpaceNear map.

sudo apt-add-repository ppa:simrunbasuita/dl-fldigi
sudo apt-get update
sudo apt-get install dl-fldigi

Listening for a Payload

So now that we have gqrx and dl-fldigi we can finally start receiving and decoding RTTY!
Make sure you have your DVB-T dongle connected to the computer before starting gqrx ;)

./gqrx

Select your dongle from the list

List.png

Push the power button, fill in the frequency and make sure that Filter is Normal and Mode is USB.
You should see a spike around the frequency of your payload

Freq.png

Just click in front of the spike and you will see a red vertical line appear.
Move this red vertical line until you see two spikes in the Audio Window like below.
At this point you should be hearing the RTTY from your payload

Tune.png

Decoding the Payload

When gqrx is running and you can still hear the RTTY from your payload it's time to decode the RTTY.
Dl-fldigi will use the default analog audio input channel so the only thing you need to do is capture the audio from gqrx.

Audio capturing can be done in multiple ways and you need to decide which works best.

  • Use alsamixer
Type F4 and you will go to the capture channels. Select the channel named "Capture" and press the space bar. A comment "L - CAPTURE - R" written in red should appear. 
  • Use gnome-alsamixer

Gnome-alsamixer.png

Just select the box named "Rec." in the channel named "Capture".
  • Use a jack-jack plug
You can always use a jack to jack plug and redirect the audio from the headphone output to the microphone input. Just make sure your microphone input is not muted.

Now start dl-fldigi

dl-fldigi --hab

Rtty.png

As you can see the RTTY is being decoded and is perfect readable.

Hint

My payload is sending with 75 baud and a 350hz shift so if yours isn't and I highly doubt you need to adjust these settings in dl-fldigi.
Just click on RTTY in the left corner below.