Raspberry Pi as Remote Server for RTL2832u SDR
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.
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
sudo make install
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.
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.