Merge upstream/dev into mqtt-bridge-implementation-flex

Pick up 97 commits from upstream/dev, resolving conflicts in
CommonCLI prefs layout, board definitions, docs, and T-Beam Supreme
platformio config.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
agessamanandCursor committed 2026-06-06 09:29:16 -07:00
commit dcc8f826db
78 files changed
+1220 -828

No files matched your search

+10 -6
View File
@@ -17,12 +17,12 @@ public:
esp_reset_reason_t reason = esp_reset_reason();
if (reason == ESP_RST_DEEPSLEEP) {
long wakeup_source = esp_sleep_get_ext1_wakeup_status();
if (wakeup_source & (1 << P_LORA_DIO_1)) { // received a LoRa packet (while in deep sleep)
if (wakeup_source & (1 << P_LORA_DIO_0)) { // received a LoRa packet (while in deep sleep)
startup_reason = BD_STARTUP_RX_PACKET;
}
rtc_gpio_hold_dis((gpio_num_t)P_LORA_NSS);
rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_1);
rtc_gpio_deinit((gpio_num_t)P_LORA_DIO_0);
}
}
@@ -30,15 +30,15 @@ public:
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
// Make sure the DIO1 and NSS GPIOs are hold on required levels during deep sleep
rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_1, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_1);
rtc_gpio_set_direction((gpio_num_t)P_LORA_DIO_0, RTC_GPIO_MODE_INPUT_ONLY);
rtc_gpio_pulldown_en((gpio_num_t)P_LORA_DIO_0);
rtc_gpio_hold_en((gpio_num_t)P_LORA_NSS);
if (pin_wake_btn < 0) {
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_0), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet
} else {
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_1) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn
esp_sleep_enable_ext1_wakeup( (1L << P_LORA_DIO_0) | (1L << pin_wake_btn), ESP_EXT1_WAKEUP_ANY_HIGH); // wake up on: recv LoRa packet OR wake btn
}
if (secs > 0) {
@@ -64,4 +64,8 @@ public:
const char* getManufacturerName() const override {
return "Heltec V2";
}
uint32_t getIRQGpio() override {
return P_LORA_DIO_0; // default for SX1276
}
};
+3 -3
View File
@@ -7,10 +7,10 @@ build_flags =
-D HELTEC_LORA_V2
-D RADIO_CLASS=CustomSX1276
-D WRAPPER_CLASS=CustomSX1276Wrapper
-D P_LORA_DIO_1=26
-D P_LORA_DIO_0=26
-D P_LORA_DIO_1=35
-D P_LORA_NSS=18
-D P_LORA_RESET=RADIOLIB_NC
-D P_LORA_BUSY=RADIOLIB_NC
-D P_LORA_RESET=14
-D P_LORA_SCLK=5
-D P_LORA_MISO=19
-D P_LORA_MOSI=27
+2 -2
View File
@@ -5,9 +5,9 @@ HeltecV2Board board;
#if defined(P_LORA_SCLK)
static SPIClass spi;
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY, spi);
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1, spi);
#else
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_1, P_LORA_RESET, P_LORA_BUSY);
RADIO_CLASS radio = new Module(P_LORA_NSS, P_LORA_DIO_0, P_LORA_RESET, P_LORA_DIO_1);
#endif
WRAPPER_CLASS radio_driver(radio, board);
@@ -0,0 +1,10 @@
#pragma once
#include <helpers/ESP32Board.h>
class LilygoT3S3SX1276Board : public ESP32Board {
public:
uint32_t getIRQGpio() override {
return P_LORA_DIO_0; // default for SX1276
}
};
+1 -1
View File
@@ -1,7 +1,7 @@
#include <Arduino.h>
#include "target.h"
ESP32Board board;
LilygoT3S3SX1276Board board;
#if defined(P_LORA_SCLK)
static SPIClass spi;
+2 -2
View File
@@ -3,7 +3,7 @@
#define RADIOLIB_STATIC_ONLY 1
#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <helpers/ESP32Board.h>
#include <LilygoT3S3SX1276Board.h>
#include <helpers/radiolib/CustomSX1276Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
@@ -12,7 +12,7 @@
#include <helpers/ui/MomentaryButton.h>
#endif
extern ESP32Board board;
extern LilygoT3S3SX1276Board board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern SensorManager sensors;
@@ -5,6 +5,13 @@ build_flags =
${esp32_base.build_flags}
-I variants/lilygo_tbeam_SX1262
-D TBEAM_SX1262
-D P_LORA_DIO_0=26
-D P_LORA_DIO_1=33
-D P_LORA_NSS=18
-D P_LORA_RESET=23
-D P_LORA_SCLK=5
-D P_LORA_MISO=19
-D P_LORA_MOSI=27
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
@@ -0,0 +1,10 @@
#pragma once
#include <helpers/esp32/TBeamBoard.h>
class LilygoTBeamSX1276Board : public TBeamBoard {
public:
uint32_t getIRQGpio() override {
return P_LORA_DIO_0; // default for SX1276
}
};
@@ -5,6 +5,13 @@ build_flags =
${esp32_base.build_flags}
-I variants/lilygo_tbeam_SX1276
-D TBEAM_SX1276
-D P_LORA_DIO_0=26
-D P_LORA_DIO_1=33
-D P_LORA_NSS=18
-D P_LORA_RESET=23
-D P_LORA_SCLK=5
-D P_LORA_MISO=19
-D P_LORA_MOSI=27
-D SX127X_CURRENT_LIMIT=120
-D RADIO_CLASS=CustomSX1276
-D WRAPPER_CLASS=CustomSX1276Wrapper
+1 -1
View File
@@ -1,7 +1,7 @@
#include <Arduino.h>
#include "target.h"
TBeamBoard board;
LilygoTBeamSX1276Board board;
#if defined(P_LORA_SCLK)
static SPIClass spi;
+2 -2
View File
@@ -3,7 +3,7 @@
#define RADIOLIB_STATIC_ONLY 1
//#include <RadioLib.h>
#include <helpers/radiolib/RadioLibWrappers.h>
#include <helpers/esp32/TBeamBoard.h>
#include <LilygoTBeamSX1276Board.h>
#include <helpers/radiolib/CustomSX1276Wrapper.h>
#include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/sensors/EnvironmentSensorManager.h>
@@ -12,7 +12,7 @@
#include <helpers/ui/MomentaryButton.h>
#endif
extern TBeamBoard board;
extern LilygoTBeamSX1276Board board;
extern WRAPPER_CLASS radio_driver;
extern AutoDiscoverRTCClock rtc_clock;
extern EnvironmentSensorManager sensors;
@@ -6,6 +6,13 @@ build_flags =
-I variants/lilygo_tbeam_supreme_SX1262
-D TBEAM_SUPREME_SX1262
-D BOARD_HAS_PSRAM=1
-D P_LORA_DIO_0=26
-D P_LORA_DIO_1=33
-D P_LORA_NSS=18
-D P_LORA_RESET=23
-D P_LORA_SCLK=5
-D P_LORA_MISO=19
-D P_LORA_MOSI=27
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D USE_SX1262
+1 -1
View File
@@ -3,7 +3,7 @@
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
#include <Adafruit_Neopixel.h>
#include <Adafruit_NeoPixel.h>
// built-ins
#define VBAT_MV_PER_LSB (0.73242188F) // 3.0V ADC range and 12-bit ADC resolution = 3000mV/4096
@@ -113,6 +113,7 @@ build_flags =
build_src_filter = ${LilyGo_T-Echo_Card.build_src_filter}
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-tiny/*.cpp>
+<helpers/ui/buzzer.cpp>
lib_deps =
${LilyGo_T-Echo_Card.lib_deps}
end2endzone/NonBlockingRTTTL@^1.3.0
@@ -21,4 +21,8 @@ public:
return (2 * raw);
}
uint32_t getIRQGpio() override {
return P_LORA_DIO_0; // default for SX1276
}
};
@@ -18,7 +18,7 @@ build_flags =
-D HAS_NEOPIXEL
-D NEOPIXEL_COUNT=1
-D NEOPIXEL_DATA=21
-D NEOPIXEL_TYPE=(NEO_GRB+NEO_KHZ800)
-D NEOPIXEL_TYPE=NEO_GRB+NEO_KHZ800
-D SX126X_DIO2_AS_RF_SWITCH=true
-D SX126X_DIO3_TCXO_VOLTAGE=1.8
-D SX126X_CURRENT_LIMIT=140
@@ -159,8 +159,8 @@ lib_deps =
${nibble_screen_connect_base.lib_deps}
densaugeo/base64 @ ~1.4.0
[env:nibble_screen_connect_kiss_modem]
extends = nibble_screen_connect_base
build_src_filter = ${nibble_screen_connect_base.build_src_filter}
+<../examples/kiss_modem/>
[env:nibble_screen_connect_kiss_modem]
extends = nibble_screen_connect_base
build_src_filter = ${nibble_screen_connect_base.build_src_filter}
+<../examples/kiss_modem/>
+1
View File
@@ -91,6 +91,7 @@ build_src_filter = ${rak11310.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps = ${rak11310.lib_deps}
densaugeo/base64 @ ~1.4.0
lib_ignore = BLE
; [env:RAK_11310_companion_radio_ble]
; extends = rak11310
+6
View File
@@ -12,6 +12,12 @@ VolatileRTCClock fallback_clock;
AutoDiscoverRTCClock rtc_clock(fallback_clock);
SensorManager sensors;
bool radio_init() {
rtc_clock.begin(Wire);
return radio.std_init(&SPI1);
}
void radio_set_tx_power(int8_t dbm) {
radio.setOutputPower(dbm);
}
+15
View File
@@ -0,0 +1,15 @@
Import('env')
import os
# Bosch has a goof in their PlatformIO packaging making linking fail.
# The BSEC library's extra_script.py selects cortex-m4/libalgobsec.a (soft-float ABI).
# nRF52840 compiles with -mfloat-abi=hard, requiring the fpv4-sp-d16-hard blob.
# Workaround to prepend the hard-float path so the linker finds it before the
# soft-float one.
bsec_hard = os.path.join(
env.subst('$PROJECT_DIR'),
'.pio', 'libdeps', env.subst('$PIOENV'),
'BSEC Software Library', 'src',
'cortex-m4', 'fpv4-sp-d16-hard'
)
env.Prepend(LIBPATH=[bsec_hard])
+5
View File
@@ -2,6 +2,8 @@
extends = nrf52_base
board = rak4631
board_check = true
extra_scripts = ${nrf52_base.extra_scripts}
post:variants/rak4631/fix_bsec_lib.py
build_flags = ${nrf52_base.build_flags}
${sensor_base.build_flags}
-I variants/rak4631
@@ -21,6 +23,8 @@ build_flags = ${nrf52_base.build_flags}
-D SX126X_CURRENT_LIMIT=140
-D SX126X_RX_BOOSTED_GAIN=1
-D ENV_INCLUDE_RAK12035=1
-UENV_INCLUDE_BME680
-D ENV_INCLUDE_BME680_BSEC=1
build_src_filter = ${nrf52_base.build_src_filter}
+<../variants/rak4631>
+<helpers/sensors>
@@ -31,6 +35,7 @@ lib_deps =
${sensor_base.lib_deps}
adafruit/Adafruit SSD1306 @ ^2.5.13
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.27
boschsensortec/BSEC Software Library @ ^1.8.1492
[env:RAK_4631_repeater]
extends = rak4631
+6 -6
View File
@@ -96,28 +96,28 @@ build_flags =
-D OFFLINE_QUEUE_SIZE=256
-D PIN_GPS_EN=34
; -D MESH_PACKET_LOGGING=1
-D MESH_DEBUG=1
; -D MESH_DEBUG=1
build_src_filter = ${rak_wismesh_tag.build_src_filter}
+<helpers/ui/buzzer.cpp>
+<helpers/nrf52/SerialBLEInterface.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-orig/*.cpp>
lib_deps =
${rak4631.lib_deps}
${rak_wismesh_tag.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0
[env:RAK_WisMesh_Tag_sensor]
extends = rak4631
extends = rak_wismesh_tag
build_flags =
${rak4631.build_flags}
${rak_wismesh_tag.build_flags}
-D ADVERT_NAME='"RAK WM Sensor"'
-D ADVERT_LAT=0.0
-D ADVERT_LON=0.0
-D ADMIN_PASSWORD='"password"'
; -D MESH_PACKET_LOGGING=1
-D MESH_DEBUG=1
build_src_filter = ${rak4631.build_src_filter}
; -D MESH_DEBUG=1
build_src_filter = ${rak_wismesh_tag.build_src_filter}
+<../examples/simple_sensor>
[env:RAK_WisMesh_Tag_kiss_modem]
+1 -1
View File
@@ -1,6 +1,5 @@
[rpi_picow]
extends = rp2040_base
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipicow
board_build.core = earlephilhower
board_build.filesystem_size = 0.5m
@@ -65,6 +64,7 @@ build_src_filter = ${rpi_picow.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps = ${rpi_picow.lib_deps}
densaugeo/base64 @ ~1.4.0
lib_ignore = BLE
; [env:PicoW_companion_radio_ble]
; extends = rpi_picow
+1
View File
@@ -13,6 +13,7 @@ build_flags = ${nrf52_base.build_flags}
-D USER_BTN_PRESSED=HIGH
-D PIN_STATUS_LED=24
-D RADIO_CLASS=CustomLR1110
-D USE_LR1110
-D WRAPPER_CLASS=CustomLR1110Wrapper
-D LORA_TX_POWER=22
-D RF_SWITCH_TABLE
+7 -3
View File
@@ -34,7 +34,6 @@ build_flags = ${esp32_base.build_flags}
build_src_filter = ${esp32_base.build_src_filter}
+<helpers/ui/SH1106Display.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<../variants/thinknode_m2>
lib_deps = ${esp32_base.lib_deps}
adafruit/Adafruit SH110X @ ~2.1.13
@@ -144,6 +143,7 @@ build_flags =
build_src_filter = ${ThinkNode_M2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
@@ -162,6 +162,7 @@ build_flags =
build_src_filter = ${ThinkNode_M2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
@@ -183,6 +184,7 @@ build_flags =
build_src_filter = ${ThinkNode_M2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
@@ -197,18 +199,20 @@ build_flags =
-I examples/companion_radio/ui-new
-D MAX_CONTACTS=350
-D MAX_GROUP_CHANNELS=40
-D SERIAL_TX=D6
-D SERIAL_RX=D7
-D SERIAL_TX=43
-D SERIAL_RX=44
; -D MESH_PACKET_LOGGING=1
; -D MESH_DEBUG=1
build_src_filter = ${ThinkNode_M2.build_src_filter}
+<helpers/esp32/*.cpp>
+<helpers/ui/MomentaryButton.cpp>
+<helpers/ui/buzzer.cpp>
+<../examples/companion_radio/*.cpp>
+<../examples/companion_radio/ui-new/*.cpp>
lib_deps =
${ThinkNode_M2.lib_deps}
densaugeo/base64 @ ~1.4.0
end2endzone/NonBlockingRTTTL@^1.3.0
[env:ThinkNode_M2_kiss_modem]
extends = ThinkNode_M2
@@ -90,6 +90,7 @@ build_src_filter = ${waveshare_rp2040_lora.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps = ${waveshare_rp2040_lora.lib_deps}
densaugeo/base64 @ ~1.4.0
lib_ignore = BLE
; [env:waveshare_rp2040_lora_companion_radio_ble]
; extends = waveshare_rp2040_lora
+1
View File
@@ -67,6 +67,7 @@ build_src_filter = ${Xiao_rp2040.build_src_filter}
+<../examples/companion_radio/*.cpp>
lib_deps = ${Xiao_rp2040.lib_deps}
densaugeo/base64 @ ~1.4.0
lib_ignore = BLE
; [env:Xiao_rp2040_companion_radio_ble]
; extends = Xiao_rp2040
+6 -1
View File
@@ -151,4 +151,9 @@ build_flags =
; -D MESH_DEBUG=1
lib_deps =
${Xiao_S3.lib_deps}
${esp32_ota.lib_deps}
${esp32_ota.lib_deps}
[env:Xiao_S3_kiss_modem]
extends = Xiao_S3
build_src_filter = ${Xiao_S3.build_src_filter}
+<../examples/kiss_modem/>