Code Monkey home page Code Monkey logo

dronebridge / esp32 Goto Github PK

View Code? Open in Web Editor NEW
365.0 12.0 105.0 13.37 MB

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

Home Page: https://dronebridge.github.io/ESP32/

License: Apache License 2.0

CMake 0.05% Makefile 0.01% C 98.59% HTML 0.30% JavaScript 0.73% CSS 0.07% Python 0.07% PowerShell 0.09% GDB 0.01% Shell 0.08%
dronebridge uav mavlink msp multiwii ltm esp32 espressif drone multicopter

esp32's Introduction

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 (Continuous stream of data required).

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
  • 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 for continuous streams
  • 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.

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 low in price, have everything you need and are also very small. Perfect for use on any drone.

For further info please check the wiki!

Installation/Flashing using precompiled binaries

First download the latest release from this repository. You can find them here.

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!

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 & Donations

If you benefited from this project please consider a donation:

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

Developers

Compile

You will need the Espressif SDK: esp-idf + toolchain. Check out their website for more info and on how to set it up. The code is written in pure C using the esp-idf (no Arduino libs).
Compile using esp-idf v5.1 or esp-idf v5.2

  • ESP32 idf.py set-target esp32 build
  • ESP32S2 idf.py set-target esp32s2 build
  • ESP32S3 idf.py set-target esp32s3 build
  • ESP32C3 idf.py set-target esp32c3 build

Or compile all at once with release configuration running the release scripts for bash or powershell create_release_zip.sh or create_release_zip.ps1

This project supports the v5.1.2 & v5.2.2 of ESP-IDF
Compile and flash by running: idf.py build, idf.py flash

The web interface is built using the command idf.py frontend. This is done automatically when compiling the entire project using idf.py build. The frontend is built to build/frontend.
Alternatively, the frontend can be built using npm install && npm i -D shx && npm run build within /frontend/, then manually copy the content of /frontend/build to /build/frontend

API

The web interface communicates with a REST: API on the ESP32. You can use that API to set configurations not selectable via the web interface (e.g. baud rate). It also allows you to easily integrate DroneBridge for ESP32.

Request settings

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

Request stats

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

Request ESP32 info

GET http://dronebridge.local/api/system/info

Request IP and port of active UDP connections

GET http://dronebridge.local/api/system/clients

Trigger a reboot

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

Trigger a general settings change:

Send a valid JSON

{
  "esp32_mode":	2,
  "wifi_ssid":	"DroneBridge",
  "wifi_pass":	"dronebridge",
  "ap_channel":	6,
  "trans_pack_size":	128,
  "tx_pin":	4,
  "rx_pin":	5,
  "cts_pin":	0,
  "rts_pin":	0,
  "rts_thresh":	64,
  "baud":	115200,
  "telem_proto":	4,
  "ltm_pp":	2,
  "ap_ip":	"192.168.2.1",
  "static_client_ip":	"",
  "static_netmask":	"",
  "static_gw_ip":	""
  }

to

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

Manually add a UDP connection target:

Send a valid JSON

{
  "ip": "XXX.XXX.XXX.XXX",
  "port": 452
}

to

POST http://dronebridge.local/api/settings/clients/udp

Assign a static IP to the ESP32 when in WiFi client mode:

Send a valid JSON to set static IP and send the same JSON but with empty strings ("client_ip": "") to remove the static IP setting

 {
  "client_ip": "XXX.XXX.XXX.XXX",
  "netmask": "XXX.XXX.XXX.XXX",
  "gw_ip": "XXX.XXX.XXX.XXX"
 }

to

POST http://dronebridge.local/api/settings/static-ip

Testing

Check /test for scripts triggering the API.

To test the frontend without the ESP32 run

npm install -g json-server
json-server db.json --routes routes.json

Set const ROOT_URL = "http://localhost:3000/" inside index.html and the <script> block

esp32's People

Contributors

aaronli avatar chaitanya110703 avatar lanealucy avatar mmalecki avatar seeul8er avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp32's Issues

Feature Request: OTA Firmware Updates

A minimal ESP32 telemetry solution is an ESP32-WROOM-xx wired directly to the FC and powered by 3v from the FC. Simple and incredibly lightweight. Initial programming is done with a snap-in interface to the module. Then it gets wired in.

It would be great to be able to update the firmware over the air, rather than having to unsolder and remove the module. Mav8266 already has OTA updates.

Compile with ESP-IDF v5+

How are you getting master to compile with v5.1? A lot of changes that break some of the code for me.

Can the baud rate be higher?

I really like this project.
I bought some modules to do the experiment. It Works!
But my data is very large and I need a higher baud rate.(1Mbps or higher will be great)
Thank you for this good project, I will always pay attention to it.

QGC error binding UDP port: The address is protected

qgc
dronebridge
I am using ESP-WROOM-32 connected to serial 1 of my flight controller. The baud rate is set at 115200 in config as well as dronebridge. I tried with DroneBridgeESP32_v1_2_alt_UART_conf as well as DroneBridgeESP32_v1_2 but i still getting the same error.

Feat. Req connect to Internet

Can the data push to the Andruav server?
For example the esp32 connect to usb dongle modem instead becaming Access Point mode. And send the data via internet.

ESP32-C3 support

Would it be possible to compile this for ESP32-C3?
Or is the C3 hardware incompatible?
If it is possible: could you provide a binary?

STA MODE

hello ,i wan it connetc to a 4g dongle for remote ,but now it's in ap mode ,how can i change it to STA MODE or sta+ap?

and can you release the latest Compiled version if you have time ,thanks

ESP32 Rebooting...

I downloaded the DroneBridge firmware from Ubuntu20 using espidf. After downloading, esp32 kept restarting. The serial port output is as follows. Thanks!



Rebooting...
ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7288
load:0x40078000,len:15052
ho 0 tail 12 room 4
load:0x40080400,len:3688
entry 0x4008067c
�[0;32mI (29) boot: ESP-IDF v4.3.4-315-gaa8a00c4f0 2nd stage bootloader�[0m
�[0;32mI (29) boot: compile time 15:40:43�[0m
�[0;32mI (29) boot: chip revision: 1�[0m
�[0;32mI (33) boot_comm: chip revision: 1, min. bootloader chip revision: 0�[0m
�[0;32mI (40) boot.esp32: SPI Speed : 40MHz�[0m
�[0;32mI (45) boot.esp32: SPI Mode : DIO�[0m
�[0;32mI (49) boot.esp32: SPI Flash Size : 16MB�[0m
�[0;32mI (54) boot: Enabling RNG early entropy source...�[0m
�[0;32mI (59) boot: Partition Table:�[0m
�[0;32mI (63) boot: ## Label Usage Type ST Offset Length�[0m
�[0;32mI (70) boot: 0 nvs WiFi data 01 02 00009000 00006000�[0m
�[0;32mI (78) boot: 1 phy_init RF data 01 01 0000f000 00001000�[0m
�[0;32mI (85) boot: 2 factory factory app 00 00 00010000 00100000�[0m
�[0;32mI (93) boot: 3 www Unknown data 01 82 00110000 00200000�[0m
�[0;32mI (100) boot: End of partition table�[0m
�[0;32mI (104) boot_comm: chip revision: 1, min. application chip revision: 0�[0m
�[0;32mI (112) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=196a0h (104096) map�[0m
�[0;32mI (158) esp_image: segment 1: paddr=000296c8 vaddr=3ffb0000 size=03f74h ( 16244) load�[0m
�[0;32mI (164) esp_image: segment 2: paddr=0002d644 vaddr=40080000 size=029d4h ( 10708) load�[0m
�[0;32mI (169) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=8a8b0h (567472) map�[0m
�[0;32mI (377) esp_image: segment 4: paddr=000ba8d8 vaddr=400829d4 size=13184h ( 78212) load�[0m
�[0;32mI (420) boot: Loaded app from partition at offset 0x10000�[0m
�[0;32mI (421) boot: Disabling RNG early entropy source...�[0m
�[0;32mI (432) cpu_start: Pro cpu up.�[0m
�[0;32mI (432) cpu_start: Starting app cpu, entry point is 0x40081364�[0m
�[0;32mI (418) cpu_start: App cpu up.�[0m
�[0;32mI (449) cpu_start: Pro cpu start user code�[0m
�[0;32mI (449) cpu_start: cpu freq: 160000000�[0m
�[0;32mI (449) cpu_start: Application information:�[0m
�[0;32mI (453) cpu_start: Project name: db_esp32�[0m
�[0;32mI (458) cpu_start: App version: v1.0�[0m
�[0;32mI (463) cpu_start: Compile time: Jan 11 2023 15:43:49�[0m
�[0;32mI (469) cpu_start: ELF file SHA256: e3bc86bc613428de...�[0m
�[0;32mI (475) cpu_start: ESP-IDF: v4.3.4-315-gaa8a00c4f0�[0m
�[0;32mI (482) heap_init: Initializing. RAM available for dynamic allocation:�[0m
�[0;32mI (489) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM�[0m
�[0;32mI (495) heap_init: At 3FFBA390 len 00025C70 (151 KiB): DRAM�[0m
�[0;32mI (501) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM�[0m
�[0;32mI (507) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM�[0m
�[0;32mI (514) heap_init: At 40095B58 len 0000A4A8 (41 KiB): IRAM�[0m
�[0;32mI (521) spi_flash: detected chip: generic�[0m
�[0;32mI (525) spi_flash: flash io: dio�[0m
�[0;32mI (530) cpu_start: Starting scheduler on PRO CPU.�[0m
�[0;32mI (0) cpu_start: Starting scheduler on APP CPU.�[0m
�[0;32mI (601) DB_ESP32: Reading settings from NVS�[0m
I (621) wifi:wifi driver task: 3ffc3908, prio:23, stack:6656, core=0
�[0;32mI (621) system_api: Base MAC address is not set�[0m
�[0;32mI (621) system_api: read default base MAC address from EFUSE�[0m
I (631) wifi:wifi firmware version: aa6486c
I (631) wifi:wifi certification version: v7.0
I (631) wifi:config NVS flash: enabled
I (631) wifi:config nano formating: disabled
I (641) wifi:Init data frame dynamic rx buffer num: 32
I (641) wifi:Init management frame dynamic rx buffer num: 32
I (651) wifi:Init management short buffer num: 32
I (651) wifi:Init dynamic tx buffer num: 64
I (661) wifi:Init static rx buffer size: 1600
I (661) wifi:Init static rx buffer num: 10
I (661) wifi:Init dynamic rx buffer num: 32
�[0;32mI (671) wifi_init: rx ba win: 6�[0m
�[0;32mI (671) wifi_init: tcpip mbox: 32�[0m
�[0;32mI (681) wifi_init: udp mbox: 6�[0m
�[0;32mI (681) wifi_init: tcp mbox: 6�[0m
�[0;32mI (681) wifi_init: tcp tx win: 5744�[0m
�[0;32mI (691) wifi_init: tcp rx win: 5744�[0m
�[0;32mI (691) wifi_init: tcp mss: 1440�[0m
�[0;32mI (701) wifi_init: WiFi IRAM OP enabled�[0m
�[0;32mI (701) wifi_init: WiFi RX IRAM OP enabled�[0m
I (711) wifi:invalid country code string cc=XX

ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400873a4
file: "../main/main.c" line 165
func: init_wifi
expression: esp_wifi_set_country(&wifi_country)

abort() was called at PC 0x400873a7 on core 0

Backtrace:0x400817fe:0x3ffbce10 0x400898d5:0x3ffbce30 0x4008fffa:0x3ffbce50 0x400873a7:0x3ffbcec0 0x400d9038:0x3ffbcee0 0x400d956b:0x3ffbd080 0x4015a623:0x3ffbd0a0

ELF file SHA256: e3bc86bc613428de

Esp32-cam

Hello,

Will this work with an esp32-cam ?
Would be nice to develop some stream and recognition.
Plus there is an ipex connector on it.

Thank you for this nice project,

Not working with APM2.8

Hey
I tried it with apm2.8 it and its not connecting to Mission planner. Any help on this please.

Adding Ethernet Support

Hi, would do you like to add Ethernet support? So it will be easy to connect any kind of IP datalink to a serial based autopilot.

Compatibility with ESP32 Pico D4

I think I figured out an incompatibility issue while trying to run DroneBridge on my M5Stack Atom Lite.
The network would show up, but any connections to it would cause the device to restart. I think the issue is related to the ESP32 Pico's default configuration where pins 16 and 17 are used for internal storage. I resolved this by changing the default Serial pins in main.c to 21 and 25 (which make sense for my board's configuration) and then reflashing the device (after clearing the NVS).

Automatically fixing this would require being able to detect if a given ESP32 is an ESP32 Pico D4 or to just handle the error and use alternate default values

Flashing ESP32-03-01M

Hello,

I am using an ESP32-03-01M kit, which is supposed to interact with a flight controller with QGroundControl.

However I cannot flash the firmware. I downloaded the v1_1.zip, erased the flash, and flashed the firmware with esptool folowing these instructions on Ubuntu 18.04. This gives me no error, but in the end the firmware does not appear to be flashed, as no Wi-Fi network called "DroneBridge ESP32" exists afterwards, when I restart the ESP.

I also tried with the tool on Windows 11, which tells me that the firmware has been flashed successfully has the same result.

Any idea what I am doing wrong?

Thank you!

Feat. req.: connect to another ESP32 instead of GCS on PC/Tablet/Smartphone

If I understand correctly, presently DroneBridge on ESP32 can connect to a PC/Tablet/Smartphone, but not to another ESP32, where two of them would emulate a wireless serial link?

If so, this is a feature request to be able to connect two or more ESP32s with DroneBridge to each other to relay/route bi-directional MAVLink (transparent serial) over them.

To motivate why not connecting to a ground control station on PC/Tablet/Smartphone makes sense, please consider long range radios, mounted on a high pole for best performance. E.g. DragonLink high up on a 5m pole (see e.g. here for some images of such setup). Not only need to get MAVLink data down to GCS, but also e.g. to MAVLink capable OpenTX/EdgeTX radio (e.g. http://www.olliw.eu/2020/olliwtelem/ ) and/or antenna tracker.

As latest DragonLink transmitter even comes with embedded user re-programmable/re-purposable ESP32, this could be super streamlined solution to install DroneBridge directly there (a pj. called Mavlink2Passthrough already makes use of this feature, but is very sub-optimal due to protocol conversion to very limited S.Port Passthrough). A second ESP32 with DroneBridge could be attached to a OpenTX/EdgeTX radio USART that runs native MAVLink capable firmware.

Connecting more than two ESP32 together, would allow even higher flexibility. Ideas for MAVLink Router can be e.g. found under: https://github.com/olliw42/fastmavlink
GCS could also join the MAVLink routing via UDP or TCP and third ESP32 with DroneBridge could be for example to connect an antenna tracker.

Panic abort when using init_fs()

IDF version: ESP-IDF v4.4-dev-1849-g8e3e65a47

I have ran:

esptool.py -p /dev/ttyUSB0 erase_flash
idf.py build
idf.py -p /dev/ttyUSB0 flash

on the source code with ESP-IDF 4.4, but it doesn't work:

I (826) DB_ESP32: AP started!
E (826) esp_semihost: OpenOCD is not connected!
E (826) DB_ESP32: Failed to register semihost driver (ESP_ERR_NOT_SUPPORTED)!
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x40088894
0x40088894: _esp_error_check_failed at /home/georgeflorian/esp/esp-idf/components/esp_system/esp_err.c:42

file: "../main/main.c" line 260
func: app_main
expression: init_fs()

abort() was called at PC 0x40088897 on core 0
0x40088897: _esp_error_check_failed at /home/georgeflorian/esp/esp-idf/components/esp_system/esp_err.c:43



Backtrace:0x400d344e:0x3ffbc6f00x400888a5:0x3ffbc710 0x4008edf2:0x3ffbc730 0x40088897:0x3ffbc7a0 0x400d9ffb:0x3ffbc7c0 0x40152d3f:0x3ffbc7e0 
0x400d344e: panic_abort at /home/georgeflorian/esp/esp-idf/components/esp_system/panic.c:390

0x400888a5: esp_system_abort at /home/georgeflorian/esp/esp-idf/components/esp_system/esp_system.c:126

0x4008edf2: abort at /home/georgeflorian/esp/esp-idf/components/newlib/abort.c:46

0x40088897: _esp_error_check_failed at /home/georgeflorian/esp/esp-idf/components/esp_system/esp_err.c:43

0x400d9ffb: app_main at /home/georgeflorian/NewVolume/ESP-IDF/DroneBridgeMaster/build/../main/main.c:260 (discriminator 1)

0x40152d3f: main_task at /home/georgeflorian/esp/esp-idf/components/freertos/port/port_common.c:142

The precompiled binaries work, but I am using a different ESP32 than the one used for building the precompiled binaries and I would've liked to eliminate any issues.

Can't change settings

I am unable to change any settings of the DroneBridge.
Whenever I hit Save another page loads with no content on it.

And even when it says settings saved, the settings remain the same. I've tried rebooting and the settings NEVER change.

UAV couldn't be found on the Android App

I had my fair share of problems to get the ESP32 to run with the DroneBridge Software (had to download the Master and flash with the esp-idf) but now it works (or I believe it does). But atm I can't connect to the drone with your app - the UAV wasn't found or didn't it responde in time? When I connect to the ESP32 with my Browser i see the fallowing (and changed some smaller details like AP Password): https://imgur.com/KWYixoI on Inav I set my ports like this: https://imgur.com/dtpr6Ii (UART4 is where the ESP32 is connected) and in the config Tab i set it like this: https://imgur.com/a/hEfb25D (GPS and Compass are deactivated but will added soon) - I did connect the ESP to my Kakute F7 like this: https://imgur.com/TNrPv0I (5V to 5V, Grd to Grd, TX (ESP32) to UART4 RX, RX (ESP32) to UART4 TX) I even tried to connect TX to TX and RX to RX (maybee you'll see it on this foto: https://imgur.com/ikUdyc1) but either way I couldn't connect with the app :( Full view of the ESP32 - it is an ESP-WROOM-32: https://imgur.com/YAJ54Rh) Here are also the screenshots of the App and Settings: https://imgur.com/pbO8sHo , https://imgur.com/aGsMFn9 , https://imgur.com/li5auFG --- Before some one ask why there is an ESP8266 on uart1 => this is atm the only why to connect to my flight controller after the USB Port was ripped off :( shout out to inav to leave UART1 with MSP enabled (yay) - on the ESP8266 runs just a small WifiClientToSerial program which is in the examples of the esp8266 included (it works okay for the moment until the replacement F7 arrives)
Btw to flash the chip with the IDF I had to create a new sdkconfig, which you'll find it here: https://pastebin.com/ER1S8j1C I'll hope everything there was set correctly :)

Additional Details: FC Kakute F7 with INAV 2.1 Firmware Version Jan 8 2019 13:22:21

So I hope you have every Info you need to help me there if you miss something just ask and I'll deliver everything possible can :)

So Again PLEASE I need some help :D

GroundControl Softwares do not connect to ESP

I have flashed the precompiled binaries on an ESP32 Wrover-B.
I have connected to the DroneBridge AP.
I have changed the UART pins accordingly.
The drone's TELECOM port is set to 115200 baud rate and Mavlink v2 (also tried v1).

I have tried connecting via UDP and TCP using MissionPlanner and QGC but it doesn't work.

When trying UDP I get Mavlink Connecting... loading forever.

When trying TCP I get: No Hearteat Packets Received.

There is no message on the Monitor.

Multiple Issues

I'm having multiple issues with DroneBridge on ESP32.

The first issue is that the webpage doesn't work very well. If I make changes and click save, it opens a new tab/webpage without making any changes (subsequent changes and clicks on save button result in more open tabs). It seems like I can force the changes if I click save and then power cycle the ESP32.

The next issue is that neither UDP nor TCP seems to work at all. I get an error that says connection refused when using TCP and UDP doesn't seem to do anything at all.

UDP do not work?

Tested, TCP works fine, but UDP doesn't seem to work? Where do I set Wrong?
thanks

WiFi not showing

Hello,

I build the code and flashed to the ESP32 but WiFi is not showing up. weird thing is my db_esp32.bin file is 763 KB but the one you provide is 792KB am i doing sth wrong ?

MavFTP does not work

Hi,

with the current firmware no parameter download with MavFTP works yet. But this has been standard for some time and should therefore work.

Can't connect to DroneBridge ESP32 AP. Sometimes it disappears

I am having trouble connecting to the DroneBridhe ESP32 AP. I keep getting: "Couldn't get IP Address" on the phone and "connection failed" on the PC.

These are the logs:

I (112188) wifi: new:<1,0>, old:<1,0>, ap:<1,0>, sta:<255,255>, prof:1
I (112188) wifi: station: 2e:fa:09:ac:34:43 join, AID=1, b, 20
␛[0;32mI (112268) DB_ESP32: Wifi AP started!␛[0m
I (130488) wifi: station: 2e:fa:09:ac:34:43 leave, AID = 1, bss_flags is 131121, bss:0x3ffc935c
I (130488) wifi: new:<1,0>, old:<1,0>, ap:<1,0>, sta:<255,255>, prof:1
␛[0;32mI (130488) DB_ESP32: Wifi AP stopped!␛[0m

I have tried two ESP32 that work with different code.

I have been trying to connect using Samsung phone and a Linux PC.

Another problem that I have encountered is that sometimes the AP doesn't appear in the WiFi list.

Some thoughts ?

GPIO Sleep Mode ext0/ext1

This would be more of a feature request. Thanks you in advance for all the people working on this project.

I'm worried about the power consumption of the ESP32. I would like for there to be a way to sleep/wake up (ext0) the ESP32 using a GPIO on Ardupilot. Would this be possible?

idf 4.3.5 + latest firmware(default), reboot

I just use idf 4.3.5 + latest firmware(default), compile and flash, it reboots.

Any idea?

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7208
load:0x40078000,len:15132
ho 0 tail 12 room 4
load:0x40080400,len:3712
0x40080400: _init at ??:?

entry 0x40080680
I (29) boot: ESP-IDF v4.3.5 2nd stage bootloader
I (29) boot: compile time 15:55:34
I (29) boot: chip revision: v1.0
I (32) boot.esp32: SPI Speed      : 40MHz
I (37) boot.esp32: SPI Mode       : DIO
I (41) boot.esp32: SPI Flash Size : 4MB
I (46) boot: Enabling RNG early entropy source...
I (51) boot: Partition Table:
I (55) boot: ## Label            Usage          Type ST Offset   Length
I (62) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (69) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (77) boot:  2 factory          factory app      00 00 00010000 00100000
I (84) boot:  3 www              Unknown data     01 82 00110000 00200000
I (92) boot: End of partition table
I (96) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1a398h (107416) map
I (143) esp_image: segment 1: paddr=0002a3c0 vaddr=3ffb0000 size=03830h ( 14384) load
I (149) esp_image: segment 2: paddr=0002dbf8 vaddr=40080000 size=02420h (  9248) load
I (153) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=8af98h (569240) map
I (364) esp_image: segment 4: paddr=000bafc0 vaddr=40082420 size=136d0h ( 79568) load
I (407) boot: Loaded app from partition at offset 0x10000
I (407) boot: Disabling RNG early entropy source...
I (419) cpu_start: Pro cpu up.
I (419) cpu_start: Starting app cpu, entry point is 0x40081334
0x40081334: call_start_cpu1 at /home/daniel/ArduPilot/esp-idf/components/esp_system/port/cpu_start.c:150

I (405) cpu_start: App cpu up.
I (435) cpu_start: Pro cpu start user code
I (435) cpu_start: cpu freq: 160000000
I (435) cpu_start: Application information:
I (440) cpu_start: Project name:     db_esp32
I (445) cpu_start: App version:      v1.0-7-g43998fd
I (451) cpu_start: Compile time:     Jun  3 2023 15:56:59
I (457) cpu_start: ELF file SHA256:  b97e7b9485607f30...
I (463) cpu_start: ESP-IDF:          v4.3.5
I (467) cpu_start: Min chip rev:     v0.0
I (472) cpu_start: Max chip rev:     v3.99
I (477) cpu_start: Chip rev:         v1.0
I (482) heap_init: Initializing. RAM available for dynamic allocation:
I (489) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (495) heap_init: At 3FFB9C90 len 00026370 (152 KiB): DRAM
I (501) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (508) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (514) heap_init: At 40095AF0 len 0000A510 (41 KiB): IRAM
I (521) spi_flash: detected chip: winbond
I (525) spi_flash: flash io: dio
W (529) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (543) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (614) DB_ESP32: Reading settings from NVS
I (634) wifi:wifi driver task: 3ffc2a7c, prio:23, stack:6656, core=0
I (634) system_api: Base MAC address is not set
I (634) system_api: read default base MAC address from EFUSE
I (644) wifi:wifi firmware version: 9ec65ef
I (644) wifi:wifi certification version: v7.0
I (644) wifi:config NVS flash: enabled
I (644) wifi:config nano formating: disabled
I (654) wifi:Init data frame dynamic rx buffer num: 32
I (654) wifi:Init management frame dynamic rx buffer num: 32
I (664) wifi:Init management short buffer num: 32
I (664) wifi:Init dynamic tx buffer num: 64
I (674) wifi:Init static rx buffer size: 1600
I (674) wifi:Init static rx buffer num: 10
I (674) wifi:Init dynamic rx buffer num: 32
I (684) wifi_init: rx ba win: 6
I (684) wifi_init: tcpip mbox: 32
I (694) wifi_init: udp mbox: 6
I (694) wifi_init: tcp mbox: 6
I (694) wifi_init: tcp tx win: 5744
I (704) wifi_init: tcp rx win: 5744
I (704) wifi_init: tcp mss: 1440
I (714) wifi_init: WiFi IRAM OP enabled
I (714) wifi_init: WiFi RX IRAM OP enabled
I (724) wifi:invalid country code string cc=XX

ESP_ERROR_CHECK failed: esp_err_t 0x102 (ESP_ERR_INVALID_ARG) at 0x400873dc
0x400873dc: _esp_error_check_failed at /home/daniel/ArduPilot/esp-idf/components/esp_common/src/esp_err.c:41

file: "/home/daniel/ArduPilot/DroneBridge/main/main.c" line 171
func: init_wifi
expression: esp_wifi_set_country(&wifi_country)

abort() was called at PC 0x400873df on core 0
0x400873df: _esp_error_check_failed at /home/daniel/ArduPilot/esp-idf/components/esp_common/src/esp_err.c:42


Backtrace:0x400817ce:0x3ffbc030 0x4008990d:0x3ffbc050 0x4008ff7e:0x3ffbc070 0x400873df:0x3ffbc0e0 0x400d90d4:0x3ffbc100 0x400d9607:0x3ffbc2a0 0x4015a8c3:0x3ffbc2c0
0x400817ce: panic_abort at /home/daniel/ArduPilot/esp-idf/components/esp_system/panic.c:404

0x4008990d: esp_system_abort at /home/daniel/ArduPilot/esp-idf/components/esp_system/system_api.c:112

0x4008ff7e: abort at /home/daniel/ArduPilot/esp-idf/components/newlib/abort.c:46

0x400873df: _esp_error_check_failed at /home/daniel/ArduPilot/esp-idf/components/esp_common/src/esp_err.c:42

0x400d90d4: init_wifi at /home/daniel/ArduPilot/DroneBridge/main/main.c:171 (discriminator 1)

0x400d9607: app_main at /home/daniel/ArduPilot/DroneBridge/main/main.c:261 (discriminator 2)

0x4015a8c3: main_task at /home/daniel/ArduPilot/esp-idf/components/freertos/port/port_common.c:145



ELF file SHA256: b97e7b9485607f30

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7208
load:0x40078000,len:15132
ho 0 tail 12 room 4
load:0x40080400,len:3712
0x40080400: _init at ??:?

entry 0x40080680
I (29) boot: ESP-IDF v4.3.5 2nd stage bootloader
I (29) boot: compile time 15:55:34

Wifi Client mode with no password

Seem to be unable to get dronebridge to connect (in wifi client mode) to my local, un-encrypted wifi, I tried configuring with a blank password field but dronebridge then seems unable to connect/associate. Do I have to use an encrypted wifi?

Can't connect GCS to DroneBridge ESP32. A lot of gibberish on Serial Monitor

Hello.

I have the DroneBridge running on an ESP32 that is connected to Telem1 of CubeOrange.

I have changed the BAUD_RATE on DroneBrigde and on GCS to 115200.

I have connected to DroneBridge AP, I have opened QGroundControl, made a TCP connection to 192.168.2.1 and Port: 5760. I hit Connect and nothing happens. QGroundControl says DISCONNECTED and I get no data.

I have tried the DroneBridge app and nothing happens there.

I have the ESP connected via USB so that I can monitor it, and it sends a lot of gibberish on the Serial Monitor:

I (12205) wifi:station: 2e:fa:09:ac:34:43 join, AID=1, b, 20
I (12475) DB_ESP32: Wifi AP started!
�       ����    ��zd�   ��D��   �����   ��)��   ���    ����    ��j�   �����            ����    ���
                                                                                                        ���v�
���x�   �����   ��t��   ��G��   �����   ���1�   ��yO�   ���?�   ��A�    ��*��   �����   ��$#�   ���]�   �����   ��������    ��w��   ��I-�   ���S�    ��/��  !�����  "���B�  #��<�   $���L�  %��|2�  &��B��  '�����  (��LP�  )���.�  *�����      +��r��  ,�����  -����   .��!^�  /��� �  0���i�  1���    2��,��  3�����  4��A��  5�����  6���g�  7���    8�����      9��q��  :��O{�  ;����   <��"u�  =���
                                            �   >�����  ?����   @���Y�  A��'�   B��+��  C�����  D��F��  E�����  F���W�      G��x)�  H�����  I��v��  J��HK�  K���5�  L��%E�  M���;�  N����   O���    P��(��  Q�����  R���r�  S��
                                                                                                           �    T���|�      U��{�   V��E��  W�����  X��K`�  Y����   Z�����  [��u��  \����   ]����   ^��&n�  _����   `��@��  a�����  b����       c��~�   d����   e��q�   f��-��  g��nj�   h��#�   i���m�  j�����  k����   l�����  m��p��  n��N�   o���c�  p���*�      q��}T�  r��C��  s�����  t��.��  u��ħ�   v���$�  w��Z�   x�����  y����   z�� 8�  {���F�  |��M6�  }���H�  ~�����      ������  ������  ������  ���~��  ���@}�  ������  ����J�  ���s4�  ���M��  ������  ����    ��zd�   ��D��   �����       ��)��   ��×�    ����    ��j�   �����            ����    ���
                                                                        ���v�
���x�   �����   ��t��   ��G��   �����   ���1�   ��yO�   ���?�   ��A�    ��*��   �����   ��$#�   ���]�   �����   ��������    ��w��   ��I-�   ���S�    ��/��  !�����  "���B�  #��<�   $���L�  %��|2�  &��B��  '�����  (��LP�  )���.�  *�����      +��r��  ,�����  -����   .��!^�  /��� �  0���i�  1���    2��,��  3�����  4��A��  5�����  6���g�  7���    8�����      9��q��  :��O{�  ;����   <��"u�  =���
                                            �   >�����  ?����   @���Y�  A��'�   B��+��  C�����  D��F��  E�����  F���W�      G��x)�  H�����  I��v��  J��HK�  K���5�  L��%E�  M���;�  N����   O���    P��(��  Q�����  R���r�  S��
                                                                                                           �    T���|�      U��{�   V��E��  W�����  X��K`�  Y����   Z�����  [��u��  \����   ]����   ^��&n�  _����   `��@��  a�����  b����       c��~�   d����   e��q�   f��-��  g��nj�   h��#�   i���m�  j�����  k����   l�����  m��p��  n��N�   o���c�  p���*�      q��}T�  r��C��  s�����  t��.��  u��ħ�   v���$�  w��Z�   x�����  y����   z�� 8�  {���F�  |��M6�  }���H�  ~�����      ������  ������  ������  ���~��  ���@}�  ������  ����J�  ���s4�  ���M��  ������  ��� ��  ������  ����D�  ���:�       ������  �����   ���.X�  ����&�  ���CV�  ����(�  ������  ���}��  ����9�  ����    ���%��  ���Ϻ�   ���H��  ������      ����7�  ���vI�  ������  ���x��  ���F+�  ����U�  ���+%�  ����[�  ������  �����   ���&��  ���̑�    �����   ���l

How do I connect ? How can I see the telemetry data ?

Include flashing instructions for C3 in release notes

Thanks for all your hard work on DroneBridge/ESP32. It's great that C3 is now supported and a .zip for it is now included in releases.

I'd suggest including flash instructions for the C3 in the release notes, otherwise people may assume the given esptool.py command will work for both the classic ESP32 and the C3. I know you've included flash_args.txt in the .zip files but I'm not sure people will notice it.

Maybe a quick start section like this, in the release notes, would be useful:

Quick start

Install the Espressif tool esptool.py first (you'll need Python 3.7 or newer). Connect your ESP32 or C3 board and always first erase its flash:

$ esptool.py -p (PORT) erase_flash

Then extract the .zip file for your board (DroneBridge_vX_Y_ESP32.zip for a classic ESP32 board or DroneBridge_vX_Y_ESP32C3.zip for a C3 board) and then flash the contained .bin files to your board.

For a classic ESP32 board, the flash command is:

$ esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset  write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x110000 www.bin

For a C3 board, the command is:

$ esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32c3  write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x110000 www.bin

Then connect your laptop or phone to the DroneBridge ESP32 WiFi access point and open the link http://192.168.2.1/ in a browser (depending on your setup, the easier to remember URL http://dronebridge.local/ may also work).

Users report varying degrees of success accessing these links via browsers running on phones or laptops so try both if you experience issues.


I included the last line as I experienced exactly the opposite issue to the one you note, i.e. "Load errors may occur on the ESP32C3 when in AP-Mode and accessed via PC/Desktop browser. Android mobile browsers performed well." For me, accessing my C3 board via my Android Pixel phone didn't work but accessing from Chrome on a MacBook worked fine.

And maybe update the README to reflect the fact that classic ESP32 and C3 definitely work but that S3 does not (I have some experience with ESP32 and I've tried a few S3 boards and they don't work - I'm sure it requires just a trivial change but as it stands there's little point in end users trying these boards unless they're happy to work on the code to get them to work).

Again, thanks for all the hard work on this project 👍

DroneBridge on ground side

This may be similar to the issue posted but not clear on that and it’s a quart on rather than an issue.

Can you plug in an esp32 (running drone bridge) to a serial modem (sik based and mavlink - take your pick) on the ground and then connect to the esp via wifi from my gcs so I can make a wifi bridge to my vehicle in the air? I Want to still use the longer range serial link but have a transparent link that is connected via wifi so I don’t have to plug into my serial modem but it is still talking to my vehicle.

gcs (via wifi) —-w—-> esp32 (running drone bridge and hard wired to rx/tx of telem module) —> sik telemtry module ——w——-> vehicle telemetry module -> autopilot

is this possible?

Build Problems...

Hello, i have some problems with the source code. I just want to change the frontend index.html but its giving too many problems in main folder. Olso when i compile it without changes its giving many problems too. Most of them are library problems i guess. What could i do about it? Thank you for answers already.

failed to enter wifi client mode

when I try to enter a id or password consists of numbers(such as id:629,password:1234567890),something goes wrong. dronebridge can't save messgaes into esp32 by the website

TinyPICO no Wifi network visible

I followed the instructions to flash and connect the TinyPICO V2 board, but I cannot connect to the wifi network, because I can't see it (macOS, iOS). I am new to DroneBridge and cannot figure out what's going wrong.

Many thanks for your help
Stefan

Resources needed by index.html randomly fail to load with ERR_CONNECTION_RESET

I installed the 1.2 release on an ESP32 development board (the classic ESP32, not an S2 or S3) and several of the resources needed by index.html always fail to load.

Which ones fail to load seems to be fairly random, sometimes it's the .css files or the logo but other times it's the JavaScript files and the UI (unsurprisingly) fails to function.

If I open the developer tools, I can see the failures fairly clearly:
failures

As noted, which files fail to load seems random but they always fail with ERR_CONNECTION_RESET. I'm using Google Chrome running on a Mac. I can imagine Chrome is fairly aggressive about downloading the files that it sees are needed by index.html and it simply overwhelms the ESP32 and it gives up with connection resets.

The solution was to inline everything into the index.html, i.e. copy the contents of the .js files into the .html file and surround them with <script> tags and the same for the .css files (with <style> tags) and replacing the logo file with a data URI (as shown in this commit).

Obviously, a much nicer solution would be to keep the files as they are and do this inlining using some kind of tool so that the result is used in the build process but isn't checked into git.

I described my experiences and how I resolved things in more detail here.

Changing AP mode to APSTA

hello,
I came up with idea to control several drones by QGC. My goal is to connect ESP32's to routes then in QGC switching ip to controll other one UAV. I had change wifi mode to use Access Point and Station, but this modification prevented me from connecting over UDP. This solution works on ESP8266. Any ideas what could be blocking me?

feature request: RTS/CTS support

Works great 👍

But it could work even better if UART RTS and CTS pins would be supported, just like RX/TX pins, especially with the upcoming ppp support of ArduPilot.

QGC stuck at "Reading params"

After weeks of trying to make this work I still can't get any parameters from the drone.

I have tried TCP and the QGC gets stuck at reading parameters.
I have tried UDP and the QGC gets stuck at reading parameters.

If and when I can connect to the softAP and establish a connection (TCP or UDP) with the ESP I get nothing from the drone.

These are the Drone settings:
settings

I've tried both MavLink v1 and v2

The drone ports is on 3v3.
3v3

Nothing works.

HTTP 502 Error

When I try to save the settings i get HTTP 02 Error. Then it becomes unresponsive for a while. Any ideas ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.