2. Options and supported AddOns - athertop/MavLink_FrSkySPort GitHub Wiki

Teensy code options and the AddOns supported by these options

This section describes the current configuration options which can be enabled within the Arduino code before writing the sketch to the teensy.

AddOns section in MavLink_FrSkySPort.ino looks like this:

/*
 * *******************************************************
 * *** Enable Addons/options:                          ***
 * *******************************************************
 */
//#define USE_FCS_SENSOR_INSTEAD_OF_APM_DATA              // Enable if you use a FrSky FCS Sensor.
//#define USE_FLVSS_FAKE_SENSOR_DATA                      // Enable if you want send fake cell info calculated from VFAS, please set MAXCELLs according your Number of LiPo Cells
//#define USE_SINGLE_CELL_MONITOR                         // Disable if you use a FrSky FLVSS Sensor. - Setup in LSCM Tab
//#define USE_AP_VOLTAGE_BATTERY_FROM_SINGLE_CELL_MONITOR // Use this only with enabled USE_SINGLE_CELL_MONITOR
//#define USE_BATT2                                       // Enable reporting for 2nd APM battery brick (Pixhawk 2.1) - Do NOT enable if USE_SINGLE_CELL_MONITOR is enabled or if USE_FLVSS_FAKE_SENSOR_DATA is enabled with MAXCELLS >6
//#define USE_RC_CHANNELS                                 // Use of RC_CHANNELS Informations ( RAW Input Valus of FC ) - enable if you use TEENSY_LED_SUPPORT.
//#define USE_TEENSY_LED_SUPPORT                          // Enable LED-Controller functionality
//#define POLLING_ENABLED                                 // Enable Sensor Polling - for use with Ultimate LRS (where Teensy connected to Taranis S.Port input directly).
//#define USE_MAV_RSSI                                    // Enable Mavlink RSSI on A3 (A4 will be 0)- in place of pitch/roll - required for Ultimate LRS
#define SEND_STATUS_TEXT_MESSAGE                        // Enable sending Status Text Messages to RC
#define AUTO_MAV_STREAM_CFG                             // Enable auto Mavlink SRn_ configuration - comment out for manual stream rate configuration

Remove // to enable AddOns (or prefix with // to disable):

  • If you use a FrSky FLVSS LiPo monitor sensor, then no changes are required - this will work by default

  • If you use a FrSky FCS SmartPort Sensor, enable USE_FCS_SENSOR_INSTEAD_OF_APM_DATA - this will prevent the Teensy from outputting Mavlink voltage data allowing FrSky FAS sensor to be used in its place.

  • If you want to build and use the Single Cell Monitor DIY solution, then enable USE_SINGLE_CELL_MONITOR and USE_AP_VOLTAGE_BATTERY_FROM_SINGLE_CELL_MONITOR. additionally configure the line #define MAXCELLS = with your cell count. Section 2.1 describes this AddOn in more detail and how to fine tune for more accurate voltage calibration.

  • If you don't have any LiPo cell monitoring solution in place (so you have neither a FLVSS sensor or the Single Cell Monitor DIY solution), and still want the telemetry screen to display Singe Cell Voltage, then enable USE_FLVSS_FAKE_SENSOR_DATA (this is recommended if you have no direct cell monitoring solution installed). This will take the Ardupilot battery voltage reading (provided by the APM battery monitor), and divide this by the cell count to provide simulated cell values through an emulated FLVSS sensor called Cels - used to replace real cell data in the LUA screen. This is supported in models with a single APM power brick (up to 12 cells in series).

Note - in the last two cases above, its important to also configure the line (around line #123): #define MAXCELLS 6 to reflect your serial cell count (assumes a single APM power brick/Mauch sensor being used here) - for 1-6 cells set MAXCELLS 6, for 7-12 cells, set MAXCELLS 12

  • Experimental feature - For those with the Pixhawk 2.1 running two redundant flight batteries, each through its own sensor, a recent addition has been added to the options section to allow monitoring of the second flight battery (BATT2). Please note that this addition is not fully featured in the code. This can be enabled by uncommenting the line //#define USE_BATT2 - this simply creates a second VFAS sensor on ID 15 which must be renamed so as not to clash with the original VFAS sensor. The new sensor is not used/displayed in the LUA screen or taken into account in battery warning voices - it was simply added at user request and should be considered an experimental option. Note - by enabling this option sensor ID 15 is used, so this can't be used in a number of circumstances:

    • if you have two FLVSS devices being used (as the second FLVSS will use ID 15)

    • if more than 6 serial cells are in use (so MAXCELLS is set to 12), and you have the USE_FLVSS_FAKE_SENSOR_DATA enabled. This will cause a second FLVSS sensor to be emulated using ID 15.

  • This project also supports the LED AddOn - by enabling the line //#define USE_TEENSY_LED_SUPPORT the teensy will run additional code to control one of the supported LED control schemes. See the section "LED Control" for further details.

  • For using #define POLLING_ENABLED and #define USE_MAV_RSSI in the code above, see the section "Ultimate LRS Support" for further details.

  • If your teensy is sharing a telemetry port with another device, only one of these devices can be wired to talk to the Pixhawk This is discussed here in more detail. In this shared port configuration (where Teensy can not physically talk to the Pixhawk), there is no point having AUTO_MAV_STREAM_CFG enabled, so comment out #define AUTO_MAV_STREAM_CFG, which cuts down on the code in your compile to save resources. It will then be required for you to configure the SRn_ values manually in Ardupilot ( see Ardupilot Parameter Configuration for details).

The Basic Configuration section contains the following lines:

/*
 * *******************************************************
 * *** Basic Configuration:                            ***
 * *******************************************************
 */
//#define AC_VERSION          3.2
#define AC_VERSION          3.3

Its important that we enable only one of these two lines such that the enabled line reflects the version of Ardupilot we are using - this lines up voice messages with those voice files installed on the Taranis SD card. As seen above, the default configuration is for Arducopter 3.3 (or newer).

In a future version we hope to consolidate the voice messages to allow the Teensy solution to work with either version of AP firmware.

Options implemented in LUA on Taranis

  • celinf.lua - Audio Message Minimum Cell Info config (implemeting this script is optional)

    This model/mixer script can be implemented to configure cell info alarms and voltage calls. This is detailed in its own section.

  • servce.lua - Keep your model maintained with service reminders to help