RTLSDR Scanner

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Screenshot 6

GitHub

GPL

A cross platform Python frequency scanning GUI for USB TV dongles, using the OsmoSDR rtl-sdr library.

In other words a cheap, simple Spectrum Analyser.

The scanner attempts to overcome the tuner's frequency response by averaging scans from both the positive and negative frequency offsets of the baseband data.

Tested on:

  • Windows 7 (x86 and x64) and XP
  • Ubuntu 12.04 (x86), 12.10 (x64) and 13.04 (x64)
  • OS X Snow Leopard (10.6) and Mountain Lion (10.8)

Download

Download the Windows installer from Sourceforge.

Download the latest source from GitHub.

Installation

Installation instructions are here.

The following dependencies are needed:

Linux and Mac users will need to manually install these,  Windows users can use the installer.

Manual

A basic manual is available in Portable Document Format.

Quick start

Run 'rtlsdr_scan.py'.

To start a scan simple enter the range at the bottom of the window and click 'Start', after a while a plot of signal strengths should be displayed.

'Dwell' controls how long each step is sampled for, longer times will result in more averaging of the signal.

'Continuous update' updates the display on each step. Caution only use this with small scans and low dwell times, otherwise it will become unresponsive.

'Grid' displays a grid on the scan plot.

Auto Calibration

Scans around the frequency specified for the strongest signal and then calculates the error correction of the dongle.

To get the best out of it you really need a continuous signal peak that stands out from the background noise.  If you live near an airport RADAR signals are great for this. Mobile phone signals also work well but you need to know the channel frequencies, making it tricky.  I have had some luck with commercial FM radio but you'll have to set the dwell time to the highest setting to get a usable offset.

Main Window

  • Start - Scan start frequency
  • Stop - Scan stop frequency
  • Mode - Sing or continuous scanning
  • Dwell - Sampling time spent on each step
  • FFT Size - FFT size, greater values result in higher analysis precision (with higher sizes dwell should be increased)
  • Live update - Update the display on each step (caution this can be slow and unpredictable)
  • Grid - Show a grid on the scan
  • Display - Change the plot type

File Menu

  • Open... - Open a saved scan
  • Save As... - Save a scan
  • Export... - Export a scan to a CSV file
  • Properties ... - Scan information

Edit Menu

  • Preferences - Set dongle gain, calibration, Local Oscillator (positive offset for upconverters) and sample bands (see below)

Scan Menu

  • Start - Start a scan
  • Stop - Stop the scan
  • Stop at end - Stop the scan when the current sweep is finished (only in continuous mode)

Tools Menu

  • Compare - Compare two previously saved scans
  • Auto Calibration - Perform a crude calibration of the dongle to a known signal (this should be a continuous, unwavering signal)

Tweaking

Dongles will differ depending on the tuner and circuit that's used, the software allows you to pick the best range that is sampled to give improved results.

Click on View -> Preferences and select the 'Band Offset' for you tuner, next detach the aerial or even better terminate it with a 50 ohm load.  Now click refresh to show the noise floor of the tuner, adjust the offset so the marked bands overlay the flattest areas of the plot and click OK.

I find the following offsets work well (click the offsets for images):

Tuner Offset (kHz)
Elonics E4000 250
Fitipower FC0012 140
Rafael Micro R820T 100

Note the large peak in the middle, this is at 0Hz (i.e. its the DC offset).  On the R820T it is much narrower, this is because it uses an intermediate frequency away from the low frequencies.  In this case the resulting spike is due to the sample length not being infinitely long (imagine taking a complete cycle of a sine wave then chopping the end off, this leaves it unbalanced and its average value is no longer 0, in other words it looks like it has a DC offset), the sample is windowed to reduce this but it's a trade-off between accuracy and frequency response.

Troubleshooting

Run 'rtlsdr_scan_diag.py', this test if the correct modules are installed.

Categories:

Comments

hello,

i really like this software, and would love to use it. unfortunatly, i cant figure out how to instal/ open it. can anyone help me with this?
thanks in advance!

kind regards vincent

Al's picture

Hello, I've posted some installation notes here to help with the installation.

If you need any more help just ask.

hello,

i followed all the steps, but when i open rtlsdr_scan.py only short time a cmd window pops up, nothing else happens...

vincent

Al's picture

Hi,

Can you run rtlsdr_scan_diag.py and post the results please?

Thank you for your work. Your aplication runs perfectly on my windows 7 32bit. Only one thing, in the installation instructions link at the windows instructions after:
In the same way download pyrtlsdr and extract it, then run the command setup.py from the extracted folder.
I think there should be a link pointing RTLSDR-Scanner package, because the next instruction is run rtlsdr_scan.py

thank you 73's

Al's picture

Thanks for the feedback, everything helps!
I've updated the installation instructions to make things clearer.

Any chance to get an already compiled .exe for Windows?
No chance for me to do such monster install process.
Thanks.

Al's picture

Hi Bill,

I've put up some binaries on SourceForge, let me know if you have any luck.

Hi Al,

i tested it under Win7/32 and it works great, thanks a lot!

Just one question:
"Dwell"-setting: no matter if i set at 25ms or 1s, a DVB-T channel looks the same, no "enveloping" by rising the sweep (?) time ?!? Rising Dwell-time lowers base noise as expected.

Would it also be possible, painting the line live like a SA does? That would give the chance, stopping the measurement early when you see that e.g. the gain setting is not optimal.

If it is possible, i want to use it for comparing filter and amplifiers (TV-equipment) in a cheap (but slow...) way.

Al's picture

Hi Bill,
DVB-T has a high spectral density so I'm not sure that you'd see that much difference with increased dwell times. It's more useful on FM where a higher dwell will allow you to see the wider response of a signal.

If you click on 'Continuous Update' the graph will be updated with each sub-scan but this can really slow down your machine on large scans due to the amount of points plotted, I hope to fix this problem soon

That *32-bit.exe file required a Python package (?) named 'mulitarray'.!! Never heard of it and neither did pip.exe. So I simply ran
'python rtlsdr_scan.py' and it worked well but slow.

Al's picture

Hi Gisle, I'll have to admit I have no idea why you got that error but I'll try and track it down.

The scan will be slow, on older machines this isn't helped by the amount of number crunching that is required.

The overall speed is limited by the bandwidth of the dongle, the program effectively samples a 500kHz wide block for the dwell time before moving to the block.  Although it's possible to sample a 2.8MHz bandwidth the frequency response of the dongle tuners does limit this in practice (especially if they have a large DC offset).

Al

I just need to say thank you very much for this RTL-SDR scanner, this become the parts of my RF bench tool since i wondering for years about have an real RF spectrum analyzer. i has used extensively since i get done with the tunings. I would always watch in here to know what updates. Great jobs!

Al's picture

Thanks Rudik, great to hear that you're finding it so useful. If you have any ideas for features you would like so see please let me know.

Hello Alan,
Yesterday I installed your RTLSDR-Scanner software on Windows7 64 bits. It works perfectly with the key RC HD Cinergy without GNU. Thanks for a wonderful and clever program compiled for Windows. I am a ham radio happy and this tool is useful to search for issuance in the VHF and UHF 144 MHz to 432 MHz. It lacks only one thing to find the equivalent of a spectrum analyzer: namely, the continuous scanning without a stop after the first scan. Would it be possible to add this to a typical RF analyzer functionality?. In conjunction with this option you can consider if it is possible remanence of the spectrum with a refresh every 1, 2, 3, and 10 scans v "never" to an accumulation peaks on a very long time. What do you think? To me this mode is very important. Thank you again for your great work of research applications RYLSDR stick. Good luck. Cordially Pascal f1mij

Al's picture

Hi Pascal,
This is a feature that I want to add at some point, hopefully I'll have time to implement it soon.

Hello Al
Thank you your answer. I'm looking forward to testing the Continuous sweep mode. The single sweep mode works perfectly with the RC HD Cinergy stick. A soon the pleasure of reading you, Pascal

Dear Alan,
Another quick note to throw some ideas for improvement on this already great before I forget ... but these remarks are called for a constructive purpose and not anything imperative. To see if it would be possible to add a vertical line marker in the stop mode to better locate the frequency or maybe a cross on the blue line of the spectrum. The frequency and the cursor would be visible at the top of the window ... would be better if the text just above the spectrum peak examines the place. Very good for the scan range at the bottom with the start frequency and stop frequency ... However, you may also provide input to the center frequency and span of bandwidth for research: this method may be faster for the user. It would be really nice to have the adjustment of the gain in the low spectrum under the direct access without going through the menu. Another idea would be to put four windows side by side to see for example the occupation of four frequency ranges at the same time with a single key ... course of the scanning would be a window to another in a cyclic manner without stop with a tidal of the screen at each scanning ... Window 1 Window 2 Window 3 Window 4 Window 1, etc ...
That is all for now. Excellent work and soon to test a new Windows version, 73's of F1MIJ

Al's picture

Hello again,
Unfortunately adding lines to the plot causes a complete re-draw of the graph which slows things down massively. I'll try and code an overlay sometime so I can implement features like this.
I'll add centre frequency/bandwidth and gain controls to the toolbar soon.
I like the idea of separate windows for different ranges. For the moment if you have more than one dongle you could start the scanner multiple times, once for each dongle.

HELLO ALAN
I HAVE MANY SPEAK YOUR SOFTWARE WITH FRIENDS AND OTHER APPLICATIONS OF SPOILER WAS REFERRED TO: THAT OF AN OPTION TO OFFSET FREQUENCY FOR BAR X BOTTOM TO ALLOW THE USE OF A CONVERTER HF OR BY MY SHF FRIENDS HANDY. GOOD TO YOU, PASCAL

Al's picture

Hi Pascal,
You can set the converter offset in the 'Preferences' window, it's under 'LO' short for Local Oscillator.
Glad you're liking the software, thanks.

It is noted for the adjustment of the offset. Thank you for the info because I did not see this parameter in the preference menu: This will be very useful to me for scanning frequencies of bases with my converter HF 0-30 MHz and also high frequencies Sat LNB with 10 Ghz. Best regards, Pascal

Hello, Very good job. The program works very well on Window 7. It lacks the scanning and continuous scanning mode "Look and Listen" for listening to FM demodulated signal on the position of the mouse in the spectral window.
Sincere greetings. Jarold

I love this program. The RTLSDR Scanner Windows Version 6 4 bits is 100% ok. Can there be a button to resume scanning automatically after each measurement? A permanent udapte of scanning would be nice without the popup to save the trace each scan. Thanks, f1zbe

Al's picture

Hi Pascal,

I've added continuous scanning, the binaries can be found on SourceForge, I'm having trouble with the Win64 binaries but the 32bit is exactly the same.  Please note it requires the 32bit rtlsdr libraries otherwise you'll get a not found error.

Hi, would it be possible to run the scanner and use a remote rtl_tcp device ?

TnX,

Ben

Al's picture

Hi Ben,

Currently this is not possible but after I've added a continuous scanning feature I hope to add this.

hello, can you tell me if I can recommend your software to a friend in Paris who uses a FUNcube pro? Is it consistent? Thank you in advance for answer and still have my congratulations for your development. Regards, Pascal

Al's picture

Hi Pascal,
There's no support for the FUNcube as I don't have one...
Al

Al's picture

Hi All,

I've added continuous scanning, the binaries can be found on SourceForge, I'm having trouble with the Win64 binaries but the 32bit is exactly the same.  Please note it requires the 32bit rtlsdr libraries otherwise you'll get a not found error.

Thank you for the superb program continuously scan. It works perfectly on my laptop W7 64 bit. It lacks the display frequency peaks in the continuous scan mode. Congratulations for the work done and your program asks only be known. Greetings Rotarian. Pascal F1mij ... user very satisfied!

I've been using this for a couple weeks now, i find it extra useful to testing antenna / noise / grounding setups and doing cross band comparisons.

two features that are missing

One is a non-interactive / headless mode whee someone can initiate a scan with out a gui, this would be useful for scheduling scans to run when your not around.

The 2nd is the option of a non-memory resident storage of the spectrum data during scans,
I like to run may of stuff Rtlsdr-Scanner on small "embedable" platforms ( such as the Raspberry Pi or Alix 3d2 ) that I temporarily install remotely (like a roof top) and access remotely.
Unfortunately I run out of memory if I do anything more then then small scan.

have you looked into using using something like the Shelve module for a db backed dictionary ? looking though the code major problem would be floats being used as keys.

Al's picture

Hi Peter,

Thanks for the comments.

Expanding the command line interface is on the to-do list and should be available soon.

The program uses quite a bit of memory, reducing the frequency range and reducing the dwell will help but this isn't a proper solution.  Unfortunately using a database backend massively reduces the speed.  I'll keep looking for a solution to this.

Al

 

Hi Al and Bravo!! I bothered to test very quickly this new version of the night of September 20, 2013 ... He I am pleasantly surprised! It works really well! scanning stops well and the pad with the memory trace is very nice. It will be very convenient to search for RF sources. You work really well and very hard for us to build a good program for spectral analysis of the listening VHF / UHF: Congratulations. I really like the Fade and combined with the previous live update function! not bad. Good luck to you and Great Job. I adopt this new version. Cordially Pascal F1MIJ

Al, thank you for writing this very useful program. I am an audio engineer and your application has been very useful as I travel from studio to studio. It gives a very informative snapshot of the RF landscape. It has made the task of finding clear frequencies much faster. Thank you big time for your time and efforts. Regards, Rick.

Al's picture

Thanks Rick, I'm glad you find it useful.

Hi Al
I followed your Ubuntu instructions and got this working on the Raspberry Pi (already had numpy and rtl-sdr libraries installed) - thank you.
However, I can only get the waterfall demo working - lovely display and the controls work nicely.
If I run test.py, the program doesn't get to the plotting part, but no errors are reported - I stopped it with z after waiting for a while - this is the terminal output:
pi@raspberrypi ~/pyrtlsdr $ python test.py
Found Elonics E4000 tuner
Configuring SDR...
sample rate: 2.400000 MHz
center frequency 100.000000 MHz
gain: 9 dB
Reading samples...
signal mean: (-0.00154140696806-0.000662321202895j)
Testing callback...
in callback
signal mean: (-0.000668065688189-0.000628632190181j)
in callback
signal mean: (-0.00067491718367-0.000640210918352j)
^Z

Any help welcome
Tony
[1]+ Stopped python test.py

Al's picture

Hi Tony,

Unfortunately I don't have a Raspberry Pi to test this out on, my suspicion is a lack of memory, but I can't be sure.

As the rtlsdr library is already installed an alternative is to run rtl_tcp on the Pi:

rtl_tcp -a <ip address>

Just substitute <ip address> for the Pi's address (you can use 'ifconfig' to find this).

On another machine run the scanner and under 'View -> Preferences' enter the address and then you can then connect to the PI remotely.

Hi Al

Thanks for the reply. However, I was also being a bit stupid - I hadn't yet downloaded your full scanner software. I have now done that with git clone git://github.com/EarToEarOak/RTLSDR-Scanner.git
In the src files I found rtlsdr_scan_diag.py which reports no library problems.
Then from the same src directory (RTLSDR-Scanner/src) I ran python rtlsdr_scan.py but get warnings and error messages:

"/usr/lib/pymodules/python2.7/matplotlib/__init__.py:923: UserWarning: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
/usr/lib/pymodules/python2.7/matplotlib/__init__.py:923: UserWarning: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
if warn: warnings.warn(_use_error_msg)
RTLSDR Scanner
Detached kernel driver
Found Elonics E4000 tuner
Traceback (most recent call last):
File "rtlsdr_scan.py", line 84, in
FrameMain("RTLSDR Scanner", pool)
File "/home/pi/RTLSDR-Scanner/src/main_window.py", line 128, in __init__
self.devices = get_devices(self.settings.devices)
File "/home/pi/RTLSDR-Scanner/src/devices.py", line 69, in get_devices
device.gains = sdr.valid_gains_db
AttributeError: 'RtlSdr' object has no attribute 'valid_gains_db'
Reattaching kernel driver failed!
AttributeError: 'RtlSdr' object has no attribute 'valid_gains_db'
Reattaching kernel driver failed!"

Now, I dont know whether I should be doing some sort of install, but I realise this code was probably a multi-platform installer, and not fully relevant to linux. Seems python is finding things correctly, and as I posted previously, the waterfall code in the pyrtlsdr directory works.
I'm sorry if I am not fully understanding what to do - I realise you have been making it all as easy as possible for a variety of users. It would be nice to be able to turn the Raspberry Pi into a cheap spectrum analyser, so I hope it's got enough power.

best regards
Tony

Al's picture

Hi Tony,

Don't worry about the 'UserWarning', some Linux distributions use an outdated matplotlib but it won't cause any problems.
The second error is because pyrtlsdr has been updated and the scanner now uses these new functions.

If you still have the directory where you unzipped pyrtlsdr to you can run:

git pull

to update the code, then run:

setup.py install

as show in the instructions.

Hi Al
Thank you for the update - I did the pull (note - also I need to use "sudo python setup.py install" - so I guess my python isn't set up fully)
I ran ~/RTLSDR-Scanner/src $ ./rtlsdr_scan.py from a terminal window on the LXDE desktop screen - got the window up and started a scan, but got an error at first which looks like it was related to Pi resources (threading - cant show it you now). So I tried shutting down LXDE and running from SSH - fantastic - got lovely display on my Macbook. Then tried desktop again and it worked. Well done - the display is beautiful! Have achieved what I wanted - a low cost spectrum analyser with the Pi.
Just need to speed it all up a bit - I guess that needs experiments with FFT width and dwell times.
Thanks again
Tony

Al's picture

Hi,

Glad to hear you got it working.  Not sure what the threading error was but when I get time I'll try it on the Pi.

The scan will speed up if you reduce the dwell and FFTvalues, but it's a shame to reduce them much below the defaults.  The scanner spends most of it's time performing Fast Fourier Transforms, on desktop systems each FFT is performed on a sperate core but as the Pi has only one processor only one process is run at a time.

The other option with a Pi is to use it as a remote server with the dongle, you can then stream data to another machine.  Start the server on the Pi using:

rtl_tcl -a <ip address of the Pi>

Hey excellent software.So i run the installer, and then? I have to connect my tuner to receive? So simply?
It would be great if you can create a GNU radio windows installer. I tried 2 times to install, but i had difficulties.

Thanks

Al's picture

Hi Takis,

You can download a Live DVD of GNU Radio using a BitTorrent client (µTorrent worked for me).
Either create a DVD from the image and boot your computer from this, or try it in a virtual machine (VirtualBox for example), although this is more complex.

 

Thank you Al, that's great!!!! The Linux system identify automatically the usb tuner?

Al's picture

Once you've installed the driver the dongles should be recognised automatically. There are some instructions for Ubuntu on this page.

Thank you for the great software.
Unfortunately, I have met the following Xwindow errors just after completion of scan.
The GUI is gone then.
(After running rtlsdr_scan.py, GUI screen comes and click start button can start scanning.)

"rtlsdr_scan_diag.py" works fine and "pyrtlsdr/test.py" describes good figure.

I would really appreciate any suggestions. Tks. Ark from Japan
----------------------------------Console---------------------------------------------------
~/work/sdr/RTLSDR-Scanner/src$ python rtlsdr_scan.py

RTLSDR Scanner

Found Rafael Micro R820T tuner
Found Rafael Micro R820T tuner
Found Rafael Micro R820T tuner
Exact sample rate is: 2000000.052982 Hz

The program 'python' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadPixmap (invalid Pixmap parameter)'.
(Details: serial 12883 error_code 4 request_code 54 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
------------------------------------------------------------------------------------------------------
There are different errors from time to time such as
The error was 'BadRequest (invalid request code or no such operation)'.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.

Al's picture

Hi Ark,

Unfortunately Ubuntu uses an old version of matplotlib (1.1.1~rc1) which causes this bug with certain graphics cards.

The only solution is to uninstall the Ubuntu version and install an up to date version from the matplotlib website (currently version 1.3.1).
On Ubuntu the installation is fairly simple, there are some instructions here, which I followed.  Please note that you should uninstall the previous version first by running:

sudo apt-get remove matplotlib

Hello AI,
Thank you very much for your kind feedback.
I have installed the latest matplotlib, but it did not improve the error.....
I did not have enough time today and I will try again later.
Ark

Pages

Click to add a comment