RTLSDR Scanner

Screenshot 1

Last year while developing Linux drivers for digital TV, Antti Palosaar noticed a hidden debug mode, which allowed you to sample relatively large chunks of radio spectrum.  Thanks to this the RTL-SDR library was born and Software Defined Radio was available on the cheap, after all these dongles tend to cost less than £20.

A little while ago I uploaded my contribution to this, a GUI called RTLSDR Scanner, to GitHub.

The software scans a range of frequencies and plots the result, allowing you to find signals to investigate.  The RTL dongle has a maximum bandwith of about 2.8MHz but with this you can scan the full range of the dongle, allowing you to see signals with ease.  For example the screen capture shows my local FM radio stations.

Once you've installed the RTL-SDR library the dependencies are a little more involved.  On Ubuntu 12 installing them is straight forward using the Software Centre, Windows is trickier and although I've had reports of it working on OSX I haven't had the chance to try it.

Each of these dongles is based around the  RTL-SDR library chipset which interfaces the computer via USB to a tuner chip.  Several tuners are available, I've tried a FC0012 and E4000, the latter was recommened but is now hard to find so the Rafael Micro R820T is the one to look for.  Details of compatible dongles are listed on this page.

Comments

Hi, rtlsdr-scanner looks like great software and I've been following your progress for a while. Unfortunately, most likely due to ignorance on my end, I can't get it to run. Does the error message shown in http://pastebin.com/GH9sEpN7 suggests any fixable problem to you? The software GUI pops up fine. But as soon as I start the scan that error appears and the GUI stops accepting input. This is on Ubuntu 10.04.

Hi, from the error it looks like it can't find your dongle. From a terminal prompt try running:
$~ rtl_test
With my E4000 device I get:

Found 1 device(s):
0: ezcap USB 2.0 DVB-T/DAB/FM dongle

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0
Reading samples in async mode...

If you get a 'No supported devices found' this page is a good start for installing the library (look under 'Building the software')

Hopefully the next commit will have better error checking.

Al

In between attempts to get RTLSDR Scanner working I was able to use other rtlsdr programs, including a couple that also use the pyrtlsdr wrapper. I'll keep messing around with the latest from git (I see you added the error handling for no dongle) to see if I can narrow it down.

Any chance you could run this Python script and post the results?

import rtlsdr

count = rtlsdr.librtlsdr.rtlsdr_get_device_count();
print count

for dev in range(0, count):
print dev, ": ", rtlsdr.librtlsdr.rtlsdr_get_device_name(dev)

Thanks, in the meantime I'll keep hunting.

1
0 : ezcap USB 2.0 DVB-T/DAB/FM dongle

Thanks. A pull of the latest revision, with the env stuff, works in the sense of the dongle being initialized and samples read and that's good enough to begin playing with. The plot isn't actually plotted visually; something related to the formating of the x,y pairs for matplotlib. I suspect is due to Ubuntu 10.04 having old python and packages. http://pastebin.com/MBb1NB1L .

It's a python 2.6 thing. I fixed it by setting the format stuff explicitly like in line 1016,

axes.set_title("Frequency Scan\n{0} - {1} MHz".format(self.settings.start,
# axes.set_title("Frequency Scan\n{} - {} MHz".format(self.settings.start,
self.settings.stop))

and line 550,

text = "f = {0:.3f}MHz, p = {1:.2f}dB".format(xpos, ypos)
# text = "f = {:.3f}MHz, p = {:.2f}dB".format(xpos, ypos)

I don't understand how I'd do this via github so, "diff -u rtlsdr_scan_old.py rtlsdr_scan.py > python26.patch", http://pastebin.com/rC2YN2n5 .

Don't worry it's not spam, its very useful.
Thanks for the patch, I've just committed it.

Al

I'm completely ignorant of Python, but I downloaded the dependencies and installed them after installing Python 2.7 (for wxPython) and 3.3 (for all the others). If I run your script, a command Window opens and closes fast, but seems to be complaining about modules. I am using Win7 x64, and have one of the Newsky DVB dongles which works well with SDR# for example.

I recommend you try running it in a command window (Start->Programs->Accessories->Command Prompt), you'll be able to see the errors then. I'm a bit concerned that you're using two different Python versions, I'd stick with just 2.7, having 2 versions could cause all sorts or problems.

OK, thanks, I re-did everything I could find in 2.7. After adding Python27 to the PATH env var, I was also able to run the rtlsdr_scan.py script in a command window. Found a few missing dependencies, but then ran into this:

File "C:\RTLSDR-Scanner-master\src\rtlsdr_scan.py", line 39, in
import rtlsdr
ImportError: No module named rtlsdr

I had already downloaded the pre-built libraries for Windows, but this error message seems to indicate that I should have installed a Python module as I did with numpy or matplotlib, but I don't know Python like I know C, C++ and C#. Am I missing something or is this more of a configuration error?

Russ

Hi Russ,
Did you download and install pyrtlsdr? After downloading you'll need to run python setup.py install from what I remember.

I'll post a tutorial soon(ish) as installation is a bit tricky for Windows users.

Al

I made some more progress. Attempting to run setup.py, I discovered I needed setuptools and then distribute. Then I discovered I needed a PATH to C:\Python27\Lib\site-packages\rtlsdr-dev-py2.7.egg\rtlsdr\ so librtlsdr.py could be found. After this step, I still received this:

C:\RTLSDR-Scanner-master\src>python rtlsdr_scan.py
Traceback (most recent call last):
File "rtlsdr_scan.py", line 39, in
import rtlsdr
File "c:\Python27\lib\site-packages\rtlsdr-dev-py2.7.egg\rtlsdr\__init__.py",
line 18, in
from librtlsdr import librtlsdr
File "c:\Python27\lib\site-packages\rtlsdr-dev-py2.7.egg\rtlsdr\librtlsdr.py",
line 41, in
librtlsdr = load_librtlsdr()
File "c:\Python27\lib\site-packages\rtlsdr-dev-py2.7.egg\rtlsdr\librtlsdr.py",
line 36, in load_librtlsdr
raise ImportError('Error loading librtlsdr. Make sure librtlsdr '\
ImportError: Error loading librtlsdr. Make sure librtlsdr (and all of its depend
encies) are in your path

Is the RTLSDR library in your path (it should point to the location of rtlsdr.dll)?

Man, that rocks!

Obviously your last point worked. Thanks and nice work.

Glad to hear that matey, enjoy!

Super software, congratulation!It works perfectly!
One question: I want to compare two graphs (for example, to verify ratio front-rear antenna) and It would be more comfortable with fixed y-axis values...How can it do this?

Hello, glad you like the software, currently you can't set the scale but I'll look into adding this feature.

I've updated the code at GitHub which allows you to set the Y limits. There is a new button on the toolbar for this.

it's fantastic! many thanks!

Click to add a comment