Raspberry Pi as Remote Server for RTL2832u SDR
Introduction
Note: Since this project was posted it has been brought to our attention that RTL2832U / R820T sticks may not be fully supported in the RTL drivers used here. The RTL2832U / E4000 sticks work fine.
One of the often overlooked features of the RTL drivers for the RTL2832U SDR sticks is the TCP server. The TCP server allows you to send data from the RTL2832U stick across your home network to a remote PC running a program to process the data back into SDR information such as SDR Sharp. While the Raspberry Pi is not quite powerful enough to run current programs to decode and process the SDR data from the RTL2832U stick, it can do a very good job of running the rtl_tcp server. This means that you can plug the RTL2832U stick directly into the Raspberry Pi and wind up with a very small and portable SDR radio server. You can either plug the Raspberry Pi directly to your router or use Wifi for more flexibility in placement. If you decide to go the wifi route, I would suggest you use wireless N since bandwidth can be an issue. You can use either a WiFi dongle on the Raspberry Pi’s USB port or a WiFi gateway interface. The nice thing about the WiFi gateway is that it needs no drivers to connect to the Raspberry Pi since it converts WiFi date to ethernet. If you decide to go the dongle route, be sure to do a little research on what dongles work well on the Pi.
Demonstration Video
Why would you want to do this?
There are several reasons you might want to do this. Here are a few:
1. One of the biggest reasons would be to cut down on the amount of antenna cable you have to use. The less cable you use the less signal loss you will have. The Raspberry Pi and rtl_tcp combination will let you mount the RTL2832U closer to your antenna connection point. Let’s say for example that your antenna is mounted in the attic, but your monitoring station is downstairs. Rather than run 150 feet of cable to the monitoring station, mount the RTL2832U and the Raspberry Pi close to the antenna and use WiFi to send the SDR data downstairs.
2. Set up the Raspberry Pi / RTL2832U SDR server in one location and use your laptop running SDR Sharp to monitor your RTL-2832U SDR radio anywhere in the house.
3. Make the Raspberry Pi / RTL2832U server accessible from outside of your home network and listen to your SDR radio while you travel.
4. Set up a remote monitoring location in another part of the country.
5. Mount the whole thing in a weatherproof enclosure powered by solar cells and put it at the top of your antenna tower.
6. Tie it all to a helium balloon and have a 500ft antenna.
I am sure you could think of other uses for such a small portable SDR server.
Geting it Going
1. Install the latest Debian release on your Pi and update it.
2. Before you install the RTL drivers, you will have to install the following dependencies if they are not already installed by typing the following commands in terminal window at the prompt.
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0.dev
sudo apt-get install build-essential
3. Now we are ready to install the RTL drivers using the following commands:
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr/
mkdir build
cd build
cmake ../
make
sudo make install
sudo ldconfig
4. Before this will work you will need to locate your RTL directory using the file manger where the drivers where downloaded and copy the rules file into the etc/udev/rules.d directory.
5. Plug in the RTL-2832U stick and issue the rtl_test -t command to make sure the Raspberry Pi sees your stick.
6. Be sure that port 1234 is open on your router
7. To start the rtl server type rtl_tcp -a plus the ip address of your Pi. For example rtl_tcp -a 10.0.1.50
8. On your PC download the latest Dev version and configure it according to these instructions. Go to the interface section and and select RTL TCP and enter the IP address of your Raspberry Pi. Start SDR Sharp processing and it should be getting the data form the Pi and the RTL2832U.
9. You can now remove unnecessary peripherals like keyboard, monitor, and mouse.
Potential Problems
I have noticed that the server will stop working under the following circumstances, there may be more but these have been fairly consistent.
- If you exit SDR Sharp without stopping it’s processing of the remote data from the server.
- If the bandwidth gets to narrow to handle the data properly. This can be more of a problem with WiFi as the distance gets further between the Raspberry Pi and the router. A work around is to lower the sample rate on SDR Sharp.
- Tuning to an unsupported frequency area of your RTL-2832U stick.
For these reasons, if you are going to run the SDR server headless or locate the Raspberry Pi in an area where it cannot be accessed easily, you will need to get SSH going on the Pi and install Putty on your PC. By default SSH is usually already active on the Pi. Just install Putty on your PC and open a session using the IP address of your Pi. The default user name is usually Pi and the password is Raspberry. This will allow you to access the Raspberry Pi remotely to start the SDR server.







Hi thanks for you work writing this up. I went through the installation steps using the Debian Wheezy build after upgrading but I have a problem. rtl_test detects the device then reports it cannot be opened. In my distro I did not have a “etc/dev/rules.d” folder so created it and copied the rules file into it, do I need to chmod the rights on the folder of file, I did sudo su before creating the folder?
Sorry my bad, that should have read etc/udev/rules.d
Yep, that sorted my problem. Now have my Rpi serving out over my home network, albeit with the ‘problems’ you mentioned in the article. Thanks again.
Richard
Hi,
Thank You for the very easy and straight forward instructions! It worked right away! tested only with wired ethernet and no lockups!
/Risto
Works great on my 256mb PI and allows a full bandwidth transfer of the usb stick to sdr#.
Can you tell us what kind of usb stick you use? Especialy if it use E4000 or R820T on tuner… I am about to buy one and i’m not sure which one would be better (offcourse, to work with my 256M RaspberryPi). Thanks!
I used the E4000 chipset. There appears to be some issues right now getting the R820T working on the Pi.
Hi! I am trying this using an R820T tuner. Using the rtl_test, rpi successfully recognizes the device as well as the tuner, however it gives out this error:
rtlsdr_demod_write_reg failed with -1
rtlsdr_demod_read_reg failed with -1
rtlsdr_demod_write_reg failed with -1.
Any insights on this? Help would be very much appreciated, thanks!
Hello, and thanks for tutorial…
I manage to runmy Raspi and 2832/E4000 but trying the RTL 2832 / R820t i get the message:
pi@raspberrypi ~ $ rtl_tcp -a 192.168.178.60 -p 1234
Found 1 device(s).
usb_open error -3
Failed to open rtlsdr device #0.
Any idea ???
Tnx in advance and keep the nice work.
SV5BYR Mike
Rhodes island Greece.
There is an issue with the RTL820T working correctly. Even though the R820T driver looks to be available, it looks like that the R820T is missing from the provided Rules file. That will cause the stick not to be found. Maybe, someone will come up with the proper rule entry for the R820T
I found the solution to the problem. The issue is not with the Rules file. The issue is power. A standard 5V-1A power source seem to be insufficient to power up rpi as well as the dongle. To solve this, I used an external powered usb hub. This solved the problem! Hope this solves yours too!
Hi, I did run into the same error messages on my Pi and my solution was to “wirebridge” the SMD fuses on the board at the output USB ports. At a current of 200 mAmps they have a drop of about 300 mV which makes the power voltage to low for the dongles.
Thanks for the info Roman, I will have to give that a try!
Re e4000 and R820
I would say that there is a problem with the driver(s), I have tried using a 2 different powered hubs (3amp PSUs) for 820 and the dongle still is not fully recognised, it recognises the RTL chip and then says E400 not found, (does the sam even when not using powered hub) plus at one time using a hub I received the rtlsdr_demod_write_reg failed with -1
message for the E4000.
Using the dongles in PCs (various) no problem. On the PI I have bridged out the USB and power current limiting resistors so that full current can be applied (this has now been done on the new PI boards at manufacture)
It would be nice to get the 820 running as that is more sensitive than the E4000 chip
Yes, the rtl_test says that e4000 tuner is not found, however, you could now run rtl_fm and rtl_tcp successfully after using an external powered hub. or at least that is happening in my case.
You state that the “Raspberry Pi is not quite powerful enough to run current programs to decode and process the SDR data from the RTL2832U stick”. What are the limitations that you are seeing that would need to be improved on (memory, processor speed, etc)?
All the ones you listed, but mainly CPU resources with the current SDR software available. I suspect someone might come up with a light weight SDR program for it eventually. The Pi will run some SDR type programs now with some tweaking, but usually only for a dedicated application like ADS-B.
Hi, Works great with ezCap.
How do I start rtl_tcp as a service, this so it autostart and I don’t need to have my terminal window open all the time..?
Thanks!
Works perfect!
Found 1 device(s).
Found Rafael Micro R820T tuner
Using ezcap USB 2.0 DVB-T/DAB/FM dongle
Tuned to 100000000 Hz.
listening…
Use the device argument ‘rtl_tcp=192.168.1.101:1234′ in OsmoSDR (gr-osmosdr) source
to receive samples in GRC and control rtl_tcp parameters (frequency, gain, …).
Hello
I have problems with step 4. Maybe you can explain how I can get the rules into rules.d.
Hi Chris,
As step 4 says, you pretty much have to locate where you installed the original RTL driver folder on your Pi. In that folder should be a file labeled rules. You need to copy and paste that file into the etc/udev/rules.d directory on your Pi. It should work fine if your are using the recommended Wheezy version of Linux for your Pi.
Hi all, Im new to sdr and would like to have a go @ HF sdr using rasperry pi as server.Can anyone please tell me if R820t is supported by RPI os or am i best to go e4000/fcxxxx etc ? So many sticks !
The E4000 works better with the Pi.
Very good tutorial. I have a RTL2832U/FC0013, Conceptronic C08-096(CTVDIGUSB2) and it works perfect with my Raspberry Pi. Thanks!
I finally got mine up and running. Works fine at home on the local network, but when I try to access from a location outside the home network, the audio is very choppy. Away from home, I’m using Putty to start the Pi. I enter rtl_tcp -a 192.168.x.xxx and it starts fine.
I then go to SDR# and input my external ip addy in along with the port number, which has been forwarded and I get the choppy audio. This is with the sample rate in SDR# set all the way down to 0.25 MSPS.
I tried different sample rates in rtl_tcp and not much change.
Any ideas?
Thanks!
You can start rtl sdr with the & on the end on the command:
sudo rtl_tcp -a 192.168.1.101 &
When you shutdown your ssh de server keeps running, so you don’t use bandwith of for ssh.
Gr. Arie
Many thanks for the tutorial, but I have had no luck in getting the cmake ../ command to work. I am new to Linux and would appreciate any help.
On entering cmake ../ I get the following response
– Build tpe not specified: defaulting to release.
– Udev rules not being installed, install them with -DINSTALL_UDEV_RULES=ON
etc.
I copied the rules as specified into the rules.d directory.
Thanks – Mike