DragonWins Home Page


Software Defined Radio

(Last Mod: 04 November 2010 18:12:42 )


The Scope of this Website

This website has been created to support a specific project of which the use of a software-defined radio (SDR) is one aspect. As such, this site is not intended to be complete or thorough - just good enough to support the project.

Since the people involved with this project, especially myself, are novices in many/most aspects of SDR, including, for some (again, including myself), the use of Linux, this website will undoubtedly take on the flavor of a step-by-step guide to doing some very basic things. If you happen to be in a similar situation trying to do those same basic things, then this site may be quite helpful to you. But keep in mind that it is very much a case of the blind leading the blind.

The Legacy Experience

The latest installation instructions reflect quite a bit of knowledge gained from previous installation attempts. Some people may find it useful to read through those earlier attempts to see what lessons they might glean from our experiences so as to avoid repeating at least some of our mistakes.

Installation and Setup Instructions

 

The Operating System

The operating system used for this project is Fedora Core 5.

The Hardware

The hardware used for this project is the Universal Software Radio Peripheral (USRP) from Ettus Research, LLC.

The Software

The software used for this project is GNU Radio. One thing to be aware of, if you are as much a novice with Linux as I am, is that the documentation makes rather large assumptions about your familiarity with Linux. For instance, they throw around terms like "globs" and "shell globs" assuming you know exactly what they are talking about. They also tell you that you need to satisfy certain external package dependencies and make claims about some of them almost certainly being included with your OS distribution, but give no hint as to how to determine whether they are or or not and, if so, which version you have. Most of this is probably unconscious and some is inevitable (they can't assume no one has ever heard of a computer before), but it is still extremely frustrating. 

The Installation

Installing FC5 Linux was pretty straight-forward.

Installing GNU Radio was a nightmare. I spent the better part of two weeks fighting with dependencies and other things before I got GNU Radio to build successfully and, even then, could not communicate with the USRP. I learned quite a bit about Linux during that struggle - though I certainly have a lot more to learn. After fighting the battle for several more days trying to do more than make the USRP's blinking light go away, I started from scratch with a different system and got GNU Radio up and running and talking to the USRP after about four hours. I do not know why the first system didn't (and still won't) talk to the hardware - at some point I will perform a complete re-install on that system and see if I get different results.

These are some of the useful things I have learned (at least partially).

Linux is case sensitive.

I already knew that, but I also assumed that people writing things for Linux would know that and be sure to give you things using the correct case. Not so. I frequently found references to package names that used the wrong case - unfortunately in some instances that reference was the only reference I had and so had no idea that I was using the wrong case.

Linux (at least FC5) includes something called rpm.

This is a package manager and serves a purpose at least somewhat akin to the Windows Install Shield. It is used to add/remove programs and a number of other things. If a software package is installed using rpm, then its dependencies are checked and anything that it needs is also installed. Information is also added to a database (somewhat akin to certain Windows Registry entries) so that dependencies in the system can be monitored and the package easily updated/removed in the future.

One of the nice things you can do with rpm is query which packages have already been installed. You do this with the command:

#rpm -q -a

NOTE: I did most of the work installing things while logged in as root. I don't have a good feel for what things would have worked differently or not at all had this not been the case.

This will produce a rather long list. One thing you can do is "pipe" the output of this command to another command or a file. I used:

#rpm -q -a > rpm_list.txt

You can then use a text editor (gedit is the one that came with FC5) to open and search the list for the packages you are looking for.

#gedit rpm_list.txt

Another thing you can do is "grep" the output. This is a search utility that, in its most basic form, searches the input text for lines that contain matches to the pattern specified and prints out the corresponding lines. So, for instance, if you want to see if you have the boost libraries installed (and are unsure if the word boost should be capitalized or not) you can do the following:

#rpm -q -a | grep oost

or

#grep oost rpm_list.txt

You can use rpm to install packages

This can be done by running the command:

#rpm -ivh filename

from within the directory that contains the *.rpm file.

You can also use yum to install packages

This utility is basically a front end for rpm and maintains repository information. So, in theory, you don't need to know where to get the rpm file on the internet. My experience is that it is somewhat hit-and-miss.

#yum install packagename

The documentation for GNU Radio is not entirely accurate.

The README file from the build guide says, among other things:

"With the exception of SDCC, the following GNU/Linux distributions are known to come with all required dependencies pre-packaged: Ubuntu 6.06, SuSE 10.0 (the pay version, not the free download), Fedora Core 5."

This turned out to be quite, quite wrong (at least as near as I could tell).

The folks at GNU Radio obviously also know this and now have supplemental instructions for FC5. The contents of this page closely mirror my experiences, although I don't know if their instructions will properly install fftw.

The Step-by-Step that Worked

Here are the steps I used to get my first successful install. These instructions are prepared from my notes, so where I quote things, please forgive me if they are not exact verbatim quotes. I don't think I left very many steps or details out and the ones that I did I'm pretty sure are really, really obvious. I could be deluding myself. Probably the biggest thing I left out are when you have to select "next" or something similar to go to the next screen. If the next line makes no sense in the context of the current screen - try going to the next one.

Creating a Partition for Linux

The first thing to do is create a partition on the primary drive using a tool such as Gnome Partition Editor (GPE).

A colleague burned me a disk for this, so I don't have a good reference for where you can get it. Use Google and you'll probably find it pretty quickly. At this point I am going to assume that you are using a Live-CD version of GPE.

Shut down your system and boot off the CD. You may have to go into your BIOS settings to make this possible.

Once the system boots, you will have to select a video interface. I thought that Generic VESA in 24-bit color with 640x480 resolution would be safe, but it turned out that not all machines like this. If you pick wrong, your display goes off to Never-Never Land and you get to reboot. Annoying, but not too painful. Play around until you find something that you can see.

Note for my colleagues using this site:

Once you have gotten beyond this step, resize your primary drive to add sufficient space to the end. What is sufficient? I have no good answer. I used 10GB but don't know if I will regret that choice. Be sure that you actually have that much space that can be stolen from your other partitions.

Choose "apply" to make the changes and close the partition editor.

Then just select "Eject CD and reboot" from the menu that comes up by clicking the icon in the lower right corner. It will eject the CD just fine, but I have yet to actually get it to reboot the machine. That's what power switches are for.

Installing Linux

Now you need to get an appropriate Linux distribution. The same colleague that gave the GPE CD also gave me a set of FC5 CD's. Again, if you need to find out where to go and how to make a set of your own, try Google.

The FC5 distro that I have is 2.6.15-1.2054_FC5. I don't know how meaningful that is, but there it is just in case.

After booting from Disk 1, choose "Enter" to boot into graphical mode.

If it's the first time you've actually used the disks, it's probably worth it to go through and check them all. It doesn't take too long and can probably save a lot of headaches if it spots something.

Select "English" and "U.S. English keyboard" (unless something else suits your fancy).

Choose "Use free space on hda" (I had to deselect hdb manually).

Select "eth0 DHCP active on Boot" and "Set hostname automatically"

Select "America/Denver" time zone (or the appropriate one). <rant> This was a screen that really chapped me. I know I am in the Mountain Time Zone. Let me pick Mountain Time Zone off a list. Instead, you have to find a city that happens to be in the time zone you want from a huge long list of cities - and the list doesn't indicate what time zone the cities are in, so you are left guessing. Very poorly done. </rant>

Set the root password. <rant> I don't care what all the books say, write your password down and put it in a safe place that you will remember where it is but that is not obvious to anyone else. Your wallet is a good bet. Yeah, it's pretty obvious, but it's also pretty obvious when your wallet disappears. Consider the consequences of someone stealing your password and then decide if your wallet is good enough. </rant>

Check all the software options and the "customize later" box.

Make a note of where the install log is going to end up. On my machine, it was:

Now feed the CD's to the box when it asks for them.

Reboot the machine into Linux.

Accept the agreement (read it first if you want to).

Enable the firewall and trust all of the services (not necessarily a good idea, but for my purposes this is fine).

Set SELinux to enforcing.

Set the Date/Time

Choose an appropriate display.

    Note for my colleagues using this site:

Enter a Username and a Password for that user (see rant above).

Make sure the sound card checks out. GNU Radio uses it for quite a few of the demos. Keep in mind that you may have to connect external speakers to hear anything.

    Note for my colleagues using this site:

That's pretty much it. Now the real fun begins.

Getting the Network Working

If the machine wasn't connected to a network during the install or during the most recent boot, the NIC will be automatically disabled. To bring it up, do the following:

#ifconfig -a

If this doesn't work, you may have upgraded to superuser without bringing along the right configuration. If this is the case, exit back to the normal user and do the following:

$su -l

Now run ifconfig again and see if eth0 is enabled. If not, do the following:

#dhclient eth0

#ifconfig -a

You can also do this through the GUI, but I don't have that documented here. It's not too hard to find.

Getting Mozilla (Firefox) to Work from Behind a Proxy

If you are located behind a web proxy server, you have to tell the web browser to use it. Open Firefox and go to Edit-Preferences and you should see where to do this.

Note that this only applies to Firefox. You have to also configure other packages as well.

Getting Most(?) Other Things to Work from Behind a Proxy

You can create an environment variable that will tell several things where the proxy server is.

#export http_proxy=http://drenproxy.usafa.af.mil

This environment variable will go away when you reboot. To make it persistent, add this line to the file ".bashrc" located in the /root directory. When a file or directory name starts with a period, it is hidden.

To list all files, including hidden ones, use:

#ls -a

Getting svn to Work from Behind a Proxy

Neither of the above steps will get svn (which will be used to download the GNU Radio files from the repository) to work from behind a proxy server. To do this, you have to find a magical hidden file. It helps to have a few people around that are very familiar with Linux - I would have never thought to do this or figured out how to do it even had the thought occurred to me.

Starting from the top of the directory tree and working down, we found a ".subversion" directory under root's home directory. Within that directory we found a "servers" file. Edit this file and look for a section called [global]. In that section, find http-proxy-host and http-proxy-port. Uncomment them (leaving no space at the beginning of the line - trust me) and set them to the appropriate values for your proxy.

Verifying the presence of a USB 2.0 HS port.

The USRP has to have a high speed port, so there is no point installing GNU Radio on a machine that doesn't have one. If you are unsure, you can use the usbview utility to find out. But first you have to install it.

Supposedly you can do:

#yum install usbview

But this didn't work (it found no match for usbview).

So we went to www.rpmfind.org and searched for usbview and found an rpm file for FC4. We downloaded that one and put it into a new directory underneath the User's home (probably a better place, but my understanding is that the location of this file doesn't affect the install).

From within that directory, we executed the following command:

#rpm -ivh usbview

That worked nicely, so we launched the program by typing:

#usbview

It brought up a GUI and when we connected the USRP to one of the USB ports, it reported that an unknown device was now connected to a high speed port. Life was good.

Installing GNU RadioLinux

The first thing I did was to find out which packages were already installed.

#rpm -q -a > rpm_list.txt

I then searched this for the packages listed in the readme and discovered the following:

PACKAGE VERSION INSTALLED VERSION NEEDED
gcc-c++ 4.1.0-3 3.2, 3.4, 4.*
autoconf 2.59-7 2.5.9
automake 1.9.6-2 1.9.6
libtool 1.5.22-2.2 1.5.22
pkgconfig 0.20-2.2.1 0.15.0
fftw missing 3.0 (with config options)
python 2.4.2-3.2.1 2.3
numpy missing none given
boost 1.33.1-5 none given
cppunit missing 1.9.14
swig 1.3.24-2.2.1 list includes 1.3.24
sdcc missing 2.4.0
wxPython missing 2.5.2.7
doxygen 1.4.6-3 none given

The last three are optional (the sdcc is required for firmware programming on the USRP, however).

The numpy package is the numerical libraries for Python. It took a lot of hunting to figure out what the library is called.

It turns out this list of packages is incomplete. Specifically, you need cppunit-devel and libusb-devel as well. We'll get to that later.

To actually get the GNU Radio software files, do the following from a directory where you want the gnuradio subdirectory created:

#svn co http://gnuradio.utah.edu/svn/gnuradio/trunk gnuradio

If it's working, then you'll see a running list of files that are being downloaded. If it is sitting there looking stupid, then it is locked up. Kill it (Ctl-c) and you'll probably get some kind of error message.

Of the five missing packages (seven if you count the ones not listed), all but two can be yummed quite nicely:

#yum install numpy         // installed 0.9.8-1.fc5

#yum install cppunit       // installed 1.11.4-2.fc5

#yum install wxPython      // installed 2.6.3.2-1.fc5

#yum install cppunit-devel // installed 1.11.4-2.fc5

#yum install libusb-devel  // installed 0.1.11-2.2

While fftw can be yummed, it will not be configured properly. You can probably use the more sophisticated capabilities of yum, but I chose to take a more brute force approach.

I downloaded the tar file (fftw-3.1.2.tar.gz) from www.fftw.org and unzipped it into a directory. I then went into that directory and did the following:

#./configure --enable-single --enable-shared --enable-sse

#make

#make install

This worked, but since yum wasn't used, fftw won't appear in the package lists it knows about.

To get SDCC, the following was done (info obtained from http://sdcc.sourceforge.net/):

#svn co https://svn.sourceforge.net/svnroot/sdcc/trunk/sdcc sdcc

#cd sdcc

#./configure

#make

#make install

If everything has gone well up to this point, we can finally build GNU Radio:

Change to the gnuradio directory (that was created when svn was used) and do the following:

#svn co https://svn.sourceforge.net/svnroot/sdcc/trunk/sdcc sdcc

#cd sdcc

#./bootstrap

#./configure

At this point, you want to be sure that USRP is not listed as one of the modules that will not be built.

#make && make check

#make install

In order to get Python to find the libraries, you need to create the following environment variable.

#export PYTHONPATH=/usr/local/lib/python2.4/site-packages

This line needs to use the correct python version, so after you have typed up through python, hit tab and Linux will fill in the rest. This, in general, is true. If you are typing a command and hit tab, Linux will fill in the rest of the command as long as it is unambiguous what goes next. Very handy.

This should be added to the "/root/.bashrc" file as well (see above regarding the proxy server).

No find the python applications directory (note to self - need to add more specific reference) under gnuradio and run the following program.

#dial_tone.py

You should hear a pair of tones coming out of the speaker. If so, then go celebrate. It took me two weeks to get to this point!

Now you want to see if the USRP is actually working. Go to the USRP python apps directory (note to self - need to add more specific reference) and run

#test_usrp_siggen.py -f 1M // NOTE: I need to verify this command

You should see a sinusoid at the TX output board of board A (note: I need to verigy this port).