Mavlink to FrSky S.Port Passthru Converter for LRS or PX4 Pro

Would you mind creating a step-by-step How-to instructions for the RFD900 conversion? This would be a great integration/partnership with the Yaapu LUA.

Thanks.

Ok just put it here

Thanks for sharing this Colin, very well done!

Hello,

we had a strange problem today, hope someone could help me out with this.

We used this amazing script from Alex with the Horus X12 and the X8R Receiver together with the Teensy. Worked great all the time!

We now used it with the R9M and R9 for longrange. We receive the telemetry, but it stops transfering it after a couple of minutes. I still can control the drone, but don´t receive any new telemetry data. Only after I disconnect and connect the receiver or the battery from the drone, the transfer of the telemetry starts again.

We used than the same remote control again with the X8R receiver and it worked fine.

Does anybody know, where the problem could be?

Hi Christian, I personally have been using the R9M/R9 with a Horus and Alex’s lua for several months. Can you please tell me more about your configuration. I assume you now do not need the Teensy, but set serial in your FC to protocol 10, and use an inverter/converter.

If you are using the Teensy instead, that’s ok, but what version? Please flash the latest from GiHub.

I am having some trouble setting up the mav2pt converter. I followed this guide to get telemetry on a horus X10S Express, but there is no telemetry shown. I simply uploaded the precompiled

Mav2PT_v2.46.ino.TEENSY31.hex

firmware to a Teensy 3.2, but it doesn´t work. How is the precompiled hex firmware configured? Any ideas what I could try next? The Teensy led does blink once every second.

Hi David

EDIT 2019/12/21 am

I checked the default configuration in v2.46 and found that the default mavlink baud rate was 921600. It’s now changed to 57600, and also AutoBaud is activated, so that it should match your Mavlink baud rate regardless. You should get the LED on solid when the Teensy sees good Mavlink telemetry.

So please give it a try now.

It would be better in the long run to set up the Arduino IDE, and compile and flash. That way you will have full control of configuration, and see all the status messages

Hi Eric,

I set up the Arduino IDE and uploaded a compiled version and now the led is solid, but I still don´t get any telemetry data on the yaapu widget. I have connected Pin 1 on the Teensy straight to the bottom pin of the Horus. Does it need a level shifter on the S.Port? Also could you please take a look at my config.h? I am using v2.49 now.

#define mvBaudFC 57600 // Mavlink to/from the flight controller - max 921600 - must match FC or long range radio
#define frBaud 57600 // S.Port baud setting - default 57600
#define AP_Name “Mav2Passthru” // The AP SSID that we advertise ====>
#define AP_Pw “password” // Change me!
#define STA_Name “OmegaOffice” // Target AP to connect to <====
#define STA_Pw “targetPw”

/*
“EZ-WifiBroadcast” / “wifibroadcast”
“TXMOD-54-DD-FE” / “txmod123”
*/

// Do not enable for FlightDeck
#define PlusVersion // Added support for 0x5009 Mission WPs, 0x50F1 Servo_Channels, 0x50F2 VFR_Hud

// Choose only one of these three modes
#define Ground_Mode // Translator between Taranis and LRS tranceiver (like Dragonlink, ULRS, RFD900…)
//#define Air_Mode // Translator between FrSky receiver (like XRS) and Flight Controller (like Pixhawk)
//#define Relay_Mode // Translator between LRS tranceiver (like Dragonlink) and FrSky receiver (like XRS) in relay box on the ground

// Choose only one of these Flight-Controller-side I/O channels
// How does Mavlink telemetry enter this translator?
#define FC_Mavlink_IO 0 // Serial Port (default)
//#define FC_Mavlink_IO 1 // BlueTooth Classic - ESP32 only
//#define FC_Mavlink_IO 2 // WiFi - ESP32 or ESP8266 only
//#define FC_Mavlink_IO 3 // SD Card / TF - ESP32 only

// Choose only one of these GCS-side I/O channels
// How does Mavlink telemetry leave this translator?
// These are optional, and in addition to the S.Port telemetry output
#define GCS_Mavlink_IO 9 // NONE (default)
//#define GCS_Mavlink_IO 0 // Serial Port - Only Teensy 3.x and Maple Mini have Serial3
//#define GCS_Mavlink_IO 1 // BlueTooth Classic - ESP32 only
//#define GCS_Mavlink_IO 2 // WiFi - ESP32 and ESP8266 only
//#define GCS_Mavlink_IO 3 // WiFi AND Bluetooth simultaneously - ESP32 and ESP8266 only

// NOTE: The Bluetooth class library uses a great deal of application memory. During Compile/Flash
// you may need to select Tools/Partition Scheme: "Minimal SPIFFS (1.9MB APP …)

//#define GCS_Mavlink_SD // SD Card - ESP32 only - mutually inclusive with other GCS I/O

//#define BT_Master_Mode true // Master connects to BT_Slave_Name — false for BT Slave Mode
const char* BT_Slave_Name = “Crossfire 0277”; // Example

//#define Start_WiFi // Start WiFi at startup, override startWiFi Pin

// Choose one protocol - for ESP32 only
//#define WiFi_Protocol 1 // TCP/IP
#define WiFi_Protocol 2 // UDP

// Choose one mode for ESP only - AP means advertise as an access point (hotspot). STA means connect to a known host
#define WiFi_Mode 1 //AP
//#define WiFi_Mode 2 // STA

#define AutoAP // If we fail to connect in STA mode, start AP instead

//#define Battery_mAh_Source 1 // Get battery mAh from the FC - note both rx and tx lines must be connected
//#define Battery_mAh_Source 2 // Define bat1_capacity and bat2_capacity below and use those
const uint16_t bat1_capacity = 5200;
const uint16_t bat2_capacity = 0;
#define Battery_mAh_Source 3 // Define battery mAh in the LUA script on the Taranis/Horus - Recommended

#define SPort_Serial 1 // Teensy port1=pin1, port3=pin8. The default is Serial 1, but 3 is possible

// RSSI_Source is Automatic. Order of precedence:
// First: #109 SiK style RADIO_STATUS
// Second: #65 RC_CHANNELS
// Third: 35 RC_CHANNELS_RAW

//#define RSSI_Override // Dummy RSSI - fixed at 70%

//#define SiK_Rssi_Percent // #109 RSSI is already %, not relative to (0xff/100)

// Status_Text messages place a huge burden on the meagre 4 byte FrSky telemetry payload bandwith
// The practice has been to send them 3 times to ensure that they arrive unscathed at the receiver
// but that makes the bandwidth limitation worse and may crowd out other message types. Try without
// sending 3 times, but if status_text gets distorted, un-comment the next line
//#define Send_status_Text_3_Times

//#define Send_Sensor_Health_Messages
#define AutoBaud // UART Serial Only - Auto detect FC_Mavlink telemetry baud

//#define Request_Missions_From_FC // Un-comment if you need mission waypoint from FC - NOT NECESSARY RIGHT NOW

//#define Data_Streams_Enabled // Requests data streams from FC. Requires both rx and tx lines to FC. Rather set SRn in Mission Planner
#define Max_Waypoints 256 // Note. This is a global RAM trade-off. If exceeded then Debug message and shut down

// ****************************** Set your time zone here ******************************************
// Date and time determines the TLog file name only
//const float Time_Zone = 10.5; // Adelaide
const float Time_Zone = 2.0; // Jo’burg
bool daylightSaving = false;

Hi David, try this to see if the problem is Rossi related

#define RSSI_Override // Dummy RSSI - fixed at 70%

Also, I have had more than a few reports of port1 being damaged on the Teensy 3.xx. You could try:

#define SPort_Serial 3 // Teensy port1=pin1, port3=pin8. The default is Serial 1, but 3 is possible

If I define RSSI_Override it finally works!

Is this a problem related to the Teensy, or the RFD Modules? My setup is a Horus X10S Express with OpenTX 2.3.4 and the RFD868X Modules with the 3.07 firmware.

David, your RFD900 is not sending an RSSI record type in the telemetry stream. Make sure you have set the RSSI parameters correctly in Mission Planner. Follow the RFD900 setup instructions on the web. The is an option to debug RSSI in the config.h if you still have a problem.

@Eric_Stockenstrom first of all a happy new year and thanks a lot for all your effort on this!

to visualize LTM telemetry on mavlink-compatible GCS applications, i slapped together some code for a simple LTM2MAVLink converter that runs on arduino or esp8266 (mavlink udp). i got major inspiration from your converter too, thanks for that!

the code is somewhat dirty due to my lack of background and skills, but surprisingly it does work.

i thought that bringing LTM downlink telemetry on to your frsky transmitter’s screen via passthru and using yaapu’s script might open a couple of nice options too.
now my originial intention was to was to try and PR an addition of LTM support to your converter, but honestly, i’m reaching my skill limits here in terms of wrapping my head around your code and finding a good entry point for another optional input telemetry protocol.

if you think that adding LTM telemetry input support to your converter could add any value, would you maybe like to take a look at this and help?

thanks in advance,
basti.

If I enable RSSI in your code (undefine RSSI_Override), the yaapu telemetry screen ONLY works if I connect the transmitter module to MissinPlanner, but not without. If I connect to MP using USB also nothing appears on the transmitters screen.

With RSSI_Override enabled it also works without MissionPlanner.

There are no settings regarding RADIO rssi (talking about the MavLink injected rssi values) in MissionPlanner, only for rxrssi (like analog, PWM…). Any ideas how I could get your code to work with rssi even if I don´t connect to MissionPlanner? Otherwise I will just use it with the dummy rssi.

When you connect to MP, MP sends a heartbeat to the FC, and the FC starts streaming data, to the FC, but also the the S.Port and Taranis/Horus.

The Mav2PT also sends a heartbeat to the FC, but it will only get there if you have both RX and TX connected (crossed over) between the FC and the Teensy(or ESP).

Alternatively, have you set up the SRx parameters in MP?

Hi vierfuffzig:

I took a quick look. Well done with the LTM2MAVLink !

This is a nice idea, and I’m assuming that there are pilots who would like to use such a translator. Right now I’m quite busy with adding half-duplex (bi-directional) to Mav2PT, but I will look at it a little deeper in the next few days. All my kit is Mavlink based, so testing LTM is a challenge for me. Last time I needed LTM for testing I used a converter (from Guillaume S I think), but maybe the protocol has evolved since then.

with regards
Eric

hey eric, thanks for promptly getting back on this. take your time, i’d be ready to go at this whenever your timeframe permits. we do have direct LTM output on ardupilot now, and i’ve collected quite a bit of test-equipment along the way :wink:

basti.

If the SRx parameters are set, the FC streams data even if it doesn´t receive a heartbeat, or am I wrong? Why else would anything be displayed with the RSSI_Override enabled?

I´m just trying to understand how everything works.

The TX is pin10 on the Teensy. Will I still be able to use Bluetooth/Wifi connection to MP if the TX Pin is connected?

No, unfortunately you cannot share the FC RX pin. Fact of life. That is one of the reasons we now have an ESP32 version that does WiFi and Bluetooth at the same time.

Is there any chace you would port the code to the RFD transmitter module? It has an ESP8266, which is already implemented in your code. You would only (probably) have to change the pins.

Other option would be to only send heartbeat packets while there is no activity on the FC RX pin. Just thinking out loud…

@Matt_C That is THE guide I followed. However he has the same limitations, that I am facing right now.