What to do with a spare RasPi?
At the last count, I had eight Raspberry Pis at home. I bought my first one a few weeks after the little board was launched, and as the Pi advanced, I found myself buying each new version for "my next project".
Often that "next project" fell by the wayside as I moved in another direction. At one time or another, I've probably had anything from three to five Pis lying around "between projects."
It got me wondering. Is there something I can do with my "redundant" Pis while I'm waiting to use them? Something they can usefully do instead of sitting idle on a shelf?
That's when I decided to do a series of unusual projects for the Pi - projects that can work in the background, doing useful stuff, while you're wondering what to do next. It's not the regular Retropie or Kodi setups you see everywhere else, but more unique applications like aircraft monitoring, ad blocking, time-lapse pan & tilt cam, searching for aliens, and more.
So, this is the first in the series. Unlike other blogs that list "best projects" then point you to a website for instructions, I'll walk you through, giving tips to get you over the complications. I'll be doing that because I've personally built everything I'm going to describe. I'll explain the problems I encountered and how I solved them.
As I always make a point to note in my blog posts, I'm an enthusiastic amateur with no formal training in computers or electronics, so my understanding of the technicalities is limited. However, I make up for my ignorance with a determination to get things working, and my willingness to document - in non-technical language - how I do it. This lets the average Joe like myself, follow my simple instructions and make things work.
Join the pilot in the cockpit for a transatlantic flight
The first project I came across while tracking my daughter's flight across the Atlantic. For some time I've used flightradar24 to do this. For those that don't know, Flightradar24 is...
A global flight tracking service that provides you with real-time information about thousands of aircraft around the world. Our service is currently available online and for your iOS (iPhone, iPad, iPod Touch) or Android device.
Clicking on their site brings you to a world map with literally thousands of aircraft flying to and from every place imaginable. Zooming in increases the resolution and more and more aircraft show up, the "closer" you get.
Clicking on a specific aircraft brings up a sidebar with details of the flight, including aircraft type, ports, speed, altitude, time remaining, and many other bits of "aviata". (I just invented that word!)
Although it's not the only site that offers aviation tracking, I find it's the easiest to use and the graphics are outstanding.
Get in the cockpit
Clicking on the "3D" icon gives a three dimensional view of the aircraft from outside, superimposed on Google maps - giving a God-like view of the aircraft as it flies across the skies.
Clicking on the yoke (steering wheel) takes you right into the cockpit, with a view out the window.
It's a fascinating experience and can be very exciting if you know someone on the flight - especially takeoff and landing. (BTW, they do specify in their FAQ that you shouldn't be alarmed if a descending aircraft doesn't land exactly on the runway. Apparently people thought planes were crashing all over the place!)
How it evolved
Flightradar24 started as a hobby project in 2006 when two Swedish aviation geeks decided to build a network of ADS-B receivers in Northern and Central Europe. In 2009 we opened up the network, and made it possible for anyone with an ADS-B receiver to upload data to the network. Many parts of the world were quickly covered, but the quest to provide global ADS-B coverage is still ongoing. Hopefully with your support, we will get there.
Who has access?
As you can see, Flightradar24 gathers its information worldwide from ADS-B receivers that upload data to their network. Anyone can contribute and the site is open to everyone visiting their URL. Access levels, however, depend on your subscription. A casual, non-member, can watch an aircraft for a couple of minutes before timing-out. Re-clicking takes you back in. Each plan has different features, the $500 annual plan being the most advanced, offering unlimited access to everything.
What has this to do with Raspberry Pi?
Clicking around Flightradar24's interface a few weeks ago I noticed the "Add Coverage" menu item, with Raspberry Pi boldly featured.
A few quick clicks later and I discovered that a a group of aviation enthusiasts had written a Raspberry Pi package that would allow any RasPi (including Zero) to gather and upload data to the site. All that's needed is an ADS-B receiver and antenna.
Full, unfettered access
Reading further down the page I discovered that becoming a data contributor would automatically give you the full $500 unlimited package free of charge!
Get me an antenna!
Off to eBay I went; a $500 free subscription to something awesome isn't something I'll forgo lightly. I gingerly searched for an ADS-B antenna, convinced it was probably a complicated and expensive piece of equipment.
I couldn't have been more surprised when I found a slew of them for less than $10! I wasn't sure if the cheapest ones would work, but I bought one anyway and waited a month for it to arrive from China.
Setting it up
Instructions for setting up your Pi are here, but if you're too lazy to click, copy and paste the following into your Pi's terminal:
sudo bash -c "$(wget -O - http://repo.feed.flightradar24.com/install_fr24_rpi.sh)"
You'll be asked a few simple questions, including the geographic location of your antenna. For that, I used this site, obtaining my longitude and latitude from my postal address.
Set up you antenna and wait for the confirmation email to arrive from Flightrader24. Once it does, you'll have free access to your Business account.
Placing the antenna
I'm sure there are dozens of PhD theses about where to best place your antenna. Flighradar24 suggests "outdoors, at the highest point possible, preferably on the roof."
I was sceptical about my little antenna; it's about 15 cm high, has the finish of something that costs 8 bucks, and connects to the ADS-B USB dongle with a unimpressive one-meter cable. I didn't believe it would work at all.
I placed it outside a window, with the wire leading into the house to protect the Pi from the elements. I was astonished by the results. Even my $8 apparatus with its puny antenna is actively tracking aircraft up to 75 nautical miles (nm) distant!
How to see what you're logging
Booted up and attached to the antenna, your Pi is gathering data all the time. How can you see what it sees?
Go to the Pi's IP in your browser, followed by port 8754:
If everything's running smoothly, you'll arrive at this page:
Click on "Show tracked aircraft list" to be taken to the page that's actively tracking the aircraft near your location.
Clicking on the aircraft's hyperlink takes you to Flighradar's live map of that specific aircraft.
How to see your contribution
Your RasPi is contributing to the Flighradar24 network, but how do you keep track?
At the top right of your Flightradar24 screen you should see (in yellow) your Business subscription. Click it to bring up a menu. Select "Account", then "Show Statistics." You'll then be presented with this delightful page:
Note: When I set up Flightrader24, my statistics page did not update. It took more than a week before any data appeared. I spent hours trying to figure out why. Eventually I approached support. They told me it was a bug that would rectify itself - but I suspect they wanted to see my level of commitment before they allocated bandwidth.
So, if you have a spare RasPi lying around the house, why not contribute to Flighrader24? It shouldn't cost more than $10 to set up and you'll be helping the worldwide community and you'll have free access to an amazing network. The more contributors they have, the better their coverage.
If you really want to be a geek, why not attach a screen to your wall showing live coverage of the flights in an area that interests you. It would certainly be a topic for conversation!
The next project for the spare Pi lying around the house will be a device for scanning the heavens, assisting the SETI Institute in its endeavors to find extraterrestrial intelligence. Keep watching!