Dongular Deviation



Does that picture ring any bells? You know, that thing we used to listen to before the internet happened? That chunk of RF right between 88 and 108MHz with all the crazy DJs, talk and music? Right, that’s the one. But didn’t you ever wonder what could happen if you were able to force that dial way past those limits? What would you find? Some bizarro world of hitherto unknown secret transmissions you’d be the first to discover, stuff that nobody else you know has ever heard, or will ever hear? A gaping void containing infinitely more of the same fuzz you get between the few channels your radio could splurge from its speakers? Walk with me, I’ll show you, and bring some pocket money, we’re going budget for this one.

The problem with your FM radio, or indeed your AM radio, is that it’s built specifically to receive a given set of frequencies and demodulate a particular type of radio signal. This makes it quite difficult to make it do stuff it’s not supposed to unless you’re handy with a soldering iron and a healthy chunk of radio knowledge. What we need is some way to blow the doors open to any and all frequencies and modulation schemes. What we need is a handy three letter acronym to the tune of SDR. For those not in the know, that’s Software-Defined Radio, and essentially the idea is that instead of using a specific device for a specific purpose, let’s say a TV to receive TV signals, a wifi card to receive 802.11 signals, a walkie-talkie to receive personal communications, we use a single device which is pretty dumb. It doesn’t know how to decode any of this stuff, it’s just a tuner with an antenna, all the important stuff is piped through an ADC, or analogue to digital converter, to turn all those lovely RF signals into something our PCs can understand. That’s when the magic happens, the PC takes all those signals and does the same stuff in software that the TV, wifi card and walkie-talkie does in hardware. Being software, though, you can have it be as many types of radio as you can think of, you just fire up a different application or choose a different demodulation scheme. SDR is also capable of transmission, but here we’re just going to deal with reception because it’s just become incredibly cheap. Stop the presses folks, this one’s hot off the wire.

Until now, there’s been a selection of options for SDR reception, anything from the Softrock series of receivers and the ~$200 Funcube Dongle Pro right up to the USRP which could set your wallet back an order of magnitude more. They all vary in capability, usually roughly according to price, but now there’s a new kid on the block: a $20 DVB-T digital TV tuner. The magic chipset combo is the Realtek RTL2832, this is the part which takes the data from the tuner and whacks it into your USB port, and either the Elonics E4000 or Fitipower FC0012 or FC0013 tuners, this is where the antenna connects so you can get your RF on. The reason the RTL2832 is important is because it contains a mode which, rather than decoding the TV signals, will pass the data from the tuner right to your PC without messing with it, you get whatever the tuner sees. This is due to a feature of the chipset which allows it to receive FM and DAB radio signals in addition to the DVB-T it’s built to demodulate which we can exploit to enable wideband SDR reception. There’s a little more technical information on this PDF from Elonics themselves showing the reference design most of these sticks are built on. Being a standard design means that, as far as is currently known, any dongle with this combination of chips can be used for this purpose.

So where do you get one of these things? Well, there’s some good work being done by the fine folks on Reddit right over here to establish just which dongles can and can’t be used. I’m using the Hama Nano which I purchased on Amazon UK, but there’s a range of places you can source these things, from DealExtreme and AliExpress which are ridiculously cheap but may take forever to arrive to Amazon and eBay where you’ll pay a little more but will get your new shiny shiny a lot quicker. Well worth the premium to get it right now in my opinion, but maybe I’m just impatient. You’ll probably want to get a wideband antenna to go with it, the dinky DVB-T antennas they supply with the devices are generally cheap and nasty. For reference, these cards usually use either an MCX connector or a full-size Belling-Lee connector, so you’ll need to take that into account when choosing an antenna, you’ll probably require adapters.

The key to the kingdom: Hama Nano



It’s probably about time we got to the meat of the project, what can we do with it, and how do we make it comply? There’s two routes to this part, one is Linux and the other is Windows. I’m going to cover the Windows option because that’s what I’m most comfortable with, but I’ll include resources for the Linux method too, I’ve tried both and though I personally prefer working with Windows, the Linux stuff works just great too, so take your pick.

First off, grab a copy of HDSDR (or WinRad, but I’ll be using HDSDR), install it somewhere and keep a note of where you’ve installed it. Don’t run it yet though, it won’t do anything until we’ve installed another piece. To make it talk to your tuner, you’ll need to pick up a copy of Balint Seeber’s libusb and ExtIO dll installer. It’s currently in beta, but you should make sure you get the version which explicitly mentions RTL2832 support, otherwise it won’t know your tuner exists. When it asks you where you want to put it, choose the same directory you installed HDSDR or WinRad to. The default options are fine, other than install location. During installation, you’ll run into a couple of windows which aren’t standard, the first of which will ask you if you’d like to read instructions on how to install Zadig, I’ll leave that decision up to you, but I don’t think it’s critically important, I’ll explain the process next, it’s pretty easy.

Selecting either option will lead you to the next window, Zadig itself, it should look like the image below. This part of the installation process is the installation or replacement of the tuner driver with the libusb driver so the radio applications can receive data directly from the tuner without the Realtek chip trying to demodulate it and turn it into a TV picture. Chances are if you’ve already installed your tuner’s driver, two things will differ from this picture, and they’re both normal; the current driver won’t be WinUSB and the dropdown device box won’t include any devices, or won’t include your tuner. The first isn’t a problem, the second can be remedied by opening the Options menu and choosing to show all devices. On doing that, you should get a list of all USB devices which can have their drivers replaced by libusb. Choose your tuner, mine’s listed simply as “RTL2832U”, and click Install Driver. It may take a little while depending on your system, on my eeePC it takes a couple of minutes, on my desktop it’s nearly immediate, but it’ll get there in the end eventually. Oh, and it works just fine on 64bit machines.

Once you’ve installed the driver, complete the installer, it’s all pretty standard stuff, I won’t bore you with the details. Uncheck both of the options at the end and finish up. Now you’re ready to run HDSDR.


Exploring The Air

This is where we get to finally play with the thing and see what’s out there on the airwaves. On firing up HDSDR, you’ll see something that looks like the image below, you can click to embiggen for a closer look.

 You might get another window too, and a dialogue telling you that something failed to create a USRP connection, that’s normal, click OK to get rid of it. On the window that says ExtIO in the titlebar, there’s a field called “Device hint”, which you’ll need to type “RTL” into, sans quotes. Click “Create” next to it, and it should, hopefully, find your tuner. Don’t worry about anything else on this window yet, everything is fine as it is.

If you didn’t get any windows, try clicking the ExtIO button somewhere in the middle of HDSDR’s main window. If it’s not clickable, something went wrong installing the plugin, you should try again and make sure you’ve got everything in the same folder.

If it’s all gone to plan, you should have a functioning setup. To find out, tune HDSDR to a frequency, let’s say a local radio station. HDSDR can’t actually demodulate broadcast stereo FM (though other applications can, such as WRPlus, requires WinRad to install on top of), but we’ll use it to verify we can see signals, it’s the easiest thing to find because we all know a radio station’s frequency. First of all, let’s tell HDSDR we want to use FM, because that’s the kind of transmission we’re looking for, choose the FM radio button above the tuning numbers in the middle. To tune, click the numbers next to “LO”, this is the local oscillator frequency, it tells the tuner which chunk of spectrum you want to receive. Left click increases each digit, right click decreases. Once you’ve chosen a frequency, click Start in the lower left, and unmute too if it’s muted. You should start to see and hear things happening. To fine tune, you can use the “Tune” frequency. Because we’re getting a lot more RF in through the tuner than we need, the entire width of the received RF in the picture below is 3.2MHz, we can take a look at that entire 3.2MHz block and see where multiple signals exist. That’s a lot easier than tuning up and down the dial blindly, we can tell in advance where stations are within that range. This is especially useful where the signals are close together so many of them appear in the same area, we can jump to them without having to retune the dongle to find them.

If you’ve tuned correctly, you’ll see orange lines moving up the top window, this is a waterfall display. It shows you, over a range of frequencies, what’s going on. If it’s dark or blue, there’s nothing of note there, it’s probably just noise. If it’s green or orange, it’s probably a signal. In our case, a green and orange line means that there’s a radio station there. If there’s several, click around on the display and see what’s there. the brighter it is, the stronger the signal. Since we’re listening to something HDSDR isn’t really built to demodulate, it’ll try its best given the settings you’ve chosen, in this case it’ll try and demodulate it as a narrow-band FM signal. It isn’t one, so it’ll sound garbled or weak, this is because it’s only demodulating a small chunk of the signal which occupies a much larger bandwidth than it’s using to decode it as listenable audio. It’s a clue that we’re heading in the right direction though, it means we can see signals and we can work with them.

So that’s FM broadcast, what else can we do? Well, there are numerous ham radio bands around the world, to find out where you might want to look you should search for radio spectrum allocations in your area. Let’s say for example you find a ham radio frequency or band which is allocated for use for “CW”. This is “constant wave” (morse code) and to use it you would select the “CW” button on HDSDR, likewise for AM signals, choose the AM button and so on. There are many applications which I’ve yet to discover that are designed to demodulate and decode all manner of signals, and a great many of them are free, written by and for the ham radio community. There’s so much out there to receive that I don’t even know where to begin suggesting potential areas of exploration, being quite new to this myself, but with a radio tuner this versatile you can be sure that if it’s out there (and within the huge tuning range of the kit), you can take a look at it.



As I mentioned earlier, there are Linux options here, in the form of GNU Radio and its GUI app, GNU Radio Companion. The libusb library is quite standard on Linux, certainless less exotic than it seems to be on Windows platforms, so that’s easily installed as a standard package from your nearest friendly neighourhood repository. As I mention repositories, I know the Ubuntu repos have almost everything you need to get started, having installed it all on Mint 12 using the standard repositories. The one part you’ll need which isn’t present is the RTL-SDR application, available with instructions and other useful info here at Osmocom’s wiki. This does require compiling, but trust me, it’s easy, if I can do it then just about anybody can. It’s actually a little more flexible in a way, because unlike the Windows option above, you can add support for your own DVB-T stick by adding the appropriate USB PID and VID if nobody has added support for it yet. It’s a little bit more involved to get it set up, but if you wanna play with the nuts and bolts, it’s probably more your style, GNU Radio enables you to essentially build your own radio in software, swapping out parts and displays as you like.

So there we go, a basic intro to incredibly cheap software-defined radio. It’s really up to you how you choose to explore it, but there are the tools to do it with. Happy exploring!


Hama Nano in action


References, greets and thanks:

Osmocom wiki and Osmocom IRC, Freenode #osmocom, especially steve|m and Hoernchen

Balint Seeber and his excellent work on the ExtIO dll

Antti Palosaari for discovering the RTL2832’s I/Q mode

The RTL-SDR subreddit for being awesome and pooling experiences and info


About Author


  1. Pingback: Dongular Expansion | The New Tech

Leave A Reply

Welcome, guest maybe you should register or login