Developer & API Documentation
Documentation regarding DroneBridge for ESP32 aimed at developers and everyone how wants to use the REST:API.
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 or esp-idf v5.3
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
ESP32C3
idf.py set-target esp32c6 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.3 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 that are not selectable via the web interface (e.g., baud rate). It also allows you to integrate DroneBridge for ESP32 easily.
Get Settings
GET
/api/settings
Get all available settings that are currently stored on the ESP32.
Headers
Response
Get Statistics
GET
/api/system/stats
Receive real-time statistics about connected clients and received UART bytes.
Headers
Response
Get System Info
GET
/api/system/info
General information about the installed DroneBridge for ESP32 firmware
Headers
Response
Get connected clients
GET
/api/system/clients
List of all connected UDP and TCP clients with their ports.
Headers
Response
Manually add UDP target
Add a UDP target with IP and port that the ESP32 shall send serial data to. Set "save" to true in case you want the UDP client be saved to NVM. That way it will be automatically added on startup. Otherwise (false) it will only be added for this session and deleted on poweroff/reset of the ESP32. Only one UDP client can be added to NVM. The currently stored client will be overwritten if called multiple times with "save" = true.
To clear saved and manually added UDP clients call API to remove/clear UDP clients.
POST
/api/settings/clients/udp
Remove all UDP targets
Removes all UDP targets/clients for this session and from the NVM.
DELETE
/api/settings/clients/clear_udp
No need to send any content.
Assign static IP when in WiFi Client Mode
POST
/api/settings/static-ip
Request
Testing Locally
Check /test
for scripts triggering the API.
To test the frontend without the ESP32 run
Set const ROOT_URL = "http://localhost:3000/"
inside index.html
and the <script>
block
Last updated