An Open Source Frsky Telemetry Script for the Horus X10,X12 and Taranis X9D,X9E and QX7 radios

Hi,
you can try with @Eric_Stockenstrom project https://github.com/zs6buj/MavlinkToPassthru.

The idea is to send mavlink down the radio link, look for Ground Mode setup in his documentation

Cheers.

Alex

2 Likes

Hello,
I am desperate, in my Taranisxd9+ i see all sensors
screen-2018-11-01-135535
when i run the LUAPIL script i see my gps
screen-2018-10-30-170329
but when i run the yaapu9 script there is no gps
screen-2018-11-01-135554
where is my mistake
best reguards
Gerhard

On ArduPilot change the output of the telemetry to FrSky passthrough

Hallo Luis,
now i have changed the serialport 4 from 4 to 10 and it works .I do not understand that but many thanks you save my day
Thank you
Gerhard

ArduPilot supports 3 FrSky telemetry protocols :slight_smile:

This passthrough is a special protocol that requires special scripts on the radio to get data displayed

Hello, I’ve a problem with this script, everything connected with telemetry works on my Taranis QX7S, I can display over 20 sensors but when trying to run yaapu telemetry script I see only [NO TELEMETRY]. However it is working even on my old 9xr with mavlink telemetry display… So I’m 100% sure that communication between radio transmitter and receiver in my quad are working properly.

Hi,
could you describe your setup a bit better, like receiver, flight controller, ardupilot version and wiring?
If your wiring is correct and you receive [no telemetry data] most likely you have enabled the wrong serial protocol in mission planner, it should be serial protocol 10 (not 4)

Alex

Hi Alex,
thank you for fast response. My setup is: receiver: D8R-XP, Qx7S radio with stock internal transmitter, Pixhawk with ArduPilot 3.6.1. Mavlink telemetry output is Y splitted from pixhawk to arduino with very old “mavlink to frsky” code and to minimosd board (not micro, just regular board with green/purple soldermask).
It seems that I won’t get it to work from what you said… I should’ve put there some new receiver with D16 protocol or something like that and set serial protocol 10 in ardupilot (it is set to 5 now, just “Mavlink” protocol).
Can I get it to work anyways? Or maybe there is other lua script that will suit my setup, I tried 2 already.
David

you’re correct, that receiver does not have s.port telemetry support, I’m afraid you’ll have to get a new D16 receiver.
Also since you’re splitting mavling to feed the OSD you either have to use a converter that outputs passthrough such as this one https://github.com/zs6buj/MavlinkToPassthru and leave the serial port protocol as 1 (or 2 for mavlink 2) or dedicate a second uart to passthrough telemetry and on that one set serial protocol 10 (in this case you’d also need an inverter like this one Some soldering required)

Thank you for clarification, I’ll just set up telemetry screens in my taranis with values that I need and it’ll suit my needs.

Hi all,
a couple screenshots of the upcoming versions :slight_smile:

A new hud layout with speed on the left, altitude and vario on the right and vspeed on the bottom,

image

image

cheers,

Alex.

3 Likes

Just wanted to chime in to say how brilliant this is. I’ve been using this successfully on my X10 and X10S for some time now. Thank you very much.
This new look is very nice and clean. Very much looking forward to using it.

1 Like

Hi all,
I’ve created a PR to add waypoints support to the current frsky passthrough telemetry library.
There is an open discussion on what to send and why

Just to give you an idea of how it could be rendered

on the left panel (Taranis and Horus)

  • wp bearing offset from cog
  • wp number
  • wp distance

on the right side of HUD (Taranis only)

  • crosstrack error +/- 45m

image

image

quick video of a simulated flight on Taranis and Horus

feedback is very welcome,

Alex

2 Likes

Hi Alex. I have a problem with Yaapu script on Taranis X9D. I discovered on taranis telemetry window a lot of sensors that work fine but when I launch the telemetry script I can see only RSSI and BATTERY VOLTAGE overlapped by “NO TELEMETRY DATA”. Where is the problem? It could be the firmware on the radio?
On the radio’s SD card I only copied the yaapu9 luac and lua scripts and check lua and luac on settings.
Thank you for your answer

Hi Giuliano,
please double check that you enabled frsky passthrough protocol by setting SERIALn_PROTOCOL = 10 as explained here http://ardupilot.org/copter/docs/common-frsky-telemetry.html#common-frsky-configmp

Installing the script is quite simple, just follow https://github.com/yaapu/FrskyTelemetryScript#installation-on-taranis and if it still does not work come back here asking for more help :wink:

Hi Alex, I have not yet been able to solve the problem with telemetry. I’m using APM 2.6 - Arduino mini pro (serial protocol conversion) - X8R receiver with TARANIS X9D transmitter.

I loaded this code on the darling mini pro:

/*
APM2.5 Mavlink to FrSky X8R SPort interface using Teensy 3.1 http://www.pjrc.com/teensy/index.html
based on ideas found here http://code.google.com/p/telemetry-convert/


Cut board on the backside to separate Vin from VUSB

Connection on Teensy2:
SPort S --> TX1 Pin 4
SPort + --> Vin
SPort - --> GND

APM Telemetry DF13-5 Pin 7 --> RX2
APM Telemetry DF13-5 Pin 8 --> TX2
APM Telemetry DF13-5 Pin GND --> GND

Note that when used with other telemetry device (3DR Radio 433 or 3DR Bluetooth tested) in parallel on the same port the Teensy should only Receive, so please remove it’s TX output (RX input on PixHawk or APM)

Analog input --> A0 (pin14) on Teensy 3.1 ( max 3.3 V ) - Not used

This is the data we send to FrSky, you can change this to have your own
set of data


Data transmitted to FrSky Taranis:

Cell ( Voltage of Cell=Cells/(Number of cells). [V])
Cells ( Voltage from LiPo [V] )
A2 ( HDOP value * 25 - 8 bit resolution)
A3 ( Roll angle from -Pi to +Pi radians, converted to a value between 0 and 1024)
A4 ( Pitch angle from -Pi/2 to +Pi/2 radians, converted to a value between 0 and 1024)
Alt ( Altitude from baro. [m] )
GAlt ( Altitude from GPS [m])
HDG ( Compass heading [deg]) v
Rpm ( Throttle when ARMED [%] 100 + % battery remaining as reported by Mavlink)
VSpd ( Vertical speed [m/s] )
Speed ( Ground speed from GPS, [km/h] )
T1 ( GPS status = ap_sat_visible
10) + ap_fixtype )
T2 ( Armed Status and Mavlink Messages :- 16 bit value: bit 1: armed - bit 2-5: severity +1 (0 means no message - bit 6-15: number representing a specific text)
Vfas ( same as Cells )
Longitud ( Longitud )
Latitud ( Latitud )
Dist ( Will be calculated by FrSky Taranis as the distance from first received lat/long = Home Position )
Fuel ( Current Flight Mode reported by Mavlink )

AccX ( X Axis average vibration m/s?)
AccY ( Y Axis average vibration m/s?)
AccZ ( Z Axis average vibration m/s?)


*/

#include <GCS_MAVLink.h>
#include “FrSkySPort.h”

#define _MavLinkSerial Serial // Teensy2 = Serial1 | Pro Mini Serial
#define debugSerial Serial
#define START 1
#define MSG_RATE 10 // Hertz
#define FRSKY_PORT 9 // Teensy2 = pin 4 | Pro Mini = pin 9
#define MavLinkSerialBaud 57600 // Teensy2 = 58824 | Pro Mini = 57600
#define LEDPIN 13 // Teensy2 = pin 11 | Pro Mini = pin 13

//#define DEBUG_VFR_HUD
//#define DEBUG_GPS_RAW
//#define DEBUG_ACC
//#define DEBUG_BAT
//#define DEBUG_MODE
//#define DEBUG_STATUS
//#define DEBUG_ATTITUDE

//#define DEBUG_FRSKY_SENSOR_REQUEST

//#define DEBUG_AVERAGE_VOLTAGE
//#define DEBUG_PARSE_STATUS_TEXT

/// Wolke lipo-single-cell-monitor
/*
*

  • this will monitor 1 - 8 cells of your lipo
  • it display the low cell, the high cell and the difference between this cells
  • this will give you a quick overview about your lipo status and if the lipo is well balanced
  • detailed informations and schematics here

*/

//#define USE_SINGLE_CELL_MONITOR
//#define USE_AP_VOLTAGE_BATTERY_FROM_SINGLE_CELL_MONITOR // use this only with enabled USE_SINGLE_CELL_MONITOR
#ifdef USE_SINGLE_CELL_MONITOR
// configure number maximum connected analog inputs(cells) if you build an six cell network then MAXCELLS is 6
#define MAXCELLS 6
#endif
/// ~ Wolke lipo-single-cell-monitor

// ******************************************
// Message #0 HEARTHBEAT
uint8_t ap_type = 0;
uint8_t ap_autopilot = 0;
uint8_t ap_base_mode = 0;
int32_t ap_custom_mode = -1;
uint8_t ap_system_status = 0;
uint8_t ap_mavlink_version = 0;

// Message # 1 SYS_STATUS
uint16_t ap_voltage_battery = 0; // 1000 = 1V
int16_t ap_current_battery = 0; // 10 = 1A
int8_t ap_battery_remaining = 0; // Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery

// Message #24 GPS_RAW_INT
uint8_t ap_fixtype = 3; // 0= No GPS, 1 = No Fix, 2 = 2D Fix, 3 = 3D Fix
uint8_t ap_sat_visible = 0; // number of visible satelites

// FrSky Taranis uses the first recieved lat/long as homeposition.
int32_t ap_latitude = 0; // 585522540;
int32_t ap_longitude = 0; // 162344467;
int32_t ap_gps_altitude = 0; // 1000 = 1m
int32_t ap_gps_speed = 0;
uint16_t ap_gps_hdop = 255; // GPS HDOP horizontal dilution of position in cm (m100). If unknown, set to: 65535
// uint16_t ap_vdop=0; // GPS VDOP horizontal dilution of position in cm (m
100). If unknown, set to: 65535
// uint16_t ap_cog = 0; // Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0…359.99 degrees. If unknown, set to: 65535

// Message #74 VFR_HUD
uint32_t ap_groundspeed = 0; // Current ground speed in m/s
uint32_t ap_heading = 0; // Current heading in degrees, in compass units (0…360, 0=north)
uint16_t ap_throttle = 0; // Current throttle setting in integer percent, 0 to 100

// uint32_t ap_alt=0; //Current altitude (MSL), in meters
// int32_t ap_airspeed = 0; // Current airspeed in m/s

// FrSky Taranis uses the first recieved value after ‘PowerOn’ or ‘Telemetry Reset’ as zero altitude
int32_t ap_bar_altitude = 0; // 100 = 1m
int32_t ap_climb_rate=0; // 100= 1m/s

// Messages needed to use current Angles and axis speeds
// Message #30 ATTITUDE //MAVLINK_MSG_ID_ATTITUDE

int32_t ap_roll_angle = 0; //Roll angle (deg -180/180)
int32_t ap_pitch_angle = 0; //Pitch angle (deg -180/180)
uint32_t ap_yaw_angle = 0; //Yaw angle (rad)
uint32_t ap_roll_speed = 0; //Roll angular speed (rad/s)
uint32_t ap_pitch_speed = 0; //Pitch angular speed (rad/s)
uint32_t ap_yaw_speed = 0; //Yaw angular speed (rad/s)

// Message #253 MAVLINK_MSG_ID_STATUSTEXT
uint16_t ap_status_severity = 255;
uint16_t ap_status_send_count = 0;
uint16_t ap_status_text_id = 0;
mavlink_statustext_t statustext;

/*

MAV_SEVERITY_EMERGENCY=0, System is unusable. This is a “panic” condition.
MAV_SEVERITY_ALERT=1, Action should be taken immediately. Indicates error in non-critical systems.
MAV_SEVERITY_CRITICAL=2, Action must be taken immediately. Indicates failure in a primary system.
MAV_SEVERITY_ERROR=3, Indicates an error in secondary/redundant systems.
MAV_SEVERITY_WARNING=4, Indicates about a possible future error if this is not resolved within a given timeframe. Example would be a low battery warning.
MAV_SEVERITY_NOTICE=5, An unusual event has occured, though not an error condition. This should be investigated for the root cause.
MAV_SEVERITY_INFO=6, Normal operational messages. Useful for logging. No action is required for these messages.
MAV_SEVERITY_DEBUG=7, Useful non-operational messages that can assist in debugging. These should not occur during normal operation.
MAV_SEVERITY_ENUM_END=8,

*/

// ******************************************
// These are special for FrSky
int32_t vfas = 0; // 100 = 1,0V
int32_t gps_status = 0; // (ap_sat_visible * 10) + ap_fixtype
// ex. 83 = 8 sattelites visible, 3D lock
uint8_t ap_cell_count = 0;

// ******************************************
uint8_t MavLink_Connected;
uint8_t buf[MAVLINK_MAX_PACKET_LEN];

uint16_t hb_count;

unsigned long MavLink_Connected_timer;
unsigned long hb_timer;

int led = LEDPIN;

mavlink_message_t msg;

/// Wolke lipo-single-cell-monitor
#ifdef USE_SINGLE_CELL_MONITOR

//cell voltage divider. this is dependent from your resitor voltage divider network
double LIPOCELL_1TO8[13] =
{
238.547031716,
116.553595658,
77.750655456,
59.11872705,
46.535677353,
39.62328371239,//39.628929118,
0.0, // diverders 7-12 not defined because my network includes only 6 voltage dividers
0.0,
0.0,
0.0,
0.0,
0.0
};

double individualcelldivider[MAXCELLS+1];
uint8_t analogread_threshold = 100; // threshold for connected zelldetection in mV
uint8_t cells_in_use = MAXCELLS;
int32_t zelle[MAXCELLS+1];
double cell[MAXCELLS+1];
int32_t alllipocells = 0;
float lp_filter_val = 0.99; // this determines smoothness - .0001 is max 0.99 is off (no smoothing)
double smoothedVal[MAXCELLS+1]; // this holds the last loop value

#endif
/// ~Wolke lipo-single-cell-monitor

// ******************************************
void setup() {

_MavLinkSerial.begin(MavLinkSerialBaud);
//debugSerial.begin(57600);
delay(1000);
FrSkySPort_Init();

MavLink_Connected = 0;
MavLink_Connected_timer=millis();
hb_timer = millis();
hb_count = 0;

pinMode(led,OUTPUT);
pinMode(12,OUTPUT);

pinMode(14,INPUT);

//
analogReference(EXTERNAL);

/// Wolke lipo-single-cell-monitor
#ifdef USE_SINGLE_CELL_MONITOR
for(int i = 0; i < MAXCELLS; i++){
zelle[i] = 0;
cell[i] = 0.0;
individualcelldivider[i] = LIPOCELL_1TO8[i];
smoothedVal[i] = 900.0;
}
#endif
/// ~Wolke lipo-single-cell-monitor

}

// ******************************************
void loop() {

/// Wolke lipo-single-cell-monitor
#ifdef USE_SINGLE_CELL_MONITOR
double aread[MAXCELLS+1];
for(int i = 0; i < MAXCELLS; i++){
aread[i] = analogRead(i);
if(aread[i] < analogread_threshold ){
cells_in_use = i;
break;
}
else
{
cells_in_use = MAXCELLS;
}
// USE Low Pass filter
smoothedVal[i] = ( aread[i] * (1 - lp_filter_val)) + (smoothedVal[i] * lp_filter_val);
aread[i] = round(smoothedVal[i]);
cell[i] = double (aread[i]/individualcelldivider[i]) * 1000;

//debugSerial.print( cell[i]);
//debugSerial.print( ", "); 

if( i == 0 ) zelle[i] = round(cell[i]);
else zelle[i] =  round(cell[i] - cell[i-1]);

}
alllipocells = cell[cells_in_use -1];
//debugSerial.println(", end");

/*
debugSerial.println(aread[0]);
debugSerial.println(cell[0]);
debugSerial.println("-------");
//

for(int i = 0; i < MAXCELLS; i++){

debugSerial.print( aread[i]);
debugSerial.print( ", ");    

}
debugSerial.print("cells in use: ");
debugSerial.print(cells_in_use);
debugSerial.print( ", “);
debugSerial.print(”, sum ");
debugSerial.println(alllipocells);
*/

#endif
/// ~Wolke lipo-single-cell-monitor

uint16_t len;

if(millis()-hb_timer > 1500) {
hb_timer=millis();
if(!MavLink_Connected) { // Start requesting data streams from MavLink
digitalWrite(led,HIGH);
mavlink_msg_request_data_stream_pack(0xFF,0xBE,&msg,1,1,MAV_DATA_STREAM_EXTENDED_STATUS, MSG_RATE, START);
len = mavlink_msg_to_send_buffer(buf, &msg);
_MavLinkSerial.write(buf,len);
delay(10);
mavlink_msg_request_data_stream_pack(0xFF,0xBE,&msg,1,1,MAV_DATA_STREAM_EXTRA2, MSG_RATE, START);
len = mavlink_msg_to_send_buffer(buf, &msg);
_MavLinkSerial.write(buf,len);
delay(10);
mavlink_msg_request_data_stream_pack(0xFF,0xBE,&msg,1,1,MAV_DATA_STREAM_RAW_SENSORS, MSG_RATE, START);
len = mavlink_msg_to_send_buffer(buf, &msg);
_MavLinkSerial.write(buf,len);
digitalWrite(led,LOW);
}
}

if((millis() - MavLink_Connected_timer) > 1500) { // if no HEARTBEAT from APM in 1.5s then we are not connected
MavLink_Connected=0;
hb_count = 0;
}

_MavLink_receive(); // Check MavLink communication

FrSkySPort_Process(); // Check FrSky S.Port communication

}

void _MavLink_receive() {
mavlink_message_t msg;
mavlink_status_t status;

while(_MavLinkSerial.available())
{
uint8_t c = _MavLinkSerial.read();
if(mavlink_parse_char(MAVLINK_COMM_0, c, &msg, &status))
{
switch(msg.msgid)
{
case MAVLINK_MSG_ID_HEARTBEAT: // 0
ap_base_mode = (mavlink_msg_heartbeat_get_base_mode(&msg) & 0x80) > 7;
ap_custom_mode = mavlink_msg_heartbeat_get_custom_mode(&msg);
#ifdef DEBUG_MODE
debugSerial.print(millis());
debugSerial.print("\tMAVLINK_MSG_ID_SYS_STATUS: base_mode: “);
debugSerial.print((mavlink_msg_heartbeat_get_base_mode(&msg) & 0x80) > 7);
debugSerial.print(”, custom_mode: ");
debugSerial.print(mavlink_msg_heartbeat_get_custom_mode(&msg));
debugSerial.println();
#endif
MavLink_Connected_timer=millis();
if(!MavLink_Connected);
{
hb_count++;
if((hb_count++) > 10) { // If received > 10 heartbeats from MavLink then we are connected
MavLink_Connected=1;
hb_count=0;
digitalWrite(led,HIGH); // LED will be ON when connected to MavLink, else it will slowly blink
}
}
break;
case MAVLINK_MSG_ID_STATUSTEXT: //253
mavlink_msg_statustext_decode(&msg,&statustext);
ap_status_severity = statustext.severity;
ap_status_send_count = 5;
parseStatusText(statustext.severity, statustext.text);

#ifdef DEBUG_STATUS
debugSerial.print(millis());
debugSerial.print("\tMAVLINK_MSG_ID_STATUSTEXT: severity “);
debugSerial.print(statustext.severity);
debugSerial.print(”, text");
debugSerial.print(statustext.text);
debugSerial.println();
#endif
break;
break;
case MAVLINK_MSG_ID_SYS_STATUS : // 1
#ifdef USE_AP_VOLTAGE_BATTERY_FROM_SINGLE_CELL_MONITOR
ap_voltage_battery = alllipocells;
//no lipo to network connected use reported mavlink_msg voltage
if(cells_in_use == 0) ap_voltage_battery = mavlink_msg_sys_status_get_voltage_battery(&msg);
#else
ap_voltage_battery = mavlink_msg_sys_status_get_voltage_battery(&msg); // 1 = 1mV
#endif
ap_current_battery = mavlink_msg_sys_status_get_current_battery(&msg); // 1=10mA
ap_battery_remaining = mavlink_msg_sys_status_get_battery_remaining(&msg); //battery capacity reported in %
storeVoltageReading(ap_voltage_battery);
storeCurrentReading(ap_current_battery);

#ifdef DEBUG_BAT
debugSerial.print(millis());
debugSerial.print("\tMAVLINK_MSG_ID_SYS_STATUS: voltage_battery: “);
debugSerial.print(mavlink_msg_sys_status_get_voltage_battery(&msg));
debugSerial.print(”, current_battery: ");
debugSerial.print(mavlink_msg_sys_status_get_current_battery(&msg));
debugSerial.println();
#endif
uint8_t temp_cell_count;
#ifdef USE_SINGLE_CELL_MONITOR
ap_cell_count = cells_in_use;
if(cells_in_use == 0){
if(ap_voltage_battery > 21000) temp_cell_count = 6;
else if (ap_voltage_battery > 17500) temp_cell_count = 5;
else if(ap_voltage_battery > 12750) temp_cell_count = 4;
else if(ap_voltage_battery > 8500) temp_cell_count = 3;
else if(ap_voltage_battery > 4250) temp_cell_count = 2;
else temp_cell_count = 0;
if(temp_cell_count > ap_cell_count)
ap_cell_count = temp_cell_count;
}
break;
#else
if(ap_voltage_battery > 21000) temp_cell_count = 6;
else if (ap_voltage_battery > 17500) temp_cell_count = 5;
else if(ap_voltage_battery > 12750) temp_cell_count = 4;
else if(ap_voltage_battery > 8500) temp_cell_count = 3;
else if(ap_voltage_battery > 4250) temp_cell_count = 2;
else temp_cell_count = 0;
if(temp_cell_count > ap_cell_count)
ap_cell_count = temp_cell_count;
break;
#endif

  case MAVLINK_MSG_ID_GPS_RAW_INT:   // 24
    ap_fixtype = mavlink_msg_gps_raw_int_get_fix_type(&msg);                               // 0 = No GPS, 1 =No Fix, 2 = 2D Fix, 3 = 3D Fix
    ap_sat_visible =  mavlink_msg_gps_raw_int_get_satellites_visible(&msg);          // numbers of visible satelites
    gps_status = (ap_sat_visible*10) + ap_fixtype; 
    ap_gps_hdop = mavlink_msg_gps_raw_int_get_eph(&msg)/4;
    // Max 8 bit
    if(ap_gps_hdop == 0 || ap_gps_hdop > 255)
      ap_gps_hdop = 255;
    if(ap_fixtype == 3)  {
      ap_latitude = mavlink_msg_gps_raw_int_get_lat(&msg);
      ap_longitude = mavlink_msg_gps_raw_int_get_lon(&msg);
      ap_gps_altitude = mavlink_msg_gps_raw_int_get_alt(&msg);      // 1m =1000
      ap_gps_speed = mavlink_msg_gps_raw_int_get_vel(&msg);         // 100 = 1m/s
    }
    else
    {
      ap_gps_speed = 0;  
    }

#ifdef DEBUG_GPS_RAW
/*debugSerial.print(millis());
debugSerial.print("\tMAVLINK_MSG_ID_GPS_RAW_INT: fixtype: “);
debugSerial.print(ap_fixtype);
debugSerial.print(”, visiblesats: “);
debugSerial.print(ap_sat_visible);
debugSerial.print(”, status: “);
debugSerial.print(gps_status);
debugSerial.print(”, gpsspeed: “);
debugSerial.print(mavlink_msg_gps_raw_int_get_vel(&msg)/100.0);
debugSerial.print(”, hdop: “);
debugSerial.print(mavlink_msg_gps_raw_int_get_eph(&msg)/100.0);
*/
debugSerial.print(”, gps lat: “);
debugSerial.print(mavlink_msg_gps_raw_int_get_lat(&msg));
debugSerial.print(”, gps long: “);
debugSerial.print(mavlink_msg_gps_raw_int_get_lon(&msg));
//debugSerial.print(”, alt: ");
//debugSerial.print(mavlink_msg_gps_raw_int_get_alt(&msg));
debugSerial.println();
#endif
break;

  case MAVLINK_MSG_ID_RAW_IMU:   // 27
    storeAccX(mavlink_msg_raw_imu_get_xacc(&msg) / 10);
    storeAccY(mavlink_msg_raw_imu_get_yacc(&msg) / 10);
    storeAccZ(mavlink_msg_raw_imu_get_zacc(&msg) / 10);

#ifdef DEBUG_ACC
debugSerial.print(millis());
debugSerial.print("\tMAVLINK_MSG_ID_RAW_IMU: xacc: “);
debugSerial.print(mavlink_msg_raw_imu_get_xacc(&msg));
debugSerial.print(”, yacc: “);
debugSerial.print(mavlink_msg_raw_imu_get_yacc(&msg));
debugSerial.print(”, zacc: ");
debugSerial.print(mavlink_msg_raw_imu_get_zacc(&msg));
debugSerial.println();
#endif
break;

  case MAVLINK_MSG_ID_ATTITUDE:     //30
    ap_roll_angle = mavlink_msg_attitude_get_roll(&msg)*180/3.1416;  //value comes in rads, convert to deg
    // Not upside down
    if(abs(ap_roll_angle) <= 90)
    {
      ap_pitch_angle = mavlink_msg_attitude_get_pitch(&msg)*180/3.1416; //value comes in rads, convert to deg
    }
    // Upside down
    else
    {
      ap_pitch_angle = 180-mavlink_msg_attitude_get_pitch(&msg)*180/3.1416; //value comes in rads, convert to deg
    }
    ap_yaw_angle = (mavlink_msg_attitude_get_yaw(&msg)+3.1416)*162.9747; //value comes in rads, add pi and scale to 0 to 1024

#ifdef DEBUG_ATTITUDE
debugSerial.print(“MAVLINK Roll Angle: “);
debugSerial.print(mavlink_msg_attitude_get_roll(&msg));
debugSerial.print(” (”);
debugSerial.print(ap_roll_angle);
debugSerial.print(“deg)”);
debugSerial.print("\tMAVLINK Pitch Angle: “);
debugSerial.print(mavlink_msg_attitude_get_pitch(&msg));
debugSerial.print(” (");
debugSerial.print(ap_pitch_angle);
debugSerial.print(“deg)”);
debugSerial.print("\tMAVLINK Yaw Angle: “);
debugSerial.print(mavlink_msg_attitude_get_yaw(&msg));
debugSerial.println();
#endif
break;
case MAVLINK_MSG_ID_VFR_HUD: // 74
ap_groundspeed = mavlink_msg_vfr_hud_get_groundspeed(&msg); // 100 = 1m/s
ap_heading = mavlink_msg_vfr_hud_get_heading(&msg); // 100 = 100 deg
ap_throttle = mavlink_msg_vfr_hud_get_throttle(&msg); // 100 = 100%
ap_bar_altitude = mavlink_msg_vfr_hud_get_alt(&msg) * 100; // m
ap_climb_rate=mavlink_msg_vfr_hud_get_climb(&msg) * 100; // m/s
#ifdef DEBUG_VFR_HUD
debugSerial.print(millis());
debugSerial.print(”\tMAVLINK_MSG_ID_VFR_HUD: groundspeed: “);
debugSerial.print(ap_groundspeed);
debugSerial.print(”, heading: “);
debugSerial.print(ap_heading);
debugSerial.print(”, throttle: “);
debugSerial.print(ap_throttle);
debugSerial.print(”, alt: “);
debugSerial.print(ap_bar_altitude);
debugSerial.print(”, climbrate: ");
debugSerial.print(ap_climb_rate);
debugSerial.println();
#endif
break;
default:
break;
}

}

}
}


and on the taranis I detected many sensors:


NB: now you do not see the values because the receiver is not powered!

But when I load the Yaapu script on the radio it comes out:

2018-12-14_183100

How can I solve the problem? Thanks a lot for the answer

Sorry, but as far as I know there is no support for the telemetry protocol that the script requires on APM boards. And that I know no Arduino or Teensy based systems have implemented the XPort protocol.

You’ll need a recent version of Ardupilot, that only run on PixHawk or newer controllers. If you need a cheap one and more capable look at the newly support boards like Kakute’s or Matek’s

edit: Perhaps the best solution is the one Alex is pointing below, but I would also urge you to get a newer flight controller…

Hi Giuliano,
now that I know your setup I can help you better.

Try Eric Stockenstrom’s MavlinkToPassthru firmware, him and I helped an APM 2.6 user getting my script up and running.

Check this quite detailed issue on his github for further help

let me know if you need more support!

Alex

Hi @giuliano89,
I also noted that you’re running the script by invoking it as a one time script.
The yaapu script should be configured as a telemetry script, you can follow ardupilot’s wiki for the details.

@LuisVale is right, you’re missing so much by using an older board especially now that with ChibiOS based ports there are really good and cheap boards around!

cheers,

Alex

1 Like

I have copied the scripts to my SD card as indicated by the Taranis XD9 setup information. On Taranis page 13 I set the screen 1to SCRIPT and yaapu9, when I press and hold the Page button I get a message “No Telemetry Screens” what have I done wrong, and yes lua was enabled on firmware?