Remote SDR using Raspberry Pi & RTL_TCP

Over the weekend I had some time to try and see if I could get the cheap DVB-T usb dongle to work as a remote SDR using the Raspberry Pi as the server, using the tools from RTL-SDR it really isn’t that hard. On the Raspberry Pi I was using the latest version of Raspbain and also had turbo mode switched on.

You’ll need to install git which is simple “sudo apt-get install git” then clone the source code repo using the information from the RTL-SDR website. Before building RTL-SDR you need to install a few packages to make it work by doing “sudo apt-get install cmake, pkg-config, libusb-1.0″ then follow the build steps

  • cd rtl-sdr/
  • mkdir build
  • cd build
  • cmake ../ -DINSTALL_UDEV_RULES=ON
  • make
  • sudo make install
  • sudo ldconfig

Once its completed and you’ve restarted the Raspberry Pi if you do “rtl_tcp -a 192.168.1.88″ the IP address should be the one assigned to your Raspberry Pi so you’ll probably need to change it!  as long as you get no errors your now ready to connect to the RTL_TCP server from another application I’m going to use SDR# but they are other applications available for Linux.

SDR# is easy to use I’d recommend you download the nightly build as it has all the latest features, then its just a matter of selecting RTL-SDR / TCP and filling out the IP information to match the Raspberry Pi and clicking Play! you can now use SDR# normally.

SDR# Screenshot

Between my Desktop and Laptop I’ve been listening a lot to broadcast FM (mostly Radio 1) and Airband for Oxford London Airport and Heathrow without any issues whats so ever.

Raspberry Pi & DVB-T

Tags: , , ,

44 Responses to “Remote SDR using Raspberry Pi & RTL_TCP”

  1. David October 11, 2012 at 12:21 am #

    How does the audio get into the RPi

    • 2e0sql October 11, 2012 at 12:23 am #

      DVB-T into the Pi, Then streamed across using TCP to a suitable application raspberry pi which plays the audio aka SDR#

      • mike January 25, 2013 at 1:53 pm #

        hi! we build a new wiki on our noncommercial site for rtl-sdr. would it be ok for you that we use your manual about in our wiki ?

        • 2e0sql January 25, 2013 at 2:11 pm #

          Feel free to use it Mike

          • mike January 25, 2013 at 2:41 pm #

            ok, many thx !!

  2. PE0SAT October 11, 2012 at 12:34 pm #

    Nice, did you also try this with a FUNcube dongle?

    • 2e0sql October 11, 2012 at 3:58 pm #

      I haven’t yet but I believe it should work OK.

      • Tony _ G3OVH October 14, 2012 at 4:44 pm #

        Hi Peter

        It would be interesting to know if you have a FunCube Dongle and can make it work with the R-Pi. I have tried and qthid-fcd-controller 3.1.6 crashes with the dongle plugged in. It works OK with Xubuntu on a PC, but doing an strace on the R-Pi shows a segmentation error on a call:
        clock_gettime(CLOCK_MONOTONIC, {3311, 222529764}) = 0
        — SIGSEGV (Segmentation fault) @ 0 (0) —
        +++ killed by SIGSEGV +++
        Various requests to the FunCube Dongle group have not found an answer to this yet.
        I guess the code needs changing to avoid this call which might be compromised because the R-Pi doesnt have an RTC.
        ps was at you talk at the RSGB symposium yesterday on the floor at the front asking you about backups!

        Tony

  3. Philip Thompson October 24, 2012 at 7:14 pm #

    Hi
    New to Linux but following your instructions to see if I can get this working..

    I’ve got as far as cd build but when I enter
    “cmake ../ -DINSTALL_UDEV_RULES=ON”
    I get bash: cmake: command not found..

    Have I missed something obvious?

    Philip

    • 2e0sql October 24, 2012 at 7:24 pm #

      Did you run the command

      sudo apt-get install cmake, pkg-config, libusb1.0

      as its moaning that cmake isn’t installed.

      • Philip Thompson October 24, 2012 at 7:59 pm #

        Hi
        Yes I did but looking back through the process, that command failed with errors…
        Will start again and see what happens…
        Total newb with all this…

        Thanks
        Philip

        • 2e0sql October 24, 2012 at 8:04 pm #

          No problem Philip, what sort of errors you getting? will try help best I can.

          • Philip Thompson October 24, 2012 at 8:23 pm #

            Hi
            I’m going to start again tomorrow with a new Raspbien image incase I broke something..
            Would love to get this working but I’m a million miles out of my comfort zone…

            I’ll shout if it goes wrong again and many thanks

            Philip

          • 2e0sql October 24, 2012 at 8:24 pm #

            Always a good thing todo Philip, shout if you do need some help though.

          • Philip Thompson October 25, 2012 at 7:38 pm #

            Not had chance to start again today but before I do, can I just double check with you a couple of things..
            I presume I’m good to go with the latest Raspbien image and don’t need any other software than that pointed to on your site…

            Also, do I need to have the RTL dongle plugged in during the install?
            I didn’t have it plugged in yesterday…

            Any other gotchas you can think of…

            Fingers crossed

            Philip G4JVF

          • 2e0sql October 25, 2012 at 7:48 pm #

            Shouldn’t need anything else installed bar what I said on the post, would recommend not having the RTL plugged in till you’ve finished everything.

  4. Mike November 6, 2012 at 11:57 am #

    Nice is there an image somewhere with evertthing already set up?
    Mike

    • 2e0sql November 6, 2012 at 2:11 pm #

      Mike, I do have a img I just need somewhere to put a 8GB file :)

      • Juan (@JuanValdezzz) February 26, 2013 at 8:27 pm #

        Seeding a torrent of this should be appreciated!

  5. Philip Thompson November 6, 2012 at 1:29 pm #

    Hi
    Finaly got it going and thanks for your instructions and patience..

    I was getting some install problems whilst using the GUI after Startx but went through the procedure again from just the startup command prompt and all went like clock work..

    Always a problem when you don’t know what your doing but got there in the end..

    Philip G4JVF

    • 2e0sql November 6, 2012 at 2:11 pm #

      Philip,

      Excellent, pleased you got it working have fun playing :)

      Peter

  6. Enrico November 16, 2012 at 3:10 pm #

    Excellent tutorial. I just follows the step from a remote shell. I can not wait to connect my new dongle..
    Thank you for the guide.

    • 2e0sql November 16, 2012 at 3:11 pm #

      Thanks Enrico, pleased you found the guide useful!

  7. Jesus November 28, 2012 at 9:47 am #

    I have the same tdt you and I would also like to hear hf.
    I’ve seen this modification
    https://public-xrp.s3.amazonaws.com/hf2.jpg

    What would be the leg that should in my tdt welding?

    http://www.steve-m.de/pictures/rtl-sdr/rtl2832_r820t.jpg

    Advanced thank you very much!

  8. Ken December 30, 2012 at 9:03 pm #

    Hi Pete, Got a R-Pi for Christmas, now looking for an application – probably radio oriented.
    Hope you’re well.
    73
    Ken M1SLH
    HNY

    • 2e0sql December 30, 2012 at 10:03 pm #

      They are great for radio, let me know if you need any help.

  9. SV5BYR Mike January 7, 2013 at 8:04 am #

    Hello, and thanks for tutorial…
    I manage to run my Raspi and 2832/E4000 but trying the RTL 2832 / R820t i get the message:

    pi@raspberrypi ~ $ rtl_tcp -a 192.168.178.60 -p 1234
    Found 1 device(s).
    usb_open error -3
    Failed to open rtlsdr device #0.

    Any idea ???

    Tnx in advance and keep the nice work.

    SV5BYR Mike
    Rhodes island Greece.

    • Steve Potter January 24, 2013 at 4:48 pm #

      Same here, it works on the PC no problem, with Zadigs driver, sdr# adsb#, virtual radar etc. I am at ease with anything windows, but linux is new to me.
      G6HOQ – Steve

  10. Stan - K9SWX January 7, 2013 at 12:51 pm #

    Where do you get the DVB-T dongles and which one would you recommend?

    • 2e0sql January 19, 2013 at 1:19 am #

      Bought mine from ebay

  11. kk7pw January 14, 2013 at 3:58 am #

    Hi Pete,

    At the risk of asking a silly question, any chance you think I might be able to use your install procedure to use my RPi with my Ensemble RXTX SDR? I do not have a DVB-T usb dongle. I have the Ensemble and a Soundblaster MP3 external sound card. Might I somehow adapt SDR# to speak to the Ensemble? Thoughts?

    Thanks for a great post and thread. Very helpful.

    73. de KK7PW

  12. Keith January 30, 2013 at 1:20 am #

    If you are looking for 8GB worth of WEB space, if you contact me I can provide you with an account to upload to and I’ll give you the URL to publicise where the image can be down loaded from on one of our high speed WEB servers.
    You’ll find an email address if you look my call sign up on QRZ.COM.

    I would love to give this a try on my Pi, but I’m far from a Linux expert and the idea of an image of your already setup and working SD card would help me (and I am sure others too) enormously!

    Regards,
    Keith
    G4MSF

    • 2e0sql January 30, 2013 at 1:02 pm #

      Hi Keith,

      Thanks for the offer. Since writing the blog post I bought online another server for work that can cope with the SD images, I’ve just been lacking time to actually sort it out! I’ll try to get it done over the weekend if possible, I might be able to redo them on the standard 2gb iso which would make downloading a lot quicker.

      Pete.

  13. Reiner February 19, 2013 at 8:42 pm #

    libusb1.0 should be libusb-1.0 ;( Nevertheless thank you for your work. :)

    • 2e0sql February 19, 2013 at 10:58 pm #

      Thanks Adjusted.

  14. Jan G0BBL February 26, 2013 at 8:37 pm #

    Peter, thanks for your instructions on using Rpi as an RTL_TCP webserver. Works great over home network but I cannot get it to work over public network.

    Error is “unable to connect”. I have opened ports through the router and the Windows Firewall but to now avail.
    Anybody has any suggestion what to look for, or maybe step by step steps? I use a static IP address. thanks Jan

    • 2e0sql February 27, 2013 at 1:38 am #

      Jan, interesting my only guess is that its networking related with the router but there should be no reason for it not to work.

    • Jan PE0SAT February 27, 2013 at 7:58 am #

      Hello Jan,

      If you have a network address translation from outside to inside configured, this is going to work. You should keep in mind that you need an internet bandwidth of 40Mb upload and if you want to use the full 2Mb sample rate.

      NAT on router (from out to in):

      source – dest :port – source – dest :port

      A ssh tunnel wil also work, so if you have a ssh connection to you internal network you can configure a ssh tunnel to connect to the rtl_tcp session. But again, do you have enough upload bandwidth.

      73 Jan PE0SAT

  15. David Colburn February 26, 2013 at 9:59 pm #

    Have you considered adding a Ham It Up v1.0 – RF Upconverter for HF bands? Also, that add-on will reverse the process and convert an input between 100-150MHz to a HF signal for a transmit side on HF – perhaps the making of a HF/VHF/UHF transceiver? Not sure what Linux app could manage it.

    • 2e0sql February 27, 2013 at 1:37 am #

      Hi David,

      No I haven’t main reason being that I’ve the Funcube Dongle Pro Plus that includes HF, so never really required the function.

      Peter.

  16. Jan G0BBL March 3, 2013 at 4:06 pm #

    Peter, Jan, Thanks for your advice… Have done some more experimenting but still unable to connect tio RPI via Internet. I have set samplerate to 128000 bps which my 10mbps ethernet connection should be able to support. The message I am getting is “No connection could be made because the Target Machine actively refused this ip 78.105.12x.xx:1234
    I have disabled the firewall on the router and reset the router. There should be no blocking o whatsover but no luck
    Earlier on I configured port 1234 to port 1234 on LAN. SSH over the internet to RPI works fine.
    RTL_TCP -a is set to my static IP address. RCP
    Netstat on RPI shows that no connection to port 1234 on RPI. SDR# is set to my static IP address as well.. bit of a mystery… Are there any firewalls in the RPI that could block traffic?
    Thanks for advice

  17. Ruediger March 31, 2013 at 8:35 am #

    Hi there,

    i am a Linux Newbee and looking for a solution that makes rtl_tcp starts automatic when the Raspberry is starting up.
    Any ideas ?

  18. Robert May 12, 2013 at 11:48 am #

    Successfully installed everything and my RasPi started receiving with the USB SDR.
    Note: Before you do anything remember to sudo apt-get update.
    My install for git failed because I didnt do the above step.
    I also found that cmake, pkg-config, libusb1.0 worked best by doing separate installs.
    I connected to my RasPi through my local network with my Samsung GII with SDR Touch installed and worked brilliantly.
    Thanks for the great How-To.

  19. Michele Romanini April 14, 2014 at 7:55 pm #

    For the records – to those who might encounter problems “Kernel driver is active, or device is claimed by second instance of librtlsdr [...] Failed to open rtlsdr device #0″ needs to recompile using this syntax:

    cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON

    (honesly, my very first working “make” :) :)

    Cheers.

Leave a Reply