Posted on

Using the Raspberry Pi as an RTL-SDR dongle Server

Installing RTL SDR Software

NB: UPDATED 20 July 2018

  1. Added copy command for udev rules
  2. Amended required packages to include git and libusb-1.0.0-dev

Manual Installation

The first step is to install a few packages that are required by the RTL-SDR 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  git cmake pkg-config libusb-1.0-0-dev

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

git clone git://git.osmocom.org/rtl-sdr.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 cp ../rtl-sdr.rules /etc/udev/rules.d/
  8. 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 192.168.1.100

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 &
fi
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

 

76 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.

      Regards,

      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 &

    or

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

    Thanks,

    Stefan

    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!

    Stefan

  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 192.168.1.12
    -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,

      Mike

  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 192.168.0.104 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 &
    fi
    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.

    Thanks

    TomW

  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 🙂

      Regards,

      Mike

      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.

      Regards,

      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 openwebrx.py

  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
    ## NOTE THE MISSING UNDERSCORE

    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.

      Regards,

      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://git.osmocom.org/rtl-sdr.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.
    Regards,
    Aoife

  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.

      Regards,

      Mike – G4WNC

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

    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”

    Alan

  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 192.168.1.8

    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

      Thanks

  24. I get this error when running rc.local but not if I run manually rtl_tcp -a 192.168.1.66.
    Any ideas on what I am doing wrong please.
    [“192.168.1.66: 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

    Keith

    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.

      Regards,

      Mike – G4WNC

  28. Don’t know if you can help, after running the necessary apt-get upgrade and set-get update I have rebooted and run the first line in you manual installation.

    I then enter this: git clone git://git.osmocom.org/rtl-sdr.git

    and get this response:
    -bash: git: command not found

    Any ideas?

    Thanks

    1. Doh…. sudo apt-get install git —- Solved!

  29. OK, so got through thing and have ended up testing the rtf dongle and this is the response?

    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    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
    [R82XX] PLL not locked!
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    WARNING: Failed to set sample rate.
    No E4000 tuner found, aborting.
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    r82xx_write: i2c wr failed=-1 reg=06 len=1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_write_reg failed with -1

    1. Hi – Try using rtl_test -t from terminal session on the Pi to check the dongle.

  30. How to kill the rtl_tcp process without respawning itself automatically when there’s still a client connected?

    “kill -9 pid” kills the process but the RTL-SDR stick keeps active and warm.

    “kill -3 pid” quits the process and put the RTL-SDR stick in sleep (it cools down) but it respawns itself if there’s a client connected or when the kill is performed in another SSH session.

    1. Not sure without some research and I’m away on holiday at the moment. Why do you want to kill the process? I might be able to suggest a better method.
      Mike – G4WNC

      1. Because the RTL-SDR stick is running really hot during usage. I already have it replaced.

        I only want to load the rtl_tcp server during listening. During nights I want to close the process on my Raspberry Pi without having to reboot it or shut it down.

        1. Hi RemoNEW,

          The simplest solution would be to run rtl-tcp as a service under systemd control. I’ve described how to do this in my blog. To see the details, search on my blog for: rtl-sdr server as a service on the raspberry pi.
          Once installed, you can start/stop the server with:sudo systemctl start rtl-sdr and stop the service with sudo systemctl stop rtl-sdr
          Regards,

          Mike -G4WNC

          1. Thank you for your reply.

            At least I can now close the rtl_tcp process from another SSH session:

            ? rtlsdr.service – RTL-SDR Server
            Loaded: loaded (/etc/systemd/system/rtlsdr.service; disabled; vendor preset: enabled)
            Active: inactive (dead)

            Jun 29 04:11:55 raspberrypi sh[942]: set gain mode 1
            Jun 29 04:11:55 raspberrypi sh[942]: set tuner gain by index 0
            Jun 29 04:11:55 raspberrypi sh[942]: comm recv bye
            Jun 29 04:11:55 raspberrypi sh[942]: worker cond timeout
            Jun 29 04:11:55 raspberrypi sh[942]: all threads dead..
            Jun 29 04:11:55 raspberrypi sh[942]: listening…
            Jun 29 04:11:55 raspberrypi sh[942]: Use the device argument ‘rtl_tcp=192.168.178.234:1234’ in OsmoSDR (gr-osmosdr
            Jun 29 04:11:55 raspberrypi sh[942]: to receive samples in GRC and control rtl_tcp parameters (frequency, gain, ..
            Jun 29 04:11:55 raspberrypi sh[942]: bye!
            Jun 29 04:11:55 raspberrypi systemd[1]: Stopped RTL-SDR Server.

            The only problem that still exists is that it doesn’t put the RTL-SDR stick into sleep when there’s still a client connected. In that case it takes up to a minute before the service stops. It forcefully kills the process and leaves the RTL-SDR stick active and hot. The rtl_tcp proces doesn’t give a “bye” signal in this scenario:

            ? rtlsdr.service – RTL-SDR Server
            Loaded: loaded (/etc/systemd/system/rtlsdr.service; disabled; vendor preset: enabled)
            Active: failed (Result: timeout) since Fri 2018-06-29 04:15:05 CEST; 11s ago
            Process: 999 ExecStart=/bin/sh -c /usr/local/bin/rtl_tcp -a $(hostname -I) (code=killed, signa
            Main PID: 999 (code=killed, signal=TERM)

            Jun 29 04:14:43 raspberrypi sh[999]: Signal caught, exiting!
            Jun 29 04:14:48 raspberrypi sh[999]: Signal caught, exiting!
            Jun 29 04:14:54 raspberrypi sh[999]: Allocating 15 zero-copy buffers
            Jun 29 04:14:55 raspberrypi sh[999]: Signal caught, exiting!
            Jun 29 04:14:55 raspberrypi sh[999]: Signal caught, exiting!
            Jun 29 04:15:05 raspberrypi systemd[1]: rtlsdr.service: State ‘stop-final-sigterm’ timed out. Ki
            Jun 29 04:15:05 raspberrypi systemd[1]: rtlsdr.service: Killing process 1001 (rtl_tcp) with sign
            Jun 29 04:15:05 raspberrypi systemd[1]: Stopped RTL-SDR Server.

            PS: I found two errors in the other blog post. The wrong quotation marks are used and to stop the service systemctl is needed while systemd is described.

  31. Thanks for the tut. Having trouble with Pi1.

    pi@raspberrypi:~ $ rtl_test -t
    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    r82xx_write: i2c wr failed=-1 reg=05 len=7
    r82xx_write: i2c wr failed=-1 reg=0c len=1
    r82xx_init: failed=-1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    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
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    r82xx_write: i2c wr failed=-1 reg=0a len=1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    WARNING: Failed to set sample rate.
    No E4000 tuner found, aborting.
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_demod_write_reg failed with -1
    rtlsdr_demod_read_reg failed with -1
    rtlsdr_write_reg failed with -1

    This should be showing so many fails?

    1. Jack – Which model are you using? Is it an original Pi-model B, B+ or a Zero? Once I know this, I’ll set one up here and test it. Mike – G4WNC

      1. Original Pi with that generic DVB-t tuner

  32. Any idea on this Mike

    Seems to start
    pi@raspberrypi:~/rtl-sdr $ rtl_tcp -a 192.168.1.49
    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    [R82XX] PLL not locked!
    Tuned to 100000000 Hz.
    rtl_tcp: symbol lookup rror: rtl_tcp: undefined symbol: rtlsdr_set_bias_tee

    When I start SDR#

    i get
    No connection could be made because the target machine actively refused it 192.168.1.49:1234

    Neil
    GJ1YOT

    1. Hi Neil,

      Could you try running rtl_test -t and see what you get. Did you build your card with the latest Raspbian Stretch Lite?

      I’m just doing a fresh build here to see what I get.

      Keep me posted,

      Mike – G4WNC

      1. Hi Again Neil, I’ve just tried building the server from the latest Raspbian Stretch Lite and spotted that a few changes are required to my instructions. I’ve updated my blog post so, if you’re still having problems, it might be worth rebuilding the image.

        Regards,

        Mike – G4WNC

  33. Hi Mike
    Well I did a fresh build with the ‘full fat ‘ Rasp Stretch

    got gqrx running on the RPi

    Trying to run as server though I get this bias tee error:

    Windows PowerShell
    Copyright (C) Microsoft Corporation. All rights reserved.

    PS C:\Users\Neil> ssh pi@192.168.1.49
    pi@192.168.1.49‘s password:
    Linux raspberrypi 4.14.52-v7+ #1123 SMP Wed Jun 27 17:35:49 BST 2018 armv7l

    Last login: Sat Jul 21 15:23:02 2018 from 192.168.1.108
    pi@raspberrypi:~ $ rtl_test -t
    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    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
    [R82XX] PLL not locked!
    Sampling at 2048000 S/s.
    No E4000 tuner found, aborting.
    pi@raspberrypi:~ $ rtl_tcp -a 192.168.1.49
    Found 1 device(s):
    0: Realtek, RTL2838UHIDIR, SN: 00000001

    Using device 0: Generic RTL2832U OEM
    Found Rafael Micro R820T tuner
    [R82XX] PLL not locked!
    Tuned to 100000000 Hz.
    rtl_tcp: symbol lookup error: rtl_tcp: undefined symbol: rtlsdr_set_bias_tee
    pi@raspberrypi:~ $

    1. Neil, It would be better to try it without installing GQRX as that may be the cause of the problem. I’ve confirmed that the instructions in my updated blog entry work as expected with a Pi-3 and Stretch. I’ll double-check with the full Stretch later today.

      If you’re still having problems, can you let me know the Pi model and stick details.

      Regards,

      Mike

  34. OK,
    Just about sick of the sight of it all at the moment, so not going to start another build today !

    What I wanted ideally was a Pi with SDR driving a Webserver, like WebSDR, but just on my local network, to access tuner via webgui on iPhone, rather like the WebSDR pages. But the bloke who does the WebSDR software not prepared to help.. so main idea is now screwed as it seems there are no other webpage style servers that can drive the SDR.

    Wanted 4-6 different frequencies, for work monitoring ( Airfield weather, ATIS, harbour, local coast guard, 121.500 works Operations frequency (131.705)

  35. Actually I did do it.
    Clean Rasp stretch full version, all worked instantly.SDR Sharp on the Win 10 machine did connect instantly…though it did sound very poor..very low signal strength even on local broadcast stations.Play ed with as many settings as I could find and got no where .

    rebooted the Pi with the GQRX sd card..and signal strength and audio perfect…

    so for today it can sit here playing Radio 2

    1. Glad to hear it’s working. When using SDR SHARP with a fondle you need to go to settings (cogs) and tick tuner ago. Without that it starts on minimum gain so it’s very deaf.

      Mike – G4WNC

  36. Wonder if it is possible that somehtn gin the tuner dongle has ‘failed’ or a setting has become ‘stuck’. FM coming through OK but cant demodulate any AM signals.
    They were in one build, I was on aviation band on AM, all working/…went to an FM marine channel (FM) and that was good too, went back to the AM Aviation channel..and a little bit of sound then ..stopped.

    Can’t get AM on the local machine with GQRX either now
    AM signal peak is showing -30db Squelch set to -150

  37. or maybe I have screwed with some setting or other in SDR#. is ther any files to remove/ reset to get everything back to default?

    1. Hi Neil, It won’t be the dongle causing the problem, because it doesn’t handle any demodulation. The dongle just sends a stream of digitised IQ samples over the network to SDR Sharp or internally to GQRX. I have had intermittent problems with AM on GQRX but no problems with SDR Sharp. To clean SDR Sharp, just delete the entire installation directory and install again. If you want to be able to remotely access your dongle via the Internet, you’d be better off using Spy Server. This has been put together to support the Airspy range of receivers but it also supports RTL dongles. It has a very efficient low bandwidth mode that’s ideal for accessing receivers over the Internet. If you want to checkout the performance there are several servers that are open to the public. You can see them on this page: https://airspy.com/spy-servers/

      I’ve written installation instructions here:
      https://photobyte.org/running-spyserver-raspberry-pi-3/

      I’ve also added an update so you can run Spy Server as a service on the Raspberry Pi. Here’s a link:
      https://photobyte.org/raspberry-pi-running-spy-server-as-a-service/

      I’ve even got preloaded cards ready to go here: https://photobyte.org/product/spy-server/

      Regards,

      Mike

  38. Thanks Mike

    Yes, I did just that, deleted SDR# and re ran the bat file.
    Worked instantly after that

    May have come across minor error in your instructions to edit
    /etc/roc.local

    The second line
    /usr/local/bin/rtl_tcp -a $_IP &

    Think it needs “ “ around the $_IP

    Could I install Airspy ‘over the top’ of the current working RTL_TCP setup ?

  39. OK, got the airspy running..oh BTW your scripts page for configuring the Airspy config file…link seems broken.

    Cant find an iPhone app for receiving/ driving the Spyserver..so gone back to the RTL-TCP

    Ideally I’d like to run the dongle and RPi into a web server page so I can access it from any where with no client needed …just a web browser

  40. hi Mike, First thanks for the tutorial, it is very understandable. I am having some problems, using sdrsharp. it does conect to the server (raspberry pi 3), but there aren´t any rf energy exept for one extrange peak of energy in exactly the half of the espectrum displayed, if i change the frecuency range displayed, the peak stays right in the same place, I think this might be a driver or sdrsharp problem. if i connect the sdr direct to the pc it works properly and there is no peak. i cant find any app named SDR# wich i have seen in lots of your comments. (I am using windows 10)
    i look forward to your replay. thank you

    1. To use the Raspberry Pi RTL-SDR server from Windows 10 you first have to install SDR Sharp. This is a free download from airspy.com/download/
      Once you have SDR Sharp installed, connect the RTL-SDR dongle and network cable to the Raspberry Pi and power-up the Pi.
      Open SDR Sharp in Windows 10 and in the Source section (top left) choose RTL-SDR(TCP). Now go to the Settings (cogs icon) and enter the Pi IP address in the Hosts box and leave the Port at 1234. Close the settings and press the Play button at the top to start the receiver.
      When it starts it will be very insensitive as the gain is set to minimum by default. To correct this open the Settings again and adjust the RF gain slider. It’s important not to use excessive gain. The simplest way to set the gain is to slowly increase it until the noise floor starts to rise and then back-off slightly.

      Let me know how you get on
      Mike – G4WNC

  41. Hi Mike,
    is it possible to run 2 (or more…) dongles at the same time on a single Raspberry Pi?

    best DX
    de
    i2NDT Claudio

    1. Hi Claudio,

      Yes it is. The most I’ve managed is 4 on a Pi-3 but I had to reduce the dongle sample rate down to 1.024MSPS for that. A Pi-3+ will be the best option.
      Here’s an example of the commands to launch 4 instances from inside the rc.local file.

      /usr/local/bin/rtl_tcp -a $_IP -d0 -p1234 &
      /usr/local/bin/rtl_tcp -a $_IP -d1 -p1235 &
      /usr/local/bin/rtl_tcp -a $_IP -d2 -p1236 &
      /usr/local/bin/rtl_tcp -a $_IP -d3 -p1237 &

      For each instance you will see that I’ve incremented the port number by 1 and added the -d switch to select the RTL-SDR device. If you’re launching these manually, use the following from a terminal session:
      rtl_tcp -a 192.168.178.111 -d0 -p1234
      rtl_tcp -a 192.168.178.111 -d1 -p1235
      rtl_tcp -a 192.168.178.111 -d3 -p1236
      rtl_tcp -a 192.168.178.111 -d4 -p1237

      In the above change 192.168.178.111 to the IP address of your Pi.

      Mike – G4WNC

      1. thanks Mike!
        as soon as my dongles come back (I borrowed them to a friend) I will try!

        Claudio

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.