Let’s Try RTL-SDR! – Part 1

Recently, I received a device that was originally marketed as a USB DAB/DVB/FM receiver, containing a chipset compatible with the utilities from the RTL-SDR project.

It cost £17.50 (roughly €22.42/2159円/US$27.45, according to WolframAlpha) including free shipping from the US.

What’s in the kit?

The receiver that I ordered was supplied with only a remote control, and a stubby antenna with a magnetic base. No CD-ROMs, or user manuals were included.

About the hardware

The eBay listing page claims that it contains an Elonics E4000 tuner IC, and a RealTek RTL2832U DVB-T demodulator IC.

lsusb -v Reports:

Installing RTL-SDR, and associated utilities

Download and run the build-gnuradio script, as recommended by Andrew Back:

At this stage, the script will request elevated privileges, in order to search for prerequisite packages using the system package management utilities.

Since the disclaimer warns that the process may take a long time, I’d recommend obtaining one’s favourite beverage; ensuring that the PC used has a sufficient amount of free disk space, and is well-ventilated (if using a laptop), to prevent it from potentially overheating, and unexpectedly shutting down; and searching for something else to do in the meantime…

For some reason, the Checking for package python-gtk2 step seems to take an unusually long time on my laptop; and temporarily stopping the script yielded:

It seems that despite my best efforts to prepare things in advance, I ran out of disk space at that stage:

Eventually, I resorted to running apt-get clean && apt-get autoclean, and moving some large files to an external disk, in order to free 1.5GB of 9.4GB; and re-ran the script, with more successful results:

It seems that on a 64-bit Ubuntu installation, a full instance of the script’s working directory (containing all source code, and binaries) is about 520MB in size.

Notes on AirProbe installation

For readers wishing to install AirProbe using the instructions on the project’s Website, I recommend running sudo ln -s /usr/local/include/gruel/swig/gruel_common.i /usr/local/include/gnuradio/swig/ && ldconfig, after installing GNURadio, in order to avoid some frustrating bugs in various build scripts related to missing “Gruel”, and “SWIG”-related files.

Testing the result

Since this post is becoming rather long, and I’m unsatisfied with the content that I planned for this section, I’ll follow up with a second post related to testing the software post-installation, soon.

About these ads
Explore posts in the same categories: Everything

Tags: , , , , , , , , , ,

You can comment below, or link to this permanent URL from your own site.

18 Comments on “Let’s Try RTL-SDR! – Part 1”

  1. turtle Says:

    I just wanted to say thanks for the tip on compiling airprobe on backtrack x64. I was having the same issue of airprobe failing to find gruel library files.

  2. simon Says:

    hi,

    great blog – having some issues with compiling airprobe….

    maybe anybody has a solution installed the latest ubuntu:

    gsm.cc:3110:13: error: ‘ptrdiff_t’ does not name a type
    gsm.cc:3147:21: error: expected ‘;’ at end of member declaration
    gsm.cc:3147:39: error: expected ‘)’ before ‘n’
    gsm.cc:3162:34: error: declaration of ‘operator+=’ as non-function
    gsm.cc:3162:30: error: expected ‘;’ at end of member declaration
    gsm.cc:3162:44: error: expected ‘)’ before ‘n’
    gsm.cc:3167:34: error: declaration of ‘operator-=’ as non-function
    gsm.cc:3167:30: error: expected ‘;’ at end of member declaration
    gsm.cc:3167:44: error: expected ‘)’ before ‘n’
    gsm.cc:3172:33: error: declaration of ‘operator+’ as non-function
    gsm.cc:3172:30: error: expected ‘;’ at end of member declaration
    gsm.cc:3172:43: error: expected ‘)’ before ‘n’
    gsm.cc:3177:33: error: declaration of ‘operator-‘ as non-function
    gsm.cc:3177:30: error: expected ‘;’ at end of member declaration
    gsm.cc:3177:43: error: expected ‘)’ before ‘n’
    gsm.cc:3182:5: error: ‘ptrdiff_t’ does not name a type
    gsm.cc:3550:15: error: ‘swig::check_index’ declared as an ‘inline’ variable
    gsm.cc:3550:15: error: ‘ptrdiff_t’ was not declared in this scope
    gsm.cc:3550:15: note: suggested alternatives:
    /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
    /usr/include/c++/4.6/i686-linux-gnu/./bits/c++config.h:156:28: note: ‘std::ptrdiff_t’
    gsm.cc:3550:35: error: expected primary-expression before ‘size’
    gsm.cc:3550:41: error: expected primary-expression before ‘bool’
    gsm.cc:3550:60: error: expression list treated as compound expression in initializer [-fpermissive]
    gsm.cc:3550:62: error: expected ‘,’ or ‘;’ before ‘{‘ token
    In file included from /usr/include/boost/detail/sp_typeinfo.hpp:109:0,
    from /usr/include/boost/smart_ptr/detail/sp_counted_base_gcc_x86.hpp:27,
    from /usr/include/boost/smart_ptr/detail/sp_counted_base.hpp:36,
    from /usr/include/boost/smart_ptr/detail/shared_count.hpp:29,
    from /usr/include/boost/smart_ptr/shared_ptr.hpp:32,
    from /usr/include/boost/shared_ptr.hpp:17,
    from /usr/local/include/gnuradio/gr_types.h:27,
    from /usr/local/include/gnuradio/gr_runtime_types.h:27,
    from /usr/local/include/gnuradio/gr_basic_block.h:27,
    from /usr/local/include/gnuradio/gr_block.h:27,
    from gsm_receiver_cf.h:27,
    from gsm.cc:4101:
    /usr/include/c++/4.6/typeinfo:42:37: error: expected ‘}’ before end of line
    /usr/include/c++/4.6/typeinfo:42:37: error: expected declaration before end of line

  3. Willem Says:

    Hey,

    We run into troubles when installing airprobe on backtrack.
    Installing gnuradio worked fine.
    The symlinks were indeed necessary to fix gruel_common.i errors.

    But with the symlinks, we get new errors.
    gsm.cc (generated by swig) contains uses of SWIG_exception, but “make” tells us the exception “is not defined in this scope”.

    Is there anything we are missing here?

    • Tyson Key Says:

      Hi,

      I’m unfamiliar with BackTrack, and I’m away from home without my laptop, right now – so I can’t do much to test things. With that in mind, are you attempting to build the version of AirProbe at the GNUMonks site?

      Unfortunately, my recollection of all of the steps involved in building AirProbe is hazy – although I’m sure that some components failed to build, but were generally unnecessary for operation with RTL-SDR devices.

      I hope that helps, for the time being.

      Tyson.

      • Willem Says:

        Hey,

        Thank you for your quick reply.

        No we tried to build airprobe from the ccc.de site.
        The error is in the gsm-tvoid component of airprobe.
        For an assignment at the university, we need to sniff gms traffic.
        I have no idea if we actually need the tvoid component.
        We’ll see how far we get without it.

        Thanks again for your help :).

        Willem

      • Tyson Key Says:

        No worries, Willem. I suggested using the GNUMonks version of it – since the code in the repository seemed to have been the newest, at the time, as far as RTL-SDR support was concerned. (Some scripts were missing from other versions).

        If I remember correctly, the situation for each source module directory was:

        • “A5.1″ – contents of the “C” directory are probably used by other modules; but there’s no Makefile
        • “gsm-receiver” – should build successfully using the included Makefile, once GNURadio, and some other bits are installed
        • “gsm-tvoid” – couldn’t make this build using the Makefile; but it probably doesn’t hurt to have a semi-built version floating around
        • “gsmdecode” – probably a good idea to try and build/install this; needs AutoTools + Make files generating manually; can’t remember if it completely builds without errors/warnings
        • “gsmsp” – building it is worth a try; but again, I can’t remember the outcome
        • “gsmstack” – no Makefile; contents integrated into other Makefiles, for other modules
        • “gssm” – USRP-specific; probably builds – but useless with RTL-SDR devices
        • “viterbi-detector” – No Makefile; probably integrated into the build process of other components
        • “viterbi_generator” – Probably worth trying to build this – but it doesn’t really do much by itself

        I hope that summary helps.

        I’ll probably reboot into Ubuntu later, have a look at the state of my last build attempt, and report back, though. I don’t know if there’s a recommended order for installation – but I’m sure that rebuilding each in a bruteforce manner would probably “work”…

      • wburgers Says:

        Hey Tyson,

        Thanks for your explanation.
        Compiling gsm-receiver works fine.
        I’ve read somewhere that the tvoid part of airprobe is much like like the receiver, but it does not work, so we went on with the receiver.
        Running it still gives us problems though.
        When we try to capture traffic with the URSP from our university, by running capture.sh, it complains about being unable to find usrp_rx_cfile. It should be installed with gnuradio, but it isn’t.
        We got our hands on an RTL-SDR last friday, so now we tried to run gsm_receiver_rtl.py from the gsm-receiver software collection.
        This works and we get nice graphics. Output to file does not work however.

        Do you know how to really capture the traffic to an analyzable file?

        Thanks for your help!

        Regards,
        Willem

      • Tyson Key Says:

        Hi Willem,

        The AirProbe tools don’t actually produce a trace file. Instead, they output data using a broadcast UDP socket that just “throws data into the wind”, containing GSM packets with “GSMTap” encapsulation, which can be captured from the loopback interface (or the “any” pseudo-interface in Wireshark).

        I hope that helps,

        Tyson.

      • Tyson Key Says:

        PS – I’ll admit that I was also very confused by the behaviour of it, since some (encrypted?) traffic isn’t even forwarded on via the UDP interface; and things like uplink traffic, and GPRS packets are not supported by that version of the AirProbe tools.

  4. Muhammad Farrukh Says:

    Hey Wuburger,
    You need to install the old version of gnuradio which contains usrp_rx_cfile I would suggest gnuradio 3.4.2 without UHD, If you have it installed then locate usrp_rx_cfile default location on ubuntu is /usr/local/bin, could be changed in backtrack and then copy this file path to capture.sh, then it will work fine!

    • wburgers Says:

      We indeed used an older version of gnuradio for the capture script to finally work.
      In the end I just installed the gnuradio via the packet manager.

      Though we were able to get the capture script working, we were not able to capture any data. We don’t exactly know why the capture files stay empty. This could be because our USRP did not have a modified clock.

      Thank you for your reply. I hope this topic will help others!

  5. tibillys Says:

    hi wburgers i have almost the same project for my universite . Did you managed to capture gsm traffic ?

    • wburgers Says:

      Hi Tibillys,

      Unfortunately I have to tell you that we were not able to capture any gsm traffic.
      As you can see in my reply above, we were able to get the capture script working for our USRP. But the resulting file had no gsm packets in it.
      For the RTL-SDR, we gave up after we found out that the capture_rtl.sh script was bugged, because it did not put any data in the output file we specified. So to be clear, the script created a file, but it was 0 bytes big…

      I hope this topic will help people get it working! :-)
      Regards, Willem

  6. sasvari peter Says:

    helló!

    can help?

  7. Fahad Says:

    Hi,

    I want to ask about your Airprobe-GPRS code, that is available on github. Can the code be used with USRP? My aim is to capture and decode the uplink traffic using USRP. IF the code cannot be directly applied to USRP, what changes do I need to make in order to make it work.

    Thank you,
    Fahad.

    • Tyson Key Says:

      Hi Farad,

      That code is an experimental mess that I created by trying to merge two divergent versions of the AirProbe codebase together (the mainline one supporting RTL-SDR devices, and a third-party one based upon an older SCM revision that didn’t support RTL-SDR devices, but was patched to support GPRS capturing).

      It was made by copying both repositories, finding their divergence points, and then manually grafting patches from the GPRS repository back onto mainline.

      To be honest, although I’m able to compile it (with some work), it doesn’t actually work at all with my device (no waterfall is displayed in the GNURadio Companion); and I can’t afford a USRP, so I haven’t been able to test it.

      I believe that the original version of the AirProbe GPRS code would have supported USRP devices, though.

      Sorry about that,

      Tyson.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

%d bloggers like this: