From 8908805894b73ea70b9de46000e34f0378ec556d Mon Sep 17 00:00:00 2001 From: GUVWAF <78759985+GUVWAF@users.noreply.github.com> Date: Wed, 28 May 2025 01:10:14 +0200 Subject: [PATCH 1/2] Don't cancel sending ReTx for relayer if we're ROUTER(_LATE)/REPEATER (#6904) Co-authored-by: Ben Meadors --- src/mesh/NextHopRouter.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesh/NextHopRouter.cpp b/src/mesh/NextHopRouter.cpp index f21974a2e..860250f75 100644 --- a/src/mesh/NextHopRouter.cpp +++ b/src/mesh/NextHopRouter.cpp @@ -165,10 +165,15 @@ bool NextHopRouter::stopRetransmission(GlobalPacketId key) /* Only when we already transmitted a packet via LoRa, we will cancel the packet in the Tx queue to avoid canceling a transmission if it was ACKed super fast via MQTT */ if (old->numRetransmissions < NUM_RELIABLE_RETX - 1) { - // remove the 'original' (identified by originator and packet->id) from the txqueue and free it - cancelSending(getFrom(p), p->id); - // now free the pooled copy for retransmission too - packetPool.release(p); + // We only cancel it if we are the original sender or if we're not a router(_late)/repeater + if (isFromUs(p) || (config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER && + config.device.role != meshtastic_Config_DeviceConfig_Role_REPEATER && + config.device.role != meshtastic_Config_DeviceConfig_Role_ROUTER_LATE)) { + // remove the 'original' (identified by originator and packet->id) from the txqueue and free it + cancelSending(getFrom(p), p->id); + // now free the pooled copy for retransmission too + packetPool.release(p); + } } auto numErased = pending.erase(key); assert(numErased == 1); From 96c18d990880b82fb9d391a558e50696a0c9001d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 28 May 2025 01:11:32 +0200 Subject: [PATCH 2/2] Add LINK32 (Lilygo) Board with Light+Environment sensors (#6899) * Add LINK32 (Lilygo) Board with Light+Environment sensors TODO: replace PRIVATE_HW with actual HWID * Add LINK32 (Lilygo) Board with Light+Environment sensors TODO: replace PRIVATE_HW with actual HWID * Update to real HWID and trunk fmt --- .trunk/trunk.yaml | 7 +++-- src/platform/esp32/architecture.h | 2 ++ variants/link32_s3_v1/pins_arduino.h | 19 +++++++++++++ variants/link32_s3_v1/platformio.ini | 11 ++++++++ variants/link32_s3_v1/variant.h | 42 ++++++++++++++++++++++++++++ 5 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 variants/link32_s3_v1/pins_arduino.h create mode 100644 variants/link32_s3_v1/platformio.ini create mode 100644 variants/link32_s3_v1/variant.h diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 91bdf11cb..162fdfd2d 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,11 +4,12 @@ cli: plugins: sources: - id: trunk - ref: v1.6.8 + ref: v1.7.0 uri: https://github.com/trunk-io/plugins lint: enabled: - - renovate@40.0.6 + - checkov@3.2.435 + - renovate@40.32.7 - prettier@3.5.3 - trufflehog@3.88.34 - yamllint@1.37.1 @@ -37,7 +38,7 @@ runtimes: enabled: - python@3.10.8 - go@1.21.0 - - node@18.20.5 + - node@22.16.0 actions: disabled: - trunk-announce diff --git a/src/platform/esp32/architecture.h b/src/platform/esp32/architecture.h index 68d06c6d7..3763bce1e 100644 --- a/src/platform/esp32/architecture.h +++ b/src/platform/esp32/architecture.h @@ -184,6 +184,8 @@ #define HW_VENDOR meshtastic_HardwareModel_HELTEC_SENSOR_HUB #elif defined(ELECROW_PANEL) #define HW_VENDOR meshtastic_HardwareModel_CROWPANEL +#elif defined(LINK_32) +#define HW_VENDOR meshtastic_HardwareModel_LINK_32 #endif // ----------------------------------------------------------------------------- diff --git a/variants/link32_s3_v1/pins_arduino.h b/variants/link32_s3_v1/pins_arduino.h new file mode 100644 index 000000000..010e5bf2e --- /dev/null +++ b/variants/link32_s3_v1/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// The default Wire will be mapped to PMU and RTC +static const uint8_t SDA = 47; +static const uint8_t SCL = 48; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 21; +static const uint8_t MOSI = 34; +static const uint8_t MISO = 33; +static const uint8_t SCK = 16; + +#endif /* Pins_Arduino_h */ diff --git a/variants/link32_s3_v1/platformio.ini b/variants/link32_s3_v1/platformio.ini new file mode 100644 index 000000000..5a614a7af --- /dev/null +++ b/variants/link32_s3_v1/platformio.ini @@ -0,0 +1,11 @@ +[env:link32-s3-v1] +extends = esp32s3_base +board = esp32-s3-devkitc-1 +build_flags = + ${esp32_base.build_flags} -D LINK_32 -I variants/link32_s3_v1 + -DGPS_POWER_TOGGLE ; comment this line to disable triple press function on the user button to turn off gps entirely. + -DARDUINO_USB_CDC_ON_BOOT + -DARDUINO_USB_MODE=1 + -DRADIOLIB_EXCLUDE_SX128X=1 + -DRADIOLIB_EXCLUDE_SX127X=1 + -DRADIOLIB_EXCLUDE_LR11X0=1 diff --git a/variants/link32_s3_v1/variant.h b/variants/link32_s3_v1/variant.h new file mode 100644 index 000000000..1f8a7435a --- /dev/null +++ b/variants/link32_s3_v1/variant.h @@ -0,0 +1,42 @@ +#define BATTERY_PIN 15 +#define ADC_CHANNEL ADC2_GPIO15_CHANNEL // ADC channel for battery voltage measurement +#define BATTERY_SENSE_SAMPLES 30 +#define BAT_MEASURE_ADC_UNIT 2 // Use ADC2 for battery measurement + +#define USE_SSD1306 + +#define BUTTON_PIN 0 // Button pin for this board +#define BUTTON_PIN_ALT 36 + +#define HAS_NEOPIXEL // If defined, we will use the neopixel library +#define NEOPIXEL_DATA 35 // Neopixel pin for this board +#define NEOPIXEL_COUNT 1 // Number of neopixels on this board +#define NEOPIXEL_TYPE (NEO_GRB + NEO_KHZ800) // type of neopixels in use + +#define ADC_MULTIPLIER 2 + +#define I2C_SDA 47 // I2C pins for this board +#define I2C_SCL 48 + +#define USE_SX1262 + +#define LORA_SCK 16 +#define LORA_MISO 33 +#define LORA_MOSI 34 +#define LORA_CS 21 +#define LORA_RESET 18 + +#define LORA_DIO0 12 // a No connect on the SX1262 module +#define LORA_DIO1 13 +#define LORA_DIO2 14 // Not really used + +#define LORA_TCXO_GPIO 17 + +#define TCXO_OPTIONAL + +#define SX126X_CS LORA_CS +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 1.8