From 967591d63c9c755cd2fd8a7a5ba2dd45f8ce8648 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Mon, 18 May 2026 11:50:11 +0300 Subject: [PATCH 01/11] Custom LR1121 radiolib helper from https://github.com/BetaFloof/MeshCore/tree/lilygo_t3s3_LR1121 --- src/helpers/radiolib/CustomLR1121.h | 25 ++++++++++++++++ src/helpers/radiolib/CustomLR1121Wrapper.h | 34 ++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 src/helpers/radiolib/CustomLR1121.h create mode 100644 src/helpers/radiolib/CustomLR1121Wrapper.h diff --git a/src/helpers/radiolib/CustomLR1121.h b/src/helpers/radiolib/CustomLR1121.h new file mode 100644 index 0000000000..650ae9eff9 --- /dev/null +++ b/src/helpers/radiolib/CustomLR1121.h @@ -0,0 +1,25 @@ +#pragma once + +#include +#include "MeshCore.h" + +class CustomLR1121 : public LR1121 { + bool _rx_boosted = false; + public: + CustomLR1121(Module *mod) : LR1121(mod) { } + + float getFreqMHz() const { return freqMHz; } + + int16_t setRxBoostedGainMode(bool en) { + _rx_boosted = en; + return LR1121::setRxBoostedGainMode(en); + } + + bool getRxBoostedGainMode() const { return _rx_boosted; } + + bool isReceiving() { + uint16_t irq = getIrqStatus(); + bool detected = ((irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID) || (irq & RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED)); + return detected; + } +}; \ No newline at end of file diff --git a/src/helpers/radiolib/CustomLR1121Wrapper.h b/src/helpers/radiolib/CustomLR1121Wrapper.h new file mode 100644 index 0000000000..b2dec7c040 --- /dev/null +++ b/src/helpers/radiolib/CustomLR1121Wrapper.h @@ -0,0 +1,34 @@ +#pragma once + +#include "CustomLR1121.h" +#include "RadioLibWrappers.h" +#include "LR11x0Reset.h" + +class CustomLR1121Wrapper : public RadioLibWrapper { +public: + CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { } + void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); } + bool isReceivingPacket() override { + return ((CustomLR1121 *)_radio)->isReceiving(); + } + float getCurrentRSSI() override { + float rssi = -110; + ((CustomLR1121 *)_radio)->getRssiInst(&rssi); + return rssi; + } + + void onSendFinished() override { + RadioLibWrapper::onSendFinished(); + _radio->setPreambleLength(16); // overcomes weird issues with small and big pkts + } + + float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); } + float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); } + + void setRxBoostedGainMode(bool en) override { + ((CustomLR1121 *)_radio)->setRxBoostedGainMode(en); + } + bool getRxBoostedGainMode() const override { + return ((CustomLR1121 *)_radio)->getRxBoostedGainMode(); + } +}; \ No newline at end of file From 65857966417a24a9109e2b9b73499d70c6d2d6df Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Mon, 18 May 2026 12:16:52 +0300 Subject: [PATCH 02/11] add Ebyte EoRa hub (LR1121) --- variants/ebyte_eora_hub/platformio.ini | 201 +++++++++++++++++++++++++ variants/ebyte_eora_hub/target.cpp | 107 +++++++++++++ variants/ebyte_eora_hub/target.h | 30 ++++ 3 files changed, 338 insertions(+) create mode 100644 variants/ebyte_eora_hub/platformio.ini create mode 100644 variants/ebyte_eora_hub/target.cpp create mode 100644 variants/ebyte_eora_hub/target.h diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini new file mode 100644 index 0000000000..da185fb315 --- /dev/null +++ b/variants/ebyte_eora_hub/platformio.ini @@ -0,0 +1,201 @@ +[Ebyte_EoRa-hub] +extends = esp32_base +board = esp32-s3-devkitc-1 + +build_flags = + ${esp32_base.build_flags} + -I variants/ebyte_eora_hub + -D RADIO_CLASS=CustomLR1121 + -D WRAPPER_CLASS=CustomLR1121Wrapper + -D P_LORA_NSS=8 + -D P_LORA_SCLK=9 + -D P_LORA_MOSI=10 + -D P_LORA_MISO=11 + -D P_LORA_RESET=12 + -D P_LORA_DIO_9=13 + -D P_LORA_BUSY=13 + -D LR1121_IRQ_PIN=14 + -D LR11X0_DIO3_TCXO_VOLTAGE=1.8 + -D RF_SWITCH_TABLE + -D LORA_TX_POWER=22 + -D DISPLAY_CLASS=SSD1306Display + -D PIN_BOARD_SDA=18 + -D PIN_BOARD_SCL=17 + -D PIN_VBAT_READ=1 + -D ADC_CTRL=37 + -D PIN_SERIAL_TX=43 + -D PIN_SERIAL_RX=44 + -D PIN_USER_BTN=0 + -D LED_POWER=35 + +build_src_filter = + ${esp32_base.build_src_filter} + +<../variants/ebyte_eora_hub> + +lib_deps = + ${esp32_base.lib_deps} + adafruit/Adafruit SSD1306 @ ^2.5.13 + + +; === Repeater role === +[env:Ebyte_EoRa_repeater] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -D ADVERT_NAME='"EORA_HUB-1121 Repeater"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D MAX_NEIGHBOURS=50 +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + +<../examples/simple_repeater> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + ${esp32_ota.lib_deps} + + +; === ESP-NOW Bridge role === +[env:Ebyte_EoRa-hub_repeater_bridge_espnow] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -D DISPLAY_CLASS=SSD1306Display + -D ADVERT_NAME='"ESPNow Bridge"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D MAX_NEIGHBOURS=50 + -D WITH_ESPNOW_BRIDGE=1 +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + + + +<../examples/simple_repeater> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + ${esp32_ota.lib_deps} + + +; === Terminal chat role === +[env:Ebyte_EoRa-hub_terminal_chat] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -D MAX_CONTACTS=300 + -D MAX_GROUP_CHANNELS=1 +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + +<../examples/simple_secure_chat/main.cpp> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + densaugeo/base64 @ ~1.4.0 + + +; === Room server role === +[env:Ebyte_EoRa_room_server] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -D ADVERT_NAME='"EORA_HUB-1121 Room"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D ROOM_PASSWORD='"hello"' +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + +<../examples/simple_room_server> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + ${esp32_ota.lib_deps} + + +; === Companion radio (USB) === +[env:Ebyte_EoRa_companion_radio_usb] +extends = Ebyte_EoRa-hub +upload_speed = 115200 +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -I examples/companion_radio/ui-new + -D MAX_CONTACTS=300 + -D MAX_GROUP_CHANNELS=8 +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + densaugeo/base64 @ ~1.4.0 + + +; === Companion radio (BLE) === +[env:Ebyte_EoRa_companion_radio_ble] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -I examples/companion_radio/ui-new + -D MAX_CONTACTS=300 + -D MAX_GROUP_CHANNELS=8 + -D BLE_PIN_CODE=123456 + -D BLE_DEBUG_LOGGING=1 + -D OFFLINE_QUEUE_SIZE=256 +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + + + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + densaugeo/base64 @ ~1.4.0 + + +; === Companion radio (WiFi) === +[env:Ebyte_EoRa-hub_companion_radio_wifi] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -I examples/companion_radio/ui-new + -D MAX_CONTACTS=300 + -D MAX_GROUP_CHANNELS=8 + -D OFFLINE_QUEUE_SIZE=256 + -D DISPLAY_CLASS=SSD1306Display + -D WIFI_DEBUG_LOGGING=1 + -D WIFI_SSID='"myssid"' + -D WIFI_PWD='"mypwd"' +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + + + + + +<../examples/companion_radio/*.cpp> + +<../examples/companion_radio/ui-new/*.cpp> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + densaugeo/base64 @ ~1.4.0 + + +; === Sensor role === +[env:Ebyte_EoRa-hub_sensor] +extends = Ebyte_EoRa-hub +build_flags = + ${Ebyte_EoRa-hub.build_flags} + -D ADVERT_NAME='"EoRaHub Sensor"' + -D ADVERT_LAT=0.0 + -D ADVERT_LON=0.0 + -D ADMIN_PASSWORD='"password"' + -D ENV_PIN_SDA=3 + -D ENV_PIN_SCL=4 + -D DISPLAY_CLASS=SSD1306Display +build_src_filter = + ${Ebyte_EoRa-hub.build_src_filter} + + + +<../examples/simple_sensor> +lib_deps = + ${Ebyte_EoRa-hub.lib_deps} + ${esp32_ota.lib_deps} \ No newline at end of file diff --git a/variants/ebyte_eora_hub/target.cpp b/variants/ebyte_eora_hub/target.cpp new file mode 100644 index 0000000000..2884fb29f7 --- /dev/null +++ b/variants/ebyte_eora_hub/target.cpp @@ -0,0 +1,107 @@ +#include +#include "target.h" + +ESP32Board board; + +static SPIClass spi; +RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_9, P_LORA_RESET, P_LORA_BUSY, spi); + +WRAPPER_CLASS radio_driver(radio, board); + +ESP32RTCClock fallback_clock; +AutoDiscoverRTCClock rtc_clock(fallback_clock); +SensorManager sensors; + +#ifdef DISPLAY_CLASS + DISPLAY_CLASS display; + MomentaryButton user_btn(PIN_USER_BTN, 1000, true); +#endif + +#ifndef LORA_CR + #define LORA_CR 5 +#endif + +#ifdef RF_SWITCH_TABLE +// EoRa-Hub 900TB RF switch (E80-900M2213S) +static const uint32_t rfswitch_dios[Module::RFSWITCH_MAX_PINS] = { + RADIOLIB_LR11X0_DIO5, + RADIOLIB_LR11X0_DIO6, + RADIOLIB_LR11X0_DIO7, + RADIOLIB_NC, + RADIOLIB_NC +}; + +static const Module::RfSwitchMode_t rfswitch_table[] = { + { LR11x0::MODE_STBY, {LOW, LOW, LOW} }, + { LR11x0::MODE_RX, {LOW, HIGH, LOW} }, + { LR11x0::MODE_TX, {HIGH, HIGH, LOW} }, + { LR11x0::MODE_TX_HP, {HIGH, LOW, LOW} }, + { LR11x0::MODE_TX_HF, {LOW, LOW, LOW} }, + { LR11x0::MODE_GNSS, {LOW, LOW, HIGH} }, + { LR11x0::MODE_WIFI, {LOW, LOW, LOW} }, + END_OF_MODE_TABLE, +}; +#endif + +bool radio_init() { + fallback_clock.begin(); + rtc_clock.begin(Wire); + +#ifdef LR11X0_DIO3_TCXO_VOLTAGE + float tcxo = LR11X0_DIO3_TCXO_VOLTAGE; +#else + float tcxo = 1.6f; +#endif + + spi.begin(P_LORA_SCLK, P_LORA_MISO, P_LORA_MOSI, P_LORA_NSS); + + int status = radio.begin( + LORA_FREQ, + LORA_BW, + LORA_SF, + LORA_CR, + RADIOLIB_LR11X0_LORA_SYNC_WORD_PRIVATE, + LORA_TX_POWER, + 16, + tcxo + ); + + if (status != RADIOLIB_ERR_NONE) { + Serial.print("ERROR: radio init failed: "); + Serial.println(status); + return false; + } + + radio.setCRC(2); + radio.explicitHeader(); + +#ifdef RF_SWITCH_TABLE + radio.setRfSwitchTable(rfswitch_dios, rfswitch_table); +#endif + +#ifdef RX_BOOSTED_GAIN + radio.setRxBoostedGainMode(RX_BOOSTED_GAIN); +#endif + + return true; +} + +uint32_t radio_get_rng_seed() { + return radio.random(0x7FFFFFFF); +} + +void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { + radio.setFrequency(freq); + radio.setSpreadingFactor(sf); + radio.setBandwidth(bw); + radio.setCodingRate(cr); +} + +void radio_set_tx_power(int8_t dbm) { + radio.setOutputPower(dbm); +} + +mesh::LocalIdentity radio_new_identity() { + RadioNoiseListener rng(radio); + return mesh::LocalIdentity(&rng); +} diff --git a/variants/ebyte_eora_hub/target.h b/variants/ebyte_eora_hub/target.h new file mode 100644 index 0000000000..ba9b0abecc --- /dev/null +++ b/variants/ebyte_eora_hub/target.h @@ -0,0 +1,30 @@ +#pragma once + +#define RADIOLIB_STATIC_ONLY 1 +#include +#include +#include +#include +#include +#include + +#ifdef DISPLAY_CLASS + #include + #include +#endif + +extern ESP32Board board; +extern WRAPPER_CLASS radio_driver; +extern AutoDiscoverRTCClock rtc_clock; +extern SensorManager sensors; + +#ifdef DISPLAY_CLASS + extern DISPLAY_CLASS display; + extern MomentaryButton user_btn; +#endif + +bool radio_init(); +uint32_t radio_get_rng_seed(); +void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); +void radio_set_tx_power(int8_t dbm); +mesh::LocalIdentity radio_new_identity(); From 80618551e3ccd8a6f4424a027122458a2d35ad96 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 26 May 2026 11:22:01 +0300 Subject: [PATCH 03/11] fix env names --- variants/ebyte_eora_hub/platformio.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index da185fb315..f75033105a 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -38,7 +38,7 @@ lib_deps = ; === Repeater role === -[env:Ebyte_EoRa_repeater] +[env:Ebyte_EoRa-hub_repeater] extends = Ebyte_EoRa-hub build_flags = ${Ebyte_EoRa-hub.build_flags} @@ -94,7 +94,7 @@ lib_deps = ; === Room server role === -[env:Ebyte_EoRa_room_server] +[env:Ebyte_EoRa-hub_room_server] extends = Ebyte_EoRa-hub build_flags = ${Ebyte_EoRa-hub.build_flags} @@ -113,7 +113,7 @@ lib_deps = ; === Companion radio (USB) === -[env:Ebyte_EoRa_companion_radio_usb] +[env:Ebyte_EoRa-hub_companion_radio_usb] extends = Ebyte_EoRa-hub upload_speed = 115200 build_flags = @@ -133,7 +133,7 @@ lib_deps = ; === Companion radio (BLE) === -[env:Ebyte_EoRa_companion_radio_ble] +[env:Ebyte_EoRa-hub_companion_radio_ble] extends = Ebyte_EoRa-hub build_flags = ${Ebyte_EoRa-hub.build_flags} @@ -198,4 +198,4 @@ build_src_filter = +<../examples/simple_sensor> lib_deps = ${Ebyte_EoRa-hub.lib_deps} - ${esp32_ota.lib_deps} \ No newline at end of file + ${esp32_ota.lib_deps} From 0be442dd426ce2933a18493906f76114fa91519b Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 26 May 2026 11:54:37 +0300 Subject: [PATCH 04/11] fix 2 --- variants/ebyte_eora_hub/platformio.ini | 82 +++++++++++++------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index f75033105a..0f8209d159 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -1,4 +1,4 @@ -[Ebyte_EoRa-hub] +[Ebyte_EoRa_hub] extends = esp32_base board = esp32-s3-devkitc-1 @@ -38,29 +38,29 @@ lib_deps = ; === Repeater role === -[env:Ebyte_EoRa-hub_repeater] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_repeater] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -D ADVERT_NAME='"EORA_HUB-1121 Repeater"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D MAX_NEIGHBOURS=50 build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + +<../examples/simple_repeater> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} ${esp32_ota.lib_deps} ; === ESP-NOW Bridge role === -[env:Ebyte_EoRa-hub_repeater_bridge_espnow] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_repeater_bridge_espnow] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -D DISPLAY_CLASS=SSD1306Display -D ADVERT_NAME='"ESPNow Bridge"' -D ADVERT_LAT=0.0 @@ -69,74 +69,74 @@ build_flags = -D MAX_NEIGHBOURS=50 -D WITH_ESPNOW_BRIDGE=1 build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + + +<../examples/simple_repeater> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} ${esp32_ota.lib_deps} ; === Terminal chat role === -[env:Ebyte_EoRa-hub_terminal_chat] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_terminal_chat] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=1 build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} +<../examples/simple_secure_chat/main.cpp> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} densaugeo/base64 @ ~1.4.0 ; === Room server role === -[env:Ebyte_EoRa-hub_room_server] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_room_server] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -D ADVERT_NAME='"EORA_HUB-1121 Room"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 -D ADMIN_PASSWORD='"password"' -D ROOM_PASSWORD='"hello"' build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + +<../examples/simple_room_server> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} ${esp32_ota.lib_deps} ; === Companion radio (USB) === -[env:Ebyte_EoRa-hub_companion_radio_usb] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_companion_radio_usb] +extends = Ebyte_EoRa_hub upload_speed = 115200 build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -I examples/companion_radio/ui-new -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} densaugeo/base64 @ ~1.4.0 ; === Companion radio (BLE) === -[env:Ebyte_EoRa-hub_companion_radio_ble] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_companion_radio_ble] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -I examples/companion_radio/ui-new -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -144,22 +144,22 @@ build_flags = -D BLE_DEBUG_LOGGING=1 -D OFFLINE_QUEUE_SIZE=256 build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} densaugeo/base64 @ ~1.4.0 ; === Companion radio (WiFi) === -[env:Ebyte_EoRa-hub_companion_radio_wifi] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_companion_radio_wifi] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -I examples/companion_radio/ui-new -D MAX_CONTACTS=300 -D MAX_GROUP_CHANNELS=8 @@ -169,22 +169,22 @@ build_flags = -D WIFI_SSID='"myssid"' -D WIFI_PWD='"mypwd"' build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + + + +<../examples/companion_radio/*.cpp> +<../examples/companion_radio/ui-new/*.cpp> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} densaugeo/base64 @ ~1.4.0 ; === Sensor role === -[env:Ebyte_EoRa-hub_sensor] -extends = Ebyte_EoRa-hub +[env:Ebyte_EoRa_hub_sensor] +extends = Ebyte_EoRa_hub build_flags = - ${Ebyte_EoRa-hub.build_flags} + ${Ebyte_EoRa_hub.build_flags} -D ADVERT_NAME='"EoRaHub Sensor"' -D ADVERT_LAT=0.0 -D ADVERT_LON=0.0 @@ -193,9 +193,9 @@ build_flags = -D ENV_PIN_SCL=4 -D DISPLAY_CLASS=SSD1306Display build_src_filter = - ${Ebyte_EoRa-hub.build_src_filter} + ${Ebyte_EoRa_hub.build_src_filter} + +<../examples/simple_sensor> lib_deps = - ${Ebyte_EoRa-hub.lib_deps} + ${Ebyte_EoRa_hub.lib_deps} ${esp32_ota.lib_deps} From 2bb48b7be8203c3ea4ffb48ee92108d7c7cf9576 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Mon, 8 Jun 2026 11:37:12 +0300 Subject: [PATCH 05/11] update to 1.16 --- variants/ebyte_eora_hub/target.cpp | 14 -------------- variants/ebyte_eora_hub/target.h | 3 --- 2 files changed, 17 deletions(-) diff --git a/variants/ebyte_eora_hub/target.cpp b/variants/ebyte_eora_hub/target.cpp index 2884fb29f7..26f9b81f24 100644 --- a/variants/ebyte_eora_hub/target.cpp +++ b/variants/ebyte_eora_hub/target.cpp @@ -86,20 +86,6 @@ bool radio_init() { return true; } -uint32_t radio_get_rng_seed() { - return radio.random(0x7FFFFFFF); -} - -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr) { - radio.setFrequency(freq); - radio.setSpreadingFactor(sf); - radio.setBandwidth(bw); - radio.setCodingRate(cr); -} - -void radio_set_tx_power(int8_t dbm) { - radio.setOutputPower(dbm); -} mesh::LocalIdentity radio_new_identity() { RadioNoiseListener rng(radio); diff --git a/variants/ebyte_eora_hub/target.h b/variants/ebyte_eora_hub/target.h index ba9b0abecc..07aa189808 100644 --- a/variants/ebyte_eora_hub/target.h +++ b/variants/ebyte_eora_hub/target.h @@ -24,7 +24,4 @@ extern SensorManager sensors; #endif bool radio_init(); -uint32_t radio_get_rng_seed(); -void radio_set_params(float freq, float bw, uint8_t sf, uint8_t cr); -void radio_set_tx_power(int8_t dbm); mesh::LocalIdentity radio_new_identity(); From 754d801c021b490fe0d5c7107208af474b015ddb Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:16:00 +0300 Subject: [PATCH 06/11] rework LR1121 wrapper --- src/helpers/radiolib/CustomLR1121.h | 1 + src/helpers/radiolib/CustomLR1121Wrapper.h | 49 ++++++++++++++++------ 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/helpers/radiolib/CustomLR1121.h b/src/helpers/radiolib/CustomLR1121.h index 650ae9eff9..57349f4071 100644 --- a/src/helpers/radiolib/CustomLR1121.h +++ b/src/helpers/radiolib/CustomLR1121.h @@ -22,4 +22,5 @@ class CustomLR1121 : public LR1121 { bool detected = ((irq & RADIOLIB_LR11X0_IRQ_SYNC_WORD_HEADER_VALID) || (irq & RADIOLIB_LR11X0_IRQ_PREAMBLE_DETECTED)); return detected; } + uint8_t getSpreadingFactor() const { return spreadingFactor; } }; \ No newline at end of file diff --git a/src/helpers/radiolib/CustomLR1121Wrapper.h b/src/helpers/radiolib/CustomLR1121Wrapper.h index b2dec7c040..ec38332483 100644 --- a/src/helpers/radiolib/CustomLR1121Wrapper.h +++ b/src/helpers/radiolib/CustomLR1121Wrapper.h @@ -6,29 +6,54 @@ class CustomLR1121Wrapper : public RadioLibWrapper { public: - CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) : RadioLibWrapper(radio, board) { } - void doResetAGC() override { lr11x0ResetAGC((LR11x0 *)_radio, ((CustomLR1121 *)_radio)->getFreqMHz()); } - bool isReceivingPacket() override { - return ((CustomLR1121 *)_radio)->isReceiving(); + CustomLR1121Wrapper(CustomLR1121& radio, mesh::MainBoard& board) + : RadioLibWrapper(radio, board) { } + + void setParams(float freq, float bw, uint8_t sf, uint8_t cr) override { + auto* r = (CustomLR1121*)_radio; + r->setFrequency(freq); + r->setSpreadingFactor(sf); + r->setBandwidth(bw); + r->setCodingRate(cr); + updatePreamble(sf); + } + + uint8_t getSpreadingFactor() const override { + return ((CustomLR1121*)_radio)->getSpreadingFactor(); + } + + void doResetAGC() override { + lr11x0ResetAGC((LR11x0*)_radio, ((CustomLR1121*)_radio)->getFreqMHz()); + } + + bool isReceivingPacket() override { + return ((CustomLR1121*)_radio)->isReceiving(); } + float getCurrentRSSI() override { float rssi = -110; - ((CustomLR1121 *)_radio)->getRssiInst(&rssi); + ((CustomLR1121*)_radio)->getRssiInst(&rssi); return rssi; } void onSendFinished() override { RadioLibWrapper::onSendFinished(); - _radio->setPreambleLength(16); // overcomes weird issues with small and big pkts + _radio->setPreambleLength(16); + } + + float getLastRSSI() const override { + return ((CustomLR1121*)_radio)->getRSSI(); + } + + float getLastSNR() const override { + return ((CustomLR1121*)_radio)->getSNR(); } - float getLastRSSI() const override { return ((CustomLR1121 *)_radio)->getRSSI(); } - float getLastSNR() const override { return ((CustomLR1121 *)_radio)->getSNR(); } - void setRxBoostedGainMode(bool en) override { - ((CustomLR1121 *)_radio)->setRxBoostedGainMode(en); + ((CustomLR1121*)_radio)->setRxBoostedGainMode(en); } + bool getRxBoostedGainMode() const override { - return ((CustomLR1121 *)_radio)->getRxBoostedGainMode(); + return ((CustomLR1121*)_radio)->getRxBoostedGainMode(); } -}; \ No newline at end of file +}; From dae35fc8b48d3e0dc6c143d99da67e6f41aa1013 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Mon, 8 Jun 2026 14:23:08 +0300 Subject: [PATCH 07/11] no hard code --- src/helpers/radiolib/CustomLR1121Wrapper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/radiolib/CustomLR1121Wrapper.h b/src/helpers/radiolib/CustomLR1121Wrapper.h index ec38332483..f2e0d9c7eb 100644 --- a/src/helpers/radiolib/CustomLR1121Wrapper.h +++ b/src/helpers/radiolib/CustomLR1121Wrapper.h @@ -38,7 +38,7 @@ class CustomLR1121Wrapper : public RadioLibWrapper { void onSendFinished() override { RadioLibWrapper::onSendFinished(); - _radio->setPreambleLength(16); + _radio->setPreambleLength(preambleLengthForSF(getSpreadingFactor())); } float getLastRSSI() const override { From b4f11e1c3f39e78e4cfc0f6124ca53ed9bb98d3b Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 9 Jun 2026 10:10:16 +0300 Subject: [PATCH 08/11] fix Ebyte_EoRa_hub_terminal_chat compilation --- variants/ebyte_eora_hub/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index 0f8209d159..36bd88ed90 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -87,6 +87,7 @@ build_flags = -D MAX_GROUP_CHANNELS=1 build_src_filter = ${Ebyte_EoRa_hub.build_src_filter} + + +<../examples/simple_secure_chat/main.cpp> lib_deps = ${Ebyte_EoRa_hub.lib_deps} From bf3ae220fe46a2c72a7b9bd86802785941bd1fd2 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:07:28 +0300 Subject: [PATCH 09/11] board tune --- variants/ebyte_eora_hub/platformio.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index 36bd88ed90..0f839aa406 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -4,6 +4,7 @@ board = esp32-s3-devkitc-1 build_flags = ${esp32_base.build_flags} + -DBOARD_HAS_PSRAM -I variants/ebyte_eora_hub -D RADIO_CLASS=CustomLR1121 -D WRAPPER_CLASS=CustomLR1121Wrapper @@ -28,6 +29,8 @@ build_flags = -D PIN_USER_BTN=0 -D LED_POWER=35 +board_build.partitions = min_spiffs.csv + build_src_filter = ${esp32_base.build_src_filter} +<../variants/ebyte_eora_hub> From 4f4949a48bc07e4922fdd221ee399aeff8ed044b Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:19:58 +0300 Subject: [PATCH 10/11] cosmetic --- variants/ebyte_eora_hub/platformio.ini | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index 0f839aa406..17b6a0661f 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -1,11 +1,12 @@ [Ebyte_EoRa_hub] extends = esp32_base board = esp32-s3-devkitc-1 +board_build.partitions = min_spiffs.csv build_flags = ${esp32_base.build_flags} - -DBOARD_HAS_PSRAM -I variants/ebyte_eora_hub + -D BOARD_HAS_PSRAM=1 -D RADIO_CLASS=CustomLR1121 -D WRAPPER_CLASS=CustomLR1121Wrapper -D P_LORA_NSS=8 @@ -15,7 +16,7 @@ build_flags = -D P_LORA_RESET=12 -D P_LORA_DIO_9=13 -D P_LORA_BUSY=13 - -D LR1121_IRQ_PIN=14 + -D P_LORA_DIO_1=14 -D LR11X0_DIO3_TCXO_VOLTAGE=1.8 -D RF_SWITCH_TABLE -D LORA_TX_POWER=22 @@ -29,8 +30,6 @@ build_flags = -D PIN_USER_BTN=0 -D LED_POWER=35 -board_build.partitions = min_spiffs.csv - build_src_filter = ${esp32_base.build_src_filter} +<../variants/ebyte_eora_hub> @@ -202,4 +201,4 @@ build_src_filter = +<../examples/simple_sensor> lib_deps = ${Ebyte_EoRa_hub.lib_deps} - ${esp32_ota.lib_deps} + ${esp32_ota.lib_deps} \ No newline at end of file From fca5220d19f031cf276e260f6c46e5203acc5dc9 Mon Sep 17 00:00:00 2001 From: radmir <39234121+mrrdmr@users.noreply.github.com> Date: Tue, 9 Jun 2026 11:44:39 +0300 Subject: [PATCH 11/11] fixes --- variants/ebyte_eora_hub/platformio.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/variants/ebyte_eora_hub/platformio.ini b/variants/ebyte_eora_hub/platformio.ini index 17b6a0661f..1cc0fc691d 100644 --- a/variants/ebyte_eora_hub/platformio.ini +++ b/variants/ebyte_eora_hub/platformio.ini @@ -14,13 +14,14 @@ build_flags = -D P_LORA_MOSI=10 -D P_LORA_MISO=11 -D P_LORA_RESET=12 - -D P_LORA_DIO_9=13 -D P_LORA_BUSY=13 - -D P_LORA_DIO_1=14 + -D P_LORA_DIO_9=14 + -D P_LORA_DIO_1=-1 -D LR11X0_DIO3_TCXO_VOLTAGE=1.8 -D RF_SWITCH_TABLE -D LORA_TX_POWER=22 -D DISPLAY_CLASS=SSD1306Display + -D PIN_OLED_RESET=21 -D PIN_BOARD_SDA=18 -D PIN_BOARD_SCL=17 -D PIN_VBAT_READ=1