Weekend Project – Setup a RTL-SDR Server
Small weekend project, setting up a RTL–SDR server, making playing around with Gqrx, GnuRadio… more convenient. It contains:
- Hardware Setup,
- Install SW for RasPi, the RTL-SDR server,
- Install SW for Client, (Gqrx, GnuRadio and Mobile), using the RTL-SDR server ,
Basically all the following instructions are very close to this fine HowTo’s:
- Mike Richards Radio and Computing Blog – Using the Raspberry Pi as an RTL-SDR dongle Server,
- John’s Musings Blog – Make a Raspberry Pi 3 RTL-SDR Server,
- Gqrx Website (Install – HowTo),
- Android Scanner (link google play store), similar to Gqrx,
- GnuRadio (Install – HowTo)
Hardware Part
- standard Raspberry Setup, integrate it into my network and check if it running
- RTL–SDR Dongle, you can almost use every one, I used this one (Amazon.de link) I bought some years ago, unfortunately at that time a bad buy because only starting from 24Mhz and not as indicated starting from 100kHz.
- Broadband antenna. To avoid discussions: No there is no ideal broadband antenna across the whole spectrum, but this one works for me.
Screwing it all together was really simple, but some advice: between dongle and Icy box place some foam to avoid friction and consequently damage. Also isolate all cut-outs and openings with some tape. Be aware, in this setup you can’t place this setup directly exposed to the weather, especially humidity and direct sunlight (heating up!). But I installed it sheltered place so that’s fine for me. Out there is also power and a plug to my home intranet. Ready for deployment (the stick is only for backup and no needed part for deployment)
Setup Software @ RasPi
I already described the standard setup for the RasPi, using DietPi in a older blog entry. Based on this, setup for for the RTL-SDR Server. My step for step version:
- install gcc, / make & Co is needed, so ssh to your powered up RasPi and do
$ dietpi-software -> [Software Additional] & [Development / Programming]let it install and reboot, and ssh/logging in again to your RasPi as root. - Install cmake:
$ apt install cmake
- Install RTL SDR, just follow the HowTo from John’s Musings Blog – Make a Raspberry Pi 3 RTL-SDR Server, doing this as root on your RasPi:
$ sudo apt-get install -y cmake pkg-config libusb-1.0 git
$ git clone git://git.osmocom.org/rtl-sdr.git $ cd rtl-sdr/ $ mkdir build $ cd build $ cmake ../ -DINSTALL_UDEV_RULES=ON
-DDETACH_KERNEL_DRIVER=ON
$ make $ make install $ ldconfigBlacklist the RTL Drivers $ nano /etc/modprobe.d/fbdev-blacklist.confAdd the following lines to this file:
$ blacklist dvb_usb_rtl28xxu $ blacklist rtl2832 $ blacklist rtl2830
close file (<control-X> <Y> = exit and save modified file),
if not done yet, connect RTL-SDR Dongle and reboot the RasPi$ reboot
Test installation
$ rtl_test -t
Output in my case:
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.
- Auto Boot – Last step looks excellent, dongle is recognized and seems to be working. Now I need to start it during RasPi is booting every time
I can start the server with rtl_tcp -a ‘your Pi’s IP address’. As a practical example, the start command on the RasPi (if you ssh’d to it, xxx = your RasPi Network address):
$ rtl_tcp -a xxx.xxx.xxx.xxx for auto boot I make it start at boot like recommend for newer installations of Linux that use systemd, like the actual DietPi is using. To do so edit or create rtltcp.service on your RasPi:$ nano /etc/systemd/system/rtltcp.service
Then add this to the empty file (Make sure you are using the right IP address for your installation):
[Unit] Description=RTLTCP After=network.target [Service] ExecStartPre=/bin/sleep 30 ExecStart=/usr/local/bin/rtl_tcp -a xxx.xxx.xxx.xxx [Install] WantedBy=multi-user.target
close file (<control-X> <Y> = exit and save modified file),
$ systemctl enable rtltcp.service
Now it start at boot automatically
Setup Software @ local PC (Ubuntu 18.04) – Gqrx:
Basically you can follow this instructions from the Gqrx website. If necessary, purge older installations. Also, if you use other PPA’s like the following one you also should remove them. Now add::
$ sudo apt-get purge --auto-remove gqrx $ sudo apt-get purge --auto-remove gqrx-sdr $ sudo apt-get purge --auto-remove libgnuradio* $ sudo add-apt-repository -y ppa:bladerf/bladerf $ sudo add-apt-repository -y ppa:myriadrf/drivers $ sudo add-apt-repository -y ppa:myriadrf/gnuradio $ sudo add-apt-repository -y ppa:gqrx/gqrx-sdr $ sudo apt-get update $ sudo apt-get install gqrx-sdr
I also recommend to install the libvolk1-bin package and run the volk_profile tool to optimize GNU Radio performance:
$ sudo apt-get install libvolk1-bin
Run from your profile:
$ volk_profile
Now you start up (if not done yet) your server and Gqrx. Connecting to your RTL-SDR Server, following the instructions from John’s Musing “Make a Raspberry Pi 3 RTL-SDR Server“. Just add the remote control settings (xxx.xxx.xxx.xxx IP address from your RasPi) and configure the I/O devices (rtl_tcp=xxx.xxx.xxx.xxx:1234)
and you should see something like this after tune in to (for this example) a local radio station:
Setup Software @ Android Phone:
Basically the same setting like for Gqrx you can use with RF Analyzer from Android store, so you can listen to your preferred radio or ham station via mobile phone. If you open port 1234 to the outside world you can connect to your server from everywhere in the world, but I didn’t figure out the necessary security settings so I test this only one time and don’t use active now (and closing this port to outside…):
Setup Software @ GNU-Radio
There are several ways to install GNU-Radio. Something you will get some errors. Finally I used this version from the official website, installing GNU Radio version 3.7.x (3.8 didn’t work for me). But I had to purge an older version. And i installed Gqrx prior. Maybe this will help you. The source block for RTL-SDR should have this simple setting:
Device Arguments = rtl_tcp=xxx.xxx.xxx.xxx:1234 samp_rate = 1200000
Hint: You will find the source block under [no module specified] – [Sources] – … if you installed Gqrx like described above.
Additional Software
- Actual just trying out SkyWave Linux, running in a virtual Box. Looks great for now and connects without hassle to my RTL-SDR Server.
- … [tbd]…