Installing RTL SDR Software
NB: UPDATED 25th August 2021
- Updated install commands
Manual Installation
These instructions assume you are starting with the latest Raspberry Pi OS from the Pi site. NB: The Lite version is all you need.
Before you start installing RTL-SDR you should bring the OS up to date as follows:
sudo apt update && sudo apt full-upgrade -y && reboot
With the updated image the next 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 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!
- cd rtl-sdr
- mkdir build
- cd build
- cmake ../ -DINSTALL_UDEV_RULES=ON
- make
- sudo make install
- sudo cp ../rtl-sdr.rules /etc/udev/rules.d/
- 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. NB: Do not press the X to close the window
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
What software would I use as a client in Windows?
Tried SDR# with no luck so far.
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
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
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
Hi Mike,
great, thanks a lot.
Have a nice day!
Stefan
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.
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
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.
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
wondering why my pi is streaming on a different port (never 1234) each time?
works great when it works!
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
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.
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
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
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
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?
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?
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.
Just figured out my errors. Was an IP address mistake on my part.
Excellent tutorial pretty much copy paste and you are set. Used. It on 3 RPis. Takes very little time.
Thanks
TomW
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.
Hi Aaron,
You’re making a simple typo, the first letter of the command is a lowercase L 🙂
Regards,
Mike
Thanks, that worked. 😉
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
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
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
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
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
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
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 !
Unfortunately, the server only supports a single connection.
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 !
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 ?
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
Hello:
It would be interesting to create an sd card for the use of AIRSPY, similar to the RTL DONGLE SERVER
regards
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
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
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.
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
there are multiple rtl-sdr libraries colliding. Try:
export LD_LIBRARY_PATH=/usr/local/lib in the shell and retry
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
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
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!
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
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.
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
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
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
Doh…. sudo apt-get install git —- Solved!
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
Hi – Try using rtl_test -t from terminal session on the Pi to check the dongle.
Mine does the same
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!
No E4000 tuner found, aborting
I ran RTL_test-t from the terminal session as per the guide.
Hi Ben,
I think you’ve now spotted that you missed the space in the cmake command. Spaces are difficult to show reliably as it depends how your browser renders the page and what size screen you’re using.
The message you’re getting from rtl_test -t is correct. The aborting message is normal. It occurs because the test program checks to see if your dongle uses an R820T or E4000 tuner. When it finds a tuner it reports the details and then aborts when the alternative tuner is not found. You should be all running now.
Regards,
Mike
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.
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
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.
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
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.
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?
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
Original Pi with that generic DVB-t tuner
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
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
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
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:~ $
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
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)
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
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
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
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?
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
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 ?
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
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
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
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
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
thanks Mike!
as soon as my dongles come back (I borrowed them to a friend) I will try!
Claudio
I have a the problem that at all sample rates w/ rtl_test i lose bytes.
2 clean installs and 2 different dongles have i tried with no change
i have the Raspberry Pi-3 B+
Hi Michael,
Happy to help but I need a bit more information.
How many bytes are being lost?
How is the dongle connected to the Pi?
Regards,
Mike
I’ve been troubleshooting a lot since I bumped on problems getting my RT804T dongle to work with RTL-SDR and Raspberry Pi-3 B+. I have tried with powered USB-hubs, USB-Y cable to get more current etc etc. Nothing helps!
No-one seems to have mentioned it yet, but my conclusion is that it currently doesn’t work with the 3B+ version. I “downgraded” to a RPI 3B instead and everything just started working like a charm. I’m pretty sure this is a driver related issue with the new USB chipset that comes with the 3B+ model..
Hi, Mike!
Thanks for putting this together. I’m making a headless “ADS-B dongle” out of an RPi Zero W with dump1090, and most of the how-tos want to install a gazillion GUI tools I have no use for.
I like to use checkinstall to make deb packages for things I download and build from source. It makes it easier to keep track of what I’ve installed, uninstall things that don’t work (out), and reproduce software on other machines.
When I tried to do that on an RPi Zero with 2018-11-13-raspbian-stretch-lite, checkinstall failed with:
Makefile:334: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Segmentation fault
**** Installation failed. Aborting package creation.
(Don’t know why cmake is checking the build system after everything is built, but apparently it did)
This is probably a bug in checkinstall, because running “sudo make install” worked, and checkinstall worked correctly on my Ubuntu 16.04 desktop. I just thought I’d let you know in case someone else complained about it, or some similar weird issue comes up.
Thanks again,
Ran
Hi Ran,
Thanks for the info. Mike
I installed everything as in the guide. When I want to run rtl_tcp, I enter the command rtl_tcp -a 192.168.1.24 and I get the message:
“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 1,000,000,000 Hz.
rtl_tcp: symbol lookup error: rtl_tcp: undefined symbol: rtlsdr_set_bias_tee ”
What could be the reason?
Hi Mike, As an absolute newbie to the raspberry I did get stuck at creating the blacklist file. Fortunately I managed to figure it out by watching some youtube video’s. What was throwing me was the text to do the following: “Press control-X followed by Y to exit and save the modified file”. I was just closing the opened blacklist file by clicking on the X in the top right hand corner assuming that it would be saved after I had pressed Y. When I could not get it to work I spent some time trying to figure out what it was that I was missing. For me as a complete newbie then maybe you could alter this text to read “Press control-X followed by Y followed by enter to save and exit the modified file”. I do seem to have it working now. Thank you for taking the time and the trouble in writing these instructions out as it does help newbies like me.
Hi Alan,
Useful feedback – I’ll update the guide. Glad you found it useful.
Mike – G4WNC
Hi Mike, I may not of explained the problem that I ran into well enough due to my inexperience. On the raspberry O/S that I am using in order to save and close the blacklist-rtl.conf file I had to press the enter key after Pressing Control-X followed by Y to exit and save the modified file. Not knowing that the enter key had to be pressed was what had caused the problem for me. Further down at the part for creating the auto boot file (rc-local) you have included to also use enter after pressing Y. “Type control X followed by Y and Enter to save the changes”.
Alan.
Hi Mike, Thanks for the tutorial.
Unfortunate I was not able to make it work. I seemed to be stuck at the MAKE command. Typing MAKE during your procedure gives me this error:
make: no targets specified and no makefile found. Stop.
Any assistance is appreciated. Thanks!
Hi Mark,
Whilst I think you showed make in capitals for clarity it’s important to use the command in lower case. Assuming the previous steps completed successfully, the error you’re getting suggests you are in the wrong directory. You need to be in the ~/rtl-sdr/build directory.
Try that and let me know what happens.I’ve also just used the instructions here on a new card and it’s working fine. Let me know how you get on.
Regards,
Mike
This line:
4: cmake ../ -DINSTALL_UDEV_RULES=ON
should be in fact:
4: sudo cmake ../ -DINSTALL_UDEV_RULES=ON
Hi – If you’re working in your home directory (the instructions assume that) you don’t need the elevated permissions associated with sudo. This is because cmake creates all its files within the home directory. If you are not in your home directory, you would need to use sudo. The part of the build that needs sudo is make install as this copies the newly created binaries to their correct location in the file system.
Regards,
Mike – G4WNC
Hi, want to set up a remote receiver but there is no direct internet. Is this likely to work with a 4G connection?
Hi Paul, You could try but my guess is that it won’t work due to insufficient bandwidth. The RTL dongle server needs around 30-40Mb/s of continuously available bandwidth for normal operation. You could try with the sample rate reduced butbit still might struggle. 4G data is often better than local Wi-Fi so it’s worth a try.
By far the best way to use an RTL-SDR dongle or Airspy receiver over the Internet is to use Spy Server. When running with SDR Sharp, you have access to a low bandwidth mode that reduces the bandwidth demand considerably.
Regards,
Mike – G4WNC
Hi Mike, Got your book recently and followed the instructions for Chap 3, Project 3. All is OK until I click play on SDR# , I always get the following error message “An error occurred loading a configuration file: Access to the path ‘C:\Program Files\Amateur Radio\SDR#\xxxxxxxx.tmp is denied. (C:\Program Files\Amateur Radio\SDR#\SDRSharp.exe.config). Any ideas on solving this?
Thanks & Regards,
Steve G8CRB
Hi Steve,
Thanks for buying the book 🙂
This is an easy fix! Windows doesn’t like programs that attempt to write to the Program Files folder. It’s considered a security threat. The correct method is for programs to store config files and similar information in the Program Data folder. However, SDR# doesn’t obey those rules and is designed to operate in a single folder anywhere on your PC. Most people put the program in a separate folder on the root of the C: drive, i.e. C:/SDRSharp. This avoids the Windows permission problems.
Regards,
Mike
– G4WNC
Done ! Thanks for the quick reply and working solution. Regards, Steve
Not sure if anybody else is still having issues, or if I am the only one, but after several days of installing, tinkering, uninstalling, tinkering some more, researching and pulling most of my hair out, I STILL cannot get this working correctly. The issue I am having is with the “usb_claim_interface error -6”
I have followed dozens of tutorials from scratch, gone over my blacklist SEVERAL times, employed every possible fix that other people have suggested and nothing seems to work!
On the initial install, everything works like a charm. rtl_test looks good and I can start the rtl_tcp server fine. HOWEVER, the problem I have is when the Pi is shutdown/rebooted (when I relocated it to a more suitable area in my home) Any time I have to restart the Pi, the rtl_test throws the usb_claim_interface error -6… and tcp server wont start and gives the same error.. the only way I can fix this is by unplugging the SDR from the Pi and re-plugging it in.. for whatever reason, I can go right back to my pc and start the rtl_tcp with no problems…. but the problem happens all over again if the Pi loses power or is rebooted….
I am at my witts end with this and after posting to several forums and attempting contact with several Youtubers who’s tutorials I’ve followed, I’ve received no responses from any source… Can ANYONE shed some light on how to fix this????
Hi Austin,
The usb_claim_interface error -6 simply means another kernel module is using the device. This is normally the digital TV drivers as these are the default drivers for the rtl-sdr dongle and are loaded as soon as the dongle is detected. The other possibility is that the rtl_tcp server is already running. Have you followed any instructions to setup the rtl-sdr server to auto-start?
Here’s a few other points to try:
When you hit the problem, open a terminal session and type lsmod. This will list all the loaded modules. If you send me the output I’ll take a look.
An alternative solution is to give up on manual installation and use: sudo apt install -y rtl-sdr This will install rtl-sdr and is set to automatically detach any existing kermnel module when you run a rtl-sdr command.
Mike – G4WNC
Greetings, I was just checking out your website and submitted this message via your “contact us” form. The “contact us” page on your site sends you messages like this to your email account which is why you’re reading through my message at this moment correct? This is half the battle with any type of online ad, making people actually READ your advertisement and this is exactly what you’re doing now! If you have an ad message you would like to blast out to lots of websites via their contact forms in the US or anywhere in the world send me a quick note now, I can even focus on specific niches and my charges are very affordable. Send a reply to: dalosrafael9183@gmail.com
Hi, the tutorial is bang on the money, I am very late to the party but following your instructions (in fact copying and pasting many of the commands into an SSH client) had this working in a very short time indeed. Just going to do a few edits now to get it to auto-start. Thank you, kind regards David, G0FVT
Hi David,
Thanks for the feedback. Mike – G4WNC
Hi Mike once I start it up I get this
Use the device argument ‘rtl_tcp=10.0.0.232.1234’ inOsmoSDR (gr-osmodsr) source to receive samples in GRC and control rtl_parameters (frequency, gain,…
Hi Steve,
Sorry about the delayed reply. It looks as though your Pi doesn’t have an IP address. Enter hostname -I in the console to view the IP address. It should be something like 192.168.n.n.
Also, you can check the dongle connection using: rtl_test -t
Regards,
Mike
Like most every other guide I’ve followed for the Rasberry Pi, it doesn’t work.
cmake ../ -DINSTALL_UDEV_RULES=ON
bash: cmake../DINSTALL_UDEV_RULES=ON: No such file or directory
All previous steps were performed ok with no errors.
My bad
cmake ../ -DINSTALL_UDEV_RULES=ON
should have been
cmake ../ -DINSTALL_UDEV_RULES=ON
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.0.25
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.
listening…
Use the device argument ‘rtl_tcp=192.168.0.25:1234’ in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, …).
Can’t get it to work still
Ben,
The final message reports that it’s listening on 192.168.0.25, so it all looks fine. I suspect the problem is connected with how you’re accessing the dongle.
Here’s what you should be doing:
** Run SDR Sharp on another PC on the same local network.
** In the Sources box select RTL-SDR TCP
** Go to the cogs icon at the top and enter the Pi IP address in the host box (192.168.0.25)
** The Port box will probably already be set to 1234 but, if not, correct it
** Click the Play arrow at the top and the receiver should start
** It will probably be very deaf, so go to the cogs icon again and move the RF gain slider till you start hearing signals. Don’t push this too far or you’ll cause overload.
NB: Ideally the PC and the Pi should be using wired Ethernet unless you have a particularly good local WI-Fi system. The dongle needs to be able to send a 32Mb/s continuous data stream and few Wi-Fi systems can manage that reliably.
Hope that helps,
Regards,
Mike – G4WNC
Don’t know whats going on
Running from the cmd line it works fine.
But running via rc.local I can’t connect.
#!/bin/sh -e
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will “exit 0” on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Print the IP address
_IP=$(hostname -I) || true
if [ “$_IP” ]; then
printf “My IP address is %s\n” “$_IP”
fi
sleep 15
/usr/local/bin/rtl_tcp -a $_IP &
exit 0
Any idea’s?
73, Ferry PD9FER
Hi Ferry,
Look carefully at my instructions; you have two errors in your script:
1 – The sleep 15 statement should be immediately after the line: #Print the IP address
2 – The line that runs the server (/usr/local/bin/rtl_tcp -a $_IP&) should be before the line containing fi
Here’s an example of how it should look:
# Print the IP address
sleep 15
_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
Hi Mike,
Thanks for all this information, just set up and sdr server as per your instructions and it worked first time!
Keep doing all the good work
Hi Iain,
Pleased to hear it worked well for you. Thanks for taking the time to let me know.
Mike – G4WNC
These instructions are great.
However the git command needs to be edited, this works:
git clone https://gitea.osmocom.org/sdr/rtl-sdr.git
I just got a Nooelec v5 and it is up and working.
This is the same “Art” that posted the comment in September 2016.