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...
can i use an arduino pro mini 16k instead Teensy?
thanks from italy!
I'm no programmer, But it seems that I managed to hack it to get it working.
In FrSkyPort.ino, I changed:
to: FrSkySPort_SendPackage(FR_ID_T2,(ap_custom_mode +1) * 20);
to: FrSkySPort_SendPackage(FR_ID_FUEL,(ap_base_mode + 1) * 20);
I changed the two around to get a bigger number range for the AP_custom_mode to play with.
While T2 seems to go above 225, FUEL only goes to 100(%)
Also, I'm adding +1 to make sure I actually see real data and not just an empty, default value of zero i.e. during stabilize.
In Taranis, I have configured 6 custom switches using the values from Rolfs post above. I then use these CS to trigger custom functions playing the files.
One for each filghtmode:
T2~20 = Stabilize
T2~60 = AltH
T2~120 = Loiter
T2~80 = Auto
T2~200 = LAND
T2~140 = RTL
(It seems that the a~x value requires a spread of least +/-16 to avoid crossover)
(Having = as operator would be very nice)
Another two custom switches are used for ARM/DISARM, now provided in the FUEL parameter:
FUEL~20 = DISARMED
FUEL~40 = ARMED
Also, i'm using the build-in feature of playing a wav when entering a flightmode to save some custom functions. I have created the 6 modes as flightmodes (1-6) Adding the similar-named wav-files to the SD card, the files will be played automatically. I.E. sounds/en/[name-of-model]/stabilize-ON.vwav
In each flightmode, I set a GVAR with the value i want APM to recieve. Then send the corresponding output value to APM using the Mixer.
With this setup, I can hear and see the flightmode I have selected. and I am notified of the active flightmode whenever it is changing for any reason.
(GPS glitch during a sudden change to LAND - due to "low battery" - can be a nasty surprise...)
For this, I have made some additional wav-files. I.e. "Request Stabilize mode" and "Stabilize mode is active".
...Now I just need to figure out how to get GPS HDOP and Glitch warnings...
Superb work I'm going to build this into my quad next time I tear it down.
I'm going to ultimately build this for a Pro Mini as I have a stack of them on the shelf but for simplicity sake I'll stick to the 8MHz 3.3v which i think should be plenty quick enough to handle the conversion. I'll start out by building it into my R3 Uno breadboard to make sure all is well and then when that's working build up the pro mini. I'll post progress as it comes.
hi Rolf, I would like to use your project to deliver telemetry from openlrsng module to taranis, but since the most stable telemetry rate of openlrsng right now is 19200baud I would need to change the default baud rate of your program to run at 19200 baud. is it done by changing the following line _MavLinkSerial.begin(57600); to _MavLinkSerial.begin(19200); ?
also, do you happen to know how to extract RSSI info from the mavlink and what would be the best way to show it on the Taranis (which telemetry variable on the taranis would be capable of accepting values from 0 to 100)?
Hi, were you able to get gps glitch message relayed to taranis, if yes what is the mavlink message i.e. mavlink_msg_heartbeat_get_XXXXXX. as well as through which parameter would you suggest to send it through?
I was able to find this info: https://pixhawk.ethz.ch/mavlink/#RADIO_STATUS but I am not sure of the syntax, would really appreciate your response.
That is not needed anymore, since the release of OpenTX 2.01 for the Taranis.
I still have "mechanical" problems with the connections of the Teensy to the PixHawk (damn DF13), but now we can have a Custom switch with the = operand :)
S.Bus to CPPM converter connected on S.Bus port on X8R and Input 1 on APM. Jumper on Input pins 2-3. Works on both my APM 2.6 and PixHawk (no jumper and connect to SB port on PH).
what Rolf want to do is do the sbus to ppm conversion on teensy instead of the adapter.
@Rolf, have you considered using FastSerial library to do the serial communications so the ppm will get priority no matter what?
this is great information. i plan to use this when i get pixhawk and a taranis.
i do have a few questions.
is it possible to use a taranis sensor with pixhawk? for example the FrSky Current/Ampere Sensor 100A
also is there a gps that would work with both taranis and pixhawk? or do i need both (taranis gps and 3dr gps) if i want t?
I think 1.4 will be released by someone else, all the interesting stuff like flight mode and hdop are already here, the only other very useful thing (at least for me) will be a function to catch rxRSSI from the mavlink and send it down as a frsky telemetry value. why this will be useful: 2.4 band is usually very dirty and even in the clean RF environment wont go too far, so most of the people are using UHF 433 bands. out of multiple good RC links availabe there is one which is particularly useful for APM users - openlrsNG capable hardware. units like DTF UHF are of very high quality and reliability in addition they provide a valuable telemetry connection which supports mavlink at 19200 baud, and according to Kha (openlrsNG main developer) 38k mavlink is in the works. now on the part where Rolf's project becomes useful again: Taranis is able to understand only frsky branded telemetry.I work on connecting the teensy to the ground module UHF telemetry port and teensy s.port to the s.port of the Taranis. Should work, but there will be no way of getting RSSI except from the mavlink. Many can argue on why would one even use the UHF telemetry instead of the standard 3dr radios especially since the DroidPlanner. Now here is why I would prefer the UHF vs 915mhz: there is no better RC link than UHF and since the telemetry is supported why use another band all together which should lead to the RF cleaner UAVs as well as longer telemetry range (UHF pawns 915 especially as there are 1W UHF Rx -es). Just like with 3DR radios this telemetry can be accessed with MP or DP via FTDI cable or BT to serial dongle. So the GCS lovers still have mavlink connection to their drone(s), while those simple FPV pilots will get a voice alert from their taranis on important telemetry values just in case they overlooked their OSD.