Software Defined Radio — Installing the NooElec NESDR Mini 2 for Linux

Motivation

I will take the opportunity now to stop and review where I am with the Satellite Tracking project that my older son and I started several years ago. In 2009 we recorded several passes of a now decommissioned amateur radio satellite named HAMSAT (VO-52). With attention to the timing accuracy of the recording, I was able to estimate slant range from the receiver to the satellite as a function of time using a simple Doppler Shift model. I have then recently developed a Python script to estimate the actual location (eg. latitude/longitude of the ground track, altitude, and azimuth/elevation) of the satellite given the range/time data from three ground stations of known latitude and longitude.

The project now has some momentum in the direction of a real test sometime in the future raising the question of what radio receivers I should consider. My son has suggested the use of Software Defined Radio, a concept I like very much because it is in line with one of the unstated goals of most of my projects to do as much as you can with as little financial cost as possible. A month or so ago he mentioned Gnu Radio and a hardware device known generically as a DVB-T Dongle based on a Realtek RTL2832U circuit. The interface between GNU Radio and the dongle uses the RTL_SDR codebase as discussed at http://www.rtl-sdr.com/rtl-sdr-quick-start-guide/ and http://sdr.osmocom.org/trac/wiki/rtl-sdr. I invested $25 to see if I could make it work. It is not a plug and play device and it does take a little work to get it operating so I am documenting what I had to do as a blog post here.

Acquiring and installing the NooElec NESDR Mini 2

While there are a lot of DVB-T dongles available, I purchased the NooElect NESDR Mini 2  on Amazon plus a PL-259 pigtail for it. Dongles from some suppliers take a long time to ship and defective devices are reportedly common.

P1030079

 

I am programming this project in Python and decided that the best platform for the project was Linux so I installed the radio on a Dell Vostro notebook with 2 GB RAM and a 2 GHz Intel core duo processor running a brand new installation of XUbuntu 14.04 LTS. After reading several websites it looked like most pointed to osmocomSDR. There is a lot of information there. I have extracted only what I did to get up and running. My inexperience with Linux will become evident.

I downloaded the software as a package release as described on the website and extracted the archive. I tried to build the software following the instructions at osmocomSDR but the build threw several dependency  errors. Save yourself some time and install these before you start.

Here is the build sequence using cmake:

cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig

cmake was not installed so I did a

sudo apt-get install cmake

and tried again. This time the error was that the libusb1.0 library was not installed. The osmocomSDR website very explicitly says this is required. In my previous experience with Linux I have used the synaptic package manager to download things like this but it is no longer installed by default. Most of this stuff could have been install from that…I have installed it now, after the fact. I downloaded the build package for libusb1.0 from SourceForge and extracted it. It threw an error in the configure step that libudev was not installed. I installed it from the Ubuntu Software center.

After that the build as described on osmocomSDR went smoothly to completion.

The installed codebase has several command line programs so I ran the first one described on the website

rtl_fm -f 96.3e6 -M wbfm -s 200000 -r 48000 – | aplay -r 48k -f S16_LE

I was greeted by the gentle hiss of a radio that was tuned to dead air. I exited and edited the command to

rtl_fm -f 95.3e6 -M wbfm -s 200000 -r 48000 – | aplay -r 48k -f S16_LE

our local FM station. This time I was greeted by the local high school girls basketball game at the some kind of state championship or something. I must admit that I was never so happy to hear a basketball game as I was this one.

Then I installed a SDR called GQRX from the Ubuntu Software Center. After fooling with the controls (mainly the receiver gain which is set to automatic by default) I got it working too…the blue LED in the lower right is the dongle.  Shown here tuned to a nearby repeater for our regional NPR station.

 

P1030077

Finally, I downloaded Gnu Radio from the Ubuntu Software Center and prepare to build the rtl_sdr source block for it.  I ran the Gnu Radio Companion first though and was surprised to find the Osmocom rtl_sdr block already there.  I had installed Gnu Radio on another identical install of XUbuntu and there were no sources shown.

Here is a screen shot of Gnu Radio Companion ready to build a radio based on the rtl_sdr dongle.  I will describe that too once I figure out how to do it.

rtl_sdr_gr_block

 

 

A New Page — Passive Tracking of Satellites using only Range Data

QB50P1GrndTrk-Run2

I have added a new page to the Earth orbiting satellites section of Murmurs from the Earth…Whispers from the Sky.  Passive Tracking of Satellites using only Range Data continues the project started several years ago to study the Doppler shift of satellite radio beacons.  The page describes a method to determine the ground track and other information about the position of a satellite as it passes over three ground stations recording the satellite radio beacon.

While I am certain that this has been done in the past and replaced with other techniques, I developed the method and Python scripts from scratch, to the extent that is possible…obviously I scavenged code and ideas from wherever I could to make a lot of the cranks that needed to turn.  I used a  very simple geometric approach.

Lacking actual data I generated four artificial and hence, internally consistent data sets using the PREDICT pass prediction software that provide the range input data and the location check data.  I was quite pleased with the initial results.

New Page — Clear Sky Charts



With the transit of Venus rapidly approaching above cloudy skies I was very curious to see if the forecast was for clearing skies at the last minute.  My go-to website for that information is The Clear Sky Chart Homepage.   My experience has been that it is pretty accurate.  Then I realized that the authors permit embedding the chart on non-commercial websites like mine so I added a new page with charts for two locations on either side of my location in Millersburg, Stillwell and Wilmot, all in Ohio.  Find the new page in the sidebar at the right hand side of the page labeled “Clear Sky Chart

Moving Up in the World

A couple of weeks ago, in a telephone conversation, my older son mentioned that it would be interesting to see if we could measure the Doppler shift in a satellite radio beacon as it passed overhead. He suggested, if I was interested, that he could bring along a radio and we could try it when they came home to visit at Christmas. Of course I was interested!

After supper on Christmas evening, he found a candidate satellite and set up the radio. We fed the audio from the radio to the line input of my MacBook to make the recording and do the analysis. The long and the short of it was that we picked off a nice Doppler shift on two passes, one on the evening of the 25th and one on the evening of the 26th. The Raven Lite software was great for monitoring the signal, both visually and audibly but it had the shortcoming of limiting the recording time to only a minute. For the pass on the 26th, we split the signal and used his MacBook to record the full pass of several minutes into one file using Audacity while keeping Raven Lite running on mine. Since the frequency shift was greater than the radio’s passband, it had to be retuned a few times.

I picked several points off of each file and manually adjusted each point for the time and any retuning of the receiver as needed. Then I used my linear path model for the curve fit after replacing the speed of sound with the speed of light. The first pass data fit very nicely. I haven’t done the fit on the second pass yet. Once I do a little more analysis, I’ll put up a page on it.

My son reminded me that there was a docudrama on PBS’s Nova many years ago (December 1989) called “The School Boys Who Cracked the Soviet Secret” about a science class in a private boys school in England that did a similar analysis on the Sputnik satellite right after it was launched. It would be interesting to watch that again.

This is a very interesting subject that has lots of avenues to study in more detail. We’ll have to see what develops as time passes. For right now though, the basic process was pretty easy, gives me a lot of things to think about… and was very cool.

Doppler Shift part II

nelson1_strip

Thanks to Dave’s post on satellites ( Scanning Horizons ) my wife and I went out this evening and watched the International Space Station go over.  It is such an impressive sight…bright, fast, silent.

Then I got an email from my older son with the url to this:  Stan Nelson, a ham radio operator from Roswell, New Mexico has recorded a radar signal reflected off the ISS.  The spectrogram, shown above and reminiscent of my spectrograms of diesel trucks,  shows the doppler shift of the reflected radar signal.  He also includes the audio so you can actually hear the shift as the station passes overhead.  Check it out at http://www.spaceweather.com/archive.php?view=1&day=02&month=04&year=2009 .