Having fun with my ADS-B tracker project

How it started

Some years ago, I bumped into an article on Mashable about Jeremy Merrill using a Raspberry Pi ADS-B tracker to detect aircraft flying over his house and display the origin or destination of that plane (see article here and github there). As my place is just on a busy plane corridor, that gave me an idea. I decided to work on a similar project based on Piaware. Looking at how he did it and at the long literature you can find on the web on ADS-B, I created this site, my own software in Python to run on my Pi and other fun stuffs. I also ran into this site by SonicGoose and that gave me many new ideas (including the basic structure of this site – I never had any experience of html or php before).

One key part is getting access to aircraft databases to get more info from the ModeS hex code you get from the Piaware tracker. I am sharing my own database of planes, airports and routes I detected with one of my trackers (I have a fixed one at home, another one in Briancon in France (solar powered and connected by SigFox!) and a mobile one I take with me during my trips over the world).

When I started few years ago, I didn’t know that it will become such a fun project!

Updates

[2019/02] Update of installation script and new links
[2019/05] Update of the Radar page that now use my own positions database. Added aircraft silhouettes and Airlines logo.
[2019/05] Changed the domain to FoxtrotCharlie.ovh !!!
[2019/06] Changed landing page and reworked index for Google
[2019/07] Added Great Circle tracks between origin, destination and seen positions on Radar
[2019/09] Added Airports data, API page, better sitemap for Google index
[2020/01] Added a solar powered ADS-B tracker in Briancon, with a SigFox interface by SNOC to send new / special planes to this database when Wifi is off – works great!
Running an ADS-B tracker on a solar panel is quite challenging. After some research, I believed a 20W solar panel would be enough, but the stick consumption is very high, and solar energy production is far from stable… after few month using it, I would need about 80W to be able to power the system for 24h (Raspberry Pi 4 + Flightaware Pro Stick Plus + SNOC SigFox). SigFox is a great solution to replace a 4G modem which would also take too much energy. The limitation to 6 messages per hour is manageable, as I am only reporting new or special planes to this website, while the detailed data are stored and shared when the device has access to wifi.
The biggest issue I didn’t plan for was that the Pi doesn’t have a RTC, so time was wrong (it only progress when the Pi is on, about 8 to 12h per day… after few days, it was completely off). Hopefully, I could also use the downlink SigFox messages to get the network time and update the Pi time at each boot. Here the limitation is at 4 messages per day. It is controlled by the callback feature so it is quite easy to be sure you will not exceed the budget, even with a Pi with no idea what is current date or time. Next step is to work on shuting down properly the Pi when battery is low in order to avoid memory issue. So far it works with multiple wild shutdowns per day, but I don’t know for how long.
[2020/02] Updated the stats page to show more details
[2020/03] Added tweets on Sigfox interface with Briancon tracker
[2020/07] Working on adding MoPi-2 on the solar powered tracker to allow clean power down. Changed all the time in UTC. With trackers everywhere, it doesn’t make sens anymore to be on Hong Kong time.
[2020/09] Added a new blog. Let’s hope I will post regularly from now on![2020/10] API optimisation – reduced the errors from 2% to 0.05%
[2020/11] New landing page with a RSS feed reader to get up to date links to my blog posts. Let’s see the impact on Search ranking!
[2020/12] Upgraded all my Raspberry Pi code to Python3. I have been delaying that for a long time, but it was much easier than expected. Further optimisation of the API to reduce the error rate further. Some trackers are now at 0 errors, some still at 0.05%, still struggling to understand why.

Interesting links on ADS-B trackers

ADS-B tracking with an off grid Raspberry Pi

I have been looking for a solution to do ADS-B tracking off grid for quite a while. I have several Piaware trackers in different setup (fixed one at home, mobile one with GPS in the car, mobile one that I take with me when I travel abroad), and I wanted to add some in places where I don’t have power or wifi. After some research I decided to use a solar panel for power and a SigFox hat for connection. The SigFox hat has limited data throughput (6 messages per hour in uplink), but it is enough to report new or interesting aircraft to my server.

There is a lot of literature on solar power for the Pi, but I still ended up underestimating the size of the panel. 20W just gives me 8h per day in average. I will need to upgrade to 100W to make sure I run 24/24 7/7 365/365. The BIG power consumption comes from the RTL-SDR dongle, and you can not toggle it on and off to save power as it needs to be on for an extended period of time to do its job. Having my tracker going on and off created an unexpected issue that I didn’t see during my debug session with wifi: as the Pi does not have a RTC, the Pi time is losing 16h per day in average.

Rapidly, my timestamp for the planes detected were off. Hopefully, as SigFox allows also 4 downlink messages per day, I am able to request a time update through this channel. With some adjustment to make sure I don’t use my downlink messages budget when the Pi powers up just for few minutes when battery is low but sun is high, I was able to make that work. Next step is to work on improvements for the battery management and I will have a fully independent solution. I now have a Piaware tracker running fully off grid!


You can find more details on my setup and the data reported by my trackers on https://www.foxtrotcharlie.ovh


When I started this project I didn’t know how far it would bring me! My long term goal is still to share all my software on Github, but that will need some cleaning!

Also published on www.raspberrypi.org

How to build an ADS-B tracker

In order to build your ADS-B tracker you will need just few items: a Raspberry Pi, a RTL-SDR dongle, an antenna, and some free time! For the tracker, I am using a Raspberry Pi.

I started with the A version, but it was a little limited (it was often at 100% CPU load, running dump1090, Piaware and my own software). I then moved to the B+ version, and I was down to 10% which was much better. I now run a Raspberry Pi version 4.

To setup your tracker, follow these steps:

WARNING: AS THINGS MAY EVOLVE, YOU MAY NEED TO ADAPT THE TUTORIAL TO YOUR HARDWARE AND SOFTWARE VERSIONS

– First you need to download the latest NOOBS from Raspberry Pi website, onto a SD card formated in FAT (your Raspberry Pi is not recognizing FAT32 format). I do recommand to use minimum 32 GB of flash, specially if you want to have some space for recording positions of the aircraft you will track. If not, 8 GB is enough.

– Insert the SD card into the slot on the Raspberry Pi and power the board. Then follow the instructions. For this step, you will need a keyboard, a mouse and a TV with HDMI input.

– When it is done, upgrade the Raspberry Pi software and firmware:

        sudo apt-get update
        sudo apt-get upgrade
        sudo rpi-update

– Install tightvnc:

        sudo apt-get install tightvncserver
        tightvncserver

– You now have a working Pi, that you can manage from a remote computer with a VNC software (I am using tightvncjviewer.jar on Mac)

– Next step is to install the ADSB tracker. For this, you will need a SDR (Software Define Radio) dongle, that you will plus to your Pi. I am using both that one and Piaware Pro-stick. The pro-stick has an integrated amplifier that will give you some additional range. Now there is a new version with integrated filter which is working great. I recommend to switch to one of the Piaware Pro-sticks as they consistently show better results than other sticks that I have tried over the years.

Install Piaware – that will give you a free access to cool features from Flightaware at the same time. You can first create credentials on Flightaware, to get a USERNAME and a PASSWORD.

        #install piaware
        wget https://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_4.0_all.deb
        sudo dpkg -i piaware-repository_4.0_all.deb
        sudo apt-get update
        sudo apt-get install piaware
        sudo piaware-config allow-auto-updates yes
        sudo piaware-config allow-manual-updates yes
        sudo apt-get install dump1090-fa

– You now have a working tracker and you can see your data on Flightaware. This is already quite fun.

See what else you can do from there on foxtrotcharlie.ovh.