Posted on

Using the Raspberry Pi as an RTL-SDR dongle Server

Installing RTL SDR Software

NB: UPDATED 5th August 2017

The instructions listed below show you how to set up a Raspberry Pi for use as an RTL-SDR dongle server. If you would like a ready made solution, I have pre-configured and tested SD cards complete with printed instructions available via my Web Shop here.

To make installation as easy as possible, I’ve written a bash script that automates the entire process. You can download the zip file here: rtlsdr-install

  1. Download and unzip the rtlsdr-install file to the /home/pi directory on your Pi.
  2. Open an LXterminal session and type ./
  3. The script will run and show progress messages as it installs.
  4. When complete, restart the Pi and you’re in business!

Manual Installation

The first step is to install a few packages that are required by the dongle server. You may already have some of these so don’t worry if you see a message that you already have the latest version.

To install these packages, type the following at the LXTerminal command line.

sudo apt-get install -y  cmake pkg-config libusb-1.0

Now you can download the RTL-SDR code from osmocom by typing the following at the command line:

git clone git://

The next step is to build RTL-SDR using the following commands. NB: Some of these may take a while so it’s probably time for a beer!

  1. cd rtl-sdr/
  2. mkdir build
  3. cd build
  4. cmake ../ -DINSTALL_UDEV_RULES=ON
  5. make
  6. sudo make install
  7. sudo ldconfig

Blacklist the DVB-T Drivers

The later versions of Raspbian include standard drivers so that the Dongles can operate in their original role as a USB Radio/TV device. Unfortunately, these drivers prevent access to the dongle by the rtl-sdr software. The solution is to create a dedicated blacklist file to prevent the unwanted drivers from loading.  Here’s the process:

From the command line enter the following:

sudo nano /etc/modprobe.d/blacklist-rtl.conf


This creates a new file so enter the following lines:

blacklist dvb_usb_rtl28xxu

blacklist rtl2832

blacklist rtl2830

Press control-X followed by Y to exit and save the modified file.

Now reboot the Pi: sudo reboot

That completes the build and you can run a quick test by making sure your dongle is connected and typing: rtl_test -t

To start the server you need to access the Pi command line and type: rtl_tcp -a ‘your Pi’s IP address’. As a practical example, the start command for my setup is:

rtl_tcp -a

Auto Boot

It is very easy to configure the Pi to automatically run the SDR server when it powers-up. This is done by modifying the rc.local file that automatically runs on boot. We need to include two new lines in the file. The first delays execution for 10 seconds whilst the network starts and the second runs the command to start the server. The delay is necessary because the new Jessie release runs rc.local before the network is up so we won’t have the vital IP address. Here’s the updated rc.local file with the additions in red:

sleep 10
_IP=$(hostname -I) || true
if [“$_IP”]; then
printf”My IP address is %s\n” “$_IP”
/usr/local/bin/rtl_tcp -a $_IP &
exit 0

To open the rc.local file for editing type:

sudo nano /etc/rc.local

Now update the content as shown above.

Type control X followed by Y and Enter to save the changes.

That’s it – you should have an RTL-Server that auto-boots. I don’t recommend using a Wi-Fi dongle but if you do you will need to increase the sleep time as the network setup will take longer.


Good Luck,


Mike – G4WNC


46 thoughts on “Using the Raspberry Pi as an RTL-SDR dongle Server

  1. What software would I use as a client in Windows?

    Tried SDR# with no luck so far.

    1. Hi Art,

      Sorry to hear you are having problems. SDR# is the most common SDR software that’s used with the dongle server. When you use SDR# you have to select RTL-SDR(TCP) as the Source and you have to click the Cogs icon and enter the Raspberry Pi server’s IP address as the host and 1234 as the port. Not sure if you purchased one of my cards or are doing it yourself but all my cards are individually tested with SDR# before despatch.

      Let me know how you get on – I’m happy to help.


      Mike – G4WNC

  2. Hi Mike,

    thanks a lot for simply the best tutorial I could find to get the rtl-server running.

    It works very well on a RPi 3 B from a technical point of view but I have some strange noisy peaks (kind of rhythmic appearance) on some frequencies (118-137 Mhz), even more than before, when the dongle was connected to the pc, half a meter to the left. I guess I have to look into that over the weekend. Maybe a relocation will do…

    I can open a connection with SDR Touch on Android and SDR# and the service doesn’t crash if I’m shutting down the connection (I’ve read about that somewhere else), but, who knows – I’ve set up a PUTTY SSH favorite to restart the service if necessary.

    As I’m new to Linux there is a simple question, because you didn’t mention it in the tutorial.

    I would like to change the default port 1234. How should “/usr/local/bin/rtl_tcp -a $_IP &” look like?

    /usr/local/bin/rtl_tcp -a $_IP -p port number &


    /usr/local/bin/rtl_tcp -a $_IP & -p port number &



    1. Hi Stefan,

      Glad to hear you found the tutorial useful. The crash you read about that follows a link shut down was due to Raspbian using an older version of libusb – that’s now fixed.
      Changing the port is simply a case of adding a colon : followed by the new port number after $_IP but before the &. As an example, the new line for using port 4321 would be:

      /usr/local/bin/rtl_tcp -a $_IP:4321 &

      Hope that helps,

      Mike – G4WNC

  3. Hi Mike,

    great, thanks a lot.

    Have a nice day!


  4. Hi Mike, I had a problem with some of the commands. I’ll cut and paste some of the error responses…

    pi@raspberrypi:~ $ cd rtl-sdr/
    -bash: cd: rtl-sdr/: No such file or directory
    pi@raspberrypi:~ $ mkdir build
    pi@raspberrypi:~ $ cd build
    pi@raspberrypi:~/build $ cmake ../ -DINSTALL_UDEV_RULES=ON
    CMake Error: The source directory “/home/pi” does not appear to contain CMakeLists.txt.
    Specify –help for usage, or press the help button on the CMake GUI.
    pi@raspberrypi:~/build $ cmake ../ -DINSTALL_UDEV_RULES=ON
    CMake Error: The source directory “/home/pi” does not appear to contain CMakeLists.txt.
    Specify –help for usage, or press the help button on the CMake GUI.
    pi@raspberrypi:~/build $ make
    make: *** No targets specified and no makefile found. Stop.
    pi@raspberrypi:~/build $ sudo make install
    make: *** No rule to make target ‘install’. Stop.
    pi@raspberrypi:~/build $ sudo ldconfig
    pi@raspberrypi:~/build $ sudo nano /etc/modprobe.d/raspi-blacklist.conf
    pi@raspberrypi:~/build $ sudo reboot

    I did create the blacklist file. I’m running Debian GNU/ Linux.
    I didn’t create the auto boot file and booted it manually.

    pi@raspberrypi:~ $ rtl_tcp -a
    -bash: rtl_tcp: command not found

    I’m just learning linux. Thanks in advance.

    1. Hi Vendle,

      The fault seems to be with the clone operation. The git clone line downloads the software on to your machine and puts it in a new directory called rtl-sdr. The fact that your cd rtl-sdr/ line fails indicates that the directory hasn’t been created so the software won’t have been downloaded. Do you get an error when you type the clone line?
      All the subsequent lines fail because the code they are working on doesn’t exist.

      Hope that helps,


  5. As much as I would like to figure out what went wrong, I took the easy way out and ordered one of your preconfigured SD cards. Time permitting I’ll try again in the future. Thanks for your assistance.

  6. Hi Mike, I followed your instructions a little better and was able to get the server up and running ;). Your pre-configured SD card arrived and worked flawlessly. Is there a way to stream directly from the server using the wifi dongle, ad hoc style? (I may be using the wrong term)
    Thanks again, Vendel/ K2DSI

  7. wondering why my pi is streaming on a different port (never 1234) each time?

    works great when it works!

    1. Hi Richard,

      I’ve never come across that. Are you using one of my pre-configured cards or have you set it up yourself?
      This is the line that sets the IP address:

      /usr/local/bin/rtl_tcp -a $_IP &

      You could try modifying to the following to force the port No:

      /usr/local/bin/rtl_tcp -a $_IP :1234 &

      Let me know how you get on.

      Mike – G4WNC

  8. Mike,

    I was able to get the server working on a Pi 3, and use a gigabit-connected Windows 10 PC running SDR# to listen.

    I would like to get my Pi 1, which is running OSMC/Kodi on the same switch, to stream from the server. Is there a way, like with a .strm file?

    I also wonder if Kodi;s RADIO section could access the server. Them I would be able to record shows on schedule.

    1. Thanks for your comments. Whilst it’s fine to use a Pi3 and Gigabit LAN, it’s a bit overkill for this simple server as it will run quite happily on an old Pi-1 and its 100Mb/s Ethernet port. You could save your Pi-3 for doing more interesting things :-).
      The RTL-SDR Dongle server simply supplies raw IQ samples over the network and these can only be handled by dedicated SDR software such as SDR Sharp. This software uses the processing power of the host PC to select the desired station and extract the demodulated audio. If you want to record stations, you could use one of the audio recorder plug-ins that are available for SDR Sharp. You could then make the resultant audio files accessible by OSMC.

      Mike – G4WNC

  9. Instructions work great, trying on a new RPi3. Connecting over wlan0 and getting some minor audio issues (audio intermittently cuts out) but will troubleshoot later. Thank you for posting these instructions.

    David – KK6GPM

    1. Hi David,

      Glad to hear the instructions were helpful.Wlans are generally too slow to handle the IQ data rate, hence the drop outs. You can try a lower sample rate but I always recommend using Ethernet.

      ’73 Mike G4WNC

  10. Mike thanks, yes switched to ethernet and better audio, though I still have to lower to sample rate to get decent quality. New topic: now trying to stream IQ data over the Internet. Added rule to my firewall/router to forward port 1234 to the RPi’s static internal IP, but when I try to connect SDR# using the WAN IP (assigned by my ISP) I get “connection actively refused” error message. What am I missing?

  11. Hello can i ask somethings ?
    I try do autostart when system is reboot ( when mayby power is Off and a few minutes is On)

    Do you need to manually enter the IP address of the file is changed? My raspberry address is and the port 1234

    I mean this piece of code:
    sleep 10
    _IP=$(hostname -I) || true
    if [“$_IP”]; then
    printf”My IP address is %s\n” “$_IP”
    /usr/local/bin/rtl_tcp -a $_IP &
    exit 0

    Is this causes the console will move itself?

  12. I cannot for the life of me get this to work. I have tried so many different options and about to give up on it.
    SDR# will not connect at all. Even opened up the port on my router.

  13. Just figured out my errors. Was an IP address mistake on my part.

  14. Excellent tutorial pretty much copy paste and you are set. Used. It on 3 RPis. Takes very little time.



  15. 1. cd rtl-sdr/
    2. mkdir build
    3. cd build
    4. cmake ../ -DINSTALL_UDEV_RULES=ON
    5. make
    6. sudo make install
    7. sudo ldconfig

    When I enter # 7 I get “sudo: Idconfig: command not found”

    Jessie is fully up-to-date.

    1. Hi Aaron,

      You’re making a simple typo, the first letter of the command is a lowercase L 🙂



      1. Thanks, that worked. 😉

  16. Can someone point me to the right procedure?

    $ sudo killall -9 openwebrx rtl_mus csdr rtl_sdr
    openwebrx: no process found
    rtl_mus: no process found
    csdr: no process found
    rtl_sdr: no process found

    followed this procedure from start to finish…
    using an RPI2 with up-to-date raspbian

    thanks for the assistance

    1. Hi – I’m not sure I understand what you’re trying to do here. The response you’ve supplied just confirms that the processes you listed are not running on the Pi.
      An explanation would help.


      Mike – G4WNC

      1. I followed the procedures on your page…but seems i missed something or did not cpmply…
        when I try to kill the process thats the error…
        after a reboot now wont able to run the

  17. also may have found an error in /etc/rc.local as released in Jessie 2016-11-25
    in your example rc.local starts…

    _IP=$(hostname -I) || true

    but in the issued rc.local I have

    IP=$(hostname -I) || true

    without the underscore it won’t work. you need to add the underscore as well as your RED highlighted text.

    HTH, G8NXD

    1. Hi,

      I just checked the latest Raspbian image and the underscore is present and so is the raspi-blacklist.conf file from your other comment. I’d be suspicious about the image you’ve used. Might be worth downloading the latest build to get back on track.


      Mike -G4WNC

  18. Thanks a million Mike, it works Brilliant 🙂
    I have a raspberry pi B+, the only bit I couldn’t get working was the git clone git://, so I went on to github, and downloaded the zip file to the pi, and then unzipped it. Then it worked great. I used it for SSTV: Recieved by SD# on the laptop via TCP, and piped through to RX-SSTV to decode. The images were perfect.

  19. Hello.
    Thank you for this information.
    Works great.
    But one question please.
    How can multiple users connect to the SDR server that is on ?
    I tried to connect from two devices in the same time with no results.

    Thank you !

    1. Unfortunately, the server only supports a single connection.

      1. I understand, thank you !

        I have the following error:

        usb_claim_interface error -6
        Failed to open rtlsdr device #0.

        How can I resolve it ?
        The SDR is working but I cannot use any command in SSH to change port, sampling rate etc. Also I want to transmit on another port. The command line from previous post does not work for me.

        Thank you !

  20. I formatted the SC card and reinstall the application.
    Now is connected, the USB error mentioned above does not appear any more but the server does not start automatic at boot. I edit rc.local file with the text from this site, but no luck. The application needs to start manually to work.
    Where is the problem ?

    1. Hi Sorry for the late reply, I’ve been away from home for a while. I suspect you have a typing error in the rc.local file. The instructions have been tested by many people so I’m confident that they are correct.


      Mike – G4WNC

  21. Hello:
    It would be interesting to create an sd card for the use of AIRSPY, similar to the RTL DONGLE SERVER

    1. Hi Andres,

      As it happens I’m just in the final stages of preparing a card for the AirSpy. I’m using the AirSpy SpyServer and that will run on the Pi-3 but only with the AirSpy set to 2.5MSPS. It should be up on the site in the next couple of weeks. Mike – G4WNC

  22. DItto to all comments on this tutorial. Thank you.
    One question and one problem ..
    Question: Would it not be a good idea to fix the i/p address of the RPi so that SDR# can be run with the same settings each time?

    Problem (I think): When I run rtl_test, I get a response to say “No supported tuner found”. This line follows “Using device 0: Generic RTL2832U OEM and is followed by “Enabled direct sampling mode, input 1”


  23. Made a bit of progress …
    As mentioned above, I get an error to say that no supported tuner has been found. However, if I run the following steps, I can get it to work:
    1. sudo apt-get install librtlsdr0
    2. sudo reboot
    3. rtl_tcp -a

    Now at this stage, the tuner is found as FC0012 which is progress. However, I now get an error: undefined symbol: rtlsdr_set_bias_tee

    So…. I then run the following command: sudo apt-get remove librtlsdr0
    When that has finished, I can run the command at point 3 above and everything works! I can now attach SDR# on a remote laptop connected to the same network as the RPi and receive radio.

    However … if I reboot the Rpi, I am back to square 1. I am not at all sure of what is going on here but the problem is clearly software.

    I need to make some sort of change to the build of the RPi so that it accepts the FC0012 tuner in my dongle without going though all the kerfuffle above.

    1. Hi Alan,

      Did you ever solve this?

      I had 2 Ebay sellers send FC0012’s instead of the R820T’s advertised so now I am stuck with them and getting the exact same issues where I install the drivers then remove and it works


  24. I get this error when running rc.local but not if I run manually rtl_tcp -a
    Any ideas on what I am doing wrong please.
    [“ not found

    1. Hi Kieran,

      Your command looks ok but here are a few things to check:
      Make sure your have the correct IP address for the Pi.
      This type of problem usually turns out to be due to typing error so double check your typing of the command

      Let me know how you get on.

      Mike – G4WNC

  25. Like the fellow above I get the error msg ,

    usb_claim_interface error -6
    Failed to open rtlsdr device #0

    I can’t get pass that. Thanks for the tutorial, good stuff!

    1. Hi Bill, Sorry for the delay replying. The usb_claim error means the kernel DVB-T drivers have grabbed the stick. This is caused by an error in the blacklist file. Take a very close look at it and make sure there are no typos. In the latest update to these instructions I’ve recommended making a new blacklist file as follows:

      sudo nano /etc/modprobe.d/blacklist-rtl.conf

      This creates a new file so enter the following lines:

      blacklist dvb_usb_rtl28xxu

      blacklist rtl2832

      blacklist rtl2830

      Press control-X followed by Y to exit and save the modified file.

      Now reboot the Pi: sudo reboot

  26. I think I got through the blacklist problem but now when I run “rtl_test -tngg” I get the following:

    Found 1 device
    0: Realtek, RTL2838UHIDIR, SN 00000001
    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    Supported Gain Values (29): ….etc

    [R82xx] PLL not locked!
    Sampling at 2048000 s/s
    NO E4000 Turner Found, aborting.

    Thanks for putting up with this old man.

  27. I wonder if you could help me. I’m getting the error:

    ERROR: invalid device index 0
    Found 0 devices:

    It is plugged into the pi – not trying the server yet and I can see it in `lsusb`.

    Bus 001 Device 007: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    Bus 001 Device 083: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
    Bus 001 Device 005: ID 17ef:6018 Lenovo
    Bus 001 Device 004: ID 046d:c05a Logitech, Inc. M90/M100 Optical Mouse
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    I’m not sure what to do to get the device visible on the pi, thanks


    1. Hi Keith,

      Sounds like a problem with the blacklisting. The blacklist is there to stop the Pi from loading the default, TV/Radio, drivers for the RTL device. If they get loaded then the server will complain that it can’t find the dongle in the right mode. Go back and look very carefully for typos in the blacklist file you created and the name of the file.

      Let me know how you get on.


      Mike – G4WNC

Leave a Reply

Your email address will not be published. Required fields are marked *