From ca0698f06c2adae5ed0503bb5a8db800397fb68c Mon Sep 17 00:00:00 2001 From: lumapu Date: Tue, 28 Nov 2023 23:40:11 +0100 Subject: [PATCH] 0.8.13 * added ethernet build for fusion board, not tested so far --- .github/workflows/compile_development.yml | 2 +- .github/workflows/compile_release.yml | 2 +- scripts/getVersion.py | 18 ++++++++-- src/CHANGES.md | 1 + src/config/config.h | 20 +++++++++--- src/eth/ahoyeth.cpp | 2 +- src/platformio.ini | 40 +++++++++++++++++++++++ 7 files changed, 74 insertions(+), 11 deletions(-) diff --git a/.github/workflows/compile_development.yml b/.github/workflows/compile_development.yml index af81492f..31049c21 100644 --- a/.github/workflows/compile_development.yml +++ b/.github/workflows/compile_development.yml @@ -43,7 +43,7 @@ jobs: pip install --upgrade platformio - name: Run PlatformIO - run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion + run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion --environment opendtufusion-ethernet - name: Copy boot_app0.bin run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin diff --git a/.github/workflows/compile_release.yml b/.github/workflows/compile_release.yml index 70eb5f29..8f493100 100644 --- a/.github/workflows/compile_release.yml +++ b/.github/workflows/compile_release.yml @@ -47,7 +47,7 @@ jobs: pip install --upgrade platformio - name: Run PlatformIO - run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion + run: pio run -d src --environment esp8266 --environment esp8266-prometheus --environment esp8285 --environment esp32-wroom32 --environment esp32-wroom32-prometheus --environment esp32-wroom32-ethernet --environment esp32-s2-mini --environment opendtufusion --environment opendtufusion-ethernet - name: Copy boot_app0.bin run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin src/.pio/build/opendtufusion/ota.bin diff --git a/scripts/getVersion.py b/scripts/getVersion.py index be36895e..6234d432 100644 --- a/scripts/getVersion.py +++ b/scripts/getVersion.py @@ -93,9 +93,14 @@ def readVersion(path, infile): dst = path + "firmware/ESP32-S2/" + versionout os.rename(src, dst) - versionout = version[:-1] + "_" + sha + "_esp32s3.bin" - src = path + ".pio/build/opendtufusion/firmware.bin" - dst = path + "firmware/ESP32-S3/" + versionout + versionout = version[:-1] + "_" + sha + "_esp32s3_ethernet.bin" + src = path + ".pio/build/opendtufusion-ethernet/firmware.bin" + dst = path + "firmware/ESP32-S3-ETH/" + versionout + os.rename(src, dst) + + versionout = version[:-1] + "_" + sha + "_esp32_ethernet.bin" + src = path + ".pio/build/esp32-wroom32-ethernet/firmware.bin" + dst = path + "firmware/ESP32/" + versionout os.rename(src, dst) # other ESP32 bin files @@ -119,6 +124,13 @@ def readVersion(path, infile): os.rename(src + "partitions.bin", dst + "partitions.bin") genOtaBin(dst) + # other ESP32-S3-Eth bin files + src = path + ".pio/build/opendtufusion-ethernet/" + dst = path + "firmware/ESP32-S3-ETH/" + os.rename(src + "bootloader.bin", dst + "bootloader.bin") + os.rename(src + "partitions.bin", dst + "partitions.bin") + genOtaBin(dst) + os.rename("../scripts/gh-action-dev-build-flash.html", path + "install.html") print("name=" + versionnumber[:-1] ) diff --git a/src/CHANGES.md b/src/CHANGES.md index dc4b6855..f40f1991 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -3,6 +3,7 @@ ## 0.8.13 - 2023-11-28 * merge PR #1239 symbolic layout for OLED 128x64 + motion senser functionality * fix MqTT IP addr for ETH connections PR #1240 +* added ethernet build for fusion board, not tested so far ## 0.8.12 - 2023-11-20 * added button `copy to clipboard` to `/serial` diff --git a/src/config/config.h b/src/config/config.h index 4fb78107..c8fd86dc 100644 --- a/src/config/config.h +++ b/src/config/config.h @@ -41,11 +41,21 @@ #if defined(ETHERNET) #define ETH_SPI_HOST SPI2_HOST #define ETH_SPI_CLOCK_MHZ 25 - #define ETH_INT_GPIO 4 - #define ETH_MISO_GPIO 12 - #define ETH_MOSI_GPIO 13 - #define ETH_SCK_GPIO 14 - #define ETH_CS_PIN 15 + #ifndef DEF_ETH_IRQ_PIN + #define DEF_ETH_IRQ_PIN 4 + #endif + #ifndef DEF_ETH_MISO_PIN + #define DEF_ETH_MISO_PIN 12 + #endif + #ifndef DEF_ETH_MOSI_PIN + #define DEF_ETH_MOSI_PIN 13 + #endif + #ifndef DEF_ETH_SCK_PIN + #define DEF_ETH_SCK_PIN 14 + #endif + #ifndef DEF_ETH_CS_PIN + #define DEF_ETH_CS_PIN 15 + #endif #else /* defined(ETHERNET) */ // time in seconds how long the station info (ssid + pwd) will be tried #define WIFI_TRY_CONNECT_TIME 30 diff --git a/src/eth/ahoyeth.cpp b/src/eth/ahoyeth.cpp index cb63a950..21fa0821 100644 --- a/src/eth/ahoyeth.cpp +++ b/src/eth/ahoyeth.cpp @@ -41,7 +41,7 @@ void ahoyeth::setup(settings_t *config, uint32_t *utcTimestamp, OnNetworkCB onNe if(!ETH.config(ip, gateway, mask, dns1, dns2)) DPRINTLN(DBG_ERROR, F("failed to set static IP!")); } - ETH.begin(ETH_MISO_GPIO, ETH_MOSI_GPIO, ETH_SCK_GPIO, ETH_CS_PIN, ETH_INT_GPIO, ETH_SPI_CLOCK_MHZ, ETH_SPI_HOST); + ETH.begin(DEF_ETH_MISO_PIN, DEF_ETH_MOSI_PIN, DEF_ETH_SCK_PIN, DEF_ETH_CS_PIN, DEF_ETH_IRQ_PIN, ETH_SPI_CLOCK_MHZ, ETH_SPI_HOST); } diff --git a/src/platformio.ini b/src/platformio.ini index e7c87979..e1f4d574 100644 --- a/src/platformio.ini +++ b/src/platformio.ini @@ -146,6 +146,46 @@ build_flags = ${env.build_flags} monitor_filters = esp32_exception_decoder, colorize +[env:opendtufusion-ethernet] +platform = espressif32@6.4.0 +board = esp32-s3-devkitc-1 +lib_deps = + khoih-prog/AsyncWebServer_ESP32_W5500 + khoih-prog/AsyncUDP_ESP32_W5500 + nrf24/RF24 @ ^1.4.8 + paulstoffregen/Time @ ^1.6.1 + https://github.com/bertmelis/espMqttClient#v1.5.0 + bblanchon/ArduinoJson @ ^6.21.3 + https://github.com/JChristensen/Timezone @ ^1.2.4 + olikraus/U8g2 @ ^2.35.7 + zinggjm/GxEPD2 @ ^1.5.2 +upload_protocol = esp-builtin +build_flags = ${env.build_flags} + -DETHERNET + -DUSE_HSPI_FOR_EPD + -DDEF_ETH_CS_PIN=42 + -DDEF_ETH_SCK_PIN=39 + -DDEF_ETH_MISO_PIN=41 + -DDEF_ETH_MOSI_PIN=40 + -DDEF_ETH_IRQ_PIN=43 + -DDEF_NRF_CS_PIN=37 + -DDEF_NRF_CE_PIN=38 + -DDEF_NRF_IRQ_PIN=47 + -DDEF_NRF_MISO_PIN=48 + -DDEF_NRF_MOSI_PIN=35 + -DDEF_NRF_SCLK_PIN=36 + -DDEF_CMT_CSB=4 + -DDEF_CMT_FCSB=21 + -DDEF_CMT_IRQ=8 + -DDEF_CMT_SDIO=5 + -DDEF_CMT_SCLK=6 + -DDEF_LED0=18 + -DDEF_LED1=17 + -DLED_ACTIVE_HIGH + -DARDUINO_USB_MODE=1 +monitor_filters = + esp32_exception_decoder, colorize + [env:opendtufusion-dev] platform = espressif32@6.4.0 board = esp32-s3-devkitc-1