Apache License 2.0

技术解读

以下内容由 GitRead 中文社区 编辑团队基于项目 README 与官方资料整理, 结合中文开发者的常见使用场景补充技术选型建议。具体以项目官方文档为准。

DroneBridge/ESP32 项目深度技术分析

项目背景与痛点

DroneBridge for ESP32 是一个用于无人机和地面站之间通信的固件项目。在无人机飞控领域,安全与透明的链路传输是一个关键问题。传统的数据链路不仅可能存在安全隐患,还可能导致信号传输的延迟甚至信号丢失。因此,DroneBridge/ESP32 解决了这一痛点,提供了基于 WiFi 和 ESP-NOW (一种快速的低功耗蓝牙数据传输协议)的通信链路支持,其背后的愿景是更加可靠与快速的数据传输以保障无人机的正常操作。

核心技术揭秘

DroneBridge for ESP32 的技术实现基于 WiFi 和 ESP-NOW,同时支持 MAVLink、MSP、LTM 等多种通信协议。为了探寻其核心架构,我们来看如下数据流流程图:

graph TD A[地面站指令] --> B{"协议校验?"} B -->|"通过"| C[WiFi/ESP-NOW打包] B -->|"失败"| D[输出错误信息] C --> E[传输至空中节点] E --> F{"接收节点校验?"} F -->|"通过"| G[解包与指令执行] F -->|"失败"| H[重传/错误处理] G --> I[执行结果生成] I --> J[反馈打包] J --> K[WiFi/ESP-NOW反馈数据] K --> L[传输回地面站]

技术实现原理

  1. 协议校验:本地地面站发来的指令首先进行协议校验,确保指令格式正确。
  2. 数据打包与传输:校验通过后,数据将被封装为WiFi或ESP-NOW协议帧,并发送至空中节点。
  3. 空中节点接收:空中节点接收到帧后,同样进行校验,通过后解包执行指令。
  4. 反馈生成与回传:执行完毕后的结果被打包并通过原先的通信链路传回地面站。

功能亮点与差异

该项目不仅在WiFi和ESP-NOW通信协议上做出适配,还具备对多种无人机通信协议(MAVLink, MSP, LTM等)的广泛支持。其最大亮点在于,通过对不同通信链路与协议的兼容,实现了高度的灵活性和通用性,降低了使用者因硬件平台或协议束缚而受限的可能性。

应用场景与落地建议

在实际应用场景中,使用DroneBridge/ESP32的开发者需要考虑的因素包括传输速率、功耗和稳定性。WiFi传输速度快但功耗较高,适合短距离、实时性要求高的应用场景;相较之下,ESP-NOW虽然速度较慢,但功耗更低,适用于需要长时间运行的远程控制场景。开发者应根据具体需求来选择最适合的通信方式,并根据具体场景对固件进行适当的定制与优化。

综合评价

优点

  • 支持多种通信协议,易于集成;
  • 可选多种通信方式,适应不同的场景;
  • 开源代码清晰,便于二次开发与维护。

缺点

  • WiFi通信的功耗高,不适合长时间使用;
  • 硬件配合要求较高,开发者需要一定的底层通信与协议理解能力。

对于资深且有硬件通信经验的用户而言,DroneBridge/ESP32 是一款非常值得信赖的高灵活性固件,它为无人机与地面站的数据传输提供了坚实的技术基础。

关于

GitHub 原始描述(英文)

DroneBridge for ESP32. A secure & transparent telemetry link with support for WiFi and ESP-NOW. Supporting MAVLink, MSP, LTM or any other protocol

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

语言占比

C
CMake
CSS
GDB
HTML
JavaScript
Makefile
PowerShell
Python
Shell

Release

README

Contributors Forks Stargazers Issues


DroneBridge logo

DroneBridge for ESP32

A firmware for the popular ESP32 modules from Espressif Systems. Probably the cheapest way to communicate with your drone, UAV, UAS, ground-based vehicle or whatever you may call them.

It also allows for a fully transparent serial to WiFi pass-through link with variable packet size (As of release v2.0 no continuous stream of data is required anymore in MAVLink and transparent mode).

DroneBridge for ESP32 is a telemetry/low data rate-only solution. There is no support for cameras connected to the ESP32 since it does not support video encoding.

DroneBridge for ESP32 concept

Features

  • Bidirectional: serial-to-WiFi, serial-to-WiFi Long-Range (LR), serial-to-ESP-NOW link, Bluetooth LE
  • Support for MAVLink, MSP, LTM or any other payload using transparent option
  • Affordable: ~7€
  • Up to 150m range using standard WiFi
  • Up to 1km of range using ESP-NOW or Wi-Fi LR Mode - sender & receiver must be ESP32 with LR-Mode enabled
  • Fully encrypted in all modes including ESP-NOW broadcasts secured using AES-GCM 256 bit!
  • Weight: <8 g
  • Supported by: QGroundControl, Mission Planner, mwptools, impload etc.
  • Easy to set up: Power connection + UART connection to flight controller
  • Fully configurable through an easy-to-use web interface
  • Parsing of LTM & MSPv2 for more reliable connection and less packet loss
  • Parsing of MAVLink with the injection of Radio Status packets for the display of RSSI in the GCS
  • Fully transparent telemetry down-link option
  • Reliable, low latency
DroneBridge with connectionless ESP-NOW protocol support for increased range of 1km or more.
DroneBridge for ESP32 can be used to control drone swarms at a low cost.

DroneBridge for ESP32 supports ESP-NOW LR, enabling ranges of more than 1km with external receiving antennas.
The number of drones is only limited by the channel capacity and the ESP32s processing power. All data is encrypted using AES256-GCM.

Drone Light Show Edition (DLSE)

DragonDroneShow

Special version that is optimised to work for Drone Shows using Skybrush
Check drone-bridge.com to get the latest release!

  • Support for Skybrush
  • Remote Power Management (sleep, wakeup) of the show drone
  • Lots of additional checks to improve safety and reliability
  • Open Source Commercial Support Suite to help you flash, manage & maintain your drones efficiently. Script your own tools following the given examples using the DLSE API.
  • Over The Air (OTA) Updates for the ESP32
  • WiFi6 (OFDMA) & 5GHz support on supported ESP32 chips
  • ESP32-C3, ESP32-C5 & ESP32-C6

Hardware

Officially supported and tested boards:
Do the project and yourself a favour and use one of the officially supported and tested boards below.
These boards are very affordable, have everything you need, and are also very compact. Perfect for use on any drone.

You can find more info on how to get the official boards here!

Official Board DroneBridge for ESP32 featuring the ESP32C6

For further info please check the wiki!

Installation/Flashing using precompiled binaries

It is recommended that you use the official online flashing tool!

In any other case, there are multiple ways how to flash the firmware.
For further info please check the wiki!

Wiring

  1. Connect the UART of the ESP32 to a 3.3V UART of your flight controller. It is not recommended to use the ESP32s pins that are marked with TX & RX since they often are connected to the internal serial ouput. Go for any other pin instead!
  2. Set the flight controller port to the desired protocol.

Check out the manufacturer datasheet! Only some modules can take more than 3.3V. Follow the recommendations by the ESP32 board manufacturer for powering the device
For further info please check the wiki!

Configuration

  1. Connect to the WiFi DroneBridge ESP32 with password dronebridge
  2. In your browser type: dronebridge.local (Chrome: http://dronebridge.local) or 192.168.2.1 into the address bar. You might need to disable the cellular connection to force the browser to use the WiFi connection
  3. Configure as you please and hit save

DroneBridge for ESP32 web interface

For further info please check the wiki!

Serial forwarding timeout

serial_timeout (MAVLink SERIAL_T_OUT_MS) controls the serial-to-radio flush timeout in milliseconds for both transparent and MAVLink modes. Valid values are 1 to 65535; the firmware default is 20 ms. Both loops read the configured value on each polling cycle, including the value loaded from NVS. MAVLink parameter changes take effect on the next cycle without a reboot. Saving through the web interface keeps its existing save-and-reboot behavior.

This setting does not change the UART driver read timeout or the trans_pack_size packet-size limit. Timeout comparisons use FreeRTOS ticks and remain subject to the configured tick resolution and task scheduling. Transparent mode flushes after a serial-read idle period. MAVLink mode retains its existing serial-read idle timeout behavior. Increasing the timeout can reduce packet overhead but increases forwarding latency.

Regression checks need no ESP32 hardware. Activate this project’s ESP-IDF environment with the RISC-V compiler and QEMU installed, then run python test/test_serial_timeout.py. The check executes both production loop bodies with mocked UART, radio and scheduler ticks, including live timeout changes, boundary values, packet-size flushing and tick wraparound. It also verifies that the former fixed 20 ms behavior fails. Explicit tool paths can be supplied with --cc and --qemu.

Use with QGroundControl, Mission Planner or any other GCS

QGroundControl

  • The ESP will auto-send data to all connected devices via UDP to port 14550. QGroundControl should auto-connect using UDP
  • Connect via TCP on port 5760 or UDP on port 14550 to the ESP32 to send & receive data with a GCS of your choice.
  • In case of a UDP connection the GCS must send at least one packet (e.g. MAVLink heart beat etc.) to the UDP port of the ESP32 to register as an endpoint. Add ESP32 as an UDP target in the GCS
  • Manually add a UDP target using the web interface

Further Support

For questions or general chatting regarding DroneBridge for ESP32 please visit the Discord channel

评论

暂无评论