From 2b9a9ab3c6fd01062d6b117c65113dac695dc87a Mon Sep 17 00:00:00 2001 From: Nickie Deuxyeux Date: Thu, 7 May 2026 17:06:41 +0300 Subject: [PATCH] Added Aethernode-S3 and MeshPoE-S3 boards --- Boards.h | 78 ++++++++++++++++++++++++++++++++++++---------- Display.h | 18 ++++++++--- Makefile | 30 +++++++++++++----- RNode_Firmware.ino | 2 +- Utilities.h | 9 ++++++ sx126x.cpp | 4 ++- 6 files changed, 110 insertions(+), 31 deletions(-) diff --git a/Boards.h b/Boards.h index 1e13790..b777703 100644 --- a/Boards.h +++ b/Boards.h @@ -131,6 +131,7 @@ #define BOARD_MESHADVENTURER 0xF4 // MeshAdventurer #define BOARD_PROMICRO 0xF5 // FakeTec (Promicro) #define BOARD_DIY_V1 0xF6 // DIY-V1 + #define BOARD_AETHERNODE_S3 0xF7 // Aethernode-S3 #if defined(__AVR_ATmega1284P__) #define PLATFORM PLATFORM_AVR @@ -262,7 +263,7 @@ #elif BOARD_MODEL == BOARD_MESHPOE_S3 #define IS_ESP32S3 true #define HAS_DISPLAY true - #define HAS_NP true + #define HAS_NP false #define HAS_BLUETOOTH false #define HAS_BLE true #define HAS_WIFI true @@ -272,32 +273,32 @@ #define HAS_INPUT true #define HAS_TCXO true #define MODEM SX1262 - #define DIO2_AS_RF_SWITCH true - #define HAS_RF_SWITCH_RX_TX false + #define DIO2_AS_RF_SWITCH false + #define HAS_RF_SWITCH_RX_TX true #define HAS_LORA_LNA true #define LORA_LNA_GAIN 30 #define LORA_LNA_GVT 14 - const int pin_cs = 39; - const int pin_sclk = 38; - const int pin_miso = 36; - const int pin_mosi = 37; - const int pin_busy = 34; - const int pin_reset = 35; - const int pin_dio = 33; - const int pin_txen = 43; - const int pin_rxen = 44; + const int pin_cs = 16; + const int pin_sclk = 18; + const int pin_mosi = 15; + const int pin_miso = 3; + const int pin_reset = 2; + const int pin_busy = 1; + const int pin_dio = 46; + const int pin_txen = 34; + const int pin_rxen = 35; const int pin_tcxo_enable = -1; - const int pin_btn_usr1 = 40; - const int pin_np = 48; + const int pin_btn_usr1 = 36; + const int pin_np = -1; #if HAS_NP == false #if defined(EXTERNAL_LEDS) - const int pin_led_rx = 48; + const int pin_led_rx = 47; const int pin_led_tx = 48; #else - const int pin_led_rx = 48; + const int pin_led_rx = 47; const int pin_led_tx = 48; #endif #endif @@ -332,7 +333,7 @@ const int pin_rxen = 8; const int pin_tcxo_enable = -1; - const int pin_btn_usr1 = 4; + const int pin_btn_usr1 = 36 const int pin_np = 48; #if HAS_NP == false @@ -434,6 +435,49 @@ const int pin_led_rx = 2; const int pin_led_tx = 2; + #elif BOARD_MODEL == BOARD_AETHERNODE_S3 + #define IS_ESP32S3 true + #define HAS_DISPLAY true + #define HAS_NP true + #define HAS_BLUETOOTH false + #define HAS_BLE true + #define HAS_WIFI true + #define HAS_CONSOLE true + #define HAS_EEPROM true + #define HAS_BUSY true + #define HAS_INPUT false + #define HAS_TCXO true + #define MODEM SX1262 + #define DIO2_AS_RF_SWITCH true + #define HAS_RF_SWITCH_RX_TX false + #define HAS_LORA_LNA true + #define LORA_LNA_GAIN 30 + #define LORA_LNA_GVT 14 + + const int pin_cs = 10; + const int pin_sclk = 13; + const int pin_miso = 12; + const int pin_mosi = 11; + const int pin_busy = 37; + const int pin_reset = 35; + const int pin_dio = 36; + const int pin_txen = 38; + const int pin_rxen = 39; + const int pin_tcxo_enable = -1; + + const int pin_btn_usr1 = -1; + const int pin_np = 48; + + #if HAS_NP == false + #if defined(EXTERNAL_LEDS) + const int pin_led_rx = 48; + const int pin_led_tx = 48; + #else + const int pin_led_rx = 48; + const int pin_led_tx = 48; + #endif + #endif + #elif BOARD_MODEL == BOARD_TBEAM #define HAS_DISPLAY true #define HAS_PMU true diff --git a/Display.h b/Display.h index 3572bc5..f3f7acb 100644 --- a/Display.h +++ b/Display.h @@ -73,8 +73,8 @@ #elif BOARD_MODEL == BOARD_MESHPOE_S3 #define DISP_RST -1 #define DISP_ADDR 0x3C - #define SCL_OLED 1 - #define SDA_OLED 0 + #define SCL_OLED 17 + #define SDA_OLED 47 #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 #define DISP_RST -1 #define DISP_ADDR 0x3C @@ -95,6 +95,11 @@ #define DISP_ADDR 0x3C #define SCL_OLED 22 #define SDA_OLED 21 +#elif BOARD_MODEL == BOARD_AETHERNODE_S3 + #define DISP_RST -1 + #define DISP_ADDR 0x3C + #define SCL_OLED 9 + #define SDA_OLED 8 #elif BOARD_MODEL == BOARD_PROMICRO #define DISP_RST -1 #define DISP_ADDR 0x3C @@ -352,7 +357,10 @@ bool display_init() { #elif BOARD_MODEL == BOARD_HELTEC_T114 pinMode(PIN_T114_TFT_EN, OUTPUT); digitalWrite(PIN_T114_TFT_EN, LOW); - #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 + #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHPOE_S3 + Wire.setPins(SDA_OLED, SCL_OLED); + Wire.begin(); + #elif BOARD_MODEL == BOARD_AETHERNODE || BOARD_MODEL == AETHERNODE_S3 Wire.setPins(SDA_OLED, SCL_OLED); Wire.begin(); #elif BOARD_MODEL == BOARD_PROMICRO @@ -481,7 +489,7 @@ bool display_init() { #elif BOARD_MODEL == BOARD_TECHO disp_mode = DISP_MODE_PORTRAIT; display.setRotation(3); - #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 + #elif BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHPOE_S3 disp_mode = DISP_MODE_LANDSCAPE; display.setRotation(0); #elif BOARD_MODEL == BOARD_MESHADVENTURER @@ -490,7 +498,7 @@ bool display_init() { #elif BOARD_MODEL == BOARD_DIY_V1 disp_mode = DISP_MODE_LANDSCAPE; display.setRotation(0); - #elif BOARD_MODEL == BOARD_AETHERNODE + #elif BOARD_MODEL == BOARD_AETHERNODE || BOARD_MODEL == BOARD_AETHERNODE_S3 disp_mode = DISP_MODE_LANDSCAPE; display.setRotation(0); #elif BOARD_MODEL == BOARD_PROMICRO diff --git a/Makefile b/Makefile index 885b79c..295d0f7 100644 --- a/Makefile +++ b/Makefile @@ -78,6 +78,9 @@ firmware: firmware-aethernode: check_bt_buffers arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x35\"" +firmware-aethernode_s3: check_bt_buffers + arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF7\"" + firmware-diy_v1: check_bt_buffers arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF6\"" @@ -121,14 +124,11 @@ firmware-meshadventurer: check_bt_buffers arduino-cli compile --log --fqbn esp32:esp32:esp32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF4\"" firmware-meshpoe_s3: check_bt_buffers - arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF1\"" + arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DARDUINO_USB_MODE=1\" \"-DARDUINO_USB_CDC_ON_BOOT=1\" \"-DBOARD_MODEL=0xF1\"" firmware-meshadventurer_s3: check_bt_buffers arduino-cli compile --log --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\"" -firmware-meshadventurer_s3_nocdc: check_bt_buffers - arduino-cli compile --log --fqbn "esp32:esp32:esp32s3" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\"" - firmware-rnode_ng_20: check_bt_buffers arduino-cli compile --log --fqbn esp32:esp32:ttgo-lora32 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0x40\"" @@ -192,7 +192,7 @@ upload-meshpoe_s3: # @sleep 1 # rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) @sleep 3 - python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin + python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode qio --flash_freq 80m --flash_size 16MB 0x210000 ./Release/console_image.bin upload-meshadventurer_s3: arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 @@ -229,6 +229,13 @@ upload-aethernode: @sleep 3 python ./Release/esptool/esptool.py --chip esp32 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin +upload-aethernode_s3: + arduino-cli upload -p /dev/ttyACM0 --fqbn esp32:esp32:esp32s3 +# @sleep 1 +# rnodeconf /dev/ttyACM0 --firmware-hash $$(./partition_hashes ./build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin) + @sleep 3 + python ./Release/esptool/esptool.py --chip esp32s3 --port /dev/ttyACM0 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x210000 ./Release/console_image.bin + upload-mega2560: arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:mega @@ -584,7 +591,7 @@ release-genericesp32: check_bt_buffers rm -r build release-meshpoe_s3: check_bt_buffers - arduino-cli compile --fqbn esp32:esp32:esp32s3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF1\"" + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF1\"" cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshpoe_s3.boot_app0 cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin build/rnode_firmware_meshpoe_s3.bin cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_meshpoe_s3.bootloader @@ -593,7 +600,7 @@ release-meshpoe_s3: check_bt_buffers rm -r build release-meshadventurer_s3: check_bt_buffers - arduino-cli compile --fqbn esp32:esp32:esp32s3 -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\"" + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF2\"" cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_meshadventurer_s3.boot_app0 cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin build/rnode_firmware_meshadventurer_s3.bin cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_meshadventurer_s3.bootloader @@ -648,6 +655,15 @@ release-aethernode: check_bt_buffers zip --junk-paths ./Release/rnode_firmware_aethernode.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_aethernode.boot_app0 build/rnode_firmware_aethernode.bin build/rnode_firmware_aethernode.bootloader build/rnode_firmware_aethernode.partitions rm -r build +release-aethernode_s3: check_bt_buffers + arduino-cli compile --fqbn "esp32:esp32:esp32s3:CDCOnBoot=cdc" -e --build-property "build.partitions=no_ota" --build-property "upload.maximum_size=2097152" --build-property "compiler.cpp.extra_flags=\"-DBOARD_MODEL=0xF7\"" + cp ~/.arduino15/packages/esp32/hardware/esp32/$(ARDUINO_ESP_CORE_VER)/tools/partitions/boot_app0.bin build/rnode_firmware_aethernode_s3.boot_app0 + cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bin build/rnode_firmware_aethernode_s3.bin + cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.bootloader.bin build/rnode_firmware_aethernode_s3.bootloader + cp build/esp32.esp32.esp32s3/RNode_Firmware.ino.partitions.bin build/rnode_firmware_aethernode_s3.partitions + zip --junk-paths ./Release/rnode_firmware_aethernode_s3.zip ./Release/esptool/esptool.py ./Release/console_image.bin build/rnode_firmware_aethernode_s3.boot_app0 build/rnode_firmware_aethernode_s3.bin build/rnode_firmware_aethernode_s3.bootloader build/rnode_firmware_aethernode_s3.partitions + rm -r build + release-mega2560: arduino-cli compile --fqbn arduino:avr:mega -e --build-property "compiler.cpp.extra_flags=\"-DMODEM=0x01\"" cp build/arduino.avr.mega/RNode_Firmware.ino.hex Release/rnode_firmware_m2560.hex diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index 255ed65..7f6620a 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -135,7 +135,7 @@ void setup() { boot_seq(); #endif - #if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_HELTEC_T114 && BOARD_MODEL != BOARD_MESHPOE_S3 && BOARD_MODEL != BOARD_MESHADVENTURER_S3 && BOARD_MODEL != BOARD_PROMICRO && BOARD_MODEL != BOARD_TECHO && BOARD_MODEL != BOARD_T3S3 && BOARD_MODEL != BOARD_TBEAM_S_V1 && BOARD_MODEL != BOARD_TBEAM_S_V3 && BOARD_MODEL != BOARD_HELTEC32_V4 + #if BOARD_MODEL != BOARD_RAK4631 && BOARD_MODEL != BOARD_HELTEC_T114 && BOARD_MODEL != BOARD_MESHPOE_S3 && BOARD_MODEL != BOARD_MESHADVENTURER_S3 && BOARD_MODEL != BOARD_PROMICRO && BOARD_MODEL != BOARD_AETHERNODE_S3 && BOARD_MODEL != BOARD_TECHO && BOARD_MODEL != BOARD_T3S3 && BOARD_MODEL != BOARD_TBEAM_S_V1 && BOARD_MODEL != BOARD_TBEAM_S_V3 && BOARD_MODEL != BOARD_HELTEC32_V4 // Some boards need to wait until the hardware UART is set up before booting // the full firmware. In the case of the RAK4631 and Heltec T114, the line below will wait // until a serial connection is actually established with a master. Thus, it diff --git a/Utilities.h b/Utilities.h index 5854555..1ad3702 100644 --- a/Utilities.h +++ b/Utilities.h @@ -382,6 +382,13 @@ uint8_t boot_vector = 0x00; void led_tx_off() { digitalWrite(pin_led_tx, LOW); } void led_id_on() { } void led_id_off() { } + #elif BOARD_MODEL == BOARD_AETHERNODE_S3 + void led_rx_on() { digitalWrite(pin_led_rx, HIGH); } + void led_rx_off() { digitalWrite(pin_led_rx, LOW); } + void led_tx_on() { digitalWrite(pin_led_tx, HIGH); } + void led_tx_off() { digitalWrite(pin_led_tx, LOW); } + void led_id_on() { } + void led_id_off() { } #endif #elif MCU_VARIANT == MCU_NRF52 #if HAS_NP == true @@ -1739,6 +1746,8 @@ bool eeprom_model_valid() { if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) { #elif BOARD_MODEL == BOARD_AETHERNODE if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) { + #elif BOARD_MODEL == BOARD_AETHERNODE_S3 + if (model == MODEL_FF || model == MODEL_FE || model == MODEL_FD) { #elif BOARD_MODEL == BOARD_PROMICRO if (model == MODEL_FF || model == MODEL_FE) { #else diff --git a/sx126x.cpp b/sx126x.cpp index ca500a5..ec414e4 100644 --- a/sx126x.cpp +++ b/sx126x.cpp @@ -133,7 +133,7 @@ bool sx126x::preInit() { pinMode(_ss, OUTPUT); digitalWrite(_ss, HIGH); - #if BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_XIAO_S3 || BOARD_MODEL == BOARD_GENERIC_ESP32 || BOARD_MODEL == BOARD_MESHPOE_S3 || BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER || BOARD_MODEL == BOARD_DIY_V1 || BOARD_MODEL == BOARD_AETHERNODE + #if BOARD_MODEL == BOARD_T3S3 || BOARD_MODEL == BOARD_HELTEC32_V3 || BOARD_MODEL == BOARD_HELTEC32_V4 || BOARD_MODEL == BOARD_TDECK || BOARD_MODEL == BOARD_XIAO_S3 || BOARD_MODEL == BOARD_GENERIC_ESP32 || BOARD_MODEL == BOARD_MESHPOE_S3 || BOARD_MODEL == BOARD_MESHADVENTURER_S3 || BOARD_MODEL == BOARD_MESHADVENTURER || BOARD_MODEL == BOARD_DIY_V1 || BOARD_MODEL == BOARD_AETHERNODE || BOARD_MODEL == BOARD_AETHERNODE_S3 SPI.begin(pin_sclk, pin_miso, pin_mosi, pin_cs); #elif BOARD_MODEL == BOARD_TECHO SPI.setPins(pin_miso, pin_sclk, pin_mosi); @@ -752,6 +752,8 @@ void sx126x::enableTCXO() { uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; #elif BOARD_MODEL == BOARD_AETHERNODE uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; + #elif BOARD_MODEL == BOARD_AETHERNODE_S3 + uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; #elif BOARD_MODEL == BOARD_PROMICRO uint8_t buf[4] = {MODE_TCXO_1_8V_6X, 0x00, 0x00, 0xFF}; #endif