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: 308109


Reply to This

Replies to This Discussion

Robert, I'm still trying to figure out what you are doing wrong here. If you can please answer a few questions, this might help:

  1. Are you running a Taranis X9 radio? So Taranis X9D Plus for instance? This has been written specifically for this, although the telemetry sensors should be picked up by OpenTx 2.1 or newer (works fine on 2.2.0 for instance) on any radio to be honest running OpenTx 2.1 or newer (the LUA only works on the Original Taranis X9D or X9D+ though).
  2. On the Telemetry sensors page (at the bottom) be sure that 'Ignore Instances' is not checked before you do the discovery (in Companion this is called 'Disable multi sensor handling').
  3. Can I also please check that your "Telemetry type" is set to "FrSky S.PORT" at the top of the sensors page.
  4. Can you please explain your plane configuration - I.e. do you have only the teensy on the smart port connection, or do you have any other FrSky smartport sensors daisy chained? If so, what are they?
  5. You are running ArduPilot (and not PX4 flight stack)? What version of AP?

Baud should be 57600

The project is written for both Copter and Plane (assuming you're using the newer versions) the latest version in my repo here: https://github.com/athertop/MavLink_FrSkySPort includes the configuration page within the LUA script which allows you to choose between Copter/Plane - making the correct selection here ensures that the correct flight modes are displayed/called. This is all on the LUA side though (which is all about setting up your SD card contents), so lets try to concentrate on getting the Teensy/sensor part working first. I am running this on a plane running AP 3.71 (not tried 3.8 yet).

Last thing, what does the Options section of the teensy code look like in your configuration? I'm referring to the Addons/Options section in MavLink_FrSkySPort.ino

Cheers, Paul


I got a lot more of it worked out.  I did a reload of the code on Teensy and now I get a single GPS that updates.

I also see where there is a plane option on the lau script.

I am running AP 3.8.2.

Ii will do some testing on what I have now.  Is there a way to display AoA data on the screen?  Do I need to create a custom sensor with a calculation?

Thank you for your time.


By AoA you mean the pitch angle? Or the glide angle? If pitch angle, then I imagine this could be calculated in LUA code from the pitch value displayed by A4 (too complex for a calculated sensor). I've never really paid attention to this sensor but I'm sure you could work it out from the info in the wiki and by experimenting to really understand those numbers.

The wiki describes A4 as: Pitch angle from -Pi/2 to +Pi/2 radians, converted to a value between 0 and 1024. Now if I am translating this correctly, this suggests that a value of 0 would represent pitch down of 90deg, 512 would be level and 1024 would be pitch up of 90deg. 

ok.  I got to fly the plane today and things turned out good with one issue.  It seems that the airspeed units of measure seem to be wrong.  I like to have everything in kts but it seems mission planner/arduplane have a hard time being consistent with the units.  Any how, I can see that my speed on taranis was half of what mission planner says I was going.  I tend to believe mission planner.  For instance, I did some stall testing and the stall speed according to the Taranis is about 9kts which is wrong.  The plane is a Telemaster and I know it flies slow but I am doubtful it is that slow.  I suspect 9 is a meter/second reading.  GS has me stalling around 18kts which is much more believable.  I tried changing the units on the sensors but that made the gap even wider.  Anyone notice this?  Is this a problem with the units that arduplane is feeding to the teeny?  Or is this a conversion problem in the Sketch code?  Or is this a unit issue in the Lua code?  I have my Lua script setup for KTs as well as my sensors.

Thx for the help so far.


Robert, did you follow the sensor setup for airspeed and groundspeed  detailed in the wiki? You need to configure the sensors to be in knots, then on the LUA page you can choose the units of choice for display. In my setup the airspeed on the LUA page matches mission planner exactly - for ground and air speed.

As for Angle of Attack mentioned yesterday - the data I described isn't accurately the AoA, but rather the pitch attitude, as to get the AoA, you need to know the angle of the wind flow onto the underside of the wing, but we don't have any way to measure this through any sensor, so I don't think this would be an easy job to calculate this accurately.

The sensors are configured in knots as is the lua page.  I did not configure all sensors.  I will check each one of them tonight.  aspd and gspd are in knots for sure.

Regarding the AOA, the telemetry logs do have an attribute for it but it seems to be zeroed out.  I guess I assumed that AOA could be figured out between gyro and accel measurements.  In theory, this should be doable.  The gyros know the attitude of the plane while the accelerometers should know the exact direction of the plane.  Maybe there is too much error to make that happen.

Thank you for the response.

Scot (Robert is my first name, but I go by Scot)

 Below is a quote from the wiki.

Additionally Note - ASpd & GSpd- These sensors will be discovered with the unit of kts configured - even though the value it displays will actually be in m/s. Do not change the units of these sensors - leave as kts and the telemetry screen will display their values correctly in the chosen scale (chosen in the telemetry screen configuration).

There is obviously something funny going on here.  I do have my telemetry and sensor units set to knots.  I will test it again tomorrow.


To answer previous questions, see below:

I have OpenTx 2.2

Software is AP 3.8.2

Teensy is plugged into Telem2.  I have no other smart devices or sensors plugged in.

Telem 1 has the 3dr radio.

I do not see anywhere is says Telemetry type on the sensor page.  Am I looking in the wrong place?


I will have to check to see if I have ignore instances checked.


Looking at the documentation, there is supposed to be a file called mixes/offset.lua.   Is that supposed to be in the scripts dir on the Taranis SD Card?  I see no such file on my card.  Do I just create a text file with some values in it?  


I did find a config file with my planes name on it that seems to have the variables mentioned in the doc.  SpeedUnits is set to 2 there.  

On the https://github.com/athertop/MavLink_FrSkySPort/wiki/0.-Overview page, it indicates the following options:

Speed: m/s, kph, mph, kts

According to https://github.com/athertop/MavLink_FrSkySPort/wiki/0.-Overview, the options for the speed are:

Ground Speed - units can be set in mixes/offset.lua under "SpeedUnits" 1 = m/s, 2 = kph, 3 = mph

I see no ground speed option for kts.  Is 4 a valid value for kts?

Below is my config:

File name:  Auto Telmstr.cfg

 return {["speedUnits"] = 2,["altUnits"] = 1,["apType"] = 1,["offsetmah"] = 0,["offsetwh"] = 0,["whCap"] = 0,["armGvar"] = 0}

Robert, That is an issue with the wiki (missed removing a bit) since the configuration page took over from the offset.lua mixer script - that was how we used to set the offsets and plane/copter before I rewrote the LUA scripts. Thanks for spotting the wiki issue - I have just fixed that.

I haven't had the weather lately to do any flying, but once I do I will get my fx61 in the air to test the windspeed (its the only pixhawk equipped plane I have (also has digital windspeed sensor.

Cheers, Paul

This is clearer to me now.  I did two more flight and noticed that the speed on the lua dashboard is likely correct.  Outside of that, I have my own telemetry screen that has air and groundspeed in it as well as voice alerts for providing warning speeds.  Those elements are either reporting in KPS or m/s.  I am not sure which.  I also got the sensors to dump logs and they seem to indicate the airspeed to be in kts but the values in the logs are consistent with my dashboard and not the Lua dashboard.  I can upload the logs if you want to see them.  I would like both dashboards to be consistent with each so I can setup custom alerts.  

Let me get the GS Telemetry, onboard logs, and Taranis logs uploaded.

Link to logs below


Reply to Discussion


© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service