Although I love the internet, I still want my tech to operate without it. Going forward with this theme I want a mobile Flight Control Tower, as I’m a plane enthusiast and admire these machines and their operations.
Using a Raspberry PI as my platform, the options are limitless. There are internet / app based options for getting flight data feeds like flight radar 24 but as you know, i want to control my tech!
First things first, how on earth are we going to accomplish this?What hardware will be use? How much will it cost? Lets start with our shopping list .
TOTAL: $80.83
This a very cheap project which is a lot of fun.
Lets get started with the howto….
So after you have built the OS on the raspberry pi (Raspbian), ssh onto the machine and execute the following.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
sudo su - apt-get update apt-get upgrade apt-get -fym install vim screen nmap apt-get -fym install git cmake libusb-1.0-0-dev build-essential cd ~ git clone git://git.osmocom.org/rtl-sdr.git cd rtl-sdr/ mkdir build cd build/ cmake ../ -DINSTALL_UDEV_RULES=ON make install ldconfig cd ~ cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/ |
Now you will need to edit the following file and enter the following parameters.
1 |
vim /etc/modprobe.d/rtlsdr.conf |
and paste.
1 |
blacklist dvb_usb_rtl28xxu |
Now to install the dump1090 application which actually displays the planes on a map.
1 2 3 4 |
cd ~ git clone git://github.com/MalcolmRobb/dump1090.git cd dump1090/ make |
All done, lets start the application
1 |
./dump1090 --net --quiet |
This will start the application with networking.
Bring up your web browser and point it to http://ipofraspberry:8080/
So now our project is complete, you can see all the planes flying around! But this project is a mobile control tower which means we’ll need a way to view the planes on the go, so i thought I would use a wifi card acting a wireless Access point.
This way, if your in the car and you want to see whats flying ahead, you can just connect with your phone or laptop and take a look.
Access Point Setup
1 2 3 |
sudo apt-get update sudo apt-get install hostapd isc-dhcp-server sudo apt-get install iptables-persistent |
Edit the DHCP server config
1 |
sudo vim /etc/dhcp/dhcpd.conf |
Uncomment the following three lines
1 2 3 |
option domain-name "example.org"; option domain-name-servers ns1.example.org, ns2.example.org; authoritative; |
Scroll down to the bottom of the configuration file and enter the following.
1 2 3 4 5 6 7 8 9 10 |
subnet 192.168.100.0 netmask 255.255.255.0 { range 192.168.100.100 192.168.100.150; option broadcast-address 192.168.100.255; option routers 192.168.100.1; default-lease-time 600; max-lease-time 7200; option domain-name "local"; option domain-name-servers 8.8.8.8, 8.8.4.4; } |
Edit the following file
1 |
vim /etc/default/isc-dhcp-server |
replace
1 |
INTERFACES="" |
with
1 |
INTERFACES="wlan0" |
Then edit the interfaces files, have the wifi section looking like this
1 |
vim /etc/network/interfaces |
1 2 3 4 |
allow-hotplug wlan0 iface wlan0 inet static address 192.168.100.1 netmask 255.255.255.0 |
Lets setup the Access point, enter the following.
1 |
vim /etc/hostapd/hostapd.conf |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
interface=wlan0 #driver= ssid=Flighttrax country_code=US hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=flighttr@x wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_group_rekey=86400 ieee80211n=1 wme_enabled=1 |
You will notice I connected the driver out.. As far as I know its not needed. You can locate yours if you like and put it in
1 2 3 |
lsusb lsmod |
Then edit and change
1 |
vim /etc/default/hostapd |
1 |
#DAEMON_CONF="" |
To this
1 |
DAEMON_CONF="/etc/hostapd/hostapd.conf" |
Then edit this
1 |
vim /etc/init.d/hostapd |
From this
1 |
DAEMON_CONF= |
To this
1 |
DAEMON_CONF=/etc/hostapd/hostapd.conf |
Edit this
vim /etc/sysctl.conf
Uncomment this
net.ipv4.ip_forward=1
Enter the following iptables rules, into the command line
1 2 3 |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT |
Then save the rules permanently
1 |
sh -c "iptables-save > /etc/iptables/rules.v4" |
Restart the raspberry so that all the changes take affect.
Once restarted navigate to http://19.168.100.1:8080
This is because the WiFi NIC has been given a different IP.