.: RealADSB :.


Setting up email alerts using geovent output

Imagine situation when you're expecting certain tail number or type of aircraft to appear on ADS-B radar. Of course you could just routinely check iPhone, iPad, Apple TV screen or computer monitor however it may not be the most efficient solution. Why not to give this job to adsb_hub and rely on notifications sent to your inbox when something important happens?

In order to do that let's take for example Raspberry Pi. First of all you need to add mail transfer agent aka MTA. There are several products available but my personal preference is SSMTP. Because it's easy to install and configure:

Edit configuration file to include following properties:

It's highly recommended to create new email address just for alerts. It makes things easier to manage later on. Check if you can send email using terminal:

If email delivered successfully it's time to connect USB receiver, antenna and execute following commands in terminal:

Content of file shown below:

Change values of "latitude", "longitude" properties so location will match the region where you expect aircrafts to appear. Those can be latitude/longitude of airport or particular point on approach/SID/STAR. Also makes sense to replace KEWR04 with something more relevant to selected location. Don't forget to save the file and then run commands:

By default text file with name recipientname@domain.com contains large list of ICAO 24 bit codes. Format is simple: each line has single hex value. It will be used against aircrafts detected within region defined by geoevent output inside rtl_tcp_alerts.json file. If match found email notification will be sent to recipientname@domain.com since name of the file used as email destination. The rest of the magic happens inside sendalerts.sh script. It has email template (lines 28-34) and you can always change filtering criteria (line 22) to detect tail numbers ($TAIL), ICAO types ($TYPE), operators ($OPERATOR), etc instead of 24 bit codes ($ICAO). Whenever criteria changed content of recipientname@domain.com file should be updated as well. Such change becomes active right away, there is no need to restart adsb_hub in this case. Restart of adsb_hub is required though when any parameters in rtl_tcp_alerts.json file have been updated.

Configured region can be seen in RealADSB iOS app after Zones visualization enabled in app settings:

Example of email notification shown below: