Awesome
ardrone-dump1090-cross-compiler
John Wiseman, jjwiseman@gmail.com
This project makes it easy to use a cheap and widely available DVB-T USB dongle as a software-defined radio on your AR.Drone 2. Your drone will then be able to pick up Mode S and ADS-B broadcasts from aircraft transponders (see the rtl-sdr project and "Tracking planes for $20 or less" for background).
What the project actually provides is an easy way to cross-compile rtl-sdr and the dump1090 Mode S decoder for the AR.Drone.
Requirements
You will need to install vagrant as the cross-compiling is done inside of a virtual machine.
Cross compiling
Cross compiling dump1090 for the AR.Drone 2 is easy. First you will create the new VM, ssh into it, and build lib-usb and rtl-sdr:
host$ git clone git://github.com/wiseman/ardrone-dump1090-cross-compiler.git
host$ cd ardrone-dump1090-cross-compiler
host$ vagrant up
host$ vagrant ssh
vagrant$ cd cross-compiler
vagrant$ ./setup-vm.sh # This will download about 100 MB of pre-reqs.
vagrant$ ./build-prereqs.sh
Next you will checkout the source to dump1090 and build it. Note that these commands are performed while you're ssh'ed into the VM. There are a few different versions of dump1090 you can choose from; I recommend MalcolmRobb's version which has a lot of extra functionality added:
vagrant$ cd ~/cross-compiler/src
vagrant$ git clone https://github.com/MalcolmRobb/dump1090.git
vagrant$ . ~/cross-compiler/build-vars.sh
vagrant$ cd dump1090
vagrant$ make CC=$CC
Installation
A helper script will install rtl-sdr and dump1090 on your AR.Drone 2. First connect to the drone's wifi. Then run the following (on your host OS, not in the vagrant VM):
$ ./helpers/install.sh
The install script puts rtl_sdr
and dump1090
in /bin
, and
librtlsdr.so.0.0.0
in /lib
.
Usage
Before plugging your DVB-T dongle into your AR.Drone, you will need to run these commands to activate USB host mode:
$ telnet 192.168.1.1
# gpio 127 -d ho 1
# gpio 127 -d i
Now you can plug the dongle into the drone's USB connector. Once
that's done you can confirm that the dongle is visible by running
lsusb
:
# lsusb
Bus 001 Device 002: ID 0bda:2838 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002
If you don't see your dongle (the Realtek device listed above), try unplugging and re-plugging it.
You may now run dump1090
:
# dump1090 --aggressive --interactive
Hex Flight Altitude Speed Lat Lon Track Messages Seen .
--------------------------------------------------------------------------------
a54601 0 0 0.000 0.000 0 1 0 sec
a73f0b 2475 0 0.000 0.000 0 2 1 sec
aa6e4f 33000 0 0.000 0.000 0 26 0 sec
a2597f 40000 0 0.000 0.000 0 7 2 sec
a71d34 33275 0 0.000 0.000 0 14 0 sec
71be10 KAL213 4875 272 34.029 -118.312 85 166 0 sec
You can even use dump1090's fancy map mode, if you copy the
gmap.html
file to your drone and use
ardrone-wpa2 to put your
drone and laptop onto a wifi network with internet connectivity:
# Assume I've used ardrone-wpa2 to put my drone on my wifi at 192.168.0.200.
$ ftp -u ftp://anonymous:anonymous@192.168.0.200/gmap.html /src/dump1090/gmap.html
$ telnet 192.168.0.200
# cd /data/video
# dump1090 --net --aggressive
Then point a browser on your laptop at dump1090's HTTP server, which in this case would be http://192.168.0.200:8080/: