Skip to content

Commit

Permalink
Merge pull request #86 from DroneBridge/v2.0dev
Browse files Browse the repository at this point in the history
V2.0dev to master fixing github action and adding esp32-c6 build
  • Loading branch information
seeul8er authored Jul 14, 2024
2 parents 824fb02 + f664024 commit 764c02e
Show file tree
Hide file tree
Showing 9 changed files with 2,308 additions and 430 deletions.
6 changes: 6 additions & 0 deletions .github/actions/esp-idf-5_2-with-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM espressif/idf:release-v5.2
RUN apt update
RUN apt-get install -y curl
RUN curl -fsSL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh
RUN bash nodesource_setup.sh
RUN apt -y install nodejs
22 changes: 22 additions & 0 deletions .github/actions/esp-idf-5_2-with-node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Espressif IoT Development Framework (ESP-IDF), plus node.js and npm"
branding:
color: red
icon: wifi
inputs:
target:
description: "ESP32 variant to build for"
default: "esp32"
required: false
command:
description: "Command to run inside the docker container (default: builds the project)"
default: "idf.py build"
required: false
runs:
using: 'docker'
image: 'Dockerfile'
env:
IDF_TARGET: "${{inputs.target}}"
args:
- "/bin/bash"
- "-c"
- "${{inputs.command}}"
22 changes: 21 additions & 1 deletion .github/workflows/esp_idf.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: ESP-IDF build
on:
push:
branches: [ master ]
branches:
- master
- v2.0dev
pull_request:
branches: [ master ]

Expand All @@ -16,9 +18,27 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: 'recursive'
- name: ESP-IDF v5.1 build
uses: ./.github/actions/esp-idf-with-node
with:
target: "${{ matrix.target }}"
command: "idf.py set-target ${{matrix.target}} build"
build_esp32_v5_2:
runs-on: ubuntu-latest
strategy:
matrix:
target: ["esp32", "esp32s2", "esp32s3", "esp32c3", "esp32c6"]
fail-fast: false
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
submodules: 'recursive'
- name: ESP-IDF v5.2 build
uses: ./.github/actions/esp-idf-5_2-with-node
with:
target: "${{ matrix.target }}"
command: "idf.py set-target ${{matrix.target}} build"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ For questions or general chatting regarding DroneBridge for ESP32 please visit t
### 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.2
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 of ESP-IDF**
**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`.
Expand Down
11 changes: 11 additions & 0 deletions create_release_zip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ cp .\build\bootloader\bootloader.bin $release_foldername\esp32c3_USBSerial
cp .\build\www.bin $release_foldername\esp32c3_USBSerial
cp .\build\partition_table\partition-table.bin $release_foldername\esp32c3_USBSerial

rm -Recurse .\build
idf.py fullclean
cp .\sdkconfig_c6 .\sdkconfig
idf.py build
mkdir $release_foldername\esp32c6
cp .\build\flash_args $release_foldername\esp32c6\flash_args.txt
cp .\build\db_esp32.bin $release_foldername\esp32c6
cp .\build\bootloader\bootloader.bin $release_foldername\esp32c6
cp .\build\www.bin $release_foldername\esp32c6
cp .\build\partition_table\partition-table.bin $release_foldername\esp32c6

if (Test-Path $release_name_zip) {
Remove-Item $release_name_zip -verbose
}
Expand Down
11 changes: 11 additions & 0 deletions create_release_zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,17 @@ cp build/bootloader/bootloader.bin "$release_foldername/esp32c3_USBSerial"
cp build/www.bin "$release_foldername/esp32c3_USBSerial"
cp build/partition_table/partition-table.bin "$release_foldername/esp32c3_USBSerial"

rm -rf build
idf.py fullclean
cp sdkconfig_c6 sdkconfig
idf.py build
mkdir "$release_foldername/esp32c6"
cp build/flash_args "$release_foldername/esp32c6/flash_args.txt"
cp build/db_esp32.bin "$release_foldername/esp32c6"
cp build/bootloader/bootloader.bin "$release_foldername/esp32c6"
cp build/www.bin "$release_foldername/esp32c6"
cp build/partition_table/partition-table.bin "$release_foldername/esp32c6"

if [ -f "$release_name_zip" ]; then
rm "$release_name_zip"
fi
Expand Down
11 changes: 8 additions & 3 deletions flashing_instructions.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
0. On Windows you may need to run: "python -m esptool ..." instead of "esptool.py ..." - You can specify a port using e.g. "esptool.py -p COM4 ..."
1. esptool.py -p (PORT) erase_flash
2. 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
esptool --chip esp32 -b 115200 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 40m 0x1000 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x190000 www.bin


ESP32S2:
Expand All @@ -17,12 +18,16 @@

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
esptool --chip esp32c3 -b 115200 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x190000 www.bin


ESP32C3 USB Serial: For use as GND station and onboard USB. Flash the official board HWv1.x with this firmware to disable the TELEM1 serial and use the onboard USB-C instead for serial IO with the GCS. No need for a FTDI adapter.
------------------
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
esptool --chip esp32c3 -b 115200 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x190000 www.bin

ESP32C6:
-------
esptool --chip esp32c6 -b 115200 --before default_reset --after hard_reset write_flash --flash_mode dio --flash_size 2MB --flash_freq 80m 0x0 bootloader.bin 0x8000 partition-table.bin 0x10000 db_esp32.bin 0x190000 www.bin

3.
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).
Expand Down
Loading

0 comments on commit 764c02e

Please sign in to comment.