ESP32 WiFi telemetry

The ESP32 are readily available Wi-Fi modules with full TCP/IP stack and microcontroller capability. They offer dedicated UART, SPI and I2C interfaces. They can be used with any ArduPilot autopilot controller.

DroneBridge for ESP32

DroneBridge for ESP32 offers a transparent and bi-directional serial to WiFi bridge.
Using WiFi protocol does not offer the same range as the other DroneBridge implementations. Typical WiFi range is ~50m-200m depending on the antennas. High gain directional antennas would offer even more range.
DroneBridge for ESP32 connection concept

Downloading and Flashing the Firmware

Download the firmware from the GitHub repository and follow the flashing instructions there. They are always up to date.

Note

Follow the flashing instructions inside the GitHub Repository. The exact parameters may differ from release to release of DroneBridge for ESP32.

For convenience reasons some short instructions are given here:

  • Download the pre-compiled firmware binaries
  • Connect your DEVKit to your computer via USB/Serial bridge (most DevKits already offer a USB port for flashing and debugging)
  • Erase the flash and flash the DroneBridge for ESP32 firmware onto your ESP32
  • Power Cycle the ESP32
  • Connect to the “DroneBridge for ESP32” WiFi network and configure the firmware for your application

Configuring DroneBridge for ESP32

You can change the default configuration via the Webinterface. Connect to the ESP32 via WiFi and enter dronebridge.local, http://dronebridge.local or 192.168.2.1 in the address bar of your browser.

Default Configuration

  • SSID: DroneBridge for ESP32
  • Password: dronebridge
  • Transparent/MAVLink
  • UART baud rate 115200
  • UART TX pin 17
  • UART RX pin 16
  • Gateway IP: 192.168.2.1

Custom Settings & Webinterface

You can change the default configuration via the Webinterface.
Connect to the ESP32 via WiFi and enter dronebridge.local, http://dronebridge.local or 192.168.2.1 in the address bar of your browser.
DroneBridge for ESP32 Webinterface

Note

Some settings require you to reboot the ESP32 to take effect.

Wiring

Wiring is very simple and mostly the same for all devices connected to any serial port (eg TELEM1 or TELEM2) of the autopilot. This guide does not go into detail here, but provides an outline for wiring below.

  • Connect UART of ESP32 to a UART of your flight controller (e.g. TELEM 1 or TELEM 2 port). Make sure the voltage levels match! Most ESP32 DevKits can only take 3.3V!
    • TX to RX
    • RX to TX
    • GND to GND
    • Stable 3.3V or 5V power supply to the ESP32 (depending on the available inputs of your DevKit and capabilities of the autopilot)
  • Set the flight controller port to MAVLINK 1 or 2 protocol.

Some manufacturers of ESP32 DevKits have wrong labels for the pins on their products. Make sure that the PINs on your board are labeled correctly if you encounter issues.

Make sure to always follow the instructions of the ESP32 board manufacturer when it comes to wiring. Especially the power supply.

Example wiring of flight controller to ESP32

ArduPilot configuration

Configure the UART of the flight controller that is wired to the ESP32. The default configuration of DroneBridge is:

  • Protocol: MAVLink (v1 or v2)
  • Baudrate: 115200 baud

If connected to Serial2 these parameters should be set on the autopilot (if using another serial port, replace the “2” in the parameter name with the serial port’s number):

If you have problems connecting, it may help to set BRD_SER2_RTSCTS = 0 to disable flow control although this is not normally necessary

Connecting to the GCS

The following connection options are available:

  • UDP unicast on port 14550 to all connected devices.
  • TCP on port 5760

DroneBridge for ESP32 will automatically forward all data to all connected WiFi devices via UDP to port 14550. QGroundControl or Mission Planner should auto-detect the connection and no further actions should be necessary.

Toubleshooting

  • Always erase the flash of the ESP32 before flashing a new release/firmware
  • Check if the pins on your ESP board are labeled correctly.
  • Enter the IP address in your browsers address bar http://192.168.2.1. No https supported! You may need to disconnect from the cellular network when using a phone to be able to access the webinterface.
  • If your network is operating in the same IP range as DB for ESP32 you need to change the Gateway IP address in the Webinterface to something like 192.168.5.1.

API

DroneBridge for ESP32 offers a REST:API that allows you to read and write configuration options. You are not limited to the options presented by the Webinterface (e.g. baud rates). You can use the API to set custom baud rates or to integrate the system into your own setup.

To request the settings

http://dronebridge.local/api/settings/request

To request stats

http://dronebridge.local/api/system/stats

Trigger a reboot

http://dronebridge.local/api/system/reboot

Trigger a settings change: Send a valid JSON

{
  "wifi_ssid": "DroneBridge ESP32",
  "wifi_pass": "dronebridge",
  "ap_channel": 6,
  "tx_pin": 17,
  "rx_pin": 16,
  "telem_proto": 4,
  "baud": 115200,
  "msp_ltm_port": 0,
  "ltm_pp": 2,
  "trans_pack_size": 64,
  "ap_ip": "192.168.2.1"
}

to

http://dronebridge.local/api/settings/change