So my last blog-post was about creating a digital-radio, powered by an ESP8266 device, there's a joke there about wireless-control of a wireless. I'm not going to make it.
Sticking with a theme this post is also about radio, software-defined radio. I know almost nothing about SDR, except that it can be used to let your computer "do stuff" with radio. The only application I've ever read about that seemed interesting was tracking aircraft.
This post is about setting up a Debian GNU/Linux system to do exactly that, show aircraft in real-time above your head! This was almost painless to setup.
- Buy the hardware.
- Plug in the hardware.
- Confirm it is detected.
- Install the appropriate sdr development-package(s).
- Install the magic software.
- Written by @antirez, no less, you know it is gonna be good!
So I bought this USB device from AliExpress for the grand total of €8.46. I have no idea if that URL is stable, but I suspect it is probably not. Good luck finding something similar if you're living in the future!
Once I connected the Antenna to the USB stick, and inserted it into a spare slot it showed up in the output of lsusb
:
$ lsusb
..
Bus 003 Device 043: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
..
In more detail I see the major/minor numbers:
idVendor 0x0bda Realtek Semiconductor Corp.
idProduct 0x2838 RTL2838 DVB-T
So far, so good. I installed the development headers/library I needed:
# apt-get install librtlsdr-dev libusb-1.0-0-dev
Once that was done I could clone antirez's repository, and build it:
$ git clone https://github.com/antirez/dump1090.git
$ cd dump1090
$ make
And run it:
$ sudo ./dump1090 --interactive --net
This failed initially as a kernel-module had claimed the device, but removing that was trivial:
$ sudo rmmod dvb_usb_rtl28xxu
$ sudo ./dump1090 --interactive --net
Once it was running I'd see live updates on the console, every second:
Hex Flight Altitude Speed Lat Lon Track Messages Seen .
--------------------------------------------------------------------------------
4601fc 14200 0 0.000 0.000 0 11 1 sec
4601f2 9550 0 0.000 0.000 0 58 0 sec
45ac52 SAS1716 2650 177 60.252 24.770 47 26 1 sec
And opening a browser pointing at http://localhost:8080/ would show that graphically, like so:
NOTE: In this view I'm in Helsinki, and the airport is at Vantaa, just outside the city.
Of course there are tweaks to be made:
- With the right
udev
-rules in place it is possible to run the tool as non-root, and blacklist the default kernel module. - There are other forks of the
dump1090
software that are more up-to-date to explore. - SDR can do more than track planes.
Tags: linux, radio, sdr 2 comments