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

Howdy. I have a few question about my Mav2P setup. Been using this for years but have in the past year exclusively started using a relay with Dragonlink. I use a Heltec Wifi Kit 32 and on top of my relay. I am flying ever longer distances now and want to resolve some niggles. Incidentally I had fewer issues (and fewer feaures) when i ran a Teensy and ESP8266 wifi bridge.

I am using 2.67.16.
I have inhibited Blue tooth libraries by commenting out the includes.

  1. When I use STA mode (ie the ESP32 conects to my phone hotspot) the SPort telemetry stops. If I reboot the Heltec board in AP Mode S Port telemetry starts again. This is 100% consistent. I really want to fix this as STA mode is much preferred.

  2. For whatever reason the Oled display RSSI 70 (the override figure #define RSSI_Override 70 ) even though I have an correct RX RSSI and the Yaapu script is reading 70 as well. I have RSS correctly configured on the FC (in Mission Planner RSSI_TYPE = 2) as reading an Sbus channel and when my GCS is connected it is reading the RXRSSI correctly. What am I missing here? This implies the that the RSSI is being read as 0. But it’s clearly not.

I can compile with debugging enabled if need be.

Hey Marc

Ok, let’s see if we can sort this out.

#define Frs_Debug_All
#define Mav_Debug_Rssi

Be aware that the debug output might be rather verbose and could affect performance detrimentally.

And I’ll also need the serial monitor log from startup please. It would be best, but not essential, to build and flash latest v2.68.03

For some reason I never got a notification of this reply! I checked the forum a few times as well.

I will flash the latest. Did not notice there was a newer one and I thought I was using the latest and i see you have been busy. First thing is let me retest with the latest versions and see if I am still experiencing these issues. If I am then I will compile with logging enabled as you requested and report back here.

As always, thanks for your quick response.

I need a word of advice. I am using Platform.io and VSC. Previously I just grabbed the Platform.io folders on Github but they stop at 2.67.16, which is why I missed the subsequent updates. I want to connect VSC to your Git repo. Just cloning the repo did not work – well I have the files but not in the correct hierarchy for Platform.io.

What do you think the best practice should be? Can I even connect VSC/Pio to an Arduino project on Gitbub?

Hi Marc, yes you can, but I haven’t linked them for this project. I do use the GitHub functionality for the esp-idf, and it’s great. Here is a link for PIO/Github

Give me a day or so and I’ll get the Mav2PT PIO folders up to date. I’m just a little stretched right now

ok, done. You will find v2.68.3 in the PIO folder on my GitHub.

1 Like

Thanks – and I know what being stretched feels like.You could have taken a few days!

No change with latest version.

  1. No FrSky telemetry when in STA mode. This is very consistent.

  2. My RSSI is on Channel 12, which I can see is at 1905. I am suspecting I am missing something with regard to that and there is not a bug. I have not commented out this line in config.h.
    #define RSSI_Override 70

Here are the logs.

Starting src/main version:2.68.03
Display support activated: Landscape
64x128 text_size=1 char_w_px=6 char_h_px=8 scr_h_ch=8 scr_w_ch=21
EEPROM initialised successfully
EEPROM settings version:2.68.3
RESET_NVS defined. ALL SETTINGS IN EEPROM SET TO COMPILE_TIME DEFAULTS
EEPROM settings read and adopted
Relay Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Override for testing = 70%
Target Board is ESP32 / Variant is Heltec Wifi Kit 32
Mavlink Serial In
FrSky Serial Out
Mavlink WiFi Out - WiFi mode is STA>AP
Protocol is UDP IP-Targeted
No Bluetooth options selected, BT support not compiled in
Mavlink serial on pins rx:27 and tx:17 baud:57600
Sensed serial port pin 13 is IDLE_HIGH, regular rx polarity
autoBaud - sensing pin 13
autoBaud: 57600 b/s
FrSky half-duplex on pins rx:13 and tx:14
For 1-wire applications a 2-wire to 1-wire converter or diode is required
WiFi mode set to STA sucessfully
Trying to connect to Marc…E (15294) wifi:Association refused temporarily, comeback time 1499 mSec

WiFi connected!
mDNS responder started
Local IP address: 192.168.190.33
WiFi RSSI:-43 dBm
Begin UDP using STA UDP object read port:14555 send port:14550
UDP for STA started, local 192.168.190.33 remote 192.168.190.255
Web support active on http://mavtopass.local
FrPeriod mS=13191 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=203 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=202 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
hb_count=1
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=202 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=202 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
hb_count=2
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=202 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=200 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=202 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=201 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
hb_count=3
Mavlink good!
FrPeriod mS=149 Passthru out AP_status 0x5001: pt_flight_mode=6 pt_simple=0 pt_land_complete=0 pt_armed=0 pt_bat_fs=0 pt_ekf_fs=0 pt_fs=0 pt_fence_present=0 pt_fence_breached=0 pt_imu_temp=0 pt_throt=0 pt_payload=6 passthru payload 0x10 06>00>00>00> …
FrPeriod mS=22 Passthru out Params 0x5007: pt_param_id=1 pt_frame_type=1 pt_payload=16777217 passthru payload 0x10 01>00>00>01> …
FrPeriod mS=16 Passthru out VelYaw 0x5005: pt_vy=0.00 pt_vx=0.00 pt_yaw=227 After prep: pt_vy=0 pt_vx=0 pt_yaw=1135 pt_payload=148766720 passthru payload 0x10 00>00>DE>08> …
FrPeriod mS=12 Passthru out Hud 0x50F2: pt_air_spd=19.65 pt_throt=0 pt_bar_alt=2.60 pt_payload=0 passthru payload 0x10 00>00>00>00> …
FrPeriod mS=11 Passthru out Rssi 0xF101: pt_rssi=70 pt_payload=70 passthru payload 0x10 46>00>00>00> F…
FrPeriod mS=15 Passthru out Servo_Raw 0x50F1: sv_chcnt=8 sv_count=0 chunk=0 pt_sv1=63 pt_sv2=63 pt_sv3=63 pt_sv4=63 pt_payload=2130574320 passthru payload 0x10 F0>FB>FD>7E> …~
Mavlink from FC #65 RC_Channels: ap65_chcnt=16 PWM: 1=1497 2=1502 3=993 4=1491 5=2006 6=987 7=1501 8=1055 9=2012 10=2012 11=1496 12=1905 13=1501 14=1501 15=1501 16=901 ap65_rssi=254 rssiGood=1
FrPeriod mS=54 Passthru out RC 0x500B: ap_current_height=0.00 ap_terrain_spacing=0 pt_height_above_terrain=0 pt_terrain_unhealthy=1 pt_payload=8192 passthru payload 0x10 00>20>00>00>

Marc, so you are expecting frsky S.port telemetry out on serial port. It looks like its pumping out. Strange. As far as rssi on ch 12 is concerned, I can make a little change to get that working.

This part looks wrong: “Sensed serial port pin 13 is IDLE_HIGH, regular rx polarity”. Usually the S.Port is inverted (idle low). Maybe don’t have it on auto. Ill be able to look at the code in the morning .

Yaapu Lua scripts are not registering telemetry in STA mode but it works in AP mode. I am using Relay configuration and that may make me a small subset of users.

I have the SPort set to the AUTO option. None of the others work for me FWIW.

Just to clarify here. The RXRSSI in Mission Planner comes through correctly and it is also displayed correctly in my OSD, so it is configured correctly in Ardupilot.

I’m back. Finished a deliverable, so I have a breather.

This macro should be commented out, thus:

//#define RSSI_Override 70

It’s an override generally used for testing. I’m about to look at STA mode.

Marc, please could you select S.Port Legacy, and not Auto detect. For some reason we are detecting S.Port rx pin 13 as high, when it should find it low at idle on the FrSky receiver tx pin. Maybe it was not connected or turned off at the time of your test?

//===========================================================
// Choose only one setting for FrSky Port Type
//===========================================================
//#define FrSky_Port_Type 0 // No FrSky Port support needed. Now I’m a “Mavlink Switch”
//#define FrSky_Port_Type 1 // F.Port v1
//#define FrSky_Port_Type 2 // F.Port v2 FrSky ISRM/ACCESS capable transmitters and receivers only
#define FrSky_Port_Type 3 // S.Port / legacy
//#define FrSky_Port_Type 4 // Auto detect, will also auto detect speed

It should read like this:

Mavlink serial on pins rx:16 and tx:17  baud:57600
S.Port at 57.6kb/s selected on rxpin:13 is IDLE_LOW, inverting rx polarity
FrSky half-duplex on pins rx:13 and tx:12
For 1-wire applications a 2-wire to 1-wire converter or diode is required

Unfortunately I don’t have a FrSky receiver with me here in Australia right now, so I’m short on testing options. Everything looks ok, bar testing with a receiver. I return to RSA at the end of the month, so I could test more exhaustively then.

Pondering on this issue though, the one difference is that, in STA mode (connected), we have a LAN to broadcast UDP messages to, regardless if any client connects. (We broadcast until a client connects, after which we target the connected client’s IP). WiFi low ISM consumer band, 2,4GHz, which we use, is likely on the same band as your FrSky RC receiver. Why is this different from AP mode? Well, in AP mode, we can’t/don’t transmit UDP packets anywhere until a client station connects. So no potential interference in the FrSky RC band until if/when a client connects.

It’s also likely that the Heltec board and the FrSky receiver are very close to each other, or co-located in a box. You could try shielding the two, possibly in separate compartments with a metal foil shied in-between. Some new ESP boards are coming with AC band (5GHz) wifi, but I have not tried them yet.

Ok then. I think you should make it a default to have the RSSI override commented out. I never uncommented it and I read that as it injects 70 instead of zero. But that is an easy fix for me

I can shield it but I doubt this is the issue. The legacy telemetry option does not work for me (or it has not in the past). I have seen others report that only the Auto option works for them.

That said I will get logs for the legacy option. I can also try F Port again. I had no success last time I tried it. Maybe that is the answer.

Thanks again. I will report back.

OK RSSI is fine now. Pretty silly that I never thought to comment that out. I just assumed the default was to send 70 if RSSI detected was O and not to override RSSI when it was not zero.

But no joy on using #define FrSky_Port_Type 3 // S.Port / legacy

That has never worked for me using an SPort receiver - and I am not the only one I think. But I do see IDLE detected as Low.

Starting src/main version:2.68.03
Display support activated: Landscape
64x128 text_size=1 char_w_px=6 char_h_px=8 scr_h_ch=8 scr_w_ch=21
EEPROM initialised successfully
EEPROM settings version:2.68.3
RESET_NVS defined. ALL SETTINGS IN EEPROM SET TO COMPILE_TIME DEFAULTS
EEPROM settings read and adopted
Relay Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Automatic Select
Target Board is ESP32 / Variant is Heltec Wifi Kit 32
Mavlink Serial In
FrSky Serial Out
Mavlink WiFi Out - WiFi mode is AP
Protocol is UDP IP-Targeted
No Bluetooth options selected, BT support not compiled in
Mavlink serial on pins rx:27 and tx:17 baud:57600
S.Port at 57.6kb/s selected on rxpin:13 is IDLE_LOW, inverting rx polarity
FrSky half-duplex on pins rx:13 and tx:14
For 1-wire applications a 2-wire to 1-wire converter or diode is required
WiFi mode set to WIFI_AP
AP_default_IP:192.168.5.1 AP_gateway:192.168.5.1 AP_mask:255.255.255.0
AP IP address: 192.168.5.1 SSID: Mav2P
mDNS responder started
Begin UDP using AP UDP object read port:14555 send port:14550
UDP for AP started, local 192.168.5.1 remote 192.168.5.255
Web support active on http://mavtopass.local
hb_count=1
hb_count=2
hb_count=3
Mavlink good!


And for posterity here is a log where it functions fine and my Yaapu script reads the S port telemetry.

Telemetry option is 4 (Auto) and Mode is AP.

So you said you would expect it to sense pin 13 as low. Well it only works for me when this is logged as high. For #define FrSky_Port_Type 3 // S.Port / legacy I think we need to to not invert possibly.

In any event I do not think this explains my lack of telemetry as detected by my Yaapu scripts in STA mode. My yaapu lua scripts do not skip a beat when I am connected to Mission Planner so I am not sure it is 2.4 interference.

Starting src/main version:2.68.03
Display support activated: Landscape
64x128 text_size=1 char_w_px=6 char_h_px=8 scr_h_ch=8 scr_w_ch=21
EEPROM initialised successfully
EEPROM settings version:2.68.3
RESET_NVS defined. ALL SETTINGS IN EEPROM SET TO COMPILE_TIME DEFAULTS
EEPROM settings read and adopted
Relay Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Automatic Select
Target Board is ESP32 / Variant is Heltec Wifi Kit 32
Mavlink Serial In
FrSky Serial Out
Mavlink WiFi Out - WiFi mode is AP
Protocol is UDP IP-Targeted
No Bluetooth options selected, BT support not compiled in
Mavlink serial on pins rx:27 and tx:17 baud:57600
Sensed serial port pin 13 is IDLE_HIGH, regular rx polarity
autoBaud - sensing pin 13
autoBaud: 57600 b/s
FrSky half-duplex on pins rx:13 and tx:14
For 1-wire applications a 2-wire to 1-wire converter or diode is required
WiFi mode set to WIFI_AP
AP_default_IP:192.168.5.1 AP_gateway:192.168.5.1 AP_mask:255.255.255.0
AP IP address: 192.168.5.1 SSID: Mav2P
mDNS responder started
Begin UDP using AP UDP object read port:14555 send port:14550
UDP for AP started, local 192.168.5.1 remote 192.168.5.255
Web support active on http://mavtopass.local
hb_count=1
hb_count=2
hb_count=3
Mavlink good!