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...
I'm going to cut the VIN/VUSB just in case! :)
Rolf, have you thought about putting the files on a Git repo? Would make updates and mods easier.
Rolf, thank you very much for fixing the code. The coordinates now work for me! (Toronto, Canada). The speed still displays 0 (SPD 0), but the coordinates were far more important for me (for quad recovery in case of a fly away).
Hey guys simple solution to power the APM from USB is to simply push the plug in at an angle so the TX or RX do not connect.
Alternatively, just cut the tx and rx on the USB
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...
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.
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.
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.
// 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
FrSkySPort_SendPackage(FR_ID_FUEL,ap_battery_remaining); //new, the other line with FR_ID_FUEL is deleted
It works with me, and I do not think it affects any of the other code.
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