An SDR for $17 – The R820T USB RTL-SDR DVB-T Dongle – Part 2

Earlier, I wrote about the RTL2832U based USB TV tuner dongles that can be turned in an inexpensive Software Defined Radio (SDR). Please take a moment to read that for an overview of these insanely great (for the price) modules, if they’re new to you. I’ve since mounted the dongle in a small metal enclosure:

There were two reasons for this, first to reduce noise pickup, the second was to easily add an F style antenna connector.

Next, I wanted to try getting the rtl-sdr series of command line programs to run. I had tried a set of pre built binaries, but they didn’t work, so I decided to build it myself.

First I got the code from http://cgit.osmocom.org/cgit/rtl-sdr/

I followed the instructions from http://sdr.osmocom.org/trac/wiki/rtl-sdr
cd rtl-sdr/
autoreconf -i
./configure
make
sudo make install
sudo ldconfig

The first problem was after ./configure, namely:
configure: error: Package requirements (libusb-1.0 >= 1.0) were not met:

Turns out I had an ancient version of libusb.
sudo port install libusb
solved that.

With the programs built, the next step was running rtl_test:
$ rtl_test -t
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 Rafael Micro R820T tuner
Supported gain values (29): 0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
No E4000 tuner found, aborting.

So far so good.

Next I tried running rtl_fm, which lets you demodulate a FM signal. AM is supposedly also supported. I say supposedly because I could not get rtl_fm to work properly. It would run, and write demodulated sound data to a file, but playing it back always produced gibberish. Also, the files were way too large for the specified sample rate and length of time the program was running. The documentation for rtl_fm is sketchy, even by open sores standards. For example, the list of options includes:
[-s sample_rate (default: 24k)]

which naturally makes you suspect -s sets the sample rate. It does no such thing, it actually sets the IF bandwidth. Again, supposedly.

After several hours of trying to get rtl_fm to work properly, I threw in the towel, and moved on to rtl_tcp, which acts as a little TCP server, sending I/Q data to a connected client. I had much better luck here. Running the program produced the following:
$ ./rtl_tcp
Found 1 device(s).
Found Rafael Micro R820T tuner
Using ezcap USB 2.0 DVB-T/DAB/FM dongle
Tuned to 100000000 Hz.
listening...
Use the device argument 'rtl_tcp=127.0.0.1:1234' in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ...).

I then connected to it via telnet in another console window:
$ telnet 127.0.0 1234

And the rtl_tcp server program responded with:
client accepted!
and proceeded to send I/Q data to my telnet session, which spewed it to the window. Mission accomplished.

Next I wrote a small program to open a connection to the rtl_tcp server, and grab all the received data, count the number of bytes per second, and display it once per second, as a quick and dirty test to see if everything was working OK. I got around 4M bytes per second, which is correctly for a 2 MHz sample rate (the data is 8 bit I/Q, so there are two bytes per sample).

Having accomplished this, the next step was to make some use of the data. I thought trying to decode and display ADS-B aircraft transponder messages on 1090 MHz would be fun. That is my next post.

24 thoughts on “An SDR for $17 – The R820T USB RTL-SDR DVB-T Dongle – Part 2

  1. Pingback: An SDR for $17 – The R820T USB SDR DVB-T Dongle | HFUnderpants.com

  2. Thanks for the link. The app ran once, although it didn’t seem to function correctly. Subsequent tries to run it resulted in an error that it “Failed to create device: RTL tuner=R820T”

  3. Nice experiment with rdl_tcp. Smells like an iOS app waiting to be written…

    Found the libusb thing too and solved it the same way.

    Then compiled & installed rtl-sdr without issue.

    Tried dump1090, but it threw errors that some symbol that wasn’t found. Spent a small amount of time trying to fix that mess and gave up.

    Discovered that rtl-sdr was in the ports, so installed that. But, it has a billion dependencies, so after all of them were installed, rtl-sdr finally went on.

    Turned back to dump1090 and it compiled with no problem. Was grabbing data with ease.

  4. Soldering the metal mesh of the USB cable to the enclosure where it penetrates the wall will *significantly* improve shielding of the system. 😉

  5. Chris,

    I tested it on both E4K and R820T and in my case it seems to work: I just click on borip_server, the server opens then click on HDSDR and I’m ready to go…
    Have you started (or restarted) the server app first?

    Alain

  6. Restarting the server got it to run, however the waterfall does not look accurate at all. It seems to have aliased signals around the LO frequency.

  7. Have you tried running PowerSDR or PowerSDR/IF software? How about WinRad? These are all free programs. How about SpectraView? If you have not tried these for the PC, maybe you could find time to check them out. I might just order one and try it. It would be nice to know before I get one. I use PowerSDR/IF with an LP-PAN HF Pan adapter connected to an IF out from my Yaesu FT-950.

  8. Pingback: Decoding ADS-B Aircraft Transponders: An SDR for $17 – The R820T USB RTL-SDR DVB-T Dongle – Part 3 | RadioHobbyist.org

  9. Hello Chris,

    Could you tell me please, what is that black wire that is attached to the metal wall?
    Do you know, how to deal with shielded usb cable? I got completely confused after reading from different sources what to do with the shield itself..

    Thank,
    Aydar

  10. So, the ground and the shield are shortcut then? Do you think its possible to have a better photo of that part? I was reading somewhere that the usb shield abd ground should not be soldered together..

  11. Chris, did you remove the mcx antenna connector or just solder the F-type connector to the underside of the board? I was thinking about removing the mcx antenna connector completely. Any thoughts?

  12. The MCX connector is broken on my USB dongle. I would like to put the dongle into a box like you did and solder an F connector in as well. Do you remember the part number and supplier you used for this box? I’d like to order the same one you did if possible.

    Thanks!

  13. hi!

    is there any howto for compile dump1090 on osx ?
    i tried google but found nothing 🙁
    i copy the code by git on my computer, but there is noch make or cmake 🙁
    is there anyone with a little help for me ? 🙂

    many thanks guys !

  14. I tried a prelminary experiment of wrapping the cased device in foil. It got quite warm! Any issues with yours in a die-cast box? I hope not!

    Many thanks.

  15. I ran into the same issues with the compiled binaries. Having issues building my own. Can you or someone else post the compiled binary?

  16. Pingback: Running an RTL SDR USB Dongle On Your Mac The Easy Way With Cocoa RTL Server | RadioHobbyist.org

  17. I would love to see your app that connected to rtl_tcp. I can’t seem to get mine working correctly. Even a link to a decent doc would be nice, since I haven’t been able to find much for that either..

Leave a Reply

Your email address will not be published.


1 × = eight