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

I need Mavlink UDP out (to connect to MissionPlanner on a laptop), but I also need S.Port for the yaapu screen on my Horus.

Do I need to enable any debug options in config.h for the log listing?

No, not really. The crash report will give us the stack entries and should point to the most recent function when it bombed.

The start up messages should also tell us where it reached.

Here you go. The first output is the working TCP config and after that the bootloops happen until I power it down:

SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be

Starting MavToPass version:2.65.04
EEPROM initialised successfully
EEPROM settings read and adopted
Ground Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Override for testing = 70%
Target Board is ESP8266 / Variant is ESP-F - RFD900X TX-MOD
Mavlink Serial In
FrSky Serial Out
Mavlink WiFi Out - WiFi mode is STA>AP
Protocol is TCP/IP
No Bluetooth options selected, BT support not compiled in
Mavlink serial on pins rx:3 and tx:1 baud:57600
Default S.Port on rxpin:14 is IDLE_LOW, inverting rx polarity
Default S.Port baud:57600 b/s
FrSky is 1-wire simplex on tx pin:4
U
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be
add 1
aid 1
station: 3c:f0:11:fe:e5:75 join, AID = 1

Starting MavToPass version:2.65.04
EEPROM initialised successfully
EEPROM settings read and adopted
Ground Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Override for testing = 70%
Target Board is ESP8266 / Variant is ESP-F - RFD900X TX-MOD
Mavlink Serial In
FrSky Serial and UDP 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:3 and tx:1 baud:57600
Default S.Port on rxpin:14 is IDLE_LOW, inverting rx polarity
Default S.Port baud:57600 b/s
FrSky is 1-wire simplex on tx pin:4
U
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be
add 1
aid 1
station: 3c:f0:11:fe:e5:75 join, AID = 1

Starting MavToPass version:2.65.04
EEPROM initialised successfully
EEPROM settings read and adopted
Ground Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Override for testing = 70%
Target Board is ESP8266 / Variant is ESP-F - RFD900X TX-MOD
Mavlink Serial In
FrSky Serial and UDP 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:3 and tx:1 baud:57600
Default S.Port on rxpin:14 is IDLE_LOW, inverting rx polarity
Default S.Port baud:57600 b/s
FrSky is 1-wire simplex on tx pin:4
U
ets Jan 8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

The log should prove useful. I’ll be able to set it up tomorrow and try a test.

I see you have selected UDP for both Mavlink and FrSky telemetry. I need to check that out. They use different ports so should be ok.

Unfortunately the crash report does not show the stack.

I´m not sure what the FrSky_IO setting does exactly (it is new since I updated). If I disable serial, I don´t get yaapu telemetry. If I enable UDP it bootloops. If I leave UDP off and the WIFI Protocol is set to UDP, I cannot connect MissionPlanner on my laptop through TXMOD, like I used to with an older firmware.

David, could you reset the settings in eeprom.

#define Reset_Web_Defaults // Reset settings in eeprom. Do this if you suspect eeprom settings are corrupt USE SPARINGLY

Do this only once, then comment it out again.

I did this multiple times, because this is the only way I could recover from the bootloop :wink:

Ok, I managed to recreate the problem you describe. I’ll get back to you.

Please try Beta V2.65.5. When both Mavlink and FrSky UDP output I failed to start both services.

It still bootloops. Debug output:

Starting MavToPass version:2.65.05
EEPROM initialised successfully
AP Password < 8 chars long! Will fail to authenticate
STA Password < 8 chars long! Will fail to authenticate
EEPROM settings read and adopted
Ground Mode selected
Battery_mAh_Source = 3 - Define battery capacities in the LUA script
RSSI Override for testing = 70%
Target Board is ESP8266 / Variant is ESP-F - RFD900X TX-MOD
Mavlink Serial In
WiFi mode is AP
Protocol is UDP IP-Targeted
No Bluetooth options selected, BT support not compiled in
Fatal exception 0(IllegalInstructionCause):
epc1=0x4000e25d, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x00000000

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Exception (0):
epc1=0x4000e25d epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

stack>>>

ctx: cont
sp: 3ffffd50 end: 3fffffc0 offset: 0190
3ffffee0: 3fff5c9a 0000001f 3fff7964 40100920
3ffffef0: 40212f3a 00000285 3fff7964 40213042
3fffff00: 0000001c 00000000 00000000 00000000
3fffff10: 00000003 00000001 6e692064 40212d85
3fffff20: 3ffea898 00000001 3fff5d30 3fff5e60
3fffff30: 00000000 00000001 3fff5d30 4020f8bf
3fffff40: 00000000 3fff5d14 3ffeab4a 4020fbd9
3fffff50: 00000000 00000039 3fff5d14 4020fe5c
3fffff60: 00000000 0000001c 00000000 4020fed0
3fffff70: 00000000 3fff3c8c 3fff5d14 40207f14
3fffff80: 3fff7900 000b000f 80ef0073 feef0000
3fffff90: feefeffe 80efeffe feefeffe feefeffe
3fffffa0: 3fffdad0 00000000 3fff5e20 40211dac
3fffffb0: feefeffe feefeffe 3ffe854c 401015f5
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

ets Jan 8 2013,rst cause:1, boot mode:(3,3)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

SDK:2.2.2-dev(38a443e)/Core:2.7.3-3-g2843a5ac=20703003/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be

Also an improvement request: Could you display the FW version number in the WebUI to verify if updating has worked? Like in older FW.

edit. To explain what I am trying to do: I am currently using v2.61.0 which works perfect on the TXMOD for yaapu and MissionPlanner UDP in AP mode. The only problem is, now I am trying to set up RTK injection via MissionPlanner, which means I have to connect everything to the same network to receive RTK correction from my base station and forward it via MissionPlanner to the UAV. For this I would create an AP on the base station and connect everything to it (Laptop and TXMOD). For this I need to use MavToPT in STA mode, which unfortunately doesn´t work on v.2.61.0.
With newer FW starting around 2.62-63 I get more “telemtry lost” messages on my Horus.
Starting somewhere around 2.64 simply don´t work in UDP mode anymore.

As requested.

image
I also noticed we are running low on heap memory:

Executable segment sizes:
ICACHE : 32768 - flash instruction cache
IROM : 338456 - code in flash (default or ICACHE_FLASH_ATTR)
IRAM : 29633 / 32768 - code in IRAM (IRAM_ATTR, ISRs…)
DATA : 1592 ) - initialized variables (global, static) in RAM/HEAP
RODATA : 18672 ) / 81920 - constants (global, static) in RAM/HEAP
BSS : 41216 ) - zeroed variables (global, static) in RAM/HEAP
Sketch uses 388353 bytes (40%) of program storage space. Maximum is 958448 bytes.
Global variables use 61480 bytes (75%) of dynamic memory, leaving 20440 bytes for local variables. Maximum is 81920 bytes.
Low memory available, stability problems may occur.

Noted your explanation of your objectives, and your experience with the various versions.

It’s proving difficult for me to test right now. My new dev pc/windows 10 hates the fake pl2303 chip on the cheap Node MCU board I want to use for testing. I’ve wasted a lot of time trying workarounds. Much of my stuff is in storage, but I’ll try to make some progress tomorrow.

Hello Eric, First of all, Thanks for all the great work. However, I have had a problem for some time, which I cannot resolve.
I am with a dragonlink, X10s, in ground mode. I want to drive with wifi, an antenna tracker.
So I have an esp32 connected to the dragonlink behind my X10S. In config.h : #define FrSky_Port_Type 3 // S.Port / legacy
Then another ESP32 TTGO which receives the telemetry with WIFI. YAPPU does not work. The TTGO display shows LAtitude and Longitude good, but RSSI 0%. But in the debug, I have "Mavlink from FC # 65 RC_Channels: ap65_chcnt = 16 PWM: 1 = 1498 2 = 1503 3 = 1027 4 = 1498 5 = 1501 6 = 1501 7 = 1501 8 = 1001 9 = 1501 10 = 1501 11 = 1501 12 = 1900 13 = 1501 14 = 1501 15 = 1501 16 = 1460 ap65_rssi = 253 rssiGood = 1
"
My RSSI on channel 12. I think that’s why YAPPU isn’t working, but I’m lost. Can you help me.
thank you in advance

Hi Guillpoire

The problem is almost certainly RSSI. RSSI can come for three sources,
#35 MAVLINK_MSG_ID_RC_CHANNELS_RAW
#65 MAVLINK_MSG_ID_RC_CHANNELS
#109 MAVLINK_MSG_ID_RADIO_STATUS

Precedence is in the above order. If I remember correctly, DL sends a SiK modem style #109 message, so #35 and #65 would be overruled by the #109 type.

Try this again: #define Mav_Debug_Rssi // #109 > #65 > #35

and please post the serial monitor log file. From the beginning would be good, so I can see the complete setup.

Alternatively, you could post a TLog out of Mission Planner for the period when these symptoms are happening.

Hi David, I managed to set up with one of these, simply to test with a 12F module, and it does not do the reboot loop. Seems to work fine.

image

Have you made any progress?

David, I’ve also saved SRAM by optionally removing display support.

V2.65.7

Thanks, I´tt try it as soon as I am able to.

Hi Eric! I’m attempting to use your converter with Dragonlink in a relay setup using a 2.4GHz FrSky receiver. I would like to have mavlink via UDP to a GSC running on a PC, and telemetry over the 2.4GHz link into my radio for Yaapu. I have the Heltec ESP32.

Initially I used Noircogi’s pre-compiled version of firmware from this guide: https://docs.google.com/document/d/1ePGAmYa-GSwJ9TrpRcMSZ5HjKpIELJfxtvpISxID2Xs/edit?usp=sharing Using that, I have mavlink on the LAN via UDP working just fine. I built an inverter for s.port according to this: Some soldering required If I connect the s.port wire to the FrSky receiver, the ESP32 reboots endlessly in a loop. If I unplug the wire from the receiver, but leave the inverter attached to the ESP32, it starts and and operates as expected.

Last night I compiled " v2.6602d", the latest on github. I no longer have the boot loop issue with s.port connected, but I’m not getting anything over UDP, GCS will not connect. (I tried QGC and MP) I also have no data into the radio over the 2.4GHz link. The display on the Heltec board shoes “Mavlink Good!” and starts showing the RSSI and some altitude data, so I assume mavlink data is making it that far.

Could you maybe give me a quick list of options I need to set in config.h and/or in the web GUI to get it working to rule out user error before I dig any deeper to get this working?

Thanks in advance for your help!
-Keith

Just a quick follow up. I talked with Henry, aka " hurzburg" here. He has a working relay setup like I wanted to achieve. He said he was using v2.62.7 of the firmware. So I compiled that one with the same settings and everything works. Yaapu has telemetry in the radio, and WiFi/UDP sends data out to the GCS. I can only assume the rebooting thing was an issue in 2.60.2 from Noircogi’s guide, and that there’s also some issue (or I had misconfigured) the latest v2.6602d. Whatever the reason, it’s working, I’m happy. :wink:

Hi Keith, sorry for the slow response, and thanks for the feedback. I’ll make a point of checking the latest version again.

Ok, I believe the rebooting issue on older versions was related to using pin 12 for the S.Port. When pin 12 is high during startup, the esp2 reboots. We later changed to pins 13 and 14 on the Heltec.