Skip to content

WiFi, Bluetooth and or SD card ESP32 only

Eric Stockenstrom edited this page Nov 9, 2019 · 5 revisions

WiFi, Bluetooth and/or SD/TF card input or output may be selected for the ESP32 platform only

Before compile/flashing, be sure to select the desired options as:

// Choose one only of these Flight-Controller-side I/O channels // How does Mavlink telemetry enter the converter? //#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 one only of these GCS-side I/O channels '// How does Mavlink telemetry leave the converter? '// 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 useful for Ez-WiFiBroadcast in STA mode

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

For the TCP/IP the localPort = 5760

For UDP the local (ESP32) port is 14555 and the remote port (GCS like QGC) is 14550

In Access Point mode (AP) the local (the ESP32) IP is (192, 168, 4, 1) and the first remote IP allocated via DHCP is
(192, 168, 4, 2)

In Station (STA) mode the local (ESP32) IP is whatever the Access Point allocates through its own DHCP. To reach a candidate remote client (GCS / QGC), the local host (the ESP32 or ESP8266) broadcasts to all possible addresses in the x subnets marked here(192.168.x.x). When a client (say QGC) replies, local host (ESP32) remembers the sending IP (into udp_remoteIP) and from that moment all UDP traffic from the local host is targeted to that IP to avoid unnecessary LAN traffic.