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

thanks eric! I actually trying to pair HC05 on my mfd mini crossbow antenna tracker with the esp32 bluetooth using AT commands. it fails on pairing since it requires to have the same pairing key…

another instance of the project im working with is to eliminate the hc-05, and use another esp32 on my antenna tracker. maybe it can receive the mavlink data from the heltec wifi kit 32 that i have on my dragonlink. Looking at the mav2pt firmware, i cant seem to find how I can set the esp32 on my tracker to connect with the heltec that acts as access point. Maybe you can give me a hand on this matter. thank you eric!

Sure Erwin. Let’s assume we use TCP.

Use the latest versions of MavToPass (v2.62.8) and AntTrack (V2.15.2).

In MavToPass use wth web interface (username=admin, pw=changeme!) select AP (Access Point) mode, TCP and local port 5760, your SSID (say “MavToPass”) and your password. Save and reboot.

In AntTrack change the settings in config.h.

#define Telemetry_In 2 // WiFi - ESP32 and Mavlink only

#define WiFi_Protocol 1 // TCP/IP

#define WiFi_Mode 2 // STA

around line 441
uint16_t TCP_localPort = 5760;
uint16_t TCP_remotePort = 5760;

around line 484
const char *STAssid = “MavToPassthru”;
const char *STApw = “password”;

Compile and flash. AntTrack should immediately connect to MavToPass and the LED goes solid when it get good GPS co-ordinates.

Hi Eric, i tested the AntTrack firmware, and yes it seems to connect to my heltec 32 (on the dragonlink). However, I notice that when I connect the esp32 tx pin (gpio17) to my mini crossbow antenna tracker, I get no data. I am still looking at the config.h to check on the settings, perhaps the baudrates or the pin to where I should connect my tracker. Is mavlink coming out from the esp32 pin17? If so, it should be recognized by my tracker. Currently, with HC-05, i just connect the Tx pin of the HC-05 to the rx pin of the antenna tracker, that rx pin is set to mavlink mode with 115200 baud.

using mav2pt firmware:
The MFD mini crossbow antenna tracker is set to baudrate 115200, and capable of receiving mavlink data. So i am assuming i can also use mav2pt firmware. i flashed the mav2pt firmware on the esp32 and tried setting it to STA mode to connect to the heltec 32 on my dragonlink. but it seems to fail to connect… im not sure, maybe there’s something wrong with my config why it cant connect to the heltec 32 AP.

maybe i need to change this?
// 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

// How does Mavlink telemetry leave this translator?
// These are optional, and in addition to the S.Port telemetry output
//#define GCS_Mavlink_IO 0 // Serial Port - simultaneous uplink and downlink serial not supported. Not enough uarts.
//#define GCS_Mavlink_IO 1 // BlueTooth Classic - ESP32 only
#define GCS_Mavlink_IO 2 // WiFi - ESP32 or ESP8266 only - auto selects on ESP8266
//#define GCS_Mavlink_IO 3 // WiFi AND Bluetooth simultaneously. DON’T DO THIS UNLESS YOU NEED IT. SRAM is scarce! - ESP32 only

=======

Hi Erwin

Did you sort this out? I was tied up with some other stuff.

I assumed you would use WiFi from the DL, to a second ESP32. Could you draw a simple diagram? Simply draw with a pen or pencil on paper and post a photo.

Regarding your question about a passphrase or pin on BT:

I did some research, and the esp-idf stack supports SSP for BT classic. To switch back to the old BT standard using a pin or passphrse you would have to downgrade security. This can be done by disabling SSP in the idf menuconfig, and rebuilding the runtime libraries. But, perhaps you want to rethink the issue.

image

Bluetooth Secure Simple pairing.pdf (63.6 KB)

Hi eric,this is the antenna tracker I am using, the MFD Crossbow Mini. It has mavlink option as input. If i directly connect the TX (data out) from the DL v3 slim (external/UEXP port set to Radio Modem) using wire to the RX pin of this tracker, it will read the mavlink (GPS coordinates, alt from fc, distance from FC relative to the GPS on the tracker). On my current setup, instead of having a wired link, I use a HC-05 on the DL Tx (connected to the UEXP port) and another HC-05 on the Antenna tracker (Rx pin of the tracker connected to the TX pin of the HC-05). Mavlink is sent appropriately, like the previous one, but using BT this time with baudrate 115200 set on the tracker, on the two HC-05’s as well as the DL UEXP port. The UEXP port is configured for Radio Modem.


As i have mentioned before, I am using a heltec 32 wifi kit, in parallel to the HC-05 since I cannot find ways to pair the heltec with the HC-05 on the tracker. Below is the diagram of my relay setup, I am using the mav2pt firmware on the heltec to stream the mavlink to wifi and to the s.port using an inverter. The heltec is on AP mode, UDP connection, with 115200 baud (same baud I set with the DL external UEXP port). I have the BT enabled on the heltec 32 wifi kit just in case we can solve this. I have labeled the pins im using on the heltec.

Since pairing the heltec 32 with the HC-05 is a bit troublesome, I am thinking if we can somehow use the mav2pt on the heltec to send mavlink via bt to another esp32…somewhat like how two HC-05 talks other to successfully send mavlink to the tracker. Or, maybe we can use heltec to send mavlink via wifi to another esp32, with the heltec being the accesspoint… i already tried flashing the esp32 with anttracker firmware. It connects to the accesspoint, but I cant forward the mavlink to the tracker from the esp32 (flashed with anttracker). Im not sure what protocol is being sent by the esp32 tx pin (GPIO17) to the MFD Crossbow mini tracker’s rx pin. Maybe of different formats that’s why the crossbow mini cannot interpret the data? If so, maybe we can change the output data protocol of the anttracker into a format same as that of DL’s radio modem…

I also tried flashing the esp32 with mav2pt, but no luck connecting with the heltec via wifi. Im thinking, if I am able to connect the esp32 (flashed with anttracker firmware) to the heltec accesspoint, can it receive mavlink data immediately? if so, can we forward it to one of the esp32’s serial tx pin (wired to the mfd crossbow mini antenna tracker’s rx pin)?

Ah, ok, thanks for the nice explanation Erwin. Yes, I’m sure we can find a good solution.

A few things first:

  • On a serial port, you may share the tx pin (telemetry out) with as many device’s rx pins as you like, as long as you don’t load the pin down. So DL tx pin to HC-05 and Heltec WiFi Kit is not a problem.

  • You may not electrically share rx pins (telemetry in), without taking special steps. So DL rx to HC-05 and Heltec won’t work. Why is this important? On a tracker, maybe not, as it usually does not need to ask the FC for anything special. (My tracker anyway, can’t be sure about the Crossbow mini).

However, if you want the data path from the Flight Controller to go all the way to a ground station like Mission Planner or QGC, those GCSs definitely need to request parameters and other things from the FC, so two-way or half-duplex telemetry is essential in that case.

If your telemetry path branches off to a tracker that simply reads gps data, that particular fork of the data path does not need an uplink path to the FC.

So, let’s try to simplify the architecture. What if we lose the HC-05 and use the Heltec, as it stands, to talk FrSky passthru to the R-XSR as it does now, but in addition using WiFi to a second ESP32, also running Mav2PT. Mav2PT can work as a switch, similar to mavproxy. The second esp32 connects to the Heltec via wifi (could be either udp or tcp, your choice, or BT for that matter) and talks to the tracker rx/tx via serial port.

So the second esp32 would be setup like this:

// 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

// How does Mavlink telemetry leave this translator?
// These are optional, and in addition to the S.Port telemetry output
#define GCS_Mavlink_IO 0 // Serial Port - simultaneous uplink and downlink serial not supported. Not enough uarts.
//#define GCS_Mavlink_IO 1 // BlueTooth Classic - ESP32 only
//#define GCS_Mavlink_IO 2 // WiFi - ESP32 or ESP8266 only - auto selects on ESP8266
//#define GCS_Mavlink_IO 3 // WiFi AND Bluetooth simultaneously.

The serial pins on the second wifi board, if it is a heltec, would be 17 and 27.

Remember, on mav2pt the #define options only establish the settings the first time the firmware runs. From then on, you must use the web interface. On the web interface, the settings for the second esp32 would look like this:

image

I suggest that the Heltec WiFi be in AP mode and the second esp32 in STA mode, and be sure to use identical protocols (say TCP), identical ports (say 5760) identical SSIDs (hotspot name) and identical passwords. If you use UDP, be sure that remote and local port numbers match. These little details can screw you and waste a lot of time if you are not very careful.

If you want/need to tag on a ground station, simply connect that to the Heltec WiFi, no problem.

To be clear, it does not really matter which end of the wifi connection is the access point, and which the station. There are all sorts of permutations which will work if you understand the issues. For example, you could connect both to a local LAN, but let’s leave that discussion for another day.

One last thing: Wifi (and Bluetooth) share the 2.4GHz consumer band with regular rc radios (and microwave ovens :slight_smile:) . They usually manage to get along, but be aware.

Hope this helps. I’ve got a lot going on, so might not be able to get back here as often as I would like.

Just an update, I have successfully connected the 2 esp32 on my setup. Heltec sends the mavlink information via wifi to the esp32 on my crossbow mini. As i understand it, the esp32 sends out data on its GPIO tx pin 17. The Crossbow receives it, but it’s not able to recognize the format. It shows DLINK which indicates data is being received at the baudrate being used (115200 on my case), but not recognized. Somehow, the information being sent to the tracker by the esp32 is not of the same protocol as the data being transferred when using two HC-05s (on the DL and on the Crossbow tracker), or when directly connecting the DL tx (data out on UEXP) to the Crossbow mini’s Mavlink Rx pin…

Erwin, the default Mavlink baud rate on Mav2PT is 57600

image

So if Crossbow mini is expecting 115200 you need to change mav2pt. You can do that in the we interface, or in config.h. If you change it in config.h you must reset the eeprom

#define Reset_Web_Defaults

Of course the Crossbow Tracker also runs with 57600 Baud, you just have to set it …

Actually, the baudrate on the Crossbow mini tracker can be changed accordingly. Currently, I have it set to 115200, and it is working perfectly with the 2 HC05s on the setup. On Mav2PT, I changed baudrate on Mav2Pt to 115200 to have a common baudrate on all of components and still not able to recognize the data.I will try again with 57600 baudrates on both mav2pt and crossbow mini. I will do the reset defaults on the Mav2PT, im not sure if I did that last time when I changed the baud to 115200.

Yeah, the T_Display board can be a bit tricky. I use the TFTeSPI library, which requires you to edit User_Setup_Select.h in the TFTeSPI library folder. See comment below.

Here is mine: https://drive.google.com/open?id=1WL6zKYNs1yS29--ebOpXpjCLIuYHAnHn

#if (defined ST7789_Display) // TFT display type
#include <TFT_eSPI.h> // Remember to select the T_Display board in User_Setup_Select.h in TFT_eSPI library (135 x 240)
TFT_eSPI display = TFT_eSPI();
#define SCR_W_PX 240 // OLED display width, in pixels
#define SCR_H_PX 135 // OLED display height, in pixels

1 Like

Its not you
some update i think i am having issues to now

Hello,

I have a question for one setup with a LW20 rangefinder, with the direction to the front on the camera gimbal.

What we would like to have, is this value on the remote control. So that we would know how far the object is, that is shown on the camera. Would it be possible to include this somehow? @Eric_Stockenstrom

best regards
Christian

Hi Christian,
I’m away for the weekend but if I remember correctly
we did include the rangefinder. If you could give me a TLog I’ll run it through and check when I get back tomorrow.

Regards
Eric

Here is information on where you will find the Telemetry Log (TLog)

version 2.62.7 works fine

but on 2.63.6

TFT_eSPI display issue text over laying

Ok, thanks for the feedback Colin.

I took the opportunity to standardise the approach to the different display types, and all test good now.

all good with latest 2.63.7 just one thing cant scroll back with the buttons
gee you have been busy love the last screen

Lat:
Lon:
volts
Sats
rssi:

Ok, scroll buttons force log display and scroll again. Please try it.