1. Setup - athertop/MavLink_FrSkySPort GitHub Wiki

##Install and setup software: In order to implement the solution provided by this project, its necessary to install several tools in order to compile the Arduino code (known in Arduino talk as a 'Sketch') and upload it to the Teensy board. This is what you will need to download/install:

  1. Download and install [Arduino IDE] (https://www.arduino.cc/en/Main/Software)
  2. Download and install [Teensyduino] (https://www.pjrc.com/teensy/td_download.html) - Check which Versions of Arduino IDE are supported. - Teensyduino 1.31 (the latest at time of writing) has been tested to work fine with Arduino version 1.6.12 (also the latest at time of writing).
  3. Download and unpack the latest release from this repo here
  4. From the unpacked release download - install the three provided Arduino libraries (note, there are some custom changes in these libraries so don't assume that if you have alternate versions already installed that these will work with this project, instead be sure to install the libraries provided here).
  5. Physically wire and connect the Teensy
  6. From the unpacked release download - browse to the Tensy/MavLink_FrSkySPort folder and launch the Arduino IDE by opening the file MavLink_FrSkySPort.ino.
  7. In the Arduino IDE, edit the ["Enable AddOns/Options:"] (https://github.com/athertop/MavLink_FrSkySPort/wiki/2.-Options-and-supported-AddOns)section (and Debug Options) as required, specific to your installation/setup.
  8. From Arduino 'Tools' menu, choose:
  • Board: Teensy revision matching your board
  • USB Type: Serial
  • CPU Speed: 72MHz
  • Port - choose the USB serial port to which the Teensy is connected
  1. Compile and Upload Program to your Teensy
  2. From the unpacked release download, copy the relevent files from /Taranis/LUA_SD_Card to your Taranis SD card. Details of exactly which files you should copy can be found in the Wiki section - 1.1. SD Card Contents.

Note, for the lua screens to work, you will require the lua compatible version of OpenTx installed on your Taranis Radio - in the OpenTx Companion app, 'lua' is a check-box option under the 'Radio Profile' tab in the Preferences screen. Make sure this is selected before downloading and installing the OpenTx Taranis firmware. 9. Configure Ardupilot Parameters 10. Configure Model Telemetry sensors on Taranis 11. Optionally add and configure the mixer script: celinf to the CUSTOM SCRIPTS page of your model configuration. celinf is described here.

Basic Wiring (Teensy 3.0, 3.1, 3.2, LC):

Basic Wiring - Teensy 3.x (note - the connection from the Teensy's Tx2 pin shown above is optional and should only be connected where the Teensy has dedicated use of the Pixhawk/APM telemetry port)

Combining Teensy with FrSky Sensors

If FLVSS, FAS, or any other FrSky sensors are also included in your telemetry setup, then these will be daisy-chained with the SmartPort cable from the Teensy, E.g.: Teensy -> FrSky_Sensor1 -> FrSkySensor2 -> X_Series_Rx. This will resemble something like the following example:

Teensy with FLVSS Sensors

Some notes:

  • To use a FAS sensor with the Teensy, some Teensy sketch code amendments are required prior to compiling and upload to the Teensy. These amendments are described in the last paragraphs of Section 2. AddOns, in this Wiki.
  • The default Teensy code will allow the addition of one or two FLVSS sensors (as shown above) without any code modifications being required. Adding a single sensor is straightforward.
  • To add a second FLVSS sensor to your setup (for cell monitoring of upto two 6s LiPos), the second sensor must be programmed with a unique sensor ID - the suggestion is ID #15 for this sensor. For amending the sensor ID, there are two ways: one using a FrSky servo channel changer like this, or alternatively by connecting a FrSky FUC-3/SPC cable between your PC and the S.Port and using the free FrSky S.Port Tool software for Windows downloaded from here (instructions are provided with the tool download). By implementing a second FLVSS sensor, additional telemetry configuration needs to be configured on the Taranis - see details in Section 1.2

IMPORTENT NOTE FOR Teensy LC Users:

Keep in mind that Teensy LC has a strict 3.3v signal voltage limit. This should be fine with a 3DR Pixhawk, but be careful to check the Telem port specs with Pixhawk variants. The Teensy 3.0, 3.1 or 3.2 revisions are much more tolerant in this regard.

Dedicated vs shared use of an APM/Pixhawk telemetry port

On the above connection diagrams it can be seen that the Teensy is connected to the flight controller Telemetry port using both Tx and Rx connections. Although this provides the best solution, it is only possible where the Teensy has dedicated use of that telemetry port. In many situations it is required for more than one device to connect to the same telemetry port. In this shared port configuration, it is essential that only one of these devices has its Tx line wired to the telemetry port's Rx connection. All other devices must therefore be wired omitting that connection (so these devices will only be able to receive data from the flight controller, and not send it). One example of such shared use may be for the Teensy to share the telemetry port with either a bluetooth or telemetry radio module. In this example it would be required that the radio is connected to be the two-way device (as the ground station software using the radio module would need to be able to both send and receive data), so the Teensy would be wired to only receive data. Sharing the telemetry port of course requires that both devices are happy with the same telemetry port configuration - so the same data rates and Mavlink stream rates.

In most cases the device which is connected to send data to the flight controller will be running software which will attempt to configure the Mavlink message streaming rates (SRn_ parameters in Ardupilot), so it is important that this configuration configures rates appropriate to the needs of both devices. A table shown below details the requirements for the Teensy.

When the Teensy has dedicated use of a telemetry port (and so both the Tx and Rx lines are connected) on booting the teensy will attempt to automatically configure the Mavlink message streaming rates (SRn_ parameters in Ardupilot). This functionality is enabled in the Teensy by default (but can be disabled if not required by commenting the line: #define AUTO_MAV_STREAM_CFG in MavLink_FrSkySPort.ino before uploading the sketch to the Teensy).

Ardupilot Parameter configuration:

Locate the following mandatory parameters Under the full parameters list in your ground station software and adjust as follows:

Parameter Name Value
SERIAL2_PROTOCOL 1
SERIAL2_BAUD 57

(these example parameters assume we have the teensy connected to the Serial2 port on the Pixhawk autopilot - Serial1 can just as easily be used in which case we would set SERIAL1_ and SR1_ parameters instead)

Ultimate LRS Users -
The SERIALn_BAUD rate should be set to 19 for ULRS, as this is the rate the serial port on the ULRS Rx runs at.

If the Teensy has dedicated use of the Pixhawk Telemetry port (as described in the section above)it will send instructions (unless disabled) over its Tx line connection to configure the Stream Rate (SRn_) parameters of Ardupilot automatically. It is sometimes preferred however to have full manual control over these parameters instead (by leaving the Tx line disconnected), in which case it is recommended to apply the following parameters settings manually in Ardupilot:

Parameter Name Value
SR2_EXT_STAT 5
SR2_RAW_SENS 5
SR2_POSITION 2
SR2_EXTRA1 5
SR2_EXTRA2 5
*SR2_RC_CHAN 5
All other SRn_ parameters can be set to 0

*note - SRn_RC_CHAN only required for ULRS where RSSI is enabled over Mavlink. Set to 0 otherwise.