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

Can I ask a question about pin assignment. What pins can you assign as UARTs for an ESP32. Taking the Heltech Wifikit 32 V3 for example. Any of the digital GPIOs as long as you keep them to a max of three UARTs?

Generally yes, but some gpios are read only, so they can’t be tx pin. Gpio 34 and above I think. And of course they can’t already be used, like SPI for the display.

Eric,

As you can see I a working on this again as I am blowing up your thread. I am making another relay to replace the one stolen from my car.

After a lot of ESP32 Oled boards I am still wanting a more readable OLED and crucially better wifi range so I went with the IL9423 and ESP Devkit V1. Worked perfectly first time. Then I went with a Devkit V4 as I needed an external antenna and that is all I could get.

It starts up ok but cannot scroll the screen. The external mavlink status light fires up fine. I never get the telemetry screen and I cannot scroll up or down. Do you know which mis-assigned GPIO SPI pin would cause that behavior? ie not being able to redraw the screen? (I am sure I can work through them and figure it out).

#if (ESP32_Variant == 7) // ESP32 Dev Module v4 with ILI9341 2.8" colour TFT SPI 240x320
#define MavStatusLed 2 // Offboard LED
#define InvertMavLed false
#define BufStatusLed 10 // untested pin
#define fc_rxPin 3 // Mavlink serial rx
#define fc_txPin 1 // Mavlink serial tx
#define fr_rxPin 19 // FPort- Not used in 1-wire mode DON’T use 12!
#define fr_txPin 18 // FPort tx - Use me in single wire mode
#define sbus_rxPin 99 // not used - don’t care
#define sbus_txPin 99 // ?Optional SBUS out pin
#define startWiFiPin 27 // 5 Trigger WiFi startup
#define resetEepromPin 99 // 34 Trigger EEPROM reset to default settings in config.h after 10 seconds
#if !defined displaySupport // I2C OLED board is built into TTGO T2
#define displaySupport
#endif
#define ILI9341_Display // ILI9341 2.8" COLOUR TFT SPI 240x320 V1.2
#define SCLK 18 // blue wire on my test setup
#define MOSI 23 // yellow wire
#define CS 5 // white wire
#define DC 17 // green wire
#define RST 16 // brown wire
// LED=3.3V, Vcc=5v, Gnd
// MISO not used by Adafruit

/* Below please choose either Touch pin-pair or Digital pin-pair for display scrolling
 *  Pin == 99 means the pin-pair is not used
 */             
#define Pup           99        // 35 Board Button 1 to scroll the display up
#define Pdn           99        //  0 Board Button 2 to scroll the display down      
#define Tup           0        // 33 Touch pin to scroll the display up
#define Tdn           4        // 32 Touch pin to scroll the display down   

#endif

Marc, I found this

Does your board have a WROVER module? Also try alternative touch pins, maybe 32 and 33

Apparently this is also an issue with v4 dev boards

Thanks Eric,

No I do not have a WRover variant and I have avoided the flash pins you mentioned as I read that too! I will still try other GPIOs as you suggest. Was just wondering which SPI pin would cause that behavior. Sure I will figure it out.

Figured it out. For the ESP32 Devkit V4 with OLED this works:

#if (ESP32_Variant == 7) // ESP32 Dev Module v4 with ILI9341 2.8" colour TFT SPI 240x320
#define MavStatusLed 22 // Offboard LED
#define InvertMavLed false
#define BufStatusLed 10 // untested pin
#define fc_rxPin 3 // Mavlink serial rx
#define fc_txPin 1 // Mavlink serial tx
#define fr_rxPin 19 // FPort- Not used in 1-wire mode DON’T use 12!
#define fr_txPin 17 // FPort tx - Use me in single wire mode
#define sbus_rxPin 99 // not used - don’t care
#define sbus_txPin 99 // ?Optional SBUS out pin
#define startWiFiPin 5 // 5 Trigger WiFi startup
#define resetEepromPin 99 // 34 Trigger EEPROM reset to default settings in config.h after 10 seconds
#if !defined displaySupport // I2C OLED board is built into TTGO T2
#define displaySupport
#endif
#define ILI9341_Display // ILI9341 2.8" COLOUR TFT SPI 240x320 V1.2
#define SCLK 18 // blue wire on my test setup
#define MOSI 23 // yellow wire 23
#define CS 15 // white wire 5
#define DC 2 // green wire 17
#define RST 4 // brown wire 16
// LED=3.3V, Vcc=5v, Gnd
// MISO not used by Adafruit

/* Below please choose either Touch pin-pair or Digital pin-pair for display scrolling
 *  Pin == 99 means the pin-pair is not used
 */             
#define Pup           99        // 35 Board Button 1 to scroll the display up
#define Pdn           99        //  0 Board Button 2 to scroll the display down      
#define Tup           32        // 33 Touch pin to scroll the display up
#define Tdn           33        // 32 Touch pin to scroll the display down   

#endif

I knew you would Marc :slight_smile:

Guess I’ll add this on master as a new variant.

Pics of the ground station relay to follow. Just need to flip the OLED display 180. I think there is a display.rotate with parameter 0-3 buried somewhere.

Around line 662 in config.h

#define SCR_ORIENT 1 // 0 for portrait or 1 for landscape

That’s not the correct one though, is it? I need to rotate it 180 and keep landscape, not rotate 90 to get portrait. I thought it had found the correct rotate parameter (not config.h) but it did not work. Will post again if I cannot solve it.

Try a value of 3 or 4.

I’ cant check right now lOn the beach. :slight_smile:

All good. I found the right part of code. Enjoy the beach. Icy Midwest here.

Any idea why my Heltech V3 (S3) throws this error when I include Frsky_Ports.h (basically when I set config.h to output SPort telemetry. Previously I just tested it as a Mavlink switch.

include/frSky_Ports.h:2986:14: error: no declaration matches ‘uint32_t FrSkyPort::getBaud(uint8_t, pol_t)’

Its not for me but someone else trying to use a Heltech WiFikit V3. I am just trying to create compiled firmware for people to use. It compiles fine as a Mavlink switch. Oled is working fine. As soon as I add SPort telemetry it I get this error declaration.

Hi Marc, I would need to know version number, or if this is a fork, perhaps let me look at the entire code.

But, it looks like the prototype of the class function has not been declared.

It is 2.68. Does that declaration happen in config.h based on board type logic? I could not find that. I believe this is just 2.68 with pin outs from the datasheet and replacing Esp32 board type 4 (Heltech wifi kit v3) with pin designations for v3, the S3 variant.

Marc, sorry I’m only getting to this intermittently.

To save time, could you tell me the full version and patch number please 2.68.nn. Also, is it the PIO or Arduino build?

No sweat. Me too. I will fire up tonight and get that. Sorry I never saw a reply until I actually loaded the thread. I am strongly thinking this must be a dev version. It’s fishy that it only works as a Mavlink switch and you did special versions with that feature. I will apply my S3 pin out to the stable version and see if the issue persists.

Eric,

Its the PIO version 2.68.6. You created S3 support and the ability to work as a Mavlink switch. Guess I never realized that it does not work when you set:
//#define FrSky_IO 0 // None - then Mav2PT becomes a Mavlink Switch
#define FrSky_IO 1 // Serial

(as opposed to FrSky_IO 0 )

Must be something quite simple I think but I have not see it yet. Sorry I have been a bit slow to respond. So I guess we do not have a working S3 build yet.