Haversine Air Plugin
(c) 2010-2023 Haversine Ltd

Hardware and Software Requirements: 
===================================

In order to run and use this plugin you need: 

- A computer with a running copy of X-Plane version 12, 11 or 10
- An Ethernet (wired or WiFi) interface on the computer configured for a 
local IP network. 
- A WiFi network connected to the computer so that the iPhone/iPad/iPod/Mac can
  receive the data broadcasted by the plugin. 
- The devices must all be on the same subnet and layer 2 broadcast domain. 

Installation Instructions: 
==========================

For X-Plane 11 and above copy the ENTIRE folder named HaversineAir to the
Resources/plugins X-Plane folder.

Support for 32 bits has been dropped. If you still need this plugin for 32bits
please contact us and we'll try toget you a build for it.

The plugin is now Mac universal in that it supports both Intel and Apple Silicon.

For specific notes on the Flight Factor A320, see README-A320-FF.txt. In
essence, copy publish.txt to the FF A320 data folder or add to it if the file
already exists.

That's all.

Configuration File:
===================

If present, a configuration text file is used to tailor specific behaviour of 
the plugin.  This file is named HaversineAir.cfg and can be placed in either 
the resources/plugins folder of X-Plane or in the HaversineAir subfolder itself.
The first is the preferred location as if you update the plugin you can just
replace the HaversineAir folder without changing the configuration.

Changing the IP address in the settings widget in X-Plane causes this file to 
be created, if not already there. 

Each line of this file contains a configuration statement. 

DESTINATION-IP
##############

This is the IP address UDP packets are sent to. You should leave this as AUTO
which means that the plugin will try to autoconfigure and find devices using 
multicast. Alternatively if you change the IP address in the setting widget
this gets changed to that IP address.

Examples: 

DESTINATION-IP=AUTO (the default)

or 

DESTINATION-IP=192.168.1.10

Only one destination IP statement is considered. 

APP-IP
######

If the automatic configuration mode based on multicast doesn't work and you 
have multiple devices, you can use the APP-IP statement to specify multiple
devices. These are in addition to anything set as DESTINATION-IP. 

So say you have an iPad on 192.168.1.10 and an iPhone on 192.168.1.11 you can 
add the lines:

APP-IP=192.168.1.10
APP-IP=192.168.1.11


CPFLIGHT-SERIAL-PORT
####################

See below.

CPFLIGHT-IP
###########

See below.


Support for the MCP and EFIS PRO and EL from CPFlight
=====================================================

As of version 4.3, this plugin also acts as a driver for the MCP-EL, MCP-PRO
and corresponding primary EFIS units of CPFlight. 

It replaces the manufacturer's driver and replaces the previously release 
plugin CPFXPL for Mac available at x-plane.org. 

The cpflight part only works if the words CPFLIGHT-SERIAL-PORT= or CPFLIGHT-IP 
are found in the config file.

On Mac if you have a CPFLight MCP it should appear as /dev/cu.usbserial...
so create HaversineAir.cfg in the Resources/plugins folder of X-Plane and put 
one of:

CPFLIGHT-SERIAL-PORT=AUTO

or 

CPFLIGHT-SERIAL-PORT=/dev/cu.usb...

On Linux you will probably need to specify the device. Create the
HaversineAir.cfg file in the Resources/plugins folder of X-Plane and add a line 
such as CPFLIGHT-SERIAL-PORT=/dev/serial-port to it.

On Windows, create HaversineAir.cfg in the Resources/plugins folder of
X-Plane and add a line such as:

CPFLIGHT-SERIAL-PORT=COMn

where COMn is the serial port of the MCP.

As os version 5.6 this plugin also supports the MCP737PRO3 which uses ethernet
instead of a serial USB port. For this, instead of CPFLIGHT-SERIAL-PORT add the
following line to the HaversineAir.cfg file:

CPFLIGHT-IP=192.168.1.40

where 192.168.1.40 is the IP address of the MCP. The default TCP port is 4500
and currently it's not possible to change it. If you need another port please 
contact us.

Support for the Airbus A320 from Flight Factor:
===============================================
Please see: README-A320-FF.txt

Troubleshooting: 
================

If your X-Plane flight doesn't appear on your app you can try to find the
root cause of the problem. Below are some suggestions of things you can do:

1. Look at the Log.txt file under the X-Plane folder to see if the plugin
loaded successfully. 

2. The plugin will send UDP packets to the local network to address 
239.224.224.1 on port 2423 and 2424 for AirTrack, 2425 for AirFMC and 2426 for AirEFB.

From UDP port 59000 of the computer <---> To UDP port 2424, 2425 or 2426 of
the corresponding app.

Make sure these are being sent. On Mac or Linux you can use for example: 

	# sudo tcpdump port 2423

	Or for the WiFi interface of your mac: 
	# sudo tcpdump -i en1 port 2423

	Or on Linux:  

	# sudo tcpdump -i eth1 port 2423

You should see packets going out on that interface. If not, something is 
wrong with the plugin; if yes, something is wrong with the App.

The plugin attempts to bind to port 59000 so UDP packets will go:

Press CTRL-C to quit.

3. Make sure you have your iDevice connected to the same WiFi IP subnet 
of where packets are being sent out. 

4. If you have multiple network interfaces, it may be that the plugin 
is loaded but is sending packets to the wrong interface. One example of 
this is if you have a mac with a wired Internet connection and you are 
using Internet sharing to share to the Wireless Interface. 

In this case the packets sent by the plugin will go out on the interface 
that has the best route to the destination multicast address 239.224.224.1 
which, by default, is where the default Internet route is. 

In order to overcome this problem you need to route these multicast packets
onto the right interface. 

Unfortunately there is no easy way in which we can do this from the plugin 
because that would require for it (or X-Plane) to run with root privileges, 
so to fix this you need to apply a manual fix yourself: 

Just open a terminal window and type on the mac: 

	# sudo route add -host 239.224.224.1/32 -interface en1

Or on Linux: 

	/sbin/route add -host 239.224.224.1 netmask 255.255.255.255 eth1

Replace en1/eth1 by your WiFi Interface. 

Note: You will have to do this everytime you restart, or you may install 
this command on a startup script to be persistent. 

5. Try restarting the App in the iPhone/iPad/iPod by double clicking on 
the home button and killing it. 

=========

6. As of 2.2.2, a new way of targetting your iDevice has been introduced.

If all else fails, check the IP address of your iPad/iPhone/iPod and 
insert it in the address field under HSAir -> Settings menu option. 

This tells X-Plane to only send packets to that IP address, but on 
the other hand you are in control of the IP address to which it sends
packets. 

The only downside of this approach is that you can only use one device
connected to X-Plane, and that if your device changes its IP address 
(via DHCP for instance) you will need to keep changing it in X-Plane. 

Contacting Us:
==============

You can of course visit us at http://haversine.com/, see the FAQ, and 
contact us through support anytime you like. Feel free to do so if you have
problems, comments, suggestions, or just to say hi.

