Upgrading cmake on Raspbian Jessie

Trying to build and install rtl-sdr from source I got this error on a Raspberry Pi 1 running Jessie:

$ cmake ../

CMake Error at CMakeLists.txt:22 (cmake_minimum_required):
CMake 3.7.2 or higher is required.  You are running version 3.6.2

Doing an ‘apt-get update’ and ‘apt-get upgrade’ is not picking up a more recent version, so following the steps here, I downloaded the required 3.7.2 version from source and followed the steps to build it: http://osdevlab.blogspot.com/2015/12/how-to-install-latest-cmake-for.html

I downloaded a .tar for the 3.7.2 version from:

https://cmake.org/files/v3.7

The build look over 2 hours, but completed successfully, and now I’m able to build rtl-sdr.

Configuring rtl_fm and Direwolf for decoding Amateur Radio Packet on the Raspberry Pi

rtl_fm is one of the utilities from the rtl_sdr package for using a TV dongle as an SDR. Head over here if you need more info on this.

Direwolf is a soundcard based packet modem.

According to the Direwolf docs, it supports using rtl_fm as an input, so I thought I would take a look at look at getting these running together.

I’ve used rtl_sdr and rtl_tcp on my Pi before, but not rtl_fm, so first to get this working.

To playback the stream from rtl_fm you need to pipe into into some audio app. This is the same way that direwolf is going to read the stream too. Following the suggestion here on the rtl_sdr page, this command works fine for a local broadcast radio station on 96.9MHz:

rtl_fm -f 96.9M -M wbfm -s 200000 -r 48000 | play -r 48000 -t s16 -L -c 1  -

I’m not sure what all these options are, but the key options seem to be -s for the sample rate, and -r for the resolution. The -r value needs to match on the rtl_fm side and on the play side.

Now to get direwolf installed on Raspbian:

– per the userguide, first install libasound-dev:

[code]sudo apt-get install libasound-dev[/code]

– download the source zip from: https://home.comcast.net/~wb2osz/site/?/page/Download/

– unzip and cd into the direwolf folder

– make with:

[code]make -f Makefile.linux

make install-conf

make install_rpi[/code]

At this point I have rtl_fm on the Pi working as it should, and direwolf working great when decoding audio input from a 2m radio input via a USB soundcard. Combining the two though is giving me issues.

I don’t thing I’m able to get a strong enough received signal on 2m on the RTL stick even with an external 1/4wave 2m antenna.

This is the combination of commands, rtl_fm, piping into Direwolf:


[code]rtl_fm -f 145048467 -M fm -s 200000 -r 32000 -g 35 | direwolf -n 1 -r 32000 -b 16 -t 0 -[/code]

I’ve allowed for the tuning offset ppm on this RTL card, but maybe I’ve calculated this wrong?

Anyway, since Direwolf by itself on the Pi is working well and what I needed for a small packet project was to be able to decode packet on the Pi, I’ll be putting rtl_fm on hold for the time being and playing with Direwolf by itself.

Installing rtl-sdr and dump1090 on a Raspberry Pi to receive ADS-B signals

I’ve gone through these steps a couple of times when I’ve set up a new SD card, and had to go to various places to work out all the steps, so in case this is useful for someone else, here’s the steps (assuming installing on Rasbian):

Making and installing rtl-sdr from source

Instructions: http://sdr.osmocom.org/trac/wiki/rtl-sdr

Pre-req steps, if you don’t already have the following:

sudo apt-get install cmake

#usb driver for the rtl dongle
sudo apt-get install libusb-1.0

Get the source:

git clone git://git.osmocom.org/rtl-sdr.git

Build:

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

If you get permissions errors like this when using any of the rtl_* commands:

Using device 0: Terratec T Stick PLUS
usb_open error -3
Please fix the device permissions, e.g. by installing the udev rules file rtl-sdr.rules
Failed to open rtlsdr device #0.

Then you should be able to add a line to

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

 to set up correct permissions for your specific card, which you can find by running lsusb, eg for mine:

Bus 001 Device 004: ID 0ccd:00d7 TerraTec Electronic GmbH

From this I believe you take the id value and insert it into a new line in rtl-sdr.rules like:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ccd", ATTRS{idProduct}=="00d7", MODE:="0666"

and then restart udev:

sudo service udev restart

… reboot and that should be fixed.  Or you can still run the apps with sudo.

To test, try starting up the rtl_tcp server:

sudo rtl_tcp -a your_ip

and you might see a message about the device already in use by another kernel module:

Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001
Using device 0: Terratec T Stick PLUS
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.

This is saying dvb_usb_rtl28xxu is already using the device. From instructions here, you can temporarily unload this module:

sudo rmmod dvb_usb_rtl28xxu

or permantly remove it with a blacklist entry in /etc/modprobe.d – add a new file here named something like rtl-sdr.conf, add add one line with the name of the above driver:

blacklist dvb_usb_rtl28xxu

Reboot and now you should be good to go with the rtl_* commands.

 

Making and installing dump1090:

From https://github.com/MalcolmRobb/dump1090

git clone https://github.com/MalcolmRobb/dump1090.git
cd dump1090
make

Run in interactive mode:

./dump1090 --interactive

or net mode to enable the webserver (point a browser at you Pi’s IP address and port 8080):

./dump1090 --net