RTL-SDR/dump1090 build and install – Raspberry Pi (A Video Companion Article)

No Comments

These notes are adapted from a combination of sources and are subject to change. If you find an error, please leave a comment here or on the video so I can adjust as needed. LAST UPDATED 10/11/2021 17:02:40

 

The corresponding YouTube video is located here: RTL-SDR/dump1090 build and install – Raspberry Pi
I’ve also embedded it at the bottom of this article.

 

Setup the Raspberry Pi

 

As I mentioned above and in the video, a clean install just makes it easier and in the long run you have a purpose built system!

 

Install and update the Raspbian OS of your choice (as mentioned I start with the Raspberry Pi OS with Desktop
[https://www.raspberrypi.com/software/operating-systems/].

 

It’s worth noting that git is included with the version noted above, but ensure it’s updated! If for some reason you choose to use an existing RasPi you can install/verify the install by using:

RTL-SDR

 

This is a fairly straightforward install, run these individually (you can do them as a group command [sudo apt install git git-core cmake libusb-1.0-0-dev build-essential], but I prefer to do them individually to ensure no errors are missed if they occur):

                    

sudo apt install git
sudo apt install cmake
sudo apt install libusb-1.0-0-dev 
sudo apt install build-essential

On to the RTL-SDR driver source compile!

                    

git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make

You can compile quicker using a the make -j5 switch, but I don’t feel it’s necessary as this only takes a few seconds anyway!

From "man make":

-j [jobs], --jobs[=jobs]
Specifies the number of jobs (commands) to run simultaneously. If there is more than one -j option, the last one is effective. If the -j option is given without an argument, make will not limit the number of jobs that can run simultaneously. When make invokes a sub-make, all instances of make will coordinate to run the specified number of jobs at a time; see the section PARALLEL MAKE AND THE JOBSERVER for details.
                    

sudo make install
sudo ldconfig

If this was successful, the command will simply execute and return to the command line on a new line below it.

Now we can plug in our RTL dongle in an external powered USB HUB. I may have failed to mention this in the video, it’s best to use a powered hub to reduce power consumption on the RasPi as well as this allows MORE dongles to be used in the future! 😎

(Insert notes on the use of ferrite chokes here)

 

OK, a couple final steps and then we’re ready to reboot!

Basically here we’re telling Raspbian that any user can run the rtl_* commands and that the use of “sudo insertRTLcmdhere” is not necessary.

                    

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

Good to go? Awesome! Let’s reboot to put the changes into effect:

Once the Pi has rebooted, login and continue. At the command prompt let’s enter:

You should have a result similar to this:

 

pi@sdr2:~ $ rtl_test
Found 1 device(s):
0: Realtek, RTL2838UHIDIR, SN: 000000101

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.

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...

Exit the command with Ctrl C twice. (Ctrl C is a break command used to terminate running commands that continuously run until stopped).


A note on the blacklist issue: As you saw in the video I had to blacklist the modprobe.d devices to stop the kernel from locking our SDR’s.

If you see this next bit of text below (highlighted in blue) as the result of “rtl_test“, you will need to blacklist the device(s):

Found 1 device(s):
0: Realtek, RTL2832U, SN: 00001000

Using device 0: Generic RTL2832U

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.

If you have the same issue, here’s the resolution:

cd /etc/modprobe.d

In nano we need to add the following lines:

                    

blacklist dvb_usb_rtl28xxu
blacklist rtl2832
blacklist rtl2830

ctrl x and Y for yes to save and return to the command line.

Run rtl_test again and it should look like the result above (chipset and exact rtl name will vary by SDR).


dump1090

Lets go get the latest dump1090 release

                    

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

If you get the pkg-config  errors as I did, ensure it’s installed. If installed, you can most likely (as I did) ignore the error.

sudo apt install pkg-config

OK! We’re just about there! 🙂

At the command line lets type

We *should* see a window like this:

As a side note, on one of my previous installs ‘dump1090‘ ran great, but for the –net switch to work, I had to run the command as “sudo

                    

sudo ./dump1090 --interactive --net

And that’s it! We’ll cover dump1090 web service as well as VirtualRadar in another video soon!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: