Skip to content

Commit

Permalink
Fixed latency issues, removed WPA2 requirement, added autorelease script
Browse files Browse the repository at this point in the history
Fixed latency and packet loss with bi-directional links between esp32s.
Removed WiFi AP WPA2 requirement. ESP32 is now allowed to connect to open WiFis
Added script for auto crafting releases
  • Loading branch information
seeul8er committed Feb 15, 2024
1 parent ec7ecfc commit 394f439
Show file tree
Hide file tree
Showing 9 changed files with 746 additions and 525 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ CMakeListsPrivate.txt
build/
cmake-build-debug*
cmake-build-release*
managed_components/espressif__mdns/.component_hash
managed_components/espressif__mdns/.component_hash
DroneBridge_ESP32_vXX.zip
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ connected devices/stations. Allows additional clients to register for UDP. Clien
## Download or Compile

Ready to use binaries for ESP32 via [GitHub releases](https://github.com/DroneBridge/ESP32/releases).
Or compile for ESP32S2, ESP32S3 & ESP32C3 using esp-idf v5.1:
Or compile using esp-idf v5.1:
- ESP32 `idf.py set-target esp32 build`
- ESP32S2 `idf.py set-target esp32s2 build`
- ESP32S3 `idf.py set-target esp32s3 build`
Expand Down
51 changes: 51 additions & 0 deletions create_release_zip.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Execute in an esp-idf enabled PowerShell
# This script will create a combined zip file containing binaries for all supported esp32 boards

$release_foldername = "DroneBridge_ESP32_vXX"
$release_name_zip = "DroneBridge_ESP32_vXX.zip"

mkdir $release_foldername
cp .\flashing_instructions.txt $release_foldername

rm -Recurse .\build
idf.py set-target esp32 build
mkdir $release_foldername\esp32
cp .\build\flash_args $release_foldername\esp32
cp .\build\db_esp32.bin $release_foldername\esp32
cp .\build\bootloader\bootloader.bin $release_foldername\esp32
cp .\build\www.bin $release_foldername\esp32
cp .\build\partition_table\partition-table.bin $release_foldername\esp32

rm -Recurse .\build
idf.py set-target esp32s2 build
mkdir $release_foldername\esp32s2
cp .\build\flash_args $release_foldername\esp32s2
cp .\build\db_esp32.bin $release_foldername\esp32s2
cp .\build\bootloader\bootloader.bin $release_foldername\esp32s2
cp .\build\www.bin $release_foldername\esp32s2
cp .\build\partition_table\partition-table.bin $release_foldername\esp32s2

rm -Recurse .\build
idf.py set-target esp32s3 build
mkdir $release_foldername\esp32s3
cp .\build\flash_args $release_foldername\esp32s3
cp .\build\db_esp32.bin $release_foldername\esp32s3
cp .\build\bootloader\bootloader.bin $release_foldername\esp32s3
cp .\build\www.bin $release_foldername\esp32s3
cp .\build\partition_table\partition-table.bin $release_foldername\esp32s3

rm -Recurse .\build
idf.py set-target esp32c3 build
mkdir $release_foldername\esp32c3
cp .\build\flash_args $release_foldername\esp32c3
cp .\build\db_esp32.bin $release_foldername\esp32c3
cp .\build\bootloader\bootloader.bin $release_foldername\esp32c3
cp .\build\www.bin $release_foldername\esp32c3
cp .\build\partition_table\partition-table.bin $release_foldername\esp32c3

if (Test-Path $release_name_zip) {
Remove-Item $release_name_zip -verbose
}
Compress-Archive -Path $release_foldername -DestinationPath $release_name_zip

rm -R $release_foldername
19 changes: 19 additions & 0 deletions flashing_instructions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Flash your esp32 with the command below using esptool.py
ESP32:
-------
esptool.py -p (PORT) -b 115200 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size 2MB --flash_freq 40m 0x1000 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x110000 www.bin


ESP32S2:
-------
esptool.py -p (PORT) -b 115200 --before default_reset --after hard_reset --chip esp32s2 write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x1000 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x110000 www.bin


ESP32S3:
-------
esptool.py -p (PORT) -b 115200 --before default_reset --after hard_reset --chip esp32s3 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


ESP32C3:
-------
esptool.py -p (PORT) -b 115200 --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
5 changes: 2 additions & 3 deletions main/db_esp32_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ uint ltm_frames_in_buffer_pnt = 0;

uint32_t uart_byte_count = 0;
int8_t num_connected_tcp_clients = 0;
//int8_t num_connected_udp_clients = 0;

esp_err_t open_serial_socket() {
uart_config_t uart_config = {
Expand Down Expand Up @@ -133,7 +132,7 @@ void parse_msp_ltm(int tcp_clients[], struct udp_conn_list_t *udp_connection, ui
msp_ltm_port_t *db_msp_ltm_port) {
uint8_t serial_bytes[TRANS_RD_BYTES_NUM];
uint read;
if ((read = uart_read_bytes(UART_NUM, serial_bytes, TRANS_RD_BYTES_NUM, 200 / portTICK_PERIOD_MS)) > 0) {
if ((read = uart_read_bytes(UART_NUM, serial_bytes, TRANS_RD_BYTES_NUM, 0)) > 0) {
uart_byte_count += read;
for (uint j = 0; j < read; j++) {
(*serial_read_bytes)++;
Expand Down Expand Up @@ -173,7 +172,7 @@ void parse_transparent(int tcp_clients[], struct udp_conn_list_t *udp_connection
uint *serial_read_bytes) {
uint8_t serial_bytes[TRANS_RD_BYTES_NUM];
uint read;
if ((read = uart_read_bytes(UART_NUM, serial_bytes, TRANS_RD_BYTES_NUM, 200 / portTICK_PERIOD_MS)) > 0) {
if ((read = uart_read_bytes(UART_NUM, serial_bytes, TRANS_RD_BYTES_NUM, 0)) > 0) {
memcpy(&serial_buffer[*serial_read_bytes], serial_bytes, read);
uart_byte_count += read;
*serial_read_bytes += read;
Expand Down
2 changes: 1 addition & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ int init_wifi_clientmode() {
.sta = {
.ssid = "DroneBridge_ESP32_Init",
.password = "dronebridge",
.threshold.authmode = WIFI_AUTH_WPA_PSK
.threshold.authmode = WIFI_AUTH_OPEN
},
};
strncpy((char *)wifi_config.sta.ssid, (char *)DEFAULT_SSID, 32);
Expand Down
22 changes: 19 additions & 3 deletions main/main.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
//
// Created by cyber on 17.07.21.
//
/*
* This file is part of DroneBridge: https://github.com/DroneBridge/ESP32
*
* Copyright 2018 Wolfgang Christl
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/


#ifndef DB_ESP32_MAIN_H
#define DB_ESP32_MAIN_H
Expand Down
Loading

0 comments on commit 394f439

Please sign in to comment.