ForeFlight

Configure ForeFlight to display LiveTraffic‘s traffic

LiveTraffic can feed ForeFlight to show the user's plane and traffic. Here's a screenshot what it looks like.

In LiveTraffic‘s Basic Settings you need to enable the output channel ForeFlight. Usually, your own position and the planes created through tracking data ("traffic") will appear soon in ForeFlight.

ForeFlight's Configuration

In ForeFlight, make sure the device "LiveTraffic", which appears as soon as the app receives the first broadcast from LiveTraffic, is enabled. This is usually the case and it should also not disable itself, but just to be sure:

ForeFlight: Settings > Devices > LiveTraffic: Enabled

To see other traffic than only the user's plane also enable the layer called "Traffic".

The "Traffic" layer seems to be reset every now and then! So if you see no traffic in ForeFlight, double-check the "Traffic" layer is enabled:

ForeFlight: Aero & TFRs: Enable "Traffic"

RealTraffic also feeds into ForeFlight! If also RealTraffic is enabled you will likely see two sets of traffic, one from a device "LiveTraffic" and one from a device "PSX" (which is RealTraffic's data). Ideally, you disable the "PSX" device within ForeFlight. However, as the "PSX" device might appear sporadically only this is simpler written than done.

X-Plane itself can also feed directly (Settings > Network > iPhone, iPad, and External Apps > Other Mapping Apps). If this is enabled then you might also see AI planes controlled by X-Plane in ForeFlight, displayed with their internal tail number (like N172SP for the Cessna, or N816NN for the B738).

So generally, ForeFlight can receive data from various sources in parallel. Before blaming LiveTraffic for bad (or good, for that matter) data make sure it's the only feeding application.

ForeFlight Data Format

If you are a developer you could actually make use of the broadcasted data for other purposes than ForeFlight. The ForeFlight data format is described here and LiveTraffic sticks to it. Example broadcasts (around OMDB) look like this:

Example ForeFlight broadcast datagrams
XGPSLiveTraffic,55.367,25.256,240.6,119.235,52.2
XATTLiveTraffic,119.3,1.8,-0.5
XTRAFFICLiveTraffic,4921470,25.269,55.200,5023.0,0.0,1,289.6,208.9,SWR243
XTRAFFICLiveTraffic,7701531,25.252,55.359,9.9,0.0,0,123.0,14.9,CEB015
XTRAFFICLiveTraffic,8994918,25.157,55.366,6707.5,2711.5,1,273.7,266.6,GFA513
XTRAFFICLiveTraffic,9003216,25.245,55.366,36.9,0.0,0,253.2,11.2,UAE529

User plane's position is broadcasted with 1Hz, its attitude with 5Hz. The repeat interval of traffic data is not defined by ForeFlight and configurable in LiveTraffic.

Output port is 49002 as defined by ForeFlight. There is no GUI setting for it so that nobody can accidently change it. But you'll find it in LiveTraffic's configuration file.

Here's a simplistic Python script, with which I test receiving any broadcasts. It does not interpret the data, but only displays it together with a timestamp. It works for Python 2 and 3 (only the output format slightly differs) and takes just one parameter, the port number:

udp_listen.py
#!/usr/bin/python
import sys
import socket
import time
#---socket creation
connexion = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
connexion.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
if sys.platform != "win32":
connexion.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
#---Bind
try:
connexion.bind(('', int(sys.argv[1])))
except socket.error:
print ("connexion failed")
connexion.close()
sys.exit()
#---wait for and print data
while 1:
data, addr = connexion.recvfrom(1024)
print (time.time(), ":", data)

Called like ./udp_listen.py 49002, it would output received UDP datagrams continuously like this:

Example Output of udp_listen.py
(1554490061.876467, ':', 'XTRAFFICLiveTraffic,3958292,50.021,8.430,1569.0,-1146.4,1,69.6,186.4,DLH805')
(1554490061.876575, ':', 'XTRAFFICLiveTraffic,3958350,50.035,8.545,324.9,0.0,0,58.1,2.3,DLH2VH')
(1554490061.876621, ':', 'XTRAFFICLiveTraffic,3958370,50.043,8.522,350.3,0.0,0,70.4,59.8,DLH8A')
(1554490061.878866, ':', 'XTRAFFICLiveTraffic,3958394,50.048,8.570,366.6,0.0,0,0.0,0.0,DLH5MR')
(1554490061.889803, ':', 'XGPSLiveTraffic,8.583,50.032,106.5,180.000,0.0')
(1554490061.891284, ':', 'XTRAFFICLiveTraffic,3957833,50.042,8.582,358.0,0.0,0,27.2,12.4,DLH21U')
(1554490061.900316, ':', 'XTRAFFICLiveTraffic,3958441,50.044,8.536,341.7,0.0,0,81.9,30.8,DLH1449')
(1554490061.923233, ':', 'XTRAFFICLiveTraffic,3958443,50.045,8.569,360.9,0.0,0,270.0,0.0,DLH57F')
(1554490061.944078, ':', 'XTRAFFICLiveTraffic,3958499,50.043,8.561,351.1,0.0,0,162.2,11.5,DLH044')
(1554490061.95145, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490061.964778, ':', 'XTRAFFICLiveTraffic,3958610,50.072,8.526,23984.0,135.9,1,335.5,332.7,EWG1910')
(1554490061.987202, ':', 'XTRAFFICLiveTraffic,3958617,50.040,8.575,347.0,0.0,0,60.1,24.4,DLH9KL')
(1554490061.992343, ':', 'XTRAFFICLiveTraffic,3958157,50.043,8.547,342.5,0.0,0,145.1,22.6,DLH087')
(1554490062.009156, ':', 'XTRAFFICLiveTraffic,3960929,50.041,8.562,345.9,0.0,0,248.7,9.7,GEC8343')
(1554490062.029472, ':', 'XTRAFFICLiveTraffic,4458944,50.039,8.555,339.9,0.0,0,247.5,20.5,EJU25DA')
(1554490062.05433, ':', 'XTRAFFICLiveTraffic,4566062,50.049,8.589,359.1,0.0,0,342.2,4.1,SAS1636')
(1554490062.076019, ':', 'XTRAFFICLiveTraffic,4920849,50.029,8.542,452.8,-1150.5,1,69.9,125.7,SWR1076')
(1554490062.094481, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490062.098079, ':', 'XTRAFFICLiveTraffic,4921315,50.041,8.559,343.6,0.0,0,0.0,0.0,SWR106U')
(1554490062.121316, ':', 'XTRAFFICLiveTraffic,5270561,50.032,8.526,324.9,0.0,0,190.1,20.1,ADR125')
(1554490062.145733, ':', 'XTRAFFICLiveTraffic,7786223,49.952,8.592,8000.0,0.0,1,249.1,280.6,SIA326')
(1554490062.152416, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490062.167006, ':', 'XTRAFFICLiveTraffic,7867067,50.060,8.653,2733.6,682.0,1,71.9,228.2,CPA282')
(1554490062.197146, ':', 'XTRAFFICLiveTraffic,3958217,50.049,8.570,368.4,0.0,0,0.0,0.0,DLH892')
(1554490062.299546, ':', 'XTRAFFICLiveTraffic,3958350,50.035,8.545,324.9,0.0,0,58.1,2.3,DLH2VH')
(1554490062.354267, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490062.403429, ':', 'XTRAFFICLiveTraffic,3958441,50.044,8.536,341.7,0.0,0,81.9,30.8,DLH1449')
(1554490062.504334, ':', 'XTRAFFICLiveTraffic,3958443,50.045,8.569,360.9,0.0,0,270.0,0.0,DLH57F')
(1554490062.55615, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490062.608154, ':', 'XTRAFFICLiveTraffic,3958610,50.072,8.526,23984.0,135.9,1,335.5,332.7,EWG1910')
(1554490062.693573, ':', 'XGPSLiveTraffic,8.583,50.032,106.5,180.000,0.0')
(1554490062.710873, ':', 'XTRAFFICLiveTraffic,3960929,50.041,8.562,345.9,0.0,0,248.7,9.7,GEC8343')
(1554490062.757548, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490062.915558, ':', 'XTRAFFICLiveTraffic,4921315,50.041,8.559,343.6,0.0,0,0.0,0.0,SWR106U')
(1554490062.96226, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490063.018004, ':', 'XTRAFFICLiveTraffic,7786223,49.952,8.592,8000.0,0.0,1,249.1,280.6,SIA326')
(1554490063.120083, ':', 'XTRAFFICLiveTraffic,7867067,50.060,8.653,2733.6,682.0,1,71.9,228.2,CPA282')
(1554490063.162793, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490063.220842, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490063.364389, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')
(1554490063.564868, ':', 'XATTLiveTraffic,114.3,-1.3,0.2')