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...
okay cheers, this one was giving me problems for hours hehe, i only tried a UBEC because of the OP's comment
I have a PixHawk not an APM, but for me, Yes the telemetry works when powered by USB and not a battery
Thats interesting, because I do get telemetry when connected via USB only. I just tested it and watched the pixhawk acquire satellites via my Taranis. I am using a PixHawk though and not an APM
sorry i tested and meant the apm. dont own a pixhawk yet.
When using USB the Telemetry port on APM will not work.
That's because the Telemetry and USB share the same serial port, with some clever multiplexing to detect if the USB cable is plugged in and switching output to the USB if so.
Just an FYI for anyone who is trying this. I got the mode number to be sent to the Taranis via the fuel telemetry value. That all works. However, at present there is no way I could find to get the Taranis to create custom switches that triggered on the fuel value in order to trigger the functions to play the voice files.
The issue is that you have to use the a~x,a>x,a<x functions to trigger the switch, where a is the fuel value and x is a constant. Unfortunately a~x is meant to deal with things like RC inputs where you dont really want to trigger on a single value as much as its close to this value As such, a trigger for say mode 3 (fuel ~= 3) will trigger on several other values because they are close.
I submitted an issue on the OpenTx git hub site to add an a=x function in addition to the a~x function that exists now. The response from OpenTx was that that feature was already incorporated into version 2.0 of OpenTx. If anyone has thought of another way to do it let me know. Otherwise I will continue to trigger off of the physical switches to get the mode rather than the telemetry value until OpenTx 2.0 is released
You have tried fuel>2 and fuel<4 ? I think you can have two conditions?
Unfortunately you only get one condition per switch. You can do it that way to do a few modes. But it consumes 3 custom switches for each mode (one for a<x one for a>x and one to AND them). There are 13 modes, so you eat more than the 32 available switches to handle all of the modes. You can do it in 25 switches by just doing all a>x for x = 1 to 12 and then do 13 more ANDs in the form of CSX AND !CSY to do x>2 and !x>3. I only have about 18 free custom switches at the moment. Now that I have gone through the numbers, I could implement most of them that way. I will try it out.
For a moment I thought you could have two switches per CS, but now I remember you can only AND a state.
How about multiplying the fuel (mode) by ~10 to get it in the same range as the stick inputs, using Gvars on custom functions or a mix to a dummy output channel and then using this value as a CS a~x (fuel~x)? I don't have any documentation or my TX to test. But will have a play tonight when home.
That's an interesting idea. I could not see a way to multiply the fuel level in the Taranis radio, but I can multiply it in the Teensy before it comes down. I think fuel is a % so I am guessing it can only range from 0 to 100. I will try that and see what the a~x spread is.
Rolf, I think I've managed to modify your code and Adafruit's code so that I have a GPS trying to send data to the SPort. Nothing appears in the Taranis yet, but that is to be expected for the first try.
I currently either have the Teensy connected to USB to see the GPS data or to the SPort. I need to be able to dump the SPort data to the screen. Will cutting the bridge on the Teensy allow me to connect USB and the powered SPort at the same time?