Monday, March 4, 2013

Compiling rtl_fm on the Raspberry Pi

EDITED 13-Sep-2013: Minor bugfixes on commands, added more explanation.

I got myself an RTL2832 DVB-T dongle from the bestest provider of cheap stuff in the whole Internets.

Getting it going on Raspbian Wheezy on the Pi turned out to be easy (ref):

sudo su -
apt-get update
apt-get install git
git clone git://git.osmocom.org/rtl-sdr.git
apt-get install libusb-dev libusb-1.0 libtool cmake
apt-get install build-essential

cd rtl-sdr/
mkdir build
cd build
cmake ../
make
make install
ldconfig

I found that the instructions about running cmake ../ -DINSTALL_UDEV_RULES=ON  to allow non-root access didn't work, so I copied the udev rule over manually to the correct directory:

cd ..
cp rtl-sdr.rules /etc/udev/rules.d/


Proof of the pudding, reboot, plug in the dongle, test it as a regular user.


pi@raspberrypi ~ $ rtl_test -t
Found 1 device(s):
  0:  ezcap USB 2.0 DVB-T/DAB/FM dongle

Using device 0: ezcap USB 2.0 DVB-T/DAB/FM dongle
Found Elonics E4000 tuner
Supported gain values (14): -1.0 1.5 4.0 6.5 9.0 11.5 14.0 16.5 19.0 21.5 24.0 29.0 34.0 42.0 
Benchmarking E4000 PLL...
[E4K] PLL not locked for 51000000 Hz!
[E4K] PLL not locked for 2217000000 Hz!
[E4K] PLL not locked for 1109000000 Hz!
[E4K] PLL not locked for 1243000000 Hz!
E4K range: 52 to 2216 MHz
E4K L-band gap: 1109 to 1243 MHz

And we're all done!

You'll notice the first command I entered is sudo su - .This gives root access, saving you from having to type Simon Says sudo for every command. Once you're done, exit brings you back to the unprivileged user.

1 comment: