You have probably heard about the cheap little USB Dongles made to receive digital Television and / or radio. They come in many shapes and forms (and prices) but you can find some cheap ones around the net. You can score one for around 10 € easy on ebay.
The heart of the system is build on the RTL2832U Chipset or the RTL2838 (Many devices with EEPROM have 0x2838 as PID and RTL2838 as product name, but in fact all of them have an RTL2832U inside. Realtek never released a chip marked as RTL2838 so far (source) ) and comes with a variety of tuners. The two most common (and wanted) tuners are :
E4000 – 53 Mhz – 2217 Mhz (with a gap in 1109 to 1251 Mhz) These tuners are the most desirable to have, though the company providing this tuner (Elonics IP) seems to be sold. The future of this tuner is unsure. My Terratec Tstick, for example, has this tuner.
R820T – Rafael Micro R820T – According to rtlsdr.org this tuner is a worthy follow up with comparable performance and cheaper in production.
I have both variants. And I will connect them both to my freshly new Rasperry PI with Raspian and see what we are running up to 🙂
So basically what I will do is install RTL-SDR to communicate with the USB Stick and we will install multimon-ng to add some extra nifty features for decoding POCSAG e.t.c.
So the first step is to boot-up your Raspberry, connected to the network and SSH to your Raspberry (or use the local shell ofcourse, but I prefer to do it remotely)
If you add the USB Stick (the R820T + RTL2838) I’ve noticed the Raspberry rebooted.
pi@srv-rasp-01 ~ $ lsusb Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
To see a bit more details and to find out the VID (Vendor ID) and PID (Product ID) you can use LSUSB -v and check if your hardware is compatible with RTL-SDR here : http://sdr.osmocom.org/trac/wiki/rtl-sdr
idVendor 0x0bda Realtek Semiconductor Corp. idProduct 0x2838 RTL2838 DVB-T
It seems my DVB-T Stick is compatible. ( Generic RTL2832U (e.g. hama nano)) so lets move on to the installation of the RTL-SDR software.
Get your Raspberry up2date first.
sudo -i apt-get update && apt-get upgrade
Now install the required utils and libraries to compile RTL-SDR
apt-get install git cmake libusb-1.0-0.dev build-essential
Download RTL-SDR and compile the software.
git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr/ mkdir build cd build cmake ../ -DINSTALL_UDEV_RULES=ON make make install ldconfig
In order to be able to use the dongle as a non-root user, I used cmake with -DINSTALL_UDEV_RULES=ON argument in the above build steps. This is an optional thing. The software will install in /usr/local/bin/ and consists of a few utils : rtl_adsb, rtl_eeprom, rtl_fm, rtl_power, rtl_sdr, rtl_tcp, rtl_test
After the installation, reboot the raspberry and login with a normal user account.
Now, type rtl_test :
pi@srv-rasp-01 ~ $ rtl_test Found 1 device(s): 0: Generic RTL2832U OEM
Using device 0: Generic RTL2832U OEM
Kernel driver is active, or device is claimed by second instance of librtlsdr. In the first case, please either detach or blacklist the kernel module (dvb_usb_rtl28xxu), or enable automatic detaching at compile time.
usb_claim_interface error -6 Failed to open rtlsdr device #0.
Ok, not good. let’s fix this little issue 🙂 . We have to blacklist the automatically loading of the kernel module. Edit /etc/modprobe.d/raspi-blacklist.conf and add the following lines. (Note : If this raspi-blacklist.conf doesn’t exist, just create it)
blacklist dvb_usb_rtl28xxu blacklist rtl_2832 blacklist rtl_2830
Reboot the Raspberry again and retry the rtl_test
pi@srv-rasp-01 ~ $ rtl_test Found 1 device(s): 0: Generic RTL2832U OEM 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
Info: This tool will continuously read from the device, and report if samples get lost. If you observe no further output, everything is fine.
Reading samples in async mode… lost at least 64 bytes
This looks O.K. to me. I lost a few samples at the startup. But no new messages popped up.