Hi all,

I just bought an FrSky Taranis for my quad copter and needed to get the Mavlink data up on the Taranis LCD telemetry display. So here is my solution using a Teensy3.1 as a converter between MavLink and the S.Port on FrSky X8R.

See attached file below...

Views: 310360


Reply to This

Replies to This Discussion

hi luis,

i do some work on the single-cell-lipo fork.

i increase analogRead  to 13bit. available on teensy3.1. this give more precision in voltage measuring. 

i add autodetection of cells theoretical usable for 12s lipos. currently i can not test 12s because my resistor network only have 6 inputs.

auto detection for lipo monitor works correctly if a resistor network is connected to teensy3.1 A0-A(n).

i add to lua telemetry script some info sounds.

 * play info level of min cell.  this happens if cell-min voltage decrease  0.1 volts.

 * play warn level each 4 seconds if cell-min reach 3.5 volts

 * play critical level each 4 seconds if cell-min reach 3.4 volts

also i add (but only for me because i think you already work on it) play apm messages for example (compas is not healthy).

i found a lot of MSG??.wav files in SOUNDS/en. i think you create them. this is why i add a minimal test implementation to play this files.

two questions:

first, did somebody actually work on the apm_status_message implementation( lvale/MavLink_FrSkySPort )?

second, is it possible to create user configurable input vars in telemetry scrips? i found this nice function in model scrips. but not in telemetry scrips.

i will make cell-min warn level, cell-min critical level and cell-min info level user configurable.




This is by design actually.

The code is designed to emulate different frsky sensors. If you disable FLVSS, its stops reporting voltage as FLVSS. It still emulates a FAS-sensor though, so the voltage you see is from voltage/current sensor. 

The source for the voltage is adjusted on the telemetry-setup screen on your Taranis. I would suspect yours is setup as FAS? If you set it to Cells, it will use your FLVSS sensor instead (and if you don't have any, it should show 0).

2. These messages is reported by your autopilot. You shouldn't even be able to arm with those messages? There should be some parameters in ardupilot to disable gps/compass, and that might remove these messages. It is also possible to disable them in ApmTelem.lua if you need.


I think the apm_status_message comes from the base branch (found here: https://github.com/chsw/MavLink_FrSkySPort)


Hi Wolke

Great progress on the cells issue.

The MSGx.wav files I created to be used by Christian and me (or anyone else that wishes to) and are a direct implementation of most (almost all) the messages that the current APM code reports. There are some exceptions where variables are also used on the message that are not easy to parse correctly. Even so, there are 100+ messages :).

I haven't been pursuing the reporting of the messages, although everything is in place to do it, because I haven't found a good way to do it easily and that won't make the radio crash the Lua scripting, because we are on the limits of what can be done. I already had working code on the simulator but would not run on the radio due to memory issues.

Christian has a different structure of the scripts and one of his scripts is only dedicated to the errors.

No user inputs available on telemetry scripts, but you can have a model script that could collect the data from the user and then the telemetry script use that Global Variable.

I personally prefer to not have a mix of model and telemetry scripts with interdependences between them. Christian has gone that way, and had to develop additional checks on the code to determine if the model scripts are in place and of the correct version.

For your purpose I would create a reasonable value defined on the beginning of the script and a comment on the script telling the user what the parameters are for and that they are adjustable.

btw: 4 seconds delay between messages??? If you accept a suggestion make that time based depending on the rate of decay. i.e.. if the voltage drops by 0.1v in less than 1 minute then warn.


thx for information. i do not like global vars on (for me)unknown systems. my first idea also was creating a modelscript which can adjust some global vars. but i do not like this way.

the 4 seconds delay between messages are only if voltage reach the warn level <3.5 volt on lowest cell. else it only say cell voltage infos if the cell drop next 0.1volt. this happens in dependent of your lipo capacity ever 40 - 120 seconds. i often fly in setups with external camera operator and director. so mostly two or three persons are communicate in a movie scene. if voltage drops to a critical level i need unmistakeable infos. also other people on set become attention that the scene must interrupted.

if the cell drops, because high current activity like full throttle or full speed you also get info warn and critical messages. but they recover if you come back to normal flight.



Hi luis

    First let me say thanks for all the work you are puting in

I have downloaded  your ula scripts for taranis and have a teensy mavlink to frsky converter

and it works very well    ...... except for pitch and roll on A3 /A4 i have traced the signal back to the teensy

by inserting fixed numbers (int32_t ap_pitch_angle = 7; in to the sketch ,these then are displayed correctly

but do not change

so i assume the error is in the arduno sketch or librarys ?


Tim Painter

Sorry, but can't trace the error you're having. From my hexa, and others that have used this script and the Teensy code, roll and pitch are correct.

There's a provision on the code that runs on Teensy to debug the values collected, and I suggest that would be a good place to start.

Uncomment this line


In the case you'll need an unmistakable critical alarm then let me suggest to use Not a voice prompting but an alarm horn type of sound. It's different enough from the voice messages and raises the attention to the surrounding people.

Hi Luis

    Thanks for the advise

on #define DEBUG_ATTITUDE no comport output

after moving  debug_attitude out of the switch case select

debug reports pitch and roll =0

  in the     "switch(msg.msgid) "  

   case MAVLINK_MSG_ID_ATTITUDE:     //30

is never selected therefor no output to Sport  (and no attitude_debug )

any ideas??



Can you see the data on a standard GCS software ?? It is exactly the same data that goes to the GCS, so if the GCS HUD moves the Roll,Pitch should also be seen.

What Flight Controller do you have ? And what firmware release? Is it Multicopter ?

On the simulator check the A3 and A4 values



What's your OpenTX version ??

Well, I found it strange so I uncommented the debug line I mentioned and recompiled the code to the Teensy and the monitor shows me this:

Reply to Discussion


© 2020   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service