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...
Replies
hello Glenn, I know this is an old post, but did you by chance look into this any more? It seems a whole lot more straightforward to invert the output signal and send directly from the PX4.
This weekend I bought a Teensy 3.1 from the Arduino booth at the maker faire I was flying drones on :)
Yesterday I wired it to my OpenRLSng but failed to get telemetry info on my Taranis. So I just wanted to check some things:
I have made across-post of this on the OpenLRSng thread at RCGroups too and will share the answers. Thanks!
very cool, i have been meaning to get my LRS project going... thanks for posting
Hello Rolf.
Thanks for a great job, I'm very impressed.
I have taken the liberty to change some of the code so Fuel can be read as a percentage.
I do not know if it has use to anyone other then me, but I like to see how much I have left in the battery.
In "MavLink_FrSkySPort"
// Message # 1 SYS_STATUS
uint16_t ap_voltage_battery = 0; // 1000 = 1V
int16_t ap_current_battery = 0; // 10 = 1A
int16_t ap_battery_remaining = 0; // new
***
ap_voltage_battery = Get_Volt_Average(mavlink_msg_sys_status_get_voltage_battery(&msg)); // 1 = 1mV
ap_current_battery = Get_Current_Average(mavlink_msg_sys_status_get_current_battery(&msg)); // 1=10mA
ap_battery_remaining = mavlink_msg_sys_status_get_battery_remaining(&msg); // new
if(ap_battery_remaining<=0) // new
{
ap_battery_remaining=0; // new
}
***
In "FrSkySPort"
case 19:
FrSkySPort_SendPackage(FR_ID_FUEL,ap_battery_remaining); //new, the other line with FR_ID_FUEL is deleted
break;
It works with me, and I do not think it affects any of the other code.
I will most definitely uset his feature as I like to know the usage of the battery as well.
Thanks for doing so.
I've got my Teensy to work! ...thank you Rolf and others ;)
I've noticed one small issue. The Teensy does not always kick in after plugging main battery. Often, after I plug in main battery, I have to disconnect and reconnect Teensy from S.Port or disconnect and reconnect X8R from APM (I'm using CPPM converter).
Also, the X8R has A1 built in analog voltage sensor providing the voltage that powers the X8R. So in case where Teensy is powered from X8R A2 is always same as A1.
A2 is coming from Teensy analog port A0, if this port is not connected then you will get a random value as A2.
else if connected you will have 0V = 0 to 3.3V = 255 these values are then scaled at the Taranis to show a representation of the voltage.
Rolf I have a couple of questions about this reply. First I am running an apm 2.6 with the teensy 3.1 board hooked to my Frysky 8XR receiver using my Taranis Transmitter. My telemetry is working fine but my battery voltage (CEL and CELS) is showing .2 amps low. Is there anyway to correct this or should I just work around this issue. (not a big deal...better lower than higher)
My A2 reading on the Taranis is jumping all over. When I disconnect teensy it goes back to normal. You mention that A2 voltage comes from pin A0, My A0 pin is not wired into anything. How would I go about connecting and correcting it.
I understand. All I'm saying is that voltage on A1 and A2 is going to show the same value if Teensy is powered from X8R.
Any thoughts on the power-on issue I'm seeing? Almost always, after powering the main battery I have to unplug and replug Teensy from X8R to start it working. If I don't is seems "dead" ... no LED won't blink at all.
This is really cool. Thanks so much for creating this and all the helpful posts. I just received my Teensy today and hope to tinker with it this weekend. Took a couple of images of the board with my digital microscope here at work for anyone to use as reference, etc...
(stitched images, 50x magnification)
teensy_front_50x.jpg
teensy_back_50x.jpg