From 15b474172a922a1c80769e75af1b15fb27f4061e Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Wed, 21 Jan 2026 17:33:50 +0800 Subject: [PATCH 001/150] Added compatibility with LilyGo T-Deck-Pro V1.1 --- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 27 +++- src/graphics/EInkDisplay2.cpp | 3 + src/main.cpp | 4 + .../extra_variants/t_deck_pro/variant.cpp | 116 +++++++++++++++++- .../esp32s3/t-deck-pro-v1_1/pins_arduino.h | 19 +++ .../esp32s3/t-deck-pro-v1_1/platformio.ini | 41 +++++++ variants/esp32s3/t-deck-pro-v1_1/variant.h | 106 ++++++++++++++++ 8 files changed, 312 insertions(+), 7 deletions(-) create mode 100644 variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h create mode 100644 variants/esp32s3/t-deck-pro-v1_1/platformio.ini create mode 100644 variants/esp32s3/t-deck-pro-v1_1/variant.h diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index dffcd8fb6..7b6fdc7a2 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -88,7 +88,8 @@ class ScanI2C BH1750, DA217, CHSC6X, - CST226SE + CST226SE, + CST3530, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index c6ef34846..cb20a85c7 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -508,8 +508,33 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(DFROBOT_RAIN_ADDR, DFROBOT_RAIN, "DFRobot Rain Gauge", (uint8_t)addr.address); SCAN_SIMPLE_CASE(LTR390UV_ADDR, LTR390UV, "LTR390UV", (uint8_t)addr.address); SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); + case CST328_ADDR: - // Do we have the CST328 or the CST226SE + // Do we have the CST328 or the CST226SE,CST3530 + { + // T-Deck pro V1.1 new touch panel use CST3530 + int retry = 5; + while(retry--) { + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(r_cmd, sizeof(r_cmd)); + if(i2cBus->endTransmission() == 0){ + i2cBus->requestFrom((int)addr.address,7); + i2cBus->readBytes(buffer,7); + if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + logFoundDevice("CST3530", (uint8_t)addr.address); + type = CST3530; + break; + } + } + uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(cmd1, sizeof(cmd1)); + i2cBus->endTransmission(); + delay(50); + } + } registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1); if (registerValue == 0xA9) { type = CST226SE; diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 1678da793..6f53a56b9 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -104,8 +104,11 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) // End the update process - virtual method, overriden in derived class void EInkDisplay::endUpdate() { +#ifndef EINK_NOT_HIBERNATE // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) adafruitDisplay->hibernate(); +#endif + } // Write the buffer to the display memory diff --git a/src/main.cpp b/src/main.cpp index c1096a240..d28dbb809 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -413,6 +413,10 @@ void setup() digitalWrite(SDCARD_CS, HIGH); pinMode(PIN_EINK_CS, OUTPUT); digitalWrite(PIN_EINK_CS, HIGH); + pinMode(PIN_EINK_RES, OUTPUT); + digitalWrite(PIN_EINK_RES, HIGH); + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); #elif defined(T_LORA_PAGER) pinMode(LORA_CS, OUTPUT); digitalWrite(LORA_CS, HIGH); diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index eae9335ce..77fba53b9 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -8,20 +8,126 @@ CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, CST328_PIN_INT); +static bool is_cst3530 = false; +volatile bool touch_isr = false; +#define CST3530_ADDR 0x1A + +bool read_cst3530_touch(int16_t *x, int16_t *y) { + uint8_t buffer[9] = {0}; + uint8_t r_cmd[] = {0xD0, 0x07, 0x00, 0x00}; + uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 I2C send addr failed"); + return false; + } + + int read_len = Wire.requestFrom((int)CST3530_ADDR, sizeof(buffer)); + if (read_len != sizeof(buffer)) { + LOG_DEBUG("CST3530 read len error: %d (expect 9)", read_len); + return false; + } + int actual_read = Wire.readBytes(buffer, sizeof(buffer)); + if (actual_read != sizeof(buffer)) { + LOG_DEBUG("CST3530 read bytes error: %d (expect 9)", actual_read); + return false; + } + + uint8_t report_typ = buffer[2]; + if (report_typ != 0xFF) { + return false; + } + + uint8_t touch_points = buffer[3] & 0x0F; + if (touch_points == 0 || touch_points > 1) { + LOG_DEBUG("CST3530 touch points invalid: %d", touch_points); + return false; + } + + *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); + *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); + + // LOG_DEBUG("CST3530 touch: num:%d x=%d,y=%d", touch_points, *x, *y); + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(clear_cmd, sizeof(clear_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 clear cmd failed"); + } + + return true; +} + bool readTouch(int16_t *x, int16_t *y) { - if (tsPanel.getTouches()) { - *x = tsPanel.getPoint(0).x; - *y = tsPanel.getPoint(0).y; - return true; + + if(is_cst3530){ + if(touch_isr){ + touch_isr = false; + return read_cst3530_touch(x, y); + } + return false; + }else{ + if (tsPanel.getTouches()) { + *x = tsPanel.getPoint(0).x; + *y = tsPanel.getPoint(0).y; + return true; + } } return false; } + +static void touchInterruptHandler(){ + touch_isr = true; +} + // T-Deck Pro specific init void lateInitVariant() { - tsPanel.begin(); + // Reset touch + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + digitalWrite(CST328_PIN_RST, LOW); + delay(80); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + + int retry = 5; + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + + // Probe touch chip + while(retry--) { + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if(Wire.endTransmission() == 0){ + Wire.requestFrom((int)CST3530_ADDR,7); + Wire.readBytes(buffer,7); + if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + LOG_DEBUG("CST3530 detected"); + is_cst3530 = true; + + // The CST3530 will automatically enter sleep mode; + // polling should not be used, but rather an interrupt method should be employed. + pinMode(CST328_PIN_INT, INPUT); + attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchInterruptHandler, FALLING); + + break; + }else{ + LOG_DEBUG("CST3530 not response ~!"); + } + } + uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + Wire.beginTransmission(CST3530_ADDR); + Wire.write(cmd1, sizeof(cmd1)); + Wire.endTransmission(); + delay(50); + } + touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch); touchScreenImpl1->init(); } diff --git a/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h new file mode 100644 index 000000000..af0ba80b3 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// used for keyboard, touch controller, beam sensor, and gyroscope +static const uint8_t SDA = 13; +static const uint8_t SCL = 14; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 3; +static const uint8_t MOSI = 33; +static const uint8_t MISO = 47; +static const uint8_t SCK = 36; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini new file mode 100644 index 000000000..b76522934 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -0,0 +1,41 @@ +[env:t-deck-pro-v1_1] +custom_meshtastic_hw_model = 102 +custom_meshtastic_hw_model_slug = T_DECK_PRO +custom_meshtastic_architecture = esp32-s3 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = LILYGO T-Deck Pro +custom_meshtastic_images = tdeck_pro.svg +custom_meshtastic_tags = LilyGo +custom_meshtastic_requires_dfu = true +custom_meshtastic_partition_scheme = 16MB + +extends = esp32s3_base +board = t-deck-pro +board_check = true +upload_protocol = esptool + +build_flags = + ${esp32s3_base.build_flags} -I variants/esp32s3/t-deck-pro-v1_1 + -D T_DECK_PRO + -D USE_EINK + -D EINK_DISPLAY_MODEL=GxEPD2_310_GDEQ031T10 + -D EINK_WIDTH=240 + -D EINK_HEIGHT=320 + ;-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted + -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -D EINK_NOT_HIBERNATE ; Disable hibernate to avoid issues with elink + +lib_deps = + ${esp32s3_base.lib_deps} + # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 + zinggjm/GxEPD2@1.6.5 + # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main + https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip + # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 + https://github.com/CIRCUITSTATE/CSE_CST328/archive/refs/tags/v0.0.4.zip + # renovate: datasource=git-refs depName=BQ27220 packageName=https://github.com/mverch67/BQ27220 gitBranch=main + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip + # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library + adafruit/Adafruit DRV2605 Library@1.2.4 diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h new file mode 100644 index 000000000..8584fd8a1 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -0,0 +1,106 @@ +// Display (E-Ink) +#define PIN_EINK_CS 34 +#define PIN_EINK_BUSY 37 +#define PIN_EINK_DC 35 +#define PIN_EINK_RES 16 +#define PIN_EINK_SCLK 36 +#define PIN_EINK_MOSI 47 +#define TFT_BL 45 // option , default not backlight + +#define I2C_SDA SDA +#define I2C_SCL SCL + +// CST328 touch screen (implementation in src/platform/extra_variants/t_deck_pro/variant.cpp) +#define HAS_TOUCHSCREEN 1 +#define CST328_PIN_INT 12 +#define CST328_PIN_RST 38 + +#define USE_POWERSAVE +#define SLEEP_TIME 120 + +// GNNS +#define HAS_GPS 1 +#define GPS_BAUDRATE 38400 +#define PIN_GPS_EN 39 +#define GPS_EN_ACTIVE 1 +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 +#define PIN_GPS_PPS 1 + +#define BUTTON_PIN 0 + +// vibration motor +#define HAS_DRV2605 +#define PIN_DRV_EN 2 + +// Have SPI interface SD card slot +#define HAS_SDCARD +#define SDCARD_USE_SPI1 +#define SPI_MOSI (33) +#define SPI_SCK (36) +#define SPI_MISO (47) +#define SPI_CS (48) +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// TCA8418 keyboard +#define KB_BL_PIN 42 +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// microphone PCM5102A +#define PCM5102A_SCK 47 +#define PCM5102A_DIN 17 +#define PCM5102A_LRCK 18 + +// LTR_553ALS light sensor +#define HAS_LTR553ALS + +// gyroscope BHI260AP +// #define BOARD_1V8_EN 38 //Deck-Pro remove 1.8v en pin +#define HAS_BHI260AP + +// battery charger BQ25896 +#define HAS_PPM 1 +#define XPOWERS_CHIP_BQ25896 + +// battery quality management BQ27220 +#define HAS_BQ27220 1 +#define BQ27220_I2C_SDA SDA +#define BQ27220_I2C_SCL SCL +#define BQ27220_DESIGN_CAPACITY 1400 + +// LoRa +#define USE_SX1262 +#define USE_SX1268 + +#define LORA_EN 46 // LoRa enable pin +#define LORA_SCK 36 +#define LORA_MISO 47 +#define LORA_MOSI 33 +#define LORA_CS 3 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 4 +#define LORA_DIO1 5 // SX1262 IRQ +#define LORA_DIO2 6 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 2.4 +// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) + +#define MODEM_POWER_EN 41 +#define MODEM_PWRKEY 40 +#define MODEM_RST 9 +#define MODEM_RI 7 +#define MODEM_DTR 8 +#define MODEM_RX 10 +#define MODEM_TX 11 + +#define HAS_PHYSICAL_KEYBOARD 1 \ No newline at end of file From c4bac04be3065758fad25fd5a9a9726987e46f7c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 25 Mar 2026 17:52:02 -0500 Subject: [PATCH 002/150] Exclude web server, paxcounter and few others from original ESP32 generation to fix IRAM overflow (#10005) * Exclude web server, paxcounter and few others from original ESP32 generation to fix IRAM overflow * Update variants/esp32/esp32.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update variants/esp32/esp32.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update build source filter in esp32.ini Removed WiFiAPClient.cpp from build source filter. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/mesh/http/WebServer.h | 19 +++++++++++++++++++ variants/esp32/esp32.ini | 20 ++++++++++++-------- variants/esp32/station-g1/platformio.ini | 3 +++ 3 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/mesh/http/WebServer.h b/src/mesh/http/WebServer.h index e7a29a5a7..762afc618 100644 --- a/src/mesh/http/WebServer.h +++ b/src/mesh/http/WebServer.h @@ -5,6 +5,8 @@ #include #include +#if !MESHTASTIC_EXCLUDE_WEBSERVER + void initWebServer(); void createSSLCert(); @@ -24,3 +26,20 @@ class WebServerThread : private concurrency::OSThread }; extern WebServerThread *webServerThread; + +#else +// Stub implementations when web server is excluded +inline void initWebServer() {} +inline void createSSLCert() {} + +class WebServerThread +{ + public: + WebServerThread() {} + uint32_t requestRestart = 0; + void markActivity() {} +}; + +inline WebServerThread *webServerThread = nullptr; + +#endif diff --git a/variants/esp32/esp32.ini b/variants/esp32/esp32.ini index e0c05896d..b19a960dc 100644 --- a/variants/esp32/esp32.ini +++ b/variants/esp32/esp32.ini @@ -4,25 +4,29 @@ extends = esp32_common custom_esp32_kind = esp32 +build_src_filter = + ${esp32_common.build_src_filter} + - + - + build_flags = ${esp32_common.build_flags} -DMESHTASTIC_EXCLUDE_AUDIO=1 -; Override lib_deps to use environmental_extra_no_bsec instead of environmental_extra -; BSEC library uses ~3.5KB DRAM which causes overflow on original ESP32 targets + -DMESHTASTIC_EXCLUDE_ACCELEROMETER=1 + -DMESHTASTIC_EXCLUDE_PAXCOUNTER=1 + -DMESHTASTIC_EXCLUDE_WEBSERVER=1 + -DMESHTASTIC_EXCLUDE_RANGETEST=1 + lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${networking_extra.lib_deps} + ${radiolib_base.lib_deps} ${environmental_base.lib_deps} ${environmental_extra_no_bsec.lib_deps} - ${radiolib_base.lib_deps} - # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master - https://github.com/meshtastic/esp32_https_server/archive/b78f12c86ea65c3ca08968840ff554ff7ed69b60.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 - # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master - https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip # renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib https://github.com/lewisxhe/XPowersLib/archive/v0.3.3.zip # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto - rweather/Crypto@0.4.0 \ No newline at end of file + rweather/Crypto@0.4.0 diff --git a/variants/esp32/station-g1/platformio.ini b/variants/esp32/station-g1/platformio.ini index fad003b20..b1f3e15f3 100644 --- a/variants/esp32/station-g1/platformio.ini +++ b/variants/esp32/station-g1/platformio.ini @@ -10,6 +10,9 @@ custom_meshtastic_tags = B&Q extends = esp32_base board = ttgo-t-beam +build_unflags = + ${esp32_common.build_unflags} + -DBOARD_HAS_PSRAM build_flags = ${esp32_base.build_flags} -D STATION_G1 From 5a009889cce8d6971e020d11ea140201ab288d1f Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 25 Mar 2026 19:27:48 -0400 Subject: [PATCH 003/150] Deps: Cleanup LewisHe library references (#10007) We cache and dedupe our dependencies, referring to them with multiple methods/urls is just noise. ``` lewisxhe/XPowersLib@0.3.3 lewisxhe/SensorLib@0.3.4 ``` This does *not* include any updates, just a cleanup. --- variants/esp32/esp32-common.ini | 4 ++-- variants/esp32/esp32.ini | 4 ++-- variants/esp32/tbeam/platformio.ini | 2 +- variants/esp32s3/t5s3_epaper/platformio.ini | 6 ++---- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/variants/esp32/esp32-common.ini b/variants/esp32/esp32-common.ini index 701183280..21322b244 100644 --- a/variants/esp32/esp32-common.ini +++ b/variants/esp32/esp32-common.ini @@ -73,8 +73,8 @@ lib_deps = h2zero/NimBLE-Arduino@^1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip - # renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib - https://github.com/lewisxhe/XPowersLib/archive/v0.3.3.zip + # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib + lewisxhe/XPowersLib@0.3.3 # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 diff --git a/variants/esp32/esp32.ini b/variants/esp32/esp32.ini index b19a960dc..7d9b77d1d 100644 --- a/variants/esp32/esp32.ini +++ b/variants/esp32/esp32.ini @@ -26,7 +26,7 @@ lib_deps = ${environmental_extra_no_bsec.lib_deps} # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 - # renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib - https://github.com/lewisxhe/XPowersLib/archive/v0.3.3.zip + # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib + lewisxhe/XPowersLib@0.3.3 # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 diff --git a/variants/esp32/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini index dbaccee8f..26c8e9cd3 100644 --- a/variants/esp32/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -32,5 +32,5 @@ lib_deps = ${env:tbeam.lib_deps} # renovate: datasource=github-tags depName=meshtastic-st7796 packageName=meshtastic/st7796 https://github.com/meshtastic/st7796/archive/1.0.5.zip - # renovate: datasource=custom.pio depName=lewisxhe-SensorLib packageName=lewisxhe/library/SensorLib + # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib lewisxhe/SensorLib@0.3.4 diff --git a/variants/esp32s3/t5s3_epaper/platformio.ini b/variants/esp32s3/t5s3_epaper/platformio.ini index 0f1308273..8f4a02a00 100644 --- a/variants/esp32s3/t5s3_epaper/platformio.ini +++ b/variants/esp32s3/t5s3_epaper/platformio.ini @@ -23,10 +23,8 @@ build_src_filter = +<../variants/esp32s3/t5s3_epaper> lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=github-tags depName=XPowersLib packageName=lewisxhe/XPowersLib - https://github.com/lewisxhe/XPowersLib/archive/refs/tags/v0.3.3.zip - # renovate: datasource=github-tags depName=SensorLib packageName=lewisxhe/SensorLib - https://github.com/lewisxhe/SensorLib/archive/refs/tags/v0.3.4.zip + # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib + lewisxhe/SensorLib@0.3.4 https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip https://github.com/mverch67/FastEPD/archive/0df1bff329b6fc782e062f611758880762340647.zip From e7e34e86d55b2168f7e6414e197597301ba4dafe Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 26 Mar 2026 07:16:08 -0400 Subject: [PATCH 004/150] Dependencies: Remove all fuzzy-matches, spot-add renovate (#10008) --- platformio.ini | 4 ++-- variants/esp32/esp32-common.ini | 4 ++-- variants/esp32/esp32.ini | 2 +- variants/native/portduino.ini | 4 ++-- variants/nrf52840/ELECROW-ThinkNode-M4/platformio.ini | 3 ++- variants/nrf52840/t-echo-plus/platformio.ini | 4 +++- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/platformio.ini b/platformio.ini index f9add198b..2e60a16cb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -233,5 +233,5 @@ lib_deps = [environmental_extra_no_bsec] lib_deps = ${environmental_extra_common.lib_deps} - # renovate: datasource=custom.pio depName=adafruit/Adafruit BME680 Library packageName=adafruit/library/Adafruit BME680 - adafruit/Adafruit BME680 Library@^2.0.5 + # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library + adafruit/Adafruit BME680 Library@2.0.5 diff --git a/variants/esp32/esp32-common.ini b/variants/esp32/esp32-common.ini index 21322b244..bf8459f24 100644 --- a/variants/esp32/esp32-common.ini +++ b/variants/esp32/esp32-common.ini @@ -8,7 +8,7 @@ platform = platformio/espressif32@6.13.0 platform_packages = # renovate: datasource=custom.pio depName=platformio/tool-mklittlefs packageName=platformio/tool/tool-mklittlefs - platformio/tool-mklittlefs@^1.203.210628 + platformio/tool-mklittlefs@1.203.210628 extra_scripts = ${env.extra_scripts} @@ -70,7 +70,7 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master https://github.com/meshtastic/esp32_https_server/archive/b78f12c86ea65c3ca08968840ff554ff7ed69b60.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino - h2zero/NimBLE-Arduino@^1.4.3 + h2zero/NimBLE-Arduino@1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib diff --git a/variants/esp32/esp32.ini b/variants/esp32/esp32.ini index 7d9b77d1d..f40f1d064 100644 --- a/variants/esp32/esp32.ini +++ b/variants/esp32/esp32.ini @@ -25,7 +25,7 @@ lib_deps = ${environmental_base.lib_deps} ${environmental_extra_no_bsec.lib_deps} # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino - h2zero/NimBLE-Arduino@^1.4.3 + h2zero/NimBLE-Arduino@1.4.3 # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@0.3.3 # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 17828f6f6..407e144b7 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -34,8 +34,8 @@ lib_deps = adafruit/Adafruit seesaw Library@1.7.9 # renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip - # renovate: datasource=custom.pio depName=adafruit/Adafruit BME680 Library packageName=adafruit/library/Adafruit BME680 - adafruit/Adafruit BME680 Library@^2.0.5 + # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library + adafruit/Adafruit BME680 Library@2.0.5 build_flags = ${arduino_base.build_flags} diff --git a/variants/nrf52840/ELECROW-ThinkNode-M4/platformio.ini b/variants/nrf52840/ELECROW-ThinkNode-M4/platformio.ini index 9a2b3a467..f96e6038c 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M4/platformio.ini +++ b/variants/nrf52840/ELECROW-ThinkNode-M4/platformio.ini @@ -12,4 +12,5 @@ build_flags = ${nrf52840_base.build_flags} build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ELECROW-ThinkNode-M4> lib_deps = ${nrf52840_base.lib_deps} - lewisxhe/PCF8563_Library@^1.0.1 + # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library + lewisxhe/PCF8563_Library@1.0.1 diff --git a/variants/nrf52840/t-echo-plus/platformio.ini b/variants/nrf52840/t-echo-plus/platformio.ini index b77d54748..9ec9187e8 100644 --- a/variants/nrf52840/t-echo-plus/platformio.ini +++ b/variants/nrf52840/t-echo-plus/platformio.ini @@ -22,5 +22,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/t-echo- lib_deps = ${nrf52840_base.lib_deps} https://github.com/meshtastic/GxEPD2/archive/55f618961db45a23eff0233546430f1e5a80f63a.zip - lewisxhe/PCF8563_Library@^1.0.1 + # renovate: datasource=custom.pio depName=PCF8563 packageName=lewisxhe/library/PCF8563_Library + lewisxhe/PCF8563_Library@1.0.1 + # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library adafruit/Adafruit DRV2605 Library@1.2.4 From 3b29eea5775c6e73e550f9244b3a14cbe66d0f01 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 26 Mar 2026 06:45:48 -0500 Subject: [PATCH 005/150] Update Adafruit_BME680 to v2.0.6 (#10009) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- variants/native/portduino.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 2e60a16cb..2fcfc480d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -234,4 +234,4 @@ lib_deps = lib_deps = ${environmental_extra_common.lib_deps} # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library - adafruit/Adafruit BME680 Library@2.0.5 + adafruit/Adafruit BME680 Library@2.0.6 diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 407e144b7..a247b0af1 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -35,7 +35,7 @@ lib_deps = # renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library - adafruit/Adafruit BME680 Library@2.0.5 + adafruit/Adafruit BME680 Library@2.0.6 build_flags = ${arduino_base.build_flags} From 3d4f0b895b06e6f590310f4da47c0426bfea0074 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 06:35:56 -0500 Subject: [PATCH 006/150] Upgrade trunk (#9978) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 0385ffd6a..5ecc0aeba 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.510 - - renovate@43.84.0 + - checkov@3.2.511 + - renovate@43.92.1 - prettier@3.8.1 - - trufflehog@3.93.8 + - trufflehog@3.94.1 - yamllint@1.38.0 - bandit@1.9.4 - trivy@0.69.3 - taplo@0.10.0 - - ruff@0.15.7 + - ruff@0.15.8 - isort@8.0.1 - markdownlint@0.48.0 - oxipng@10.1.0 @@ -28,7 +28,7 @@ lint: - shellcheck@0.11.0 - black@26.3.1 - git-diff-check - - gitleaks@8.30.0 + - gitleaks@8.30.1 - clang-format@16.0.3 ignore: - linters: [ALL] From 993c2422025cb6f1ac9123cb689b2cbd3b0778f6 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Fri, 27 Mar 2026 11:52:00 +0000 Subject: [PATCH 007/150] Supporting STM32WL is like squeezing blood from a stone (#10015) --- variants/stm32/stm32.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/stm32/stm32.ini b/variants/stm32/stm32.ini index 7a3b37642..d2c155398 100644 --- a/variants/stm32/stm32.ini +++ b/variants/stm32/stm32.ini @@ -27,7 +27,7 @@ build_flags = -DMESHTASTIC_EXCLUDE_TZ=1 ; Exclude TZ to save some flash space. -DSERIAL_RX_BUFFER_SIZE=256 ; For GPS - the default of 64 is too small. -DHAS_SCREEN=0 ; Always disable screen for STM32, it is not supported. - -DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; This is REQUIRED for at least traceroute debug prints - without it the length ends up uninitialized. + ;-DPIO_FRAMEWORK_ARDUINO_NANOLIB_FLOAT_PRINTF ; Enable this if enabling debugg logging. It is REQUIRED for at least traceroute debug prints - without it the length returned by printf ends up uninitialized. -DDEBUG_MUTE ; You can #undef DEBUG_MUTE in certain source files if you need the logs. -fmerge-all-constants -ffunction-sections From 068f5af4d85cba179728355fc05c7c78136f4a92 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 27 Mar 2026 12:38:49 -0400 Subject: [PATCH 008/150] Add meshtasticd config metadata (#10001) To be consumed by config-picker utils, and hopefully meshtasticd itself in the future. --- .../OpenWRT/BananaPi-BPI-R4-sx1262.yaml | 6 +++ .../OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml | 6 +++ .../OpenWRT/OpenWRT_One_mikroBUS_sx1262.yaml | 6 +++ bin/config.d/README.md | 28 ++++++++++++ bin/config.d/display-waveshare-1-44.yaml | 6 +++ bin/config.d/display-waveshare-2.8.yaml | 6 +++ bin/config.d/lora-Adafruit-RFM9x.yaml | 6 +++ bin/config.d/lora-MeshAdv-900M30S.yaml | 6 +++ bin/config.d/lora-MeshAdv-Mini-900M22S.yaml | 6 +++ bin/config.d/lora-RAK6421-13300-slot1.yaml | 8 +++- bin/config.d/lora-RAK6421-13300-slot2.yaml | 8 +++- bin/config.d/lora-RAK6421-13302-slot1.yaml | 8 +++- bin/config.d/lora-RAK6421-13302-slot2.yaml | 8 +++- ...XO.yaml => lora-femtofox_LR1121_TCXO.yaml} | 42 ++++++++--------- ...XO.yaml => lora-femtofox_SX1262_TCXO.yaml} | 45 ++++++++++--------- ...AL.yaml => lora-femtofox_SX1262_XTAL.yaml} | 45 ++++++++++--------- bin/config.d/lora-hat-rak-6421-pi-hat.yaml | 8 +++- .../lora-lyra-picocalc-wio-sx1262.yaml | 6 +++ bin/config.d/lora-lyra-ultra_1w.yaml | 7 +++ bin/config.d/lora-lyra-ultra_2w.yaml | 7 +++ .../lora-lyra-ws-raspberry-pi-pico-hat.yaml | 6 +++ bin/config.d/lora-meshstick-1262.yaml | 6 +++ bin/config.d/lora-piggystick-lr1121.yaml | 6 +++ bin/config.d/lora-pinedio-usb-sx1262.yaml | 8 +++- ...lora-raxda-rock2f-starter-edition-hat.yaml | 6 +++ .../lora-starter-edition-sx1262-i2c.yaml | 6 +++ bin/config.d/lora-usb-meshstick-1262.yaml | 6 +++ bin/config.d/lora-usb-meshtoad-e22.yaml | 6 +++ bin/config.d/lora-usb-umesh-1262-30dbm.yaml | 6 +++ bin/config.d/lora-usb-umesh-1268-30dbm.yaml | 6 +++ bin/config.d/lora-waveshare-sxxx.yaml | 6 +++ ...a-ws-raspberry-pi-pico-to-rpi-adapter.yaml | 7 +++ ...lora-ws-raspberry-pico-to-orangepi-03.yaml | 6 +++ 33 files changed, 281 insertions(+), 68 deletions(-) create mode 100644 bin/config.d/README.md rename bin/config.d/{femtofox/femtofox_LR1121_TCXO.yaml => lora-femtofox_LR1121_TCXO.yaml} (75%) rename bin/config.d/{femtofox/femtofox_SX1262_TCXO.yaml => lora-femtofox_SX1262_TCXO.yaml} (87%) rename bin/config.d/{femtofox/femtofox_SX1262_XTAL.yaml => lora-femtofox_SX1262_XTAL.yaml} (86%) diff --git a/bin/config.d/OpenWRT/BananaPi-BPI-R4-sx1262.yaml b/bin/config.d/OpenWRT/BananaPi-BPI-R4-sx1262.yaml index 825ab2699..a854dff5b 100644 --- a/bin/config.d/OpenWRT/BananaPi-BPI-R4-sx1262.yaml +++ b/bin/config.d/OpenWRT/BananaPi-BPI-R4-sx1262.yaml @@ -1,3 +1,9 @@ +Meta: + name: BananaPi-BPI-R4-sx1262 + support: community + compatible: + - bananapi_bpi-r4 # OpenWrt target + Lora: Module: sx1262 # BananaPi-BPI-R4 SPI via 26p GPIO Header ## CS: 28 diff --git a/bin/config.d/OpenWRT/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml b/bin/config.d/OpenWRT/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml index ca5b27ebc..7687e0f58 100644 --- a/bin/config.d/OpenWRT/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml +++ b/bin/config.d/OpenWRT/OpenWRT-One-mikroBUS-LR-IOT-CLICK.yaml @@ -1,4 +1,10 @@ ## https://www.mikroe.com/lr-iot-click +Meta: + name: OpenWRT One mikroBUS LR-IOT-CLICK + support: community + compatible: + - openwrt_one # OpenWrt target + Lora: Module: lr1110 # OpenWRT ONE mikroBUS with LR-IOT-CLICK # CS: 25 diff --git a/bin/config.d/OpenWRT/OpenWRT_One_mikroBUS_sx1262.yaml b/bin/config.d/OpenWRT/OpenWRT_One_mikroBUS_sx1262.yaml index 6dc1e870d..ab0b62810 100644 --- a/bin/config.d/OpenWRT/OpenWRT_One_mikroBUS_sx1262.yaml +++ b/bin/config.d/OpenWRT/OpenWRT_One_mikroBUS_sx1262.yaml @@ -1,3 +1,9 @@ +Meta: + name: OpenWRT One mikroBUS sx1262 + support: community + compatible: + - openwrt_one # OpenWrt target + Lora: Module: sx1262 IRQ: 10 diff --git a/bin/config.d/README.md b/bin/config.d/README.md new file mode 100644 index 000000000..b199fb439 --- /dev/null +++ b/bin/config.d/README.md @@ -0,0 +1,28 @@ +# meshtasticd configuration files + +This directory contains YAML configuration files for meshtasticd. Each file describes a specific hardware configuration, including the LoRa module and pin assignments. These configurations are used by meshtasticd to correctly interface with the hardware. + +## Metadata structure + +Each configuration file includes a `Meta` section that provides information about the configuration. +This configuration is consumed by configuration-selection tools. + +```yaml +Meta: + name: MeshAdv-Pi E22-900M30S # A unique identifier for this configuration. + support: community # community, official, or deprecated; determined by Meshtastic Leads. + compatible: # A list of compatible products or platforms. + - raspberry-pi +``` +`name`: A unique identifier for the configuration, typically reflecting the hardware it supports. + +`support`: Indicates the level of support for this configuration. It can be one of the following: + +- `community`: Supported by the Meshtastic community. Meshtastic Members may not possess, or have not tested this configuration. +- `official`: Fully supported by Meshtastic. Meshtastic Members have tested and verified this configuration. +- `deprecated`: No longer recommended for deployment by Meshtastic. + +`compatible`: A list of compatible products or platforms that can use this configuration. +This will vary depending on the intended use case / platform. +Multiple compatible entries can be included. E.g. Armbian `BOARD` value or OpenWrt `TARGET` value. +These tags can be consumed by different configuration-selection tools, filtering based upon their platform/etc. diff --git a/bin/config.d/display-waveshare-1-44.yaml b/bin/config.d/display-waveshare-1-44.yaml index d37f6cf6a..e6b4f8271 100644 --- a/bin/config.d/display-waveshare-1-44.yaml +++ b/bin/config.d/display-waveshare-1-44.yaml @@ -1,3 +1,9 @@ +Meta: + name: Waveshare 1.44inch LCD HAT + support: community + compatible: + - raspberry-pi + ### Waveshare 1.44inch LCD HAT Display: Panel: ST7735S diff --git a/bin/config.d/display-waveshare-2.8.yaml b/bin/config.d/display-waveshare-2.8.yaml index 2e28276d8..586d1107e 100644 --- a/bin/config.d/display-waveshare-2.8.yaml +++ b/bin/config.d/display-waveshare-2.8.yaml @@ -1,3 +1,9 @@ +Meta: + name: Waveshare 2.8inch LCD HAT + support: community + compatible: + - raspberry-pi + Display: ### Waveshare 2.8inch RPi LCD diff --git a/bin/config.d/lora-Adafruit-RFM9x.yaml b/bin/config.d/lora-Adafruit-RFM9x.yaml index 20295dc72..1258af4f5 100644 --- a/bin/config.d/lora-Adafruit-RFM9x.yaml +++ b/bin/config.d/lora-Adafruit-RFM9x.yaml @@ -1,3 +1,9 @@ +Meta: + name: Adafruit RFM9x + support: deprecated + compatible: + - raspberry-pi + Lora: Module: RF95 # Adafruit RFM9x Reset: 25 diff --git a/bin/config.d/lora-MeshAdv-900M30S.yaml b/bin/config.d/lora-MeshAdv-900M30S.yaml index 5c148bf68..c90391cb0 100644 --- a/bin/config.d/lora-MeshAdv-900M30S.yaml +++ b/bin/config.d/lora-MeshAdv-900M30S.yaml @@ -1,5 +1,11 @@ # MeshAdv-Pi E22-900M30S # https://github.com/chrismyers2000/MeshAdv-Pi-Hat +Meta: + name: MeshAdv-Pi E22-900M30S + support: community + compatible: + - raspberry-pi + Lora: Module: sx1262 CS: 21 diff --git a/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml index b47b5c996..d878bce1b 100644 --- a/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml +++ b/bin/config.d/lora-MeshAdv-Mini-900M22S.yaml @@ -1,5 +1,11 @@ # MeshAdv Mini E22-900M22S # https://github.com/chrismyers2000/MeshAdv-Mini +Meta: + name: MeshAdv Mini E22-900M22S + support: community + compatible: + - raspberry-pi + Lora: Module: sx1262 # Ebyte E22-900M22S CS: 8 diff --git a/bin/config.d/lora-RAK6421-13300-slot1.yaml b/bin/config.d/lora-RAK6421-13300-slot1.yaml index 628198887..a88544896 100644 --- a/bin/config.d/lora-RAK6421-13300-slot1.yaml +++ b/bin/config.d/lora-RAK6421-13300-slot1.yaml @@ -1,6 +1,12 @@ +Meta: + name: RAK6421 + RAK13300 Slot 1 + support: official + compatible: + - raspberry-pi + Lora: - ### RAK13300in Slot 1 + ### RAK13300 in Slot 1 Module: sx1262 IRQ: 22 #IO6 Reset: 16 # IO4 diff --git a/bin/config.d/lora-RAK6421-13300-slot2.yaml b/bin/config.d/lora-RAK6421-13300-slot2.yaml index f890f0467..40b0cea09 100644 --- a/bin/config.d/lora-RAK6421-13300-slot2.yaml +++ b/bin/config.d/lora-RAK6421-13300-slot2.yaml @@ -1,5 +1,11 @@ +Meta: + name: RAK6421 + RAK13300 Slot 2 + support: official + compatible: + - raspberry-pi + Lora: - ### RAK13300in Slot 2 pins + ### RAK13300 in Slot 2 pins IRQ: 18 #IO6 Reset: 24 # IO4 Busy: 19 # IO5 diff --git a/bin/config.d/lora-RAK6421-13302-slot1.yaml b/bin/config.d/lora-RAK6421-13302-slot1.yaml index 13747d4e7..85b934ce6 100644 --- a/bin/config.d/lora-RAK6421-13302-slot1.yaml +++ b/bin/config.d/lora-RAK6421-13302-slot1.yaml @@ -1,6 +1,12 @@ +Meta: + name: RAK6421 + RAK13302 Slot 1 + support: official + compatible: + - raspberry-pi + Lora: - ### RAK13300in Slot 1 + ### RAK13302 in Slot 1 Module: sx1262 IRQ: 22 #IO6 Reset: 16 # IO4 diff --git a/bin/config.d/lora-RAK6421-13302-slot2.yaml b/bin/config.d/lora-RAK6421-13302-slot2.yaml index 194172774..5aa23911f 100644 --- a/bin/config.d/lora-RAK6421-13302-slot2.yaml +++ b/bin/config.d/lora-RAK6421-13302-slot2.yaml @@ -1,5 +1,11 @@ +Meta: + name: RAK6421 + RAK13302 Slot 2 + support: official + compatible: + - raspberry-pi + Lora: - ### RAK13300in Slot 2 pins + ### RAK13302 in Slot 2 pins IRQ: 18 #IO6 Reset: 24 # IO4 Busy: 19 # IO5 diff --git a/bin/config.d/femtofox/femtofox_LR1121_TCXO.yaml b/bin/config.d/lora-femtofox_LR1121_TCXO.yaml similarity index 75% rename from bin/config.d/femtofox/femtofox_LR1121_TCXO.yaml rename to bin/config.d/lora-femtofox_LR1121_TCXO.yaml index 7aa860f61..10166fa35 100644 --- a/bin/config.d/femtofox/femtofox_LR1121_TCXO.yaml +++ b/bin/config.d/lora-femtofox_LR1121_TCXO.yaml @@ -1,20 +1,22 @@ ---- -Lora: -## Ebyte E80-900M22S -## This is a bit experimental -## -## - Module: lr1121 - gpiochip: 1 # subtract 32 from the gpio numbers - DIO3_TCXO_VOLTAGE: 1.8 - CS: 16 #pin6 / GPIO48 1C0 - IRQ: 23 #pin17 / GPIO55 1C7 - Busy: 22 #pin16 / GPIO54 1C6 - Reset: 25 #pin13 / GPIO57 1D1 - - - spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) - spiSpeed: 2000000 - -General: - MACAddressSource: eth0 +--- +Meta: + name: Femtofox Ebyte E80-900M22S with TCXO + support: community + compatible: + - luckfox-pico-mini # Armbian + +Lora: +## Ebyte E80-900M22S +## This is a bit experimental +## +## + Module: lr1121 + gpiochip: 1 # subtract 32 from the gpio numbers + DIO3_TCXO_VOLTAGE: 1.8 + CS: 16 #pin6 / GPIO48 1C0 + IRQ: 23 #pin17 / GPIO55 1C7 + Busy: 22 #pin16 / GPIO54 1C6 + Reset: 25 #pin13 / GPIO57 1D1 + + spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) + spiSpeed: 2000000 diff --git a/bin/config.d/femtofox/femtofox_SX1262_TCXO.yaml b/bin/config.d/lora-femtofox_SX1262_TCXO.yaml similarity index 87% rename from bin/config.d/femtofox/femtofox_SX1262_TCXO.yaml rename to bin/config.d/lora-femtofox_SX1262_TCXO.yaml index a4dec870a..31012c0f6 100644 --- a/bin/config.d/femtofox/femtofox_SX1262_TCXO.yaml +++ b/bin/config.d/lora-femtofox_SX1262_TCXO.yaml @@ -1,21 +1,24 @@ ---- -Lora: -## Ebyte E22-900M30S, E22-900M22S with or without external RF switching setup -## HT-RA62 (Has internal switching, but whatever) -## Seeed WIO SX1262 (already has TXEN-DIO2 link, but needs RXEN) -## Will work with any module with or without RF switching, and with TCXO - Module: sx1262 - gpiochip: 1 # subtract 32 from the gpio numbers - DIO2_AS_RF_SWITCH: true - DIO3_TCXO_VOLTAGE: true - CS: 16 #pin6 / GPIO48 1C0 - IRQ: 23 #pin17 / GPIO55 1C7 - Busy: 22 #pin16 / GPIO54 1C6 - Reset: 25 #pin13 / GPIO57 1D1 - RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things? -# TXen: bridge to DIO2 on E22 module - spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) - spiSpeed: 2000000 - -General: - MACAddressSource: eth0 +--- +Meta: + name: Femtofox SX1262 TCXO + support: community + compatible: + - luckfox-pico-mini # Armbian + +Lora: +## Ebyte E22-900M30S, E22-900M22S with or without external RF switching setup +## HT-RA62 (Has internal switching, but whatever) +## Seeed WIO SX1262 (already has TXEN-DIO2 link, but needs RXEN) +## Will work with any module with or without RF switching, and with TCXO + Module: sx1262 + gpiochip: 1 # subtract 32 from the gpio numbers + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + CS: 16 #pin6 / GPIO48 1C0 + IRQ: 23 #pin17 / GPIO55 1C7 + Busy: 22 #pin16 / GPIO54 1C6 + Reset: 25 #pin13 / GPIO57 1D1 + RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things? +# TXen: bridge to DIO2 on E22 module + spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) + spiSpeed: 2000000 diff --git a/bin/config.d/femtofox/femtofox_SX1262_XTAL.yaml b/bin/config.d/lora-femtofox_SX1262_XTAL.yaml similarity index 86% rename from bin/config.d/femtofox/femtofox_SX1262_XTAL.yaml rename to bin/config.d/lora-femtofox_SX1262_XTAL.yaml index 6b956f3e3..7132f382e 100644 --- a/bin/config.d/femtofox/femtofox_SX1262_XTAL.yaml +++ b/bin/config.d/lora-femtofox_SX1262_XTAL.yaml @@ -1,21 +1,24 @@ ---- -Lora: -## Ebyte E22-900MM22S with no external RF switching setup -## Waveshare SX126X XXXM, AI Thinker RA-01SH -## Will work with any module with or without RF switching and no TCXO - - Module: sx1262 - gpiochip: 1 # subtract 32 from the gpio numbers - DIO2_AS_RF_SWITCH: true - DIO3_TCXO_VOLTAGE: false - CS: 16 #pin6 / GPIO48 1C0 - IRQ: 23 #pin17 / GPIO55 1C7 - Busy: 22 #pin16 / GPIO54 1C6 - Reset: 25 #pin13 / GPIO57 1D1 - RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things? -# TXen: bridge to DIO2 on E22 module - spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) - spiSpeed: 2000000 - -General: - MACAddressSource: eth0 +--- +Meta: + name: Femtofox SX1262 XTAL + support: community + compatible: + - luckfox-pico-mini # Armbian + +Lora: +## Ebyte E22-900MM22S with no external RF switching setup +## Waveshare SX126X XXXM, AI Thinker RA-01SH +## Will work with any module with or without RF switching and no TCXO + + Module: sx1262 + gpiochip: 1 # subtract 32 from the gpio numbers + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: false + CS: 16 #pin6 / GPIO48 1C0 + IRQ: 23 #pin17 / GPIO55 1C7 + Busy: 22 #pin16 / GPIO54 1C6 + Reset: 25 #pin13 / GPIO57 1D1 + RXen: 24 #pin12 / GPIO56 1D0 # Not strictly needed for auto-switching, but why complicate things? +# TXen: bridge to DIO2 on E22 module + spidev: spidev0.0 #pins are (CS=16, CLK=17, MOSI=18, MISO=19) + spiSpeed: 2000000 diff --git a/bin/config.d/lora-hat-rak-6421-pi-hat.yaml b/bin/config.d/lora-hat-rak-6421-pi-hat.yaml index cf25caf07..b0ac0306a 100644 --- a/bin/config.d/lora-hat-rak-6421-pi-hat.yaml +++ b/bin/config.d/lora-hat-rak-6421-pi-hat.yaml @@ -1,6 +1,12 @@ +Meta: + name: RAK6421 + RAK13300 Slot 1 (Autoconf default) + support: official + compatible: + - raspberry-pi + Lora: - ### RAK13300in Slot 1 + ### RAK13300 in Slot 1 Module: sx1262 IRQ: 22 #IO6 Reset: 16 # IO4 diff --git a/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml b/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml index 2fd128ce8..f944a7949 100644 --- a/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml +++ b/bin/config.d/lora-lyra-picocalc-wio-sx1262.yaml @@ -1,3 +1,9 @@ +Meta: + name: Luckfox Lyra PicoCalc Wio LoRa SX1262 + support: official + compatible: + - luckfox-lyra-plus # Armbian + Lora: Module: sx1262 DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-lyra-ultra_1w.yaml b/bin/config.d/lora-lyra-ultra_1w.yaml index 0bdc05fef..71d05f84e 100644 --- a/bin/config.d/lora-lyra-ultra_1w.yaml +++ b/bin/config.d/lora-lyra-ultra_1w.yaml @@ -2,6 +2,13 @@ # Enable overlay 'luckfox-lyra-ultra-w-spi0-cs0-spidev' with armbian-config # https://github.com/wehooper4/Meshtastic-Hardware/tree/main/Luckfox%20Ultra%20Hat # 1 Watt Lyra Ultra hat +Meta: + name: wehooper4 Luckfox Ultra 1W + support: community + compatible: + - luckfox-pico-ultra # Armbian + - luckfox-lyra-ultra # Armbian + Lora: Module: sx1262 DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-lyra-ultra_2w.yaml b/bin/config.d/lora-lyra-ultra_2w.yaml index a1fe6d7f7..e3bb18c7b 100644 --- a/bin/config.d/lora-lyra-ultra_2w.yaml +++ b/bin/config.d/lora-lyra-ultra_2w.yaml @@ -2,6 +2,13 @@ # Enable overlay 'luckfox-lyra-ultra-w-spi0-cs0-spidev' with armbian-config # https://github.com/wehooper4/Meshtastic-Hardware/tree/main/Luckfox%20Ultra%20Hat # 2 Watt Lyra Ultra hat +Meta: + name: wehooper4 Luckfox Ultra 2W + support: community + compatible: + - luckfox-pico-ultra # Armbian + - luckfox-lyra-ultra # Armbian + Lora: Module: sx1262 DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-lyra-ws-raspberry-pi-pico-hat.yaml b/bin/config.d/lora-lyra-ws-raspberry-pi-pico-hat.yaml index 8425fc385..bdd98a41c 100644 --- a/bin/config.d/lora-lyra-ws-raspberry-pi-pico-hat.yaml +++ b/bin/config.d/lora-lyra-ws-raspberry-pi-pico-hat.yaml @@ -2,6 +2,12 @@ # Enable overlay 'luckfox-lyra-plus-spi0-cs0_rmio13-spidev' with armbian-config # Waveshare LoRa HAT for Raspberry Pi Pico # https://www.waveshare.com/wiki/Pico-LoRa-SX1262 +Meta: + name: Waveshare LoRa HAT for Raspberry Pi Pico + support: community + compatible: + - luckfox-lyra-plus # Armbian + Lora: Module: sx1262 DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-meshstick-1262.yaml b/bin/config.d/lora-meshstick-1262.yaml index 3f8d6c617..355d0bc0f 100644 --- a/bin/config.d/lora-meshstick-1262.yaml +++ b/bin/config.d/lora-meshstick-1262.yaml @@ -1,3 +1,9 @@ +Meta: + name: Lora Meshstick SX1262 + support: official + compatible: + - usb + Lora: Module: sx1262 CS: 0 diff --git a/bin/config.d/lora-piggystick-lr1121.yaml b/bin/config.d/lora-piggystick-lr1121.yaml index 348db61b1..e11c78dd3 100644 --- a/bin/config.d/lora-piggystick-lr1121.yaml +++ b/bin/config.d/lora-piggystick-lr1121.yaml @@ -1,3 +1,9 @@ +Meta: + name: Lora Meshstick SX1262 + support: community + compatible: + - usb + Lora: Module: lr1121 CS: 0 diff --git a/bin/config.d/lora-pinedio-usb-sx1262.yaml b/bin/config.d/lora-pinedio-usb-sx1262.yaml index 6b8a9fc95..b2351c05a 100644 --- a/bin/config.d/lora-pinedio-usb-sx1262.yaml +++ b/bin/config.d/lora-pinedio-usb-sx1262.yaml @@ -1,5 +1,11 @@ +Meta: + name: Pinedio USB SX1262 + support: deprecated + compatible: + - usb + Lora: Module: sx1262 CS: 0 IRQ: 10 - spidev: ch341 \ No newline at end of file + spidev: ch341 diff --git a/bin/config.d/lora-raxda-rock2f-starter-edition-hat.yaml b/bin/config.d/lora-raxda-rock2f-starter-edition-hat.yaml index ea86a3728..7337f39ca 100644 --- a/bin/config.d/lora-raxda-rock2f-starter-edition-hat.yaml +++ b/bin/config.d/lora-raxda-rock2f-starter-edition-hat.yaml @@ -1,3 +1,9 @@ +Meta: + name: raxda-rock2f-starter-edition-hat + support: community + compatible: + - rock-2f # Armbian + Lora: ### Raxda Rock 2F running Armbian Linux 6.1.99-vendor-rk35xx diff --git a/bin/config.d/lora-starter-edition-sx1262-i2c.yaml b/bin/config.d/lora-starter-edition-sx1262-i2c.yaml index d9b64c7da..185417cce 100644 --- a/bin/config.d/lora-starter-edition-sx1262-i2c.yaml +++ b/bin/config.d/lora-starter-edition-sx1262-i2c.yaml @@ -1,5 +1,11 @@ # https://www.waveshare.com/core1262-868m.htm # https://github.com/markbirss/lora-starter-edition-sx1262-i2c +Meta: + name: lora-starter-edition-sx1262-i2c + support: community + compatible: + - raspberry-pi + Lora: Module: sx1262 # Starter Edition SX1262 I2C Raspberry Pi HAT DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-usb-meshstick-1262.yaml b/bin/config.d/lora-usb-meshstick-1262.yaml index a539d76a1..79ca132df 100644 --- a/bin/config.d/lora-usb-meshstick-1262.yaml +++ b/bin/config.d/lora-usb-meshstick-1262.yaml @@ -1,3 +1,9 @@ +Meta: + name: meshstick-1262 + support: official + compatible: + - usb + Lora: Module: sx1262 CS: 0 diff --git a/bin/config.d/lora-usb-meshtoad-e22.yaml b/bin/config.d/lora-usb-meshtoad-e22.yaml index b6cb61c6b..49182c83e 100644 --- a/bin/config.d/lora-usb-meshtoad-e22.yaml +++ b/bin/config.d/lora-usb-meshtoad-e22.yaml @@ -1,3 +1,9 @@ +Meta: + name: meshtoad-e22 + support: official + compatible: + - usb + Lora: Module: sx1262 CS: 0 diff --git a/bin/config.d/lora-usb-umesh-1262-30dbm.yaml b/bin/config.d/lora-usb-umesh-1262-30dbm.yaml index 8b32c5af2..9f30217e0 100644 --- a/bin/config.d/lora-usb-umesh-1262-30dbm.yaml +++ b/bin/config.d/lora-usb-umesh-1262-30dbm.yaml @@ -1,3 +1,9 @@ +Meta: + name: umesh-1262-30dbm + support: community + compatible: + - clockwork-uconsole + Lora: Module: sx1262 CS: 0 diff --git a/bin/config.d/lora-usb-umesh-1268-30dbm.yaml b/bin/config.d/lora-usb-umesh-1268-30dbm.yaml index df772184c..45c8e21d0 100644 --- a/bin/config.d/lora-usb-umesh-1268-30dbm.yaml +++ b/bin/config.d/lora-usb-umesh-1268-30dbm.yaml @@ -1,3 +1,9 @@ +Meta: + name: umesh-1268-30dbm + support: community + compatible: + - clockwork-uconsole + Lora: Module: sx1268 CS: 0 diff --git a/bin/config.d/lora-waveshare-sxxx.yaml b/bin/config.d/lora-waveshare-sxxx.yaml index a9ff13653..641cf1e49 100644 --- a/bin/config.d/lora-waveshare-sxxx.yaml +++ b/bin/config.d/lora-waveshare-sxxx.yaml @@ -1,3 +1,9 @@ +Meta: + name: Waveshare SX1262 + support: deprecated + compatible: + - raspberry-pi + Lora: Module: sx1262 # Waveshare SX126X XXXM DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-ws-raspberry-pi-pico-to-rpi-adapter.yaml b/bin/config.d/lora-ws-raspberry-pi-pico-to-rpi-adapter.yaml index 1e1c325e7..b84e18d5b 100644 --- a/bin/config.d/lora-ws-raspberry-pi-pico-to-rpi-adapter.yaml +++ b/bin/config.d/lora-ws-raspberry-pi-pico-to-rpi-adapter.yaml @@ -1,5 +1,12 @@ # https://www.waveshare.com/pico-lora-sx1262-868m.htm # https://github.com/markbirss/lora-ws-raspberry-pi-pico-to-rpi-adapter + +Meta: + name: ws-raspberry-pico-to-rpi-adapter + support: community + compatible: + - raspberry-pi + Lora: Module: sx1262 # Waveshare Raspberry Pi Pico to Raspberry Pi HAT Adapter DIO2_AS_RF_SWITCH: true diff --git a/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml b/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml index 37d7e27d2..5743a9ed6 100644 --- a/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml +++ b/bin/config.d/lora-ws-raspberry-pico-to-orangepi-03.yaml @@ -15,6 +15,12 @@ # 5 CS 24 # 26 DIO1/IRQ 26 +Meta: + name: ws-raspberry-pico-to-orangepi-03 + support: community + compatible: + - orange-pi-zero-3 # Armbian + Lora: Module: sx1262 # Waveshare Raspberry Pico Lora module DIO2_AS_RF_SWITCH: true From 99abfebc4ae0b14caf40b22398672c0c9516097e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 27 Mar 2026 15:38:41 -0500 Subject: [PATCH 009/150] Fix TransmitHistory to improve epoch handling (#10017) * Fix TransmitHistory to improve epoch handling * Enable epoch handling in unit tests * Improve comments and test handling for epoch persistence in TransmitHistory * Add boot-relative timestamp handling and unit tests for TransmitHistory * loadFromDisk should handle legacy entries and clean up old v1 files after migration * Revert "loadFromDisk should handle legacy entries and clean up old v1 files after migration" This reverts commit eb7e5c7acfa4ac077fe50980be752e4b42a739b8. * Add NodeInfoModule integration for RTC quality changes and trigger immediate checks * Update test conditions for RTC quality checks --- src/gps/RTC.cpp | 28 ++++ src/gps/RTC.h | 4 + src/mesh/Throttle.cpp | 3 +- src/mesh/TransmitHistory.cpp | 163 ++++++++++++++++++----- src/mesh/TransmitHistory.h | 48 ++++++- src/modules/NodeInfoModule.cpp | 6 + src/modules/NodeInfoModule.h | 6 + test/test_transmit_history/test_main.cpp | 148 +++++++++++++++++--- 8 files changed, 344 insertions(+), 62 deletions(-) diff --git a/src/gps/RTC.cpp b/src/gps/RTC.cpp index a0315559f..a8288a069 100644 --- a/src/gps/RTC.cpp +++ b/src/gps/RTC.cpp @@ -2,6 +2,7 @@ #include "configuration.h" #include "detect/ScanI2C.h" #include "main.h" +#include "modules/NodeInfoModule.h" #include #include #include @@ -12,6 +13,14 @@ uint32_t lastSetFromPhoneNtpOrGps = 0; static uint32_t lastTimeValidationWarning = 0; static const uint32_t TIME_VALIDATION_WARNING_INTERVAL_MS = 15000; // 15 seconds +static void triggerNodeInfoCheckOnTimeSource(RTCQuality oldQuality, RTCQuality newQuality) +{ + if (oldQuality == RTCQualityNone && newQuality > RTCQualityNone && nodeInfoModule) { + LOG_DEBUG("Time source acquired (%s -> %s), triggering NodeInfo recheck", RtcName(oldQuality), RtcName(newQuality)); + nodeInfoModule->triggerImmediateNodeInfoCheck(); + } +} + RTCQuality getRTCQuality() { return currentQuality; @@ -61,9 +70,11 @@ RTCSetResult readFromRTC() LOG_DEBUG("Read RTC time from RV3028 getTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch); if (currentQuality == RTCQualityNone) { + RTCQuality oldQuality = currentQuality; timeStartMsec = now; zeroOffsetSecs = tv.tv_sec; currentQuality = RTCQualityDevice; + triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality); } return RTCSetResultSuccess; } else { @@ -105,9 +116,11 @@ RTCSetResult readFromRTC() LOG_DEBUG("Read RTC time from %s getDateTime as %02d-%02d-%02d %02d:%02d:%02d (%ld)", rtc.getChipName(), t.tm_year + 1900, t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, printableEpoch); if (currentQuality == RTCQualityNone) { + RTCQuality oldQuality = currentQuality; timeStartMsec = now; zeroOffsetSecs = tv.tv_sec; currentQuality = RTCQualityDevice; + triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality); } return RTCSetResultSuccess; } else { @@ -139,9 +152,11 @@ RTCSetResult readFromRTC() } #endif if (currentQuality == RTCQualityNone) { + RTCQuality oldQuality = currentQuality; timeStartMsec = now; zeroOffsetSecs = tv.tv_sec; currentQuality = RTCQualityDevice; + triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality); } return RTCSetResultSuccess; } @@ -214,6 +229,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd } if (shouldSet) { + RTCQuality oldQuality = currentQuality; currentQuality = q; lastSetMsec = now; if (currentQuality >= RTCQualityNTP) { @@ -281,6 +297,7 @@ RTCSetResult perhapsSetRTC(RTCQuality q, const struct timeval *tv, bool forceUpd #endif readFromRTC(); + triggerNodeInfoCheckOnTimeSource(oldQuality, currentQuality); return RTCSetResultSuccess; } else { return RTCSetResultNotSet; // RTC was already set with a higher quality time @@ -397,6 +414,17 @@ uint32_t getValidTime(RTCQuality minQuality, bool local) return (currentQuality >= minQuality) ? getTime(local) : 0; } +#ifdef PIO_UNIT_TESTING +void setBootRelativeTimeForUnitTest(uint32_t secondsSinceBoot) +{ + currentQuality = RTCQualityNone; + zeroOffsetSecs = 0; + timeStartMsec = millis() - (secondsSinceBoot * 1000); + lastSetFromPhoneNtpOrGps = 0; + lastTimeValidationWarning = 0; +} +#endif + time_t gm_mktime(const struct tm *tm) { #if !MESHTASTIC_EXCLUDE_TZ diff --git a/src/gps/RTC.h b/src/gps/RTC.h index 16ecd8245..cd1e1d002 100644 --- a/src/gps/RTC.h +++ b/src/gps/RTC.h @@ -54,6 +54,10 @@ uint32_t getValidTime(RTCQuality minQuality, bool local = false); RTCSetResult readFromRTC(); +#ifdef PIO_UNIT_TESTING +void setBootRelativeTimeForUnitTest(uint32_t secondsSinceBoot); +#endif + time_t gm_mktime(const struct tm *tm); #define SEC_PER_DAY 86400 diff --git a/src/mesh/Throttle.cpp b/src/mesh/Throttle.cpp index f278cc843..a4f8347b2 100644 --- a/src/mesh/Throttle.cpp +++ b/src/mesh/Throttle.cpp @@ -31,5 +31,6 @@ bool Throttle::execute(uint32_t *lastExecutionMs, uint32_t minumumIntervalMs, vo /// @param timeSpanMs The interval in milliseconds of the timespan bool Throttle::isWithinTimespanMs(uint32_t lastExecutionMs, uint32_t timeSpanMs) { - return (millis() - lastExecutionMs) < timeSpanMs; + uint32_t now = millis(); + return (now - lastExecutionMs) < timeSpanMs; } \ No newline at end of file diff --git a/src/mesh/TransmitHistory.cpp b/src/mesh/TransmitHistory.cpp index b615c307a..33da7d35c 100644 --- a/src/mesh/TransmitHistory.cpp +++ b/src/mesh/TransmitHistory.cpp @@ -16,6 +16,20 @@ TransmitHistory *TransmitHistory::getInstance() return transmitHistory; } +TransmitHistory::StoredTimestamp TransmitHistory::makeStoredTimestamp(uint32_t seconds, uint8_t flags) +{ + StoredTimestamp stored; + stored.seconds = seconds; + stored.flags = flags; + return stored; +} + +TransmitHistory::StoredTimestamp TransmitHistory::decodeLegacyTimestamp(uint32_t seconds) +{ + const bool isProbablyBootRelative = seconds > 0 && seconds <= LEGACY_BOOT_RELATIVE_MAX_SEC; + return makeStoredTimestamp(seconds, isProbablyBootRelative ? ENTRY_FLAG_BOOT_RELATIVE : ENTRY_FLAG_NONE); +} + void TransmitHistory::loadFromDisk() { spiLock->lock(); @@ -23,16 +37,33 @@ void TransmitHistory::loadFromDisk() if (file) { FileHeader header{}; if (file.read((uint8_t *)&header, sizeof(header)) == sizeof(header) && header.magic == MAGIC && - header.version == VERSION && header.count <= MAX_ENTRIES) { + (header.version == 1 || header.version == VERSION) && header.count <= MAX_ENTRIES) { for (uint8_t i = 0; i < header.count; i++) { - Entry entry{}; - if (file.read((uint8_t *)&entry, sizeof(entry)) == sizeof(entry)) { - if (entry.epochSeconds > 0) { - history[entry.key] = entry.epochSeconds; - // Seed in-memory millis so throttle works even without RTC/GPS. - // Treating stored entries as "just sent" is safe — worst case the - // node waits one full interval before its first broadcast. - lastMillis[entry.key] = millis(); + if (header.version == 1) { + LegacyEntry entry{}; + if (file.read((uint8_t *)&entry, sizeof(entry)) == sizeof(entry) && entry.epochSeconds > 0) { + history[entry.key] = decodeLegacyTimestamp(entry.epochSeconds); + } + } else { + Entry entry{}; + if (file.read((uint8_t *)&entry, sizeof(entry)) == sizeof(entry) && entry.epochSeconds > 0) { + history[entry.key] = makeStoredTimestamp(entry.epochSeconds, entry.flags); + // Do NOT seed lastMillis here. + // + // getLastSentToMeshMillis() reconstructs a millis()-relative value + // from the stored epoch, and Throttle::isWithinTimespanMs() uses + // the same unsigned subtraction pattern. Once getTime() has a valid + // wall-clock epoch comparable to stored values, recent reboots still + // throttle correctly while long power-off periods no longer look like + // "just sent" and incorrectly suppress the first send. + // + // Before RTC/NTP/GPS time is valid, persisted absolute epochs do not + // contribute, but boot-relative entries still suppress near-term reboot + // chatter via a narrow recovery window. + // + // If we seeded lastMillis to millis() here, every loaded entry would + // appear to have been sent at boot time, regardless of the true age + // of the last transmission. That was the regression behind #9901. } } } @@ -53,7 +84,8 @@ void TransmitHistory::setLastSentToMesh(uint16_t key) lastMillis[key] = millis(); uint32_t now = getTime(); if (now >= 2) { - history[key] = now; + const uint8_t flags = (getRTCQuality() == RTCQualityNone) ? ENTRY_FLAG_BOOT_RELATIVE : ENTRY_FLAG_NONE; + history[key] = makeStoredTimestamp(now, flags); dirty = true; // Don't flush to disk on every transmit — flash has limited write endurance. // The in-memory lastMillis map handles throttle during normal operation. @@ -68,15 +100,84 @@ void TransmitHistory::setLastSentToMesh(uint16_t key) } } +#ifdef PIO_UNIT_TESTING +void TransmitHistory::setLastSentAtEpoch(uint16_t key, uint32_t epochSeconds) +{ + if (epochSeconds > 0) { + history[key] = makeStoredTimestamp(epochSeconds, ENTRY_FLAG_NONE); + dirty = true; + } else { + history.erase(key); + lastMillis.erase(key); + } +} + +void TransmitHistory::setLastSentAtBootRelative(uint16_t key, uint32_t secondsSinceBoot) +{ + if (secondsSinceBoot > 0) { + history[key] = makeStoredTimestamp(secondsSinceBoot, ENTRY_FLAG_BOOT_RELATIVE); + dirty = true; + } else { + history.erase(key); + lastMillis.erase(key); + } +} +#endif + uint32_t TransmitHistory::getLastSentToMeshEpoch(uint16_t key) const { auto it = history.find(key); if (it != history.end()) { - return it->second; + return it->second.seconds; } return 0; } +uint32_t TransmitHistory::getLastSentAbsoluteMillis(uint32_t storedEpoch) const +{ + uint32_t now = getTime(); + if (now < 2) { + return 0; + } + + if (storedEpoch > now) { + return 0; + } + + uint32_t secondsAgo = now - storedEpoch; + uint32_t msAgo = secondsAgo * 1000; + + if (secondsAgo > 86400 || msAgo / 1000 != secondsAgo) { + return 0; + } + + return millis() - msAgo; +} + +uint32_t TransmitHistory::getLastSentBootRelativeMillis(uint32_t storedSeconds) const +{ + if (getRTCQuality() != RTCQualityNone) { + return 0; + } + + uint32_t now = getTime(); + + if (storedSeconds <= now) { + uint32_t secondsAgo = now - storedSeconds; + if (secondsAgo > BOOT_RELATIVE_RECOVERY_WINDOW_SEC) { + return 0; + } + return millis() - (secondsAgo * 1000); + } + + uint32_t secondsAhead = storedSeconds - now; + if (secondsAhead > BOOT_RELATIVE_RECOVERY_WINDOW_SEC) { + return 0; + } + + return millis(); +} + uint32_t TransmitHistory::getLastSentToMeshMillis(uint16_t key) const { // Prefer runtime millis value (accurate within this boot) @@ -86,34 +187,23 @@ uint32_t TransmitHistory::getLastSentToMeshMillis(uint16_t key) const } // Fall back to epoch conversion (loaded from disk after reboot) - uint32_t storedEpoch = getLastSentToMeshEpoch(key); - if (storedEpoch == 0) { + auto it = history.find(key); + if (it == history.end() || it->second.seconds == 0) { return 0; // No stored time — module has never sent } - uint32_t now = getTime(); - if (now < 2) { - // No valid RTC time yet — can't convert to millis. Return 0 so throttle doesn't block. - return 0; + // Convert to a millis()-relative timestamp: millis() - msAgo. + // + // The result may wrap if msAgo is larger than the current uptime, and that is + // intentional. Throttle::isWithinTimespanMs() also uses unsigned subtraction, + // so the reconstructed age is preserved across wraparound: + // - recent reboot, 5 min ago -> (millis() - lastMs) == 300000, still throttled + // - long reboot, 30 min ago -> (millis() - lastMs) == 1800000, allowed + if ((it->second.flags & ENTRY_FLAG_BOOT_RELATIVE) != 0) { + return getLastSentBootRelativeMillis(it->second.seconds); } - if (storedEpoch > now) { - // Stored time is in the future (clock went backwards?) — treat as stale - return 0; - } - - uint32_t secondsAgo = now - storedEpoch; - uint32_t msAgo = secondsAgo * 1000; - - // Guard against overflow: if the transmit was very long ago, just return 0 (won't throttle) - if (secondsAgo > 86400 || msAgo / 1000 != secondsAgo) { - return 0; - } - - // Convert to a millis()-relative timestamp: millis() - msAgo - // This gives a value that, when passed to Throttle::isWithinTimespanMs(value, interval), - // correctly reports whether the transmit was within interval ms. - return millis() - msAgo; + return getLastSentAbsoluteMillis(it->second.seconds); } bool TransmitHistory::saveToDisk() @@ -141,12 +231,13 @@ bool TransmitHistory::saveToDisk() file.write((uint8_t *)&header, sizeof(header)); uint8_t written = 0; - for (const auto &[key, epochSeconds] : history) { + for (const auto &[key, stored] : history) { if (written >= MAX_ENTRIES) break; Entry entry{}; entry.key = key; - entry.epochSeconds = epochSeconds; + entry.epochSeconds = stored.seconds; + entry.flags = stored.flags; file.write((uint8_t *)&entry, sizeof(entry)); written++; } diff --git a/src/mesh/TransmitHistory.h b/src/mesh/TransmitHistory.h index 01201eaac..1a79048ea 100644 --- a/src/mesh/TransmitHistory.h +++ b/src/mesh/TransmitHistory.h @@ -35,8 +35,25 @@ class TransmitHistory */ void setLastSentToMesh(uint16_t key); +#ifdef PIO_UNIT_TESTING /** - * Get the last transmit epoch seconds for a given key, or 0 if unknown. + * Directly set the stored epoch for a key without touching the runtime lastMillis map. + * Intended for testing purposes: lets tests simulate "the last broadcast happened N + * seconds ago" without needing to fake the system clock. + */ + void setLastSentAtEpoch(uint16_t key, uint32_t epochSeconds); + + /** + * Directly set a boot-relative timestamp (seconds since boot) for testing. + */ + void setLastSentAtBootRelative(uint16_t key, uint32_t secondsSinceBoot); +#endif + + /** + * Get the raw persisted timestamp seconds for a given key, or 0 if unknown. + * + * The returned value is an absolute epoch when persisted with valid RTC/NTP/GPS time, + * or boot-relative seconds when ENTRY_FLAG_BOOT_RELATIVE is set. */ uint32_t getLastSentToMeshEpoch(uint16_t key) const; @@ -64,13 +81,31 @@ class TransmitHistory static constexpr const char *FILENAME = "/prefs/transmit_history.dat"; static constexpr uint32_t MAGIC = 0x54485354; // "THST" - static constexpr uint8_t VERSION = 1; + static constexpr uint8_t VERSION = 2; static constexpr uint8_t MAX_ENTRIES = 16; static constexpr uint32_t SAVE_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes + static constexpr uint32_t BOOT_RELATIVE_RECOVERY_WINDOW_SEC = 2 * 60; + static constexpr uint32_t LEGACY_BOOT_RELATIVE_MAX_SEC = 365UL * 24 * 60 * 60; + + enum EntryFlags : uint8_t { + ENTRY_FLAG_NONE = 0, + ENTRY_FLAG_BOOT_RELATIVE = 0x01, + }; + + struct StoredTimestamp { + uint32_t seconds = 0; + uint8_t flags = ENTRY_FLAG_NONE; + }; struct __attribute__((packed)) Entry { uint16_t key; uint32_t epochSeconds; + uint8_t flags; + }; + + struct __attribute__((packed)) LegacyEntry { + uint16_t key; + uint32_t epochSeconds; }; struct __attribute__((packed)) FileHeader { @@ -79,8 +114,13 @@ class TransmitHistory uint8_t count; }; - std::map history; // key -> epoch seconds (for disk persistence) - std::map lastMillis; // key -> millis() value (for runtime throttle) + uint32_t getLastSentAbsoluteMillis(uint32_t storedEpoch) const; + uint32_t getLastSentBootRelativeMillis(uint32_t storedSeconds) const; + static StoredTimestamp makeStoredTimestamp(uint32_t seconds, uint8_t flags = ENTRY_FLAG_NONE); + static StoredTimestamp decodeLegacyTimestamp(uint32_t seconds); + + std::map history; // key -> persisted transmit time + std::map lastMillis; // key -> millis() value (for runtime throttle) bool dirty = false; uint32_t lastDiskSave = 0; // millis() of last disk flush }; diff --git a/src/modules/NodeInfoModule.cpp b/src/modules/NodeInfoModule.cpp index f41fafdee..4de479241 100644 --- a/src/modules/NodeInfoModule.cpp +++ b/src/modules/NodeInfoModule.cpp @@ -118,6 +118,12 @@ void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies, uint8_t cha } } +void NodeInfoModule::triggerImmediateNodeInfoCheck() +{ + LOG_DEBUG("NodeInfo: scheduling immediate periodic check"); + setIntervalFromNow(0); +} + meshtastic_MeshPacket *NodeInfoModule::allocReply() { // Only apply suppression when actually replying to someone else's request, not for periodic broadcasts. diff --git a/src/modules/NodeInfoModule.h b/src/modules/NodeInfoModule.h index 0c0dec849..9b3b66cae 100644 --- a/src/modules/NodeInfoModule.h +++ b/src/modules/NodeInfoModule.h @@ -24,6 +24,12 @@ class NodeInfoModule : public ProtobufModule, private concurren void sendOurNodeInfo(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false, uint8_t channel = 0, bool _shorterTimeout = false); + /** + * Schedule an immediate NodeInfo periodic check. + * Used when external conditions change (for example time source quality). + */ + void triggerImmediateNodeInfoCheck(); + protected: /** Called to handle a particular incoming message diff --git a/test/test_transmit_history/test_main.cpp b/test/test_transmit_history/test_main.cpp index 992668d97..3bd84b55c 100644 --- a/test/test_transmit_history/test_main.cpp +++ b/test/test_transmit_history/test_main.cpp @@ -1,5 +1,6 @@ #include "TestUtil.h" #include "TransmitHistory.h" +#include "gps/RTC.h" #include #include @@ -161,44 +162,141 @@ static void test_save_and_load_round_trip() // After loadFromDisk, millis should be seeded (non-zero) for stored entries uint32_t restoredMillis = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); if (restoredNodeInfo > 0) { - // If epoch was stored, millis should be seeded from load + // If epoch was stored (set seconds ago), epoch-conversion gives elapsed ≈ 0 s, + // so getLastSentToMeshMillis() should return a non-zero value. TEST_ASSERT_NOT_EQUAL(0, restoredMillis); } } // --- Boot without RTC scenario --- -static void test_load_seeds_millis_even_without_rtc() +// Crash-reboot protection: a send that happened moments before the reboot must still +// throttle after reload. This works because getLastSentToMeshMillis() reconstructs +// a millis()-relative timestamp from the stored epoch, and Throttle uses unsigned +// subtraction so the age survives wraparound even when uptime is near zero. +static void test_boot_after_recent_send_still_throttles() { - // This tests the critical crash-reboot scenario: - // After loadFromDisk(), even if getTime() returns 0 (no RTC), - // lastMillis should be seeded so throttle blocks immediate re-broadcast. - transmitHistory->setLastSentToMesh(meshtastic_PortNum_NODEINFO_APP); transmitHistory->saveToDisk(); - // Simulate reboot: destroy and recreate + // Simulate reboot delete transmitHistory; transmitHistory = nullptr; transmitHistory = TransmitHistory::getInstance(); transmitHistory->loadFromDisk(); - // The key insight: after load, getLastSentToMeshMillis should return non-zero - // because loadFromDisk seeds lastMillis[key] = millis() for every loaded entry. - // This ensures throttle works even without RTC. + // Epoch was set seconds ago; reconstructed age is still within the 10-min window. uint32_t result = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); - uint32_t epoch = transmitHistory->getLastSentToMeshEpoch(meshtastic_PortNum_NODEINFO_APP); - if (epoch > 0) { - // Data was persisted — millis must be seeded - TEST_ASSERT_NOT_EQUAL(0, result); - - // And it should cause throttle to block (treating as "just sent") - bool withinInterval = Throttle::isWithinTimespanMs(result, 10 * 60 * 1000); - TEST_ASSERT_TRUE(withinInterval); + if (epoch == 0) { + TEST_IGNORE_MESSAGE("Epoch not persisted; skipping"); + return; } - // If epoch == 0, RTC wasn't available — no data was saved, so nothing to restore. - // This is expected on platforms without RTC during the very first boot. + + TEST_ASSERT_NOT_EQUAL(0, result); + bool withinInterval = Throttle::isWithinTimespanMs(result, 10 * 60 * 1000); + TEST_ASSERT_TRUE(withinInterval); +} + +// Regression test for issue #9901: +// A device powered off for longer than the throttle window must broadcast NodeInfo +// on its next boot — it must not be silenced because loadFromDisk() once treated +// every loaded entry as "just sent" by seeding lastMillis to millis() at boot. +static void test_boot_after_long_gap_allows_nodeinfo() +{ + if (getRTCQuality() <= RTCQualityNone) { + TEST_IGNORE_MESSAGE("No RTC available; skipping epoch-dependent test"); + return; + } + + uint32_t now = getTime(); + + // Simulate: last NodeInfo sent 30 minutes ago (outside the 10-min throttle window) + transmitHistory->setLastSentAtEpoch(meshtastic_PortNum_NODEINFO_APP, now - (30 * 60)); + transmitHistory->saveToDisk(); + + // Simulate reboot + delete transmitHistory; + transmitHistory = nullptr; + transmitHistory = TransmitHistory::getInstance(); + transmitHistory->loadFromDisk(); + + uint32_t restoredEpoch = transmitHistory->getLastSentToMeshEpoch(meshtastic_PortNum_NODEINFO_APP); + if (restoredEpoch == 0) { + TEST_IGNORE_MESSAGE("Epoch not persisted; skipping"); + return; + } + + uint32_t restoredMs = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); + bool throttled = (restoredMs != 0) && Throttle::isWithinTimespanMs(restoredMs, 10 * 60 * 1000); + TEST_ASSERT_FALSE_MESSAGE(throttled, "NodeInfo must not be throttled after a 30-min gap (#9901)"); +} + +// Complementary: a rapid reboot must still throttle (crash-loop protection), even +// though the reconstructed lastMs may wrap because current uptime is small. +static void test_boot_within_throttle_window_still_throttles() +{ + if (getRTCQuality() <= RTCQualityNone) { + TEST_IGNORE_MESSAGE("No RTC available; skipping epoch-dependent test"); + return; + } + + uint32_t now = getTime(); + + // Simulate: last NodeInfo sent 5 minutes ago (inside the 10-min throttle window) + transmitHistory->setLastSentAtEpoch(meshtastic_PortNum_NODEINFO_APP, now - (5 * 60)); + transmitHistory->saveToDisk(); + + // Simulate reboot + delete transmitHistory; + transmitHistory = nullptr; + transmitHistory = TransmitHistory::getInstance(); + transmitHistory->loadFromDisk(); + + uint32_t restoredEpoch = transmitHistory->getLastSentToMeshEpoch(meshtastic_PortNum_NODEINFO_APP); + if (restoredEpoch == 0) { + TEST_IGNORE_MESSAGE("Epoch not persisted; skipping"); + return; + } + + uint32_t restoredMs = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); + bool throttled = (restoredMs != 0) && Throttle::isWithinTimespanMs(restoredMs, 10 * 60 * 1000); + TEST_ASSERT_TRUE_MESSAGE(throttled, "NodeInfo must still be throttled when last send was within the 10-min window"); +} + +static void test_boot_without_time_source_still_throttles_recent_restart() +{ + setBootRelativeTimeForUnitTest(32); + transmitHistory->setLastSentAtBootRelative(meshtastic_PortNum_NODEINFO_APP, 32); + transmitHistory->saveToDisk(); + + delete transmitHistory; + transmitHistory = nullptr; + transmitHistory = TransmitHistory::getInstance(); + + setBootRelativeTimeForUnitTest(31); + transmitHistory->loadFromDisk(); + + uint32_t restoredMs = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); + bool throttled = (restoredMs != 0) && Throttle::isWithinTimespanMs(restoredMs, 10 * 60 * 1000); + TEST_ASSERT_TRUE_MESSAGE(throttled, "Recent no-RTC reboots should still suppress duplicate NodeInfo"); +} + +static void test_boot_without_time_source_expires_boot_relative_history() +{ + setBootRelativeTimeForUnitTest(32); + transmitHistory->setLastSentAtBootRelative(meshtastic_PortNum_NODEINFO_APP, 32); + transmitHistory->saveToDisk(); + + delete transmitHistory; + transmitHistory = nullptr; + transmitHistory = TransmitHistory::getInstance(); + + setBootRelativeTimeForUnitTest(400); + transmitHistory->loadFromDisk(); + + uint32_t restoredMs = transmitHistory->getLastSentToMeshMillis(meshtastic_PortNum_NODEINFO_APP); + TEST_ASSERT_EQUAL_UINT32_MESSAGE(0, restoredMs, "Boot-relative history should only suppress near-term restarts"); } void setup() @@ -222,7 +320,15 @@ void setup() // Persistence RUN_TEST(test_save_and_load_round_trip); - RUN_TEST(test_load_seeds_millis_even_without_rtc); + RUN_TEST(test_boot_after_recent_send_still_throttles); + + // Issue #9901 regression tests + RUN_TEST(test_boot_after_long_gap_allows_nodeinfo); + RUN_TEST(test_boot_within_throttle_window_still_throttles); + + // No-RTC regression tests + RUN_TEST(test_boot_without_time_source_still_throttles_recent_restart); + RUN_TEST(test_boot_without_time_source_expires_boot_relative_history); exit(UNITY_END()); } From aec98b61b9b69a1e90080be716f0579e7d7509f9 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:39:26 +0100 Subject: [PATCH 010/150] MUI: WiFi map tile download: heltec V4 adaptations (#10011) * rotated MUI * mui-maps heltec-v4 adaptations --------- Co-authored-by: Ben Meadors --- platformio.ini | 2 +- src/graphics/tftSetup.cpp | 6 +++++- variants/esp32s3/heltec_v4/platformio.ini | 5 ++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 2fcfc480d..9b32c61de 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/f36d2a953524e372b78c5b4147ec55f38716964e.zip + https://github.com/meshtastic/device-ui/archive/03fbf26f5d6095f2c7c77ee2d064af01669ac38c.zip ; Common libs for environmental measurements in telemetry module [environmental_base] diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index 5654fa02a..708cd8967 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -16,6 +16,10 @@ DeviceScreen *deviceScreen = nullptr; +#ifndef TFT_TASK_STACK_SIZE +#define TFT_TASK_STACK_SIZE 16384 +#endif + #ifdef ARCH_ESP32 // Get notified when the system is entering light sleep CallbackObserver tftSleepObserver = @@ -127,7 +131,7 @@ void tftSetup(void) #ifdef ARCH_ESP32 tftSleepObserver.observe(¬ifyLightSleep); endSleepObserver.observe(¬ifyLightSleepEnd); - xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0); + xTaskCreatePinnedToCore(tft_task_handler, "tft", TFT_TASK_STACK_SIZE, NULL, 1, NULL, 0); #elif defined(ARCH_PORTDUINO) std::thread *tft_task = new std::thread([] { tft_task_handler(); }); #endif diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 9acf30c21..cb795c65d 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -68,7 +68,10 @@ build_flags = -D INPUTDRIVER_BUTTON_TYPE=0 -D HAS_SCREEN=1 -D HAS_TFT=1 - -D RAM_SIZE=1860 + -D MAP_TILES_GREY ; required for 2MB PSRAM + -D RAM_SIZE=1432 + -D STBI_ARENA_SIZE=450000 + -D LV_CACHE_DEF_SIZE=0 -D LV_LVGL_H_INCLUDE_SIMPLE -D LV_CONF_INCLUDE_SIMPLE -D LV_COMP_CONF_INCLUDE_SIMPLE From 844f5b46d071fba95c520053b87571321234b787 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 29 Mar 2026 10:55:47 -0400 Subject: [PATCH 011/150] Update meshtastic/device-ui digest to 7b1485b (#10023) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 9b32c61de..31d4d739c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/03fbf26f5d6095f2c7c77ee2d064af01669ac38c.zip + https://github.com/meshtastic/device-ui/archive/7b1485b86c8d55a40e5226749097767e8b87f396.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 80763ca235d95e149c94914873238a83f1043eb8 Mon Sep 17 00:00:00 2001 From: Austin Lane Date: Sun, 29 Mar 2026 12:14:01 -0400 Subject: [PATCH 012/150] Move core lib_deps to github zips PlatformIO registry is (probably) rate limiting us. Mitigate by switching to GitHub source zips (based upon tags). This change does not include any updates, simply swapping to a new download location. --- platformio.ini | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/platformio.ini b/platformio.ini index 31d4d739c..673966494 100644 --- a/platformio.ini +++ b/platformio.ini @@ -77,10 +77,10 @@ lib_deps = https://github.com/meshtastic/TinyGPSPlus/archive/71a82db35f3b973440044c476d4bcdc673b104f4.zip # renovate: datasource=git-refs depName=meshtastic-ArduinoThread packageName=https://github.com/meshtastic/ArduinoThread gitBranch=master https://github.com/meshtastic/ArduinoThread/archive/b841b0415721f1341ea41cccfb4adccfaf951567.zip - # renovate: datasource=custom.pio depName=Nanopb packageName=nanopb/library/Nanopb - nanopb/Nanopb@0.4.91 - # renovate: datasource=custom.pio depName=ErriezCRC32 packageName=erriez/library/ErriezCRC32 - erriez/ErriezCRC32@1.0.1 + # renovate: datasource=github-tags depName=Nanopb packageName=nanopb/nanopb + https://github.com/nanopb/nanopb/archive/refs/tags/nanopb-0.4.9.1.zip + # renovate: datasource=github-tags depName=ErriezCRC32 packageName=Erriez/ErriezCRC32 + https://github.com/Erriez/ErriezCRC32/archive/refs/tags/1.0.1.zip ; Used for the code analysis in PIO Home / Inspect check_tool = cppcheck @@ -95,8 +95,8 @@ check_flags = framework = arduino lib_deps = ${env.lib_deps} - # renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL - end2endzone/NonBlockingRTTTL@1.4.0 + # renovate: datasource=github-tags depName=NonBlockingRTTTL packageName=end2endzone/NonBlockingRTTTL + https://github.com/end2endzone/NonBlockingRTTTL/archive/refs/tags/1.4.0.zip build_unflags = -std=c++11 -std=gnu++11 @@ -107,21 +107,21 @@ build_src_filter = ${env.build_src_filter} - - Date: Sun, 29 Mar 2026 13:28:42 -0400 Subject: [PATCH 013/150] Hack: Use re-uploaded framework-arduinoespressif32 on ESP32c6 Dirty hack to keep ESP32c6 building. Remove when updating to pioarduino --- variants/esp32c6/esp32c6.ini | 3 +++ 1 file changed, 3 insertions(+) diff --git a/variants/esp32c6/esp32c6.ini b/variants/esp32c6/esp32c6.ini index 9ab185d02..cdd9f9868 100644 --- a/variants/esp32c6/esp32c6.ini +++ b/variants/esp32c6/esp32c6.ini @@ -3,6 +3,9 @@ extends = esp32_common platform = # Do not renovate until we have switched to pioarduino tagged builds https://github.com/Jason2866/platform-espressif32/archive/22faa566df8c789000f8136cd8d0aca49617af55.zip +platform_packages = + # HACK: This release was automatically removed upstream + framework-arduinoespressif32 @ https://github.com/vidplace7/platform-espressif32/releases/download/meshtastic-esp32c6/framework-arduinoespressif32-all-release_v5.1-124d64e.zip build_flags = ${arduino_base.build_flags} -Wall From 29d70853e6e0d14452a8e85ccbe6dc924eb1fa99 Mon Sep 17 00:00:00 2001 From: Austin Lane Date: Sun, 29 Mar 2026 14:11:55 -0400 Subject: [PATCH 014/150] Renovate: Run once daily (not upon EVERY change) Cut down on the spammin! Give the PIO Registry a break! --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index 187cdc600..d761f61c1 100644 --- a/renovate.json +++ b/renovate.json @@ -4,6 +4,7 @@ ":dependencyDashboard", ":semanticCommitTypeAll(chore)", ":ignoreModulesAndTests", + "schedule:daily", "group:recommended", "replacements:all", "workarounds:all" From 198339873a132804acba1ab1dd73a03e755e98d4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 30 Mar 2026 06:29:40 -0500 Subject: [PATCH 015/150] Upgrade trunk (#10033) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 5ecc0aeba..3a19e7424 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,8 +8,8 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.511 - - renovate@43.92.1 + - checkov@3.2.513 + - renovate@43.100.0 - prettier@3.8.1 - trufflehog@3.94.1 - yamllint@1.38.0 From 2955c12d2a09eaafaff6e8832e73683722528c0a Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Mon, 30 Mar 2026 15:03:10 +0100 Subject: [PATCH 016/150] Configure NFC pins as GPIO for older bootloaders (#10016) * Configure NFC pins as GPIO for older bootloaders Should hopefully solve the issue in https://github.com/meshtastic/firmware/issues/9986 * Fix formatting of CONFIG_NFCT_PINS_AS_GPIOS flag in platformio.ini --------- Co-authored-by: Ben Meadors --- variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini index 3f9a4f7af..7018d054e 100644 --- a/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini +++ b/variants/nrf52840/seeed_xiao_nrf52840_kit/platformio.ini @@ -18,6 +18,7 @@ build_flags = ${nrf52840_base.build_flags} -I src/platform/nrf52/softdevice/nrf52 -DSEEED_XIAO_NRF52840_KIT -DSEEED_XIAO_NRF_KIT_DEFAULT + -DCONFIG_NFCT_PINS_AS_GPIOS=1 board_build.ldscript = src/platform/nrf52/nrf52840_s140_v7.ld build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/seeed_xiao_nrf52840_kit> debug_tool = jlink @@ -31,4 +32,4 @@ board_level = extra build_flags = ${env:seeed_xiao_nrf52840_kit.build_flags} -DSEEED_XIAO_NRF52840_KIT -DSEEED_XIAO_NRF_KIT_I2C ; Define I2C variant - -USEEED_XIAO_NRF_KIT_DEFAULT ; Remove default define \ No newline at end of file + -USEEED_XIAO_NRF_KIT_DEFAULT ; Remove default define From 870ba800920895c46a6370c105c1702c6313bff0 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 30 Mar 2026 11:14:43 -0400 Subject: [PATCH 017/150] wio-sdk-wm1110: inherit build_unflags (#10034) --- variants/nrf52840/wio-sdk-wm1110/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/nrf52840/wio-sdk-wm1110/platformio.ini b/variants/nrf52840/wio-sdk-wm1110/platformio.ini index 7c11ef6f6..9fac82289 100644 --- a/variants/nrf52840/wio-sdk-wm1110/platformio.ini +++ b/variants/nrf52840/wio-sdk-wm1110/platformio.ini @@ -9,6 +9,7 @@ extra_scripts = # Remove adafruit USB serial from the build (it is incompatible with using the ch340 serial chip on this board) build_unflags = + ${nrf52840_base.build_unflags} -Ofast -Og -ggdb3 From 0abd3cdde87fb325ad3373da85a3dba41c19f326 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 30 Mar 2026 14:20:19 -0400 Subject: [PATCH 018/150] ESP32: Take away "tbeam" boards PSRAM to reclaim iram (#10036) You read that right! Disable PSRAM on the ttgo-tbeam board to reclaim *iram*. ttgo-tbeam.json is a copy of https://github.com/platformio/platform-espressif32/blob/v6.13.0/boards/ttgo-t-beam.json with HAS_PSRAM removed. PSRAM support on OG-ESP32 involves a lot of iram usage thanks to iram-heavy workarounds that have been added to address hardware bugs. See https://docs.espressif.com/projects/esp-idf/en/v4.4/esp32/api-guides/performance/ram-usage.html#optimizing-iram-usage --- boards/ttgo-tbeam.json | 29 +++++++++++++++++++ .../esp32/nano-g1-explorer/platformio.ini | 2 +- variants/esp32/nano-g1/platformio.ini | 2 +- variants/esp32/station-g1/platformio.ini | 5 +--- variants/esp32/tbeam/platformio.ini | 4 +-- variants/esp32/tbeam_v07/platformio.ini | 2 +- 6 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 boards/ttgo-tbeam.json diff --git a/boards/ttgo-tbeam.json b/boards/ttgo-tbeam.json new file mode 100644 index 000000000..a4c43d525 --- /dev/null +++ b/boards/ttgo-tbeam.json @@ -0,0 +1,29 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_T_Beam", + "f_cpu": "240000000L", + "f_flash": "40000000L", + "flash_mode": "dio", + "mcu": "esp32", + "variant": "tbeam" + }, + "connectivity": ["wifi", "bluetooth", "can", "ethernet"], + "debug": { + "openocd_board": "esp-wroom-32.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "TTGO T-Beam (PSRAM Disabled)", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 1310720, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://github.com/LilyGO/TTGO-T-Beam", + "vendor": "TTGO" +} diff --git a/variants/esp32/nano-g1-explorer/platformio.ini b/variants/esp32/nano-g1-explorer/platformio.ini index 16ecb99cc..b27ebf28e 100644 --- a/variants/esp32/nano-g1-explorer/platformio.ini +++ b/variants/esp32/nano-g1-explorer/platformio.ini @@ -9,7 +9,7 @@ custom_meshtastic_display_name = Nano G1 Explorer custom_meshtastic_tags = B&Q extends = esp32_base -board = ttgo-t-beam +board = ttgo-tbeam build_flags = ${esp32_base.build_flags} -D NANO_G1_EXPLORER diff --git a/variants/esp32/nano-g1/platformio.ini b/variants/esp32/nano-g1/platformio.ini index 724e008c7..b2e392dbd 100644 --- a/variants/esp32/nano-g1/platformio.ini +++ b/variants/esp32/nano-g1/platformio.ini @@ -9,7 +9,7 @@ custom_meshtastic_display_name = Nano G1 custom_meshtastic_tags = B&Q extends = esp32_base -board = ttgo-t-beam +board = ttgo-tbeam build_flags = ${esp32_base.build_flags} -D NANO_G1 diff --git a/variants/esp32/station-g1/platformio.ini b/variants/esp32/station-g1/platformio.ini index b1f3e15f3..5a7f33485 100644 --- a/variants/esp32/station-g1/platformio.ini +++ b/variants/esp32/station-g1/platformio.ini @@ -9,10 +9,7 @@ custom_meshtastic_display_name = Station G1 custom_meshtastic_tags = B&Q extends = esp32_base -board = ttgo-t-beam -build_unflags = - ${esp32_common.build_unflags} - -DBOARD_HAS_PSRAM +board = ttgo-tbeam build_flags = ${esp32_base.build_flags} -D STATION_G1 diff --git a/variants/esp32/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini index 26c8e9cd3..c9e6cce1f 100644 --- a/variants/esp32/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -10,14 +10,12 @@ custom_meshtastic_images = tbeam.svg custom_meshtastic_tags = LilyGo extends = esp32_base -board = ttgo-t-beam +board = ttgo-tbeam board_check = true build_flags = ${esp32_base.build_flags} -D TBEAM_V10 -I variants/esp32/tbeam - -DBOARD_HAS_PSRAM - -mfix-esp32-psram-cache-issue -ULED_BUILTIN upload_speed = 921600 diff --git a/variants/esp32/tbeam_v07/platformio.ini b/variants/esp32/tbeam_v07/platformio.ini index e2763fdec..1809ba56c 100644 --- a/variants/esp32/tbeam_v07/platformio.ini +++ b/variants/esp32/tbeam_v07/platformio.ini @@ -9,7 +9,7 @@ custom_meshtastic_tags = LilyGo board_level = extra extends = esp32_base -board = ttgo-t-beam +board = ttgo-tbeam build_flags = ${esp32_base.build_flags} -D TBEAM_V07 From 33d526f6f9ded593974c510261d26c39a8bb70a8 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 30 Mar 2026 14:30:54 -0400 Subject: [PATCH 019/150] Set t5s3_epaper_inkhud to `extra` (#10037) t5s3_epaper_inkhud is incomplete (missing macros). Disable it for now. Also fixes the board_check evaluation so that `false` actually works. --- bin/generate_ci_matrix.py | 2 +- variants/esp32s3/t5s3_epaper/platformio.ini | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/generate_ci_matrix.py b/bin/generate_ci_matrix.py index b4c18c05b..1458e4390 100755 --- a/bin/generate_ci_matrix.py +++ b/bin/generate_ci_matrix.py @@ -43,7 +43,7 @@ for pio_env in pio_envs: env = { "ci": {"board": pio_env, "platform": env_platform}, "board_level": cfg.get(f"env:{pio_env}", "board_level", default=None), - "board_check": bool(cfg.get(f"env:{pio_env}", "board_check", default=False)), + "board_check": cfg.get(f"env:{pio_env}", "board_check", default="false").strip().lower() == "true", } all_envs.append(env) diff --git a/variants/esp32s3/t5s3_epaper/platformio.ini b/variants/esp32s3/t5s3_epaper/platformio.ini index 8f4a02a00..bad36706c 100644 --- a/variants/esp32s3/t5s3_epaper/platformio.ini +++ b/variants/esp32s3/t5s3_epaper/platformio.ini @@ -30,6 +30,8 @@ lib_deps = [env:t5s3_epaper_inkhud] extends = t5s3_epaper_base, inkhud +board_level = extra # inkhud port is incomplete +board_check = false build_flags = ${t5s3_epaper_base.build_flags} ${inkhud.build_flags} From 4e05f20c58c20acb12d1ecf309cf6d8ea8e2540a Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 30 Mar 2026 15:36:59 -0400 Subject: [PATCH 020/150] Renovate: Don't update branches outside the schedule (daily) (#10039) Renovate is still running after each merge... maybe this will fix it --- renovate.json | 1 + 1 file changed, 1 insertion(+) diff --git a/renovate.json b/renovate.json index d761f61c1..60c51b59e 100644 --- a/renovate.json +++ b/renovate.json @@ -4,6 +4,7 @@ ":dependencyDashboard", ":semanticCommitTypeAll(chore)", ":ignoreModulesAndTests", + ":noUnscheduledUpdates", "schedule:daily", "group:recommended", "replacements:all", From 8fe12e9fdaa6166a35a2c8bf386d261ddb71de96 Mon Sep 17 00:00:00 2001 From: Philip Lykov Date: Mon, 30 Mar 2026 15:12:23 +0300 Subject: [PATCH 021/150] Fix W5100S socket exhaustion blocking MQTT and additional TCP clients (#9770) The W5100S Ethernet chip has only 4 hardware sockets. On RAK4631 Ethernet gateways with syslog and NTP enabled, all 4 sockets were permanently consumed (NTP UDP + Syslog UDP + TCP API listener + TCP API client), leaving none for MQTT, DHCP lease renewal, or additional TCP connections. - NTP: Remove permanent timeClient.begin() at startup; NTPClient::update() auto-initializes when needed. Add timeClient.end() after each query to release the UDP socket immediately. - Syslog: Remove socket allocation from Syslog::enable(). Open and close the UDP socket on-demand in _sendLog() around each message send. - MQTT: Fix socket leak in isValidConfig() where a successful test connection was never closed (PubSubClient destructor does not call disconnect). Add explicit pubSub->disconnect() before returning. Made-with: Cursor Co-authored-by: Ben Meadors --- src/DebugConfiguration.cpp | 12 ++++++++++-- src/mesh/eth/ethClient.cpp | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/DebugConfiguration.cpp b/src/DebugConfiguration.cpp index 08c7abc04..207feb8c0 100644 --- a/src/DebugConfiguration.cpp +++ b/src/DebugConfiguration.cpp @@ -98,7 +98,6 @@ Syslog &Syslog::logMask(uint8_t priMask) void Syslog::enable() { - this->_client->begin(this->_port); this->_enabled = true; } @@ -166,14 +165,21 @@ inline bool Syslog::_sendLog(uint16_t pri, const char *appName, const char *mess if ((pri & LOG_FACMASK) == 0) pri = LOG_MAKEPRI(LOG_FAC(this->_priDefault), pri); + // W5100S: acquire UDP socket on-demand to avoid permanent socket consumption + if (!this->_client->begin(this->_port)) { + return false; + } + if (this->_server != NULL) { result = this->_client->beginPacket(this->_server, this->_port); } else { result = this->_client->beginPacket(this->_ip, this->_port); } - if (result != 1) + if (result != 1) { + this->_client->stop(); return false; + } this->_client->print('<'); this->_client->print(pri); @@ -193,6 +199,8 @@ inline bool Syslog::_sendLog(uint16_t pri, const char *appName, const char *mess this->_client->print(message); this->_client->endPacket(); + this->_client->stop(); // W5100S: release UDP socket for other services + return true; } diff --git a/src/mesh/eth/ethClient.cpp b/src/mesh/eth/ethClient.cpp index 80741810a..440f7b76a 100644 --- a/src/mesh/eth/ethClient.cpp +++ b/src/mesh/eth/ethClient.cpp @@ -102,7 +102,6 @@ static int32_t reconnectETH() #ifndef DISABLE_NTP LOG_INFO("Start NTP time client"); - timeClient.begin(); timeClient.setUpdateInterval(60 * 60); // Update once an hour #endif @@ -159,6 +158,7 @@ static int32_t reconnectETH() LOG_ERROR("NTP Update failed"); ntp_renew = millis() + 300 * 1000; // failure, retry every 5 minutes } + timeClient.end(); // W5100S: release UDP socket for other services } #endif From 3ad80b80ee33e41214cb2998511b0abb4db59b9d Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:39:26 +0100 Subject: [PATCH 022/150] MUI: WiFi map tile download: heltec V4 adaptations (#10011) * rotated MUI * mui-maps heltec-v4 adaptations --------- Co-authored-by: Ben Meadors --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 673966494..5ec94a611 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/7b1485b86c8d55a40e5226749097767e8b87f396.zip + https://github.com/meshtastic/device-ui/archive/03fbf26f5d6095f2c7c77ee2d064af01669ac38c.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 9e61c44629ccc4c14e21ef4c2807388838306936 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 22 Mar 2026 18:47:52 +0000 Subject: [PATCH 023/150] fix(routing): prevent licensed users from rebroadcasting packets to or from unlicensed users (#9958) * fix(routing): prevent licensed users from rebroadcasting packets from unlicensed or unknown users * fix(routing): prevent licensed users from rebroadcasting packets to or from unlicensed users --------- Co-authored-by: Ben Meadors --- src/modules/RoutingModule.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/modules/RoutingModule.cpp b/src/modules/RoutingModule.cpp index d87cf3a44..85e7f8c06 100644 --- a/src/modules/RoutingModule.cpp +++ b/src/modules/RoutingModule.cpp @@ -20,10 +20,11 @@ bool RoutingModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mesh if ((nodeDB->getMeshNode(mp.from) == NULL || !nodeDB->getMeshNode(mp.from)->has_user) && (nodeDB->getMeshNode(mp.to) == NULL || !nodeDB->getMeshNode(mp.to)->has_user)) return false; - } else if (owner.is_licensed && nodeDB->getLicenseStatus(mp.from) == UserLicenseStatus::NotLicensed) { - // Don't let licensed users to rebroadcast packets from unlicensed users + } else if (owner.is_licensed && ((nodeDB->getLicenseStatus(mp.from) == UserLicenseStatus::NotLicensed) || + (nodeDB->getLicenseStatus(mp.to) == UserLicenseStatus::NotLicensed))) { + // Don't let licensed users to rebroadcast packets to or from unlicensed users // If we know they are in-fact unlicensed - LOG_DEBUG("Packet from unlicensed user, ignoring packet"); + LOG_DEBUG("Packet to or from unlicensed user, ignoring packet"); return false; } From 90befeeeb143aedb75bc3669c80b94aaf757d52c Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 23 Mar 2026 21:15:56 -0400 Subject: [PATCH 024/150] Add timeout to PPA uploads (#9989) Don't allow dput to run for more than 15 minutes (successful runs take about ~8 minutes) --- .github/workflows/daily_packaging.yml | 2 +- .github/workflows/package_ppa.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily_packaging.yml b/.github/workflows/daily_packaging.yml index 978699369..16363f562 100644 --- a/.github/workflows/daily_packaging.yml +++ b/.github/workflows/daily_packaging.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: push: branches: - - master + - develop # Default branch, same as 'cron' above paths: - debian/** - "*.rpkg" diff --git a/.github/workflows/package_ppa.yml b/.github/workflows/package_ppa.yml index aa091fa14..334a7016d 100644 --- a/.github/workflows/package_ppa.yml +++ b/.github/workflows/package_ppa.yml @@ -67,5 +67,6 @@ jobs: - name: Publish with dput if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }} + timeout-minutes: 15 # dput is terrible, sometimes runs 'forever' run: | dput ${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes From 8c905427a18a43551980d4b84260661d20ce5c95 Mon Sep 17 00:00:00 2001 From: "Ethac.chen" Date: Fri, 27 Mar 2026 19:56:19 +0800 Subject: [PATCH 025/150] =?UTF-8?q?Fix=20rak=5Fwismeshtag=20low=E2=80=91vo?= =?UTF-8?q?ltage=20reboot=20hang=20after=20App=20configuration=20(#9897)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix TAG low‑voltage reboot hang after App configuration * nRF52: Move low-VDD System OFF logic to variant hook * Addressed review * serialize SAADC access with shared mutex for VDD and battery reads * raise LPCOMP wake threshold to ensure rising-edge wake * Trunk fmt --------- Co-authored-by: Ben Meadors --- src/Power.cpp | 8 ++++ src/platform/nrf52/Nrf52SaadcLock.cpp | 13 +++++++ src/platform/nrf52/Nrf52SaadcLock.h | 12 ++++++ src/platform/nrf52/main-nrf52.cpp | 26 ++++++++++--- variants/nrf52840/rak_wismeshtag/variant.cpp | 40 ++++++++++++++++++++ variants/nrf52840/rak_wismeshtag/variant.h | 36 +++++++++++++++++- 6 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 src/platform/nrf52/Nrf52SaadcLock.cpp create mode 100644 src/platform/nrf52/Nrf52SaadcLock.h diff --git a/src/Power.cpp b/src/Power.cpp index ea4fcf42a..d82c870ed 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -35,6 +35,11 @@ #include "nrfx_power.h" #endif +#if defined(ARCH_NRF52) +#include "Nrf52SaadcLock.h" +#include "concurrency/LockGuard.h" +#endif + #if defined(DEBUG_HEAP_MQTT) && !MESHTASTIC_EXCLUDE_MQTT #include "mqtt/MQTT.h" #include "target_specific.h" @@ -328,6 +333,9 @@ class AnalogBatteryLevel : public HasBatteryLevel scaled = esp_adc_cal_raw_to_voltage(raw, adc_characs); scaled *= operativeAdcMultiplier; #else // block for all other platforms +#ifdef ARCH_NRF52 + concurrency::LockGuard saadcGuard(concurrency::nrf52SaadcLock); +#endif for (uint32_t i = 0; i < BATTERY_SENSE_SAMPLES; i++) { raw += analogRead(BATTERY_PIN); } diff --git a/src/platform/nrf52/Nrf52SaadcLock.cpp b/src/platform/nrf52/Nrf52SaadcLock.cpp new file mode 100644 index 000000000..21f4f4dfd --- /dev/null +++ b/src/platform/nrf52/Nrf52SaadcLock.cpp @@ -0,0 +1,13 @@ +#include "Nrf52SaadcLock.h" +#include "concurrency/Lock.h" +#include "configuration.h" + +#ifdef ARCH_NRF52 + +namespace concurrency +{ +static Lock nrf52SaadcLockInstance; +Lock *nrf52SaadcLock = &nrf52SaadcLockInstance; +} // namespace concurrency + +#endif diff --git a/src/platform/nrf52/Nrf52SaadcLock.h b/src/platform/nrf52/Nrf52SaadcLock.h new file mode 100644 index 000000000..77024eea3 --- /dev/null +++ b/src/platform/nrf52/Nrf52SaadcLock.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef ARCH_NRF52 + +namespace concurrency +{ +class Lock; +/** Shared mutex for SAADC configuration and reads (VDD + battery analog path). */ +extern Lock *nrf52SaadcLock; +} // namespace concurrency + +#endif diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index c705521ad..73780b6eb 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -25,6 +25,8 @@ #include "power.h" #include +#include "Nrf52SaadcLock.h" +#include "concurrency/LockGuard.h" #include #ifdef BQ25703A_ADDR @@ -51,6 +53,10 @@ uint16_t getVDDVoltage(); void variant_shutdown() __attribute__((weak)); void variant_shutdown() {} +// Optional variant hook called each nrf52Loop(); e.g. for low-VDD System OFF. +void variant_nrf52LoopHook(void) __attribute__((weak)); +void variant_nrf52LoopHook(void) {} + static nrfx_wdt_t nrfx_wdt = NRFX_WDT_INSTANCE(0); static nrfx_wdt_channel_id nrfx_wdt_channel_id_nrf52_main; @@ -74,11 +80,18 @@ bool powerHAL_isVBUSConnected() bool powerHAL_isPowerLevelSafe() { - static bool powerLevelSafe = true; - uint16_t threshold = SAFE_VDD_VOLTAGE_THRESHOLD * 1000; // convert V to mV - uint16_t hysteresis = SAFE_VDD_VOLTAGE_THRESHOLD_HYST * 1000; +#ifdef SAFE_VDD_VOLTAGE_THRESHOLD_MV + uint16_t threshold = SAFE_VDD_VOLTAGE_THRESHOLD_MV; +#else + uint16_t threshold = (uint16_t)(SAFE_VDD_VOLTAGE_THRESHOLD * 1000.0f + 0.5f); // convert V to mV +#endif +#ifdef SAFE_VDD_VOLTAGE_THRESHOLD_HYST_MV + uint16_t hysteresis = SAFE_VDD_VOLTAGE_THRESHOLD_HYST_MV; +#else + uint16_t hysteresis = (uint16_t)(SAFE_VDD_VOLTAGE_THRESHOLD_HYST * 1000.0f + 0.5f); +#endif if (powerLevelSafe) { if (getVDDVoltage() < threshold) { @@ -125,11 +138,12 @@ void powerHAL_platformInit() // get VDD voltage (in millivolts) uint16_t getVDDVoltage() { - // we use the same values as regular battery read so there is no conflict on SAADC + concurrency::LockGuard guard(concurrency::nrf52SaadcLock); + + // Match battery read resolution; SAADC is shared with AnalogBatteryLevel in Power.cpp. analogReadResolution(BATTERY_SENSE_RESOLUTION_BITS); // VDD range on NRF52840 is 1.8-3.3V so we need to remap analog reference to 3.6V - // let's hope battery reading runs in same task and we don't have race condition analogReference(AR_INTERNAL); uint16_t vddADCRead = analogReadVDD(); @@ -326,6 +340,8 @@ void nrf52Loop() checkSDEvents(); reportLittleFSCorruptionOnce(); + + variant_nrf52LoopHook(); // Optional variant hook called each nrf52Loop(); } #ifdef USE_SEMIHOSTING diff --git a/variants/nrf52840/rak_wismeshtag/variant.cpp b/variants/nrf52840/rak_wismeshtag/variant.cpp index a035fbaf0..a0394b2dd 100644 --- a/variants/nrf52840/rak_wismeshtag/variant.cpp +++ b/variants/nrf52840/rak_wismeshtag/variant.cpp @@ -19,7 +19,11 @@ */ #include "variant.h" +#include "Arduino.h" +#include "FreeRTOS.h" #include "nrf.h" +#include "power/PowerHAL.h" +#include "sleep.h" #include "wiring_constants.h" #include "wiring_digital.h" @@ -40,3 +44,39 @@ void initVariant() pinMode(PIN_3V3_EN, OUTPUT); digitalWrite(PIN_3V3_EN, HIGH); } + +#ifdef LOW_VDD_SYSTEMOFF_DELAY_MS +void variant_nrf52LoopHook(void) +{ + // If VDD stays unsafe for a while (brownout), force System OFF. + // Skip when VBUS present to allow recovery while USB-powered. + if (!powerHAL_isVBUSConnected()) { + // Rate-limit VDD safety checks: powerHAL_isPowerLevelSafe() calls getVDDVoltage() each time. + static constexpr uint32_t POWER_LEVEL_CHECK_INTERVAL_MS = 100; + static uint32_t last_vdd_check_ms = 0; + static bool last_power_level_safe = true; + + const uint32_t now = millis(); + if (last_vdd_check_ms == 0 || (uint32_t)(now - last_vdd_check_ms) >= POWER_LEVEL_CHECK_INTERVAL_MS) { + last_vdd_check_ms = now; + last_power_level_safe = powerHAL_isPowerLevelSafe(); + } + + // Do not use millis()==0 as a sentinel: at boot, millis() may be 0 while VDD is unsafe. + static bool low_vdd_timer_armed = false; + static uint32_t low_vdd_since_ms = 0; + + if (!last_power_level_safe) { + if (!low_vdd_timer_armed) { + low_vdd_since_ms = now; + low_vdd_timer_armed = true; + } + if ((uint32_t)(now - low_vdd_since_ms) >= (uint32_t)LOW_VDD_SYSTEMOFF_DELAY_MS) { + cpuDeepSleep(portMAX_DELAY); + } + } else { + low_vdd_timer_armed = false; + } + } +} +#endif diff --git a/variants/nrf52840/rak_wismeshtag/variant.h b/variants/nrf52840/rak_wismeshtag/variant.h index 5b20e4d93..9ea215e42 100644 --- a/variants/nrf52840/rak_wismeshtag/variant.h +++ b/variants/nrf52840/rak_wismeshtag/variant.h @@ -225,7 +225,41 @@ SO GPIO 39/TXEN MAY NOT BE DEFINED FOR SUCCESSFUL OPERATION OF THE SX1262 - TG #define AREF_VOLTAGE 3.0 #define VBAT_AR_INTERNAL AR_INTERNAL_3_0 #define ADC_MULTIPLIER 1.73 -#define OCV_ARRAY 4240, 4112, 4029, 3970, 3906, 3846, 3824, 3802, 3776, 3650, 3072 +#define OCV_ARRAY 4160, 4020, 3940, 3870, 3810, 3760, 3740, 3720, 3680, 3620, 2990 // updated OCV array for rak_wismeshtag + +// Wake from System OFF when battery rises again (LPCOMP). +// BAT_ADC divider: R22=1M (top), R24=1.5M (bottom) => V_BAT_ADC = VBAT * (1.5 / (1.0 + 1.5)) = 0.6 * VBAT +// RAK4630 module: AIN0 = nrf52840 AIN3 = Pin 5 (A0/BATTERY_PIN) +#define BATTERY_LPCOMP_INPUT NRF_LPCOMP_INPUT_3 +// LPCOMP compares the selected input to a fraction of VDD (here 5/8 of VDD at the LPCOMP input). +// With VDD ≈ 3.3 V: threshold at input ≈ (5/8) * 3.3 V ≈ 2.06 V. +// BAT_ADC divider: V_BAT_ADC = 0.6 * VBAT → equivalent VBAT ≈ 2.06 / 0.6 ≈ 3.4 V (wake when battery recovers). +// +// Note: if VDD is drooping/tracking VBAT in the low-voltage region, using a fraction >= divider ratio helps ensure the +// input is below the threshold at shutdown; the intended wake event happens when the supply recovers enough for a rising +// crossing to occur. +#define BATTERY_LPCOMP_THRESHOLD NRF_LPCOMP_REF_SUPPLY_5_8 + +// Low voltage protection: +// If VDD is below SAFE_VDD_VOLTAGE_THRESHOLD for longer than this delay (and no USB VBUS), +// the device will enter System OFF to avoid brownout loops and flash corruption. +#ifndef LOW_VDD_SYSTEMOFF_DELAY_MS +#define LOW_VDD_SYSTEMOFF_DELAY_MS 5000 +#endif + +// Prefer integer mV so platform code avoids float→int truncation quirks (e.g. 0.1 V → 99 vs 100 mV). +#ifndef SAFE_VDD_VOLTAGE_THRESHOLD_MV +#define SAFE_VDD_VOLTAGE_THRESHOLD_MV 2900 +#endif +#ifndef SAFE_VDD_VOLTAGE_THRESHOLD_HYST_MV +#define SAFE_VDD_VOLTAGE_THRESHOLD_HYST_MV 100 +#endif +#ifndef SAFE_VDD_VOLTAGE_THRESHOLD +#define SAFE_VDD_VOLTAGE_THRESHOLD (SAFE_VDD_VOLTAGE_THRESHOLD_MV / 1000.0f) +#endif +#ifndef SAFE_VDD_VOLTAGE_THRESHOLD_HYST +#define SAFE_VDD_VOLTAGE_THRESHOLD_HYST (SAFE_VDD_VOLTAGE_THRESHOLD_HYST_MV / 1000.0f) +#endif #define RAK_4631 1 From c7feef00c013d80980cc76902f39b2caabf4f05e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:07:11 -0500 Subject: [PATCH 026/150] Update meshtastic/device-ui digest to 7b1485b (#10044) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 5ec94a611..673966494 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/03fbf26f5d6095f2c7c77ee2d064af01669ac38c.zip + https://github.com/meshtastic/device-ui/archive/7b1485b86c8d55a40e5226749097767e8b87f396.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From fc6c89abebbfcab5e9245a216f4ef058c5029962 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 31 Mar 2026 14:36:29 -0500 Subject: [PATCH 027/150] Upgrade trunk (#10041) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 3a19e7424..2d8b347ac 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.513 - - renovate@43.100.0 + - renovate@43.101.2 - prettier@3.8.1 - trufflehog@3.94.1 - yamllint@1.38.0 @@ -21,7 +21,7 @@ lint: - markdownlint@0.48.0 - oxipng@10.1.0 - svgo@4.0.1 - - actionlint@1.7.11 + - actionlint@1.7.12 - flake8@7.3.0 - hadolint@2.14.0 - shfmt@3.6.0 From 8dc3c0541bdbc4465fe572f28aa3de883eda0d1b Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:03:34 +0200 Subject: [PATCH 028/150] feat: Mesh-tab wifi map + exclude screen fix (#10038) * fix MESHTASTIC_EXCLUDE_SCREEN * mesh-tab map constraints (2 MB PSRAM) * point MUI commit to the related PR --------- Co-authored-by: Ben Meadors --- src/input/InputBroker.cpp | 5 ++++- variants/esp32s3/mesh-tab/platformio.ini | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index e3125ca12..1d5199a58 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -299,6 +299,7 @@ void InputBroker::Init() // Buttons. Moved here cause we need NodeDB to be initialized // If your variant.h has a BUTTON_PIN defined, go ahead and define BUTTON_ACTIVE_LOW and BUTTON_ACTIVE_PULLUP UserButtonThread = new ButtonThread("UserButton"); +#if !MESHTASTIC_EXCLUDE_SCREEN if (screen) { ButtonConfig userConfig; userConfig.pinNumber = (uint8_t)_pinNum; @@ -317,7 +318,9 @@ void InputBroker::Init() userConfig.longPressTime = 500; userConfig.longLongPress = INPUT_BROKER_SHUTDOWN; UserButtonThread->initButton(userConfig); - } else { + } else +#endif + { ButtonConfig userConfigNoScreen; userConfigNoScreen.pinNumber = (uint8_t)_pinNum; userConfigNoScreen.activeLow = BUTTON_ACTIVE_LOW; diff --git a/variants/esp32s3/mesh-tab/platformio.ini b/variants/esp32s3/mesh-tab/platformio.ini index ecf5498b3..a153ba9fb 100644 --- a/variants/esp32s3/mesh-tab/platformio.ini +++ b/variants/esp32s3/mesh-tab/platformio.ini @@ -12,6 +12,7 @@ build_flags = ${esp32s3_base.build_flags} -D CONFIG_ARDUHAL_ESP_LOG -D CONFIG_ARDUHAL_LOG_COLORS=1 -D CONFIG_DISABLE_HAL_LOCKS=1 + -D MESHTASTIC_EXCLUDE_SCREEN=1 -D MESHTASTIC_EXCLUDE_CANNEDMESSAGES=1 -D MESHTASTIC_EXCLUDE_INPUTBROKER=1 -D MESHTASTIC_EXCLUDE_BLUETOOTH=1 @@ -31,7 +32,10 @@ build_flags = ${esp32s3_base.build_flags} -D HAS_SCREEN=0 -D HAS_TFT=1 -D USE_PIN_BUZZER - -D RAM_SIZE=1024 + -D MAP_TILES_GREY ; required for 2MB PSRAM + -D RAM_SIZE=1432 + -D STBI_ARENA_SIZE=450000 + -D LV_CACHE_DEF_SIZE=0 -D LGFX_DRIVER_TEMPLATE -D LGFX_DRIVER=LGFX_GENERIC -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_GENERIC.h\" From 98efb25a0c5fc3cf170f348a098285833181d206 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 1 Apr 2026 21:13:16 -0500 Subject: [PATCH 029/150] Thinknode_m5 minor fixes (#10049) --- src/mesh/NodeDB.cpp | 2 +- src/modules/ExternalNotificationModule.cpp | 4 ++++ src/platform/esp32/main-esp32.cpp | 4 +++- variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp | 4 ++-- variants/esp32s3/ELECROW-ThinkNode-M5/variant.h | 9 +++++---- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 8cd3172f6..49d56512e 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -819,7 +819,7 @@ void NodeDB::installDefaultModuleConfig() moduleConfig.has_store_forward = true; moduleConfig.has_telemetry = true; moduleConfig.has_external_notification = true; -#if defined(PIN_BUZZER) || defined(PIN_VIBRATION) || defined(LED_NOTIFICATION) +#if defined(PIN_BUZZER) || defined(PIN_VIBRATION) || defined(LED_NOTIFICATION) || defined(PCA_LED_NOTIFICATION) moduleConfig.external_notification.enabled = true; #endif #if defined(PIN_BUZZER) diff --git a/src/modules/ExternalNotificationModule.cpp b/src/modules/ExternalNotificationModule.cpp index 3addc4b3a..16ccdd744 100644 --- a/src/modules/ExternalNotificationModule.cpp +++ b/src/modules/ExternalNotificationModule.cpp @@ -203,6 +203,10 @@ void ExternalNotificationModule::setExternalState(uint8_t index, bool on) default: if (output > 0) digitalWrite(output, (moduleConfig.external_notification.active ? on : !on)); +#ifdef PCA_LED_NOTIFICATION + io.digitalWrite(PCA_LED_NOTIFICATION, on); + +#endif break; } diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 171911e5e..25cb30e96 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -231,7 +231,9 @@ void cpuDeepSleep(uint32_t msecToWake) #if SOC_RTCIO_HOLD_SUPPORTED && SOC_PM_SUPPORT_EXT_WAKEUP uint64_t gpioMask = (1ULL << (config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN)); #endif - +#ifdef ALT_BUTTON_WAKE + gpioMask |= (1ULL << BUTTON_PIN_ALT); +#endif #ifdef BUTTON_NEED_PULLUP gpio_pullup_en((gpio_num_t)BUTTON_PIN); #endif diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp index 917341560..51a91bef0 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.cpp @@ -9,11 +9,11 @@ void earlyInitVariant() io.pinMode(PCA_PIN_EINK_EN, OUTPUT); io.pinMode(PCA_PIN_POWER_EN, OUTPUT); io.pinMode(PCA_LED_POWER, OUTPUT); - io.pinMode(PCA_LED_USER, OUTPUT); + io.pinMode(PCA_LED_NOTIFICATION, OUTPUT); io.pinMode(PCA_LED_ENABLE, OUTPUT); io.digitalWrite(PCA_PIN_POWER_EN, HIGH); - io.digitalWrite(PCA_LED_USER, LOW); + io.digitalWrite(PCA_LED_NOTIFICATION, LOW); io.digitalWrite(PCA_LED_ENABLE, LOW); } diff --git a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h index 223f60264..2d02c7f27 100644 --- a/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h +++ b/variants/esp32s3/ELECROW-ThinkNode-M5/variant.h @@ -8,9 +8,9 @@ // LED // Both of these are on the GPIO expander -#define PCA_LED_USER 1 // the Blue LED -#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power -#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in. +#define PCA_LED_NOTIFICATION 1 // the Blue LED +#define PCA_LED_ENABLE 2 // the power supply to the LEDs, in an OR arrangement with VBUS power +#define PCA_LED_POWER 3 // the Red LED? Seems to have hardware logic to blink when USB is plugged in. #define POWER_LED_HARDWARE_BLINKS_WHILE_CHARGING // USB_CHECK @@ -18,7 +18,7 @@ #define BATTERY_PIN 8 #define ADC_CHANNEL ADC1_GPIO8_CHANNEL -#define ADC_MULTIPLIER 2.11 // 2.0 + 10% for correction of display undervoltage. +#define ADC_MULTIPLIER 2.0 // 2.0 + 10% for correction of display undervoltage. #define PIN_BUZZER 9 @@ -86,6 +86,7 @@ #define BUTTON_PIN PIN_BUTTON1 #define BUTTON_PIN_ALT PIN_BUTTON2 +#define ALT_BUTTON_WAKE #define SERIAL_PRINT_PORT 0 #endif From d5fe7dc9e60f6a4e9b7a84b3d5aeded424df484d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 06:34:31 -0500 Subject: [PATCH 030/150] Update meshtastic/device-ui digest to dfdcf00 (#10050) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 673966494..0f70795fc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/7b1485b86c8d55a40e5226749097767e8b87f396.zip + https://github.com/meshtastic/device-ui/archive/1897dd17fceb1f101bb1a3245680aa3439edcfdd.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 7f0cd70c07905312939b45ebd06178b3b824b57f Mon Sep 17 00:00:00 2001 From: Kittiwut Khongkaeo <85986506+hereismeaw@users.noreply.github.com> Date: Fri, 3 Apr 2026 04:27:36 +0700 Subject: [PATCH 031/150] =?UTF-8?q?Align=20920=E2=80=93925=20MHz=20limits?= =?UTF-8?q?=20as=20per=20NBTC=20in=20Thailand=20(27=20dBm,=2010%=20duty=20?= =?UTF-8?q?cycle)=20(#9827)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mesh/RadioInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesh/RadioInterface.cpp b/src/mesh/RadioInterface.cpp index 4defd00ed..6a8a0230a 100644 --- a/src/mesh/RadioInterface.cpp +++ b/src/mesh/RadioInterface.cpp @@ -130,8 +130,10 @@ const RegionInfo regions[] = { /* https://lora-alliance.org/wp-content/uploads/2020/11/lorawan_regional_parameters_v1.0.3reva_0.pdf + https://standard.nbtc.go.th/getattachment/Standards/%E0%B8%A1%E0%B8%B2%E0%B8%95%E0%B8%A3%E0%B8%90%E0%B8%B2%E0%B8%99%E0%B8%97%E0%B8%B2%E0%B8%87%E0%B9%80%E0%B8%97%E0%B8%84%E0%B8%99%E0%B8%B4%E0%B8%84%E0%B8%82%E0%B8%AD%E0%B8%87%E0%B9%80%E0%B8%84%E0%B8%A3%E0%B8%B7%E0%B9%88%E0%B8%AD%E0%B8%87%E0%B9%82%E0%B8%97%E0%B8%A3%E0%B8%84%E0%B8%A1%E0%B8%99%E0%B8%B2%E0%B8%84%E0%B8%A1/1033-2565.pdf.aspx?lang=th-TH + Thailand 920–925 MHz set max TX power to 27 dBm and enforce 10% duty cycle, aligned with NBTC regulations. */ - RDEF(TH, 920.0f, 925.0f, 100, 0, 16, true, false, false), + RDEF(TH, 920.0f, 925.0f, 10, 0, 27, true, false, false), /* 433,05-434,7 Mhz 10 mW From 934c3fa8be9e1c20c6c59cb018964f0690129de4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 06:39:53 -0500 Subject: [PATCH 032/150] Upgrade trunk (#10047) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 2d8b347ac..041d70486 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,14 +9,14 @@ plugins: lint: enabled: - checkov@3.2.513 - - renovate@43.101.2 + - renovate@43.104.1 - prettier@3.8.1 - - trufflehog@3.94.1 + - trufflehog@3.94.2 - yamllint@1.38.0 - bandit@1.9.4 - trivy@0.69.3 - taplo@0.10.0 - - ruff@0.15.8 + - ruff@0.15.9 - isort@8.0.1 - markdownlint@0.48.0 - oxipng@10.1.0 From 9ba44bfbfb81058088f2c8fb50ad7875ff87ebd3 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 4 Apr 2026 20:05:22 -0500 Subject: [PATCH 033/150] Set T-LoRA pager audio board volume to 75% --- src/platform/extra_variants/t_lora_pager/variant.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/platform/extra_variants/t_lora_pager/variant.cpp b/src/platform/extra_variants/t_lora_pager/variant.cpp index ea5773d30..19c8881ca 100644 --- a/src/platform/extra_variants/t_lora_pager/variant.cpp +++ b/src/platform/extra_variants/t_lora_pager/variant.cpp @@ -23,5 +23,6 @@ void lateInitVariant() cfg.i2s.bits = BIT_LENGTH_16BITS; cfg.i2s.rate = RATE_44K; board.begin(cfg); + board.setVolume(75); // 75% volume } #endif \ No newline at end of file From 1370b234eb6af1e959b094ecece6f7efd758f77d Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 5 Apr 2026 07:48:24 -0500 Subject: [PATCH 034/150] Add build flag to exclude web server in MUI build for Wismesh Tap V2 --- variants/esp32s3/rak_wismesh_tap_v2/platformio.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini index 96b1a067b..ca33093e0 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini +++ b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini @@ -43,6 +43,7 @@ extends = env:rak_wismesh_tap_v2 build_flags = ${env:rak_wismesh_tap_v2.build_flags} + -D MESHTASTIC_EXCLUDE_WEBSERVER=1 -D CONFIG_ARDUHAL_ESP_LOG -D CONFIG_ARDUHAL_LOG_COLORS=1 -D CONFIG_DISABLE_HAL_LOCKS=1 From d96770007de9dee32dc20f3e16e5ce3e3586c621 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 5 Apr 2026 16:23:52 -0400 Subject: [PATCH 035/150] meshtasticd: Add configs for luckfox-lyra-zero-w (mPWRD-OS) (#10085) --- .../lora-lyra-zero-MeshAdv-900M30S.yaml | 39 +++++++++++++++++++ .../lora-lyra-zero-MeshAdv-Mini-900M22S.yaml | 33 ++++++++++++++++ .../lora-lyra-zero-RAK6421-13300-slot1.yaml | 38 ++++++++++++++++++ .../lora-lyra-zero-RAK6421-13300-slot2.yaml | 36 +++++++++++++++++ .../lora-lyra-zero-RAK6421-13302-slot1.yaml | 39 +++++++++++++++++++ .../lora-lyra-zero-RAK6421-13302-slot2.yaml | 37 ++++++++++++++++++ .../lora-lyra-zero-waveshare-sxxx.yaml | 30 ++++++++++++++ 7 files changed, 252 insertions(+) create mode 100644 bin/config.d/lora-lyra-zero-MeshAdv-900M30S.yaml create mode 100644 bin/config.d/lora-lyra-zero-MeshAdv-Mini-900M22S.yaml create mode 100644 bin/config.d/lora-lyra-zero-RAK6421-13300-slot1.yaml create mode 100644 bin/config.d/lora-lyra-zero-RAK6421-13300-slot2.yaml create mode 100644 bin/config.d/lora-lyra-zero-RAK6421-13302-slot1.yaml create mode 100644 bin/config.d/lora-lyra-zero-RAK6421-13302-slot2.yaml create mode 100644 bin/config.d/lora-lyra-zero-waveshare-sxxx.yaml diff --git a/bin/config.d/lora-lyra-zero-MeshAdv-900M30S.yaml b/bin/config.d/lora-lyra-zero-MeshAdv-900M30S.yaml new file mode 100644 index 000000000..ea22c7953 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-MeshAdv-900M30S.yaml @@ -0,0 +1,39 @@ +# MeshAdv-Pi E22-900M30S +# https://github.com/chrismyers2000/MeshAdv-Pi-Hat +Meta: + name: MeshAdv-Pi E22-900M30S + support: community + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 + CS: # GPIO0_C2 (physical 40) + pin: 18 + gpiochip: 0 + line: 18 + IRQ: # GPIO1_D1 (physical 36) + pin: 57 + gpiochip: 1 + line: 25 + Busy: # GPIO0_C1 (physical 38) + pin: 17 + gpiochip: 0 + line: 17 + Reset: # GPIO0_B6 (physical 12) + pin: 14 + gpiochip: 0 + line: 14 + TXen: # GPIO1_C2 (physical 33) + pin: 50 + gpiochip: 1 + line: 18 + RXen: # GPIO1_D2 (physical 32) + pin: 58 + gpiochip: 1 + line: 26 + DIO3_TCXO_VOLTAGE: true + # Only for E22-900M33S: + # Limit the output power to 8 dBm + # SX126X_MAX_POWER: 8 + spidev: spidev0.0 diff --git a/bin/config.d/lora-lyra-zero-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-lyra-zero-MeshAdv-Mini-900M22S.yaml new file mode 100644 index 000000000..1fb150b15 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-MeshAdv-Mini-900M22S.yaml @@ -0,0 +1,33 @@ +# MeshAdv Mini E22-900M22S +# https://github.com/chrismyers2000/MeshAdv-Mini +Meta: + name: MeshAdv Mini E22-900M22S + support: community + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 # Ebyte E22-900M22S + CS: # GPIO0_B2_d (phys 24, RPi CE0) + pin: 10 + gpiochip: 0 + line: 10 + IRQ: # GPIO1_D1_d (phys 36, RPi GPIO16) + pin: 57 + gpiochip: 1 + line: 25 + Busy: # GPIO0_C1_d (phys 38, RPi GPIO20) + pin: 17 + gpiochip: 0 + line: 17 + Reset: # GPIO0_B4_d (phys 18, RPi GPIO24) + pin: 12 + gpiochip: 0 + line: 12 + RXen: # GPIO1_D2_d (phys 32, RPi GPIO12) + pin: 58 + gpiochip: 1 + line: 26 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + spidev: spidev0.0 diff --git a/bin/config.d/lora-lyra-zero-RAK6421-13300-slot1.yaml b/bin/config.d/lora-lyra-zero-RAK6421-13300-slot1.yaml new file mode 100644 index 000000000..b65a30c20 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-RAK6421-13300-slot1.yaml @@ -0,0 +1,38 @@ +Meta: + name: RAK6421 + RAK13300 Slot 1 + support: community # Promote when tested + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_A5 (IO6) + pin: 5 + gpiochip: 0 + line: 5 + Reset: # GPIO1_D1 (IO4) + pin: 57 + gpiochip: 1 + line: 25 + Busy: # GPIO0_B4 (IO5) + pin: 12 + gpiochip: 0 + line: 12 + # Ant_sw: # GPIO1_C2 (IO3) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 58 # GPIO1_D2 + gpiochip: 1 + line: 26 + - pin: 50 # GPIO1_C2 + gpiochip: 1 + line: 18 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_B2 + # pin: 10 + # gpiochip: 0 + # line: 10 diff --git a/bin/config.d/lora-lyra-zero-RAK6421-13300-slot2.yaml b/bin/config.d/lora-lyra-zero-RAK6421-13300-slot2.yaml new file mode 100644 index 000000000..255a3eca3 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-RAK6421-13300-slot2.yaml @@ -0,0 +1,36 @@ +Meta: + name: RAK6421 + RAK13300 Slot 2 + support: community # Promote when tested + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B6 (IO6) + pin: 14 + gpiochip: 0 + line: 14 + Reset: # GPIO0_B4 (IO4) + pin: 12 + gpiochip: 0 + line: 12 + Busy: # GPIO1_C0 (IO5) + pin: 48 + gpiochip: 1 + line: 16 + # Ant_sw: # GPIO0_B5 (IO3) + # pin: 13 + # gpiochip: 0 + # line: 13 + Enable_Pins: + - pin: 51 # GPIO1_C3 + gpiochip: 1 + line: 19 + - pin: 13 # GPIO0_B5 + gpiochip: 0 + line: 13 + spidev: spidev0.1 + # CS: # GPIO0_B1 + # pin: 9 + # gpiochip: 0 + # line: 9 diff --git a/bin/config.d/lora-lyra-zero-RAK6421-13302-slot1.yaml b/bin/config.d/lora-lyra-zero-RAK6421-13302-slot1.yaml new file mode 100644 index 000000000..c37c6fb3a --- /dev/null +++ b/bin/config.d/lora-lyra-zero-RAK6421-13302-slot1.yaml @@ -0,0 +1,39 @@ +Meta: + name: RAK6421 + RAK13300 Slot 1 + support: community # Promote when tested + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_A5 (IO6) + pin: 5 + gpiochip: 0 + line: 5 + Reset: # GPIO1_D1 (IO4) + pin: 57 + gpiochip: 1 + line: 25 + Busy: # GPIO0_B4 (IO5) + pin: 12 + gpiochip: 0 + line: 12 + # Ant_sw: # GPIO1_C2 (IO3) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 58 # GPIO1_D2 + gpiochip: 1 + line: 26 + - pin: 50 # GPIO1_C2 + gpiochip: 1 + line: 18 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_B2 + # pin: 10 + # gpiochip: 0 + # line: 10 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-lyra-zero-RAK6421-13302-slot2.yaml b/bin/config.d/lora-lyra-zero-RAK6421-13302-slot2.yaml new file mode 100644 index 000000000..773a35ab0 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-RAK6421-13302-slot2.yaml @@ -0,0 +1,37 @@ +Meta: + name: RAK6421 + RAK13300 Slot 2 + support: community # Promote when tested + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B6 (IO6) + pin: 14 + gpiochip: 0 + line: 14 + Reset: # GPIO0_B4 (IO4) + pin: 12 + gpiochip: 0 + line: 12 + Busy: # GPIO1_C0 (IO5) + pin: 48 + gpiochip: 1 + line: 16 + # Ant_sw: # GPIO0_B5 (IO3) + # pin: 13 + # gpiochip: 0 + # line: 13 + Enable_Pins: + - pin: 51 # GPIO1_C3 + gpiochip: 1 + line: 19 + - pin: 13 # GPIO0_B5 + gpiochip: 0 + line: 13 + spidev: spidev0.1 + # CS: # GPIO0_B1 + # pin: 9 + # gpiochip: 0 + # line: 9 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-lyra-zero-waveshare-sxxx.yaml b/bin/config.d/lora-lyra-zero-waveshare-sxxx.yaml new file mode 100644 index 000000000..934945202 --- /dev/null +++ b/bin/config.d/lora-lyra-zero-waveshare-sxxx.yaml @@ -0,0 +1,30 @@ +Meta: + name: Waveshare SX1262 + support: deprecated + compatible: + - luckfox-lyra-zero-w # Armbian + +Lora: + Module: sx1262 # Waveshare SX126X XXXM + DIO2_AS_RF_SWITCH: true + CS: # GPIO0_C2 (physical 40) + pin: 18 + gpiochip: 0 + line: 18 + IRQ: # GPIO1_D1 (physical 36) + pin: 57 + gpiochip: 1 + line: 25 + Busy: # GPIO0_C1 (physical 38) + pin: 17 + gpiochip: 0 + line: 17 + Reset: # GPIO0_B6 (physical 12) + pin: 14 + gpiochip: 0 + line: 14 + SX126X_ANT_SW: # GPIO1_B3 (physical 31) + pin: 43 + gpiochip: 1 + line: 11 + spidev: spidev0.0 From 6628c9e66e50846bbda77357098d1a071b890917 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 07:51:37 -0500 Subject: [PATCH 036/150] Upgrade trunk (#10091) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 041d70486..05f1bb22e 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.513 - - renovate@43.104.1 + - renovate@43.104.6 - prettier@3.8.1 - trufflehog@3.94.2 - yamllint@1.38.0 From 98963218ad46add817a6cd3263167be1436a0ca2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 06:39:53 -0500 Subject: [PATCH 037/150] Automated version bumps (#10092) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 6 ++++++ version.properties | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index fe3a3a533..0642fdb07 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.22 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.21 diff --git a/debian/changelog b/debian/changelog index 13d751ecf..b13a2ae9d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +meshtasticd (2.7.22.0) unstable; urgency=medium + + * Version 2.7.22 + + -- GitHub Actions Mon, 06 Apr 2026 11:34:12 +0000 + meshtasticd (2.7.21.0) unstable; urgency=medium * Version 2.7.21 diff --git a/version.properties b/version.properties index c25179ae2..8621dd9c9 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 21 +build = 22 From 2dd9c5eef297211a919989f4397b6917bfd8d518 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Mon, 6 Apr 2026 15:02:38 -0500 Subject: [PATCH 038/150] Fix Linux Input enable logic (#10093) --- src/input/InputBroker.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index 1d5199a58..b7c9b27a9 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -382,11 +382,13 @@ void InputBroker::Init() } #endif // HAS_BUTTON #if ARCH_PORTDUINO - if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR && portduino_config.i2cdev != "") { - seesawRotary = new SeesawRotary("SeesawRotary"); - if (!seesawRotary->init()) { - delete seesawRotary; - seesawRotary = nullptr; + if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { + if (portduino_config.i2cdev != "") { + seesawRotary = new SeesawRotary("SeesawRotary"); + if (!seesawRotary->init()) { + delete seesawRotary; + seesawRotary = nullptr; + } } aLinuxInputImpl = new LinuxInputImpl(); aLinuxInputImpl->init(); From 12f0a74557cb888527c5a966040b93cb8ed1c834 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 7 Apr 2026 08:43:29 -0500 Subject: [PATCH 039/150] Sync up custom metadata --- variants/esp32s3/elecrow_panel/platformio.ini | 3 +++ variants/esp32s3/heltec_v4/platformio.ini | 1 + .../esp32s3/heltec_vision_master_e213/platformio.ini | 1 + .../esp32s3/heltec_vision_master_e290/platformio.ini | 1 + variants/esp32s3/heltec_wireless_paper/platformio.ini | 1 + variants/esp32s3/mini-epaper-s3/platformio.ini | 3 ++- variants/esp32s3/picomputer-s3/platformio.ini | 1 + variants/esp32s3/rak3312/platformio.ini | 1 + variants/esp32s3/rak_wismesh_tap_v2/platformio.ini | 1 + .../esp32s3/seeed-sensecap-indicator/platformio.ini | 2 +- variants/esp32s3/t-beam-1w/platformio.ini | 1 + variants/esp32s3/t-deck-pro/platformio.ini | 1 + variants/esp32s3/t-deck/platformio.ini | 1 + variants/esp32s3/tlora-pager/platformio.ini | 1 + variants/esp32s3/tlora_t3s3_epaper/platformio.ini | 1 + variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini | 1 + variants/nrf52840/heltec_mesh_pocket/platformio.ini | 2 ++ .../nrf52840/seeed_wio_tracker_L1_eink/platformio.ini | 1 + variants/nrf52840/t-echo-plus/platformio.ini | 11 +++++++++++ variants/nrf52840/t-echo/platformio.ini | 1 + 20 files changed, 34 insertions(+), 2 deletions(-) diff --git a/variants/esp32s3/elecrow_panel/platformio.ini b/variants/esp32s3/elecrow_panel/platformio.ini index c357d41a5..1b91a02bb 100644 --- a/variants/esp32s3/elecrow_panel/platformio.ini +++ b/variants/esp32s3/elecrow_panel/platformio.ini @@ -84,6 +84,7 @@ custom_meshtastic_images = crowpanel_2_4.svg, crowpanel_2_8.svg custom_meshtastic_tags = Elecrow custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = crowpanel_small_esp32s3_base build_flags = @@ -119,6 +120,7 @@ custom_meshtastic_images = crowpanel_3_5.svg custom_meshtastic_tags = Elecrow custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = crowpanel_small_esp32s3_base board_level = pr @@ -158,6 +160,7 @@ custom_meshtastic_images = crowpanel_5_0.svg, crowpanel_7_0.svg custom_meshtastic_tags = Elecrow custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = crowpanel_large_esp32s3_base build_flags = diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index cb795c65d..0336bf983 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -22,6 +22,7 @@ custom_meshtastic_images = heltec_v4.svg custom_meshtastic_tags = Heltec custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = heltec_v4_base build_flags = diff --git a/variants/esp32s3/heltec_vision_master_e213/platformio.ini b/variants/esp32s3/heltec_vision_master_e213/platformio.ini index 1c4c69afe..bd1b73d2b 100644 --- a/variants/esp32s3/heltec_vision_master_e213/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e213/platformio.ini @@ -9,6 +9,7 @@ custom_meshtastic_images = heltec-vision-master-e213.svg custom_meshtastic_tags = Heltec custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 8MB +custom_meshtastic_has_ink_hud = true extends = esp32s3_base board = heltec_vision_master_e213 diff --git a/variants/esp32s3/heltec_vision_master_e290/platformio.ini b/variants/esp32s3/heltec_vision_master_e290/platformio.ini index 5affd24de..9fdb023de 100644 --- a/variants/esp32s3/heltec_vision_master_e290/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_e290/platformio.ini @@ -10,6 +10,7 @@ custom_meshtastic_images = heltec-vision-master-e290.svg custom_meshtastic_tags = Heltec custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 8MB +custom_meshtastic_has_ink_hud = true extends = esp32s3_base board = heltec_vision_master_e290 diff --git a/variants/esp32s3/heltec_wireless_paper/platformio.ini b/variants/esp32s3/heltec_wireless_paper/platformio.ini index ce4bed30e..acd619c48 100644 --- a/variants/esp32s3/heltec_wireless_paper/platformio.ini +++ b/variants/esp32s3/heltec_wireless_paper/platformio.ini @@ -9,6 +9,7 @@ custom_meshtastic_display_name = Heltec Wireless Paper custom_meshtastic_images = heltec-wireless-paper.svg custom_meshtastic_tags = Heltec custom_meshtastic_partition_scheme = 8MB +custom_meshtastic_has_ink_hud = true extends = esp32s3_base board = heltec_wifi_lora_32_V3 diff --git a/variants/esp32s3/mini-epaper-s3/platformio.ini b/variants/esp32s3/mini-epaper-s3/platformio.ini index 5c3e64681..3e4802319 100644 --- a/variants/esp32s3/mini-epaper-s3/platformio.ini +++ b/variants/esp32s3/mini-epaper-s3/platformio.ini @@ -1,5 +1,5 @@ [env:mini-epaper-s3] -;custom_meshtastic_hw_model = +custom_meshtastic_hw_model = 125 custom_meshtastic_hw_model_slug = MINI_EPAPER_S3 custom_meshtastic_architecture = esp32-s3 custom_meshtastic_actively_supported = true @@ -8,6 +8,7 @@ custom_meshtastic_display_name = LILYGO Mini ePaper S3 E-Ink custom_meshtastic_images = mini-epaper-s3.svg custom_meshtastic_tags = LilyGo custom_meshtastic_requires_dfu = no +custom_meshtastic_has_mui = false extends = esp32s3_base board = mini-epaper-s3 diff --git a/variants/esp32s3/picomputer-s3/platformio.ini b/variants/esp32s3/picomputer-s3/platformio.ini index 82147f222..6f218a126 100644 --- a/variants/esp32s3/picomputer-s3/platformio.ini +++ b/variants/esp32s3/picomputer-s3/platformio.ini @@ -6,6 +6,7 @@ custom_meshtastic_actively_supported = true custom_meshtastic_support_level = 3 custom_meshtastic_display_name = Pi Computer S3 custom_meshtastic_partition_scheme = 8MB +custom_meshtastic_has_mui = true extends = esp32s3_base board = bpi_picow_esp32_s3 diff --git a/variants/esp32s3/rak3312/platformio.ini b/variants/esp32s3/rak3312/platformio.ini index 113c2f527..87e5b63ff 100644 --- a/variants/esp32s3/rak3312/platformio.ini +++ b/variants/esp32s3/rak3312/platformio.ini @@ -9,6 +9,7 @@ custom_meshtastic_images = rak_3312.svg custom_meshtastic_tags = RAK custom_meshtastic_requires_dfu = false custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = false extends = esp32s3_base board = wiscore_rak3312 diff --git a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini index ca33093e0..7847410ae 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini +++ b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini @@ -20,6 +20,7 @@ custom_meshtastic_display_name = RAK WisMesh Tap V2 custom_meshtastic_images = rak-wismesh-tap-v2.svg custom_meshtastic_tags = RAK custom_meshtastic_partition_scheme = 8MB +custom_meshtastic_has_mui = true extends = esp32s3_base board = wiscore_rak3312 diff --git a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini index a4650f826..bb52f801b 100644 --- a/variants/esp32s3/seeed-sensecap-indicator/platformio.ini +++ b/variants/esp32s3/seeed-sensecap-indicator/platformio.ini @@ -9,7 +9,7 @@ custom_meshtastic_display_name = Seeed SenseCAP Indicator custom_meshtastic_images = seeed-sensecap-indicator.svg custom_meshtastic_tags = Seeed custom_meshtastic_partition_scheme = 8MB - = true +custom_meshtastic_has_mui = true extends = esp32s3_base platform_packages = diff --git a/variants/esp32s3/t-beam-1w/platformio.ini b/variants/esp32s3/t-beam-1w/platformio.ini index 9abf895db..b14f2fe3c 100644 --- a/variants/esp32s3/t-beam-1w/platformio.ini +++ b/variants/esp32s3/t-beam-1w/platformio.ini @@ -8,6 +8,7 @@ custom_meshtastic_support_level = 1 custom_meshtastic_display_name = LILYGO T-Beam 1W custom_meshtastic_images = tbeam-1w.svg custom_meshtastic_tags = LilyGo +custom_meshtastic_has_mui = false extends = esp32s3_base board = t-beam-1w diff --git a/variants/esp32s3/t-deck-pro/platformio.ini b/variants/esp32s3/t-deck-pro/platformio.ini index c5411da13..93ef8babf 100644 --- a/variants/esp32s3/t-deck-pro/platformio.ini +++ b/variants/esp32s3/t-deck-pro/platformio.ini @@ -9,6 +9,7 @@ custom_meshtastic_images = tdeck_pro.svg custom_meshtastic_tags = LilyGo custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = false extends = esp32s3_base board = t-deck-pro diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index 7d79e934c..1b3599464 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -10,6 +10,7 @@ custom_meshtastic_images = t-deck.svg custom_meshtastic_tags = LilyGo custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = esp32s3_base board = t-deck diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index dc96113b0..832f9d7d7 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -10,6 +10,7 @@ custom_meshtastic_images = lilygo-tlora-pager.svg custom_meshtastic_tags = LilyGo custom_meshtastic_requires_dfu = true custom_meshtastic_partition_scheme = 16MB +custom_meshtastic_has_mui = true extends = esp32s3_base board = t-deck-pro ; same as T-Deck Pro diff --git a/variants/esp32s3/tlora_t3s3_epaper/platformio.ini b/variants/esp32s3/tlora_t3s3_epaper/platformio.ini index f9d1ea7db..8f764bbe6 100644 --- a/variants/esp32s3/tlora_t3s3_epaper/platformio.ini +++ b/variants/esp32s3/tlora_t3s3_epaper/platformio.ini @@ -8,6 +8,7 @@ custom_meshtastic_display_name = LILYGO T-LoRa T3-S3 E-Ink custom_meshtastic_images = tlora-t3s3-epaper.svg custom_meshtastic_tags = LilyGo custom_meshtastic_requires_dfu = true +custom_meshtastic_has_ink_hud = true extends = esp32s3_base board = tlora-t3s3-v1 diff --git a/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini b/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini index 2a6cea73e..c169de8f7 100644 --- a/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini +++ b/variants/nrf52840/ELECROW-ThinkNode-M1/platformio.ini @@ -8,6 +8,7 @@ custom_meshtastic_support_level = 1 custom_meshtastic_display_name = ThinkNode M1 custom_meshtastic_images = thinknode_m1.svg custom_meshtastic_tags = Elecrow +custom_meshtastic_has_ink_hud = true extends = nrf52840_base board = ThinkNode-M1 diff --git a/variants/nrf52840/heltec_mesh_pocket/platformio.ini b/variants/nrf52840/heltec_mesh_pocket/platformio.ini index 9fbcc890d..c9b599382 100644 --- a/variants/nrf52840/heltec_mesh_pocket/platformio.ini +++ b/variants/nrf52840/heltec_mesh_pocket/platformio.ini @@ -15,6 +15,7 @@ custom_meshtastic_display_name = Heltec Mesh Pocket custom_meshtastic_actively_supported = true custom_meshtastic_variant = 5000mAh custom_meshtastic_key = heltec_mesh_pocket +custom_meshtastic_has_ink_hud = true # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} @@ -78,6 +79,7 @@ custom_meshtastic_display_name = Heltec Mesh Pocket custom_meshtastic_actively_supported = true custom_meshtastic_variant = 10000mAh custom_meshtastic_key = heltec_mesh_pocket +custom_meshtastic_has_ink_hud = true # add -DCFG_SYSVIEW if you want to use the Segger systemview tool for OS profiling. build_flags = ${nrf52840_base.build_flags} diff --git a/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini index d8fbaf8ff..26f4de565 100644 --- a/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini +++ b/variants/nrf52840/seeed_wio_tracker_L1_eink/platformio.ini @@ -7,6 +7,7 @@ custom_meshtastic_support_level = 1 custom_meshtastic_display_name = Seeed Wio Tracker L1 E-Ink custom_meshtastic_images = wio_tracker_l1_eink.svg custom_meshtastic_tags = Seeed +custom_meshtastic_has_ink_hud = true board = seeed_wio_tracker_L1 extends = nrf52840_base diff --git a/variants/nrf52840/t-echo-plus/platformio.ini b/variants/nrf52840/t-echo-plus/platformio.ini index 9ec9187e8..313eceadc 100644 --- a/variants/nrf52840/t-echo-plus/platformio.ini +++ b/variants/nrf52840/t-echo-plus/platformio.ini @@ -1,4 +1,15 @@ [env:t-echo-plus] +custom_meshtastic_hw_model = 33 +custom_meshtastic_hw_model_slug = T_ECHO_PLUS +custom_meshtastic_architecture = nrf52840 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = LILYGO T-Echo Plus +custom_meshtastic_images = t-echo_plus.svg +custom_meshtastic_tags = LilyGo +custom_meshtastic_requires_dfu = true +custom_meshtastic_has_ink_hud = true + extends = nrf52840_base board = t-echo board_level = pr diff --git a/variants/nrf52840/t-echo/platformio.ini b/variants/nrf52840/t-echo/platformio.ini index 89ce488ad..58ad029ae 100644 --- a/variants/nrf52840/t-echo/platformio.ini +++ b/variants/nrf52840/t-echo/platformio.ini @@ -8,6 +8,7 @@ custom_meshtastic_support_level = 1 custom_meshtastic_display_name = LILYGO T-Echo custom_meshtastic_images = t-echo.svg custom_meshtastic_tags = LilyGo +custom_meshtastic_has_ink_hud = true extends = nrf52840_base board = t-echo From 16cf9623515d699c6563c19b44b591e634e994f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 13:36:09 -0500 Subject: [PATCH 040/150] Update protobufs (#10104) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/atak.pb.cpp | 12 + src/mesh/generated/meshtastic/atak.pb.h | 394 +++++++++++++++++++- src/mesh/generated/meshtastic/mesh.pb.h | 2 + src/mesh/generated/meshtastic/portnums.pb.h | 4 + 5 files changed, 412 insertions(+), 2 deletions(-) diff --git a/protobufs b/protobufs index cb1f89372..e30092e61 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit cb1f89372a70b0d4b4f8caf05aec28de8d4a13e0 +Subproject commit e30092e6168b13341c2b7ec4be19c789ad5cd77f diff --git a/src/mesh/generated/meshtastic/atak.pb.cpp b/src/mesh/generated/meshtastic/atak.pb.cpp index a0368cf6b..bbafa33e2 100644 --- a/src/mesh/generated/meshtastic/atak.pb.cpp +++ b/src/mesh/generated/meshtastic/atak.pb.cpp @@ -24,6 +24,18 @@ PB_BIND(meshtastic_Contact, meshtastic_Contact, AUTO) PB_BIND(meshtastic_PLI, meshtastic_PLI, AUTO) +PB_BIND(meshtastic_AircraftTrack, meshtastic_AircraftTrack, AUTO) + + +PB_BIND(meshtastic_TAKPacketV2, meshtastic_TAKPacketV2, 2) + + + + + + + + diff --git a/src/mesh/generated/meshtastic/atak.pb.h b/src/mesh/generated/meshtastic/atak.pb.h index 8533bcbf9..c12b042f4 100644 --- a/src/mesh/generated/meshtastic/atak.pb.h +++ b/src/mesh/generated/meshtastic/atak.pb.h @@ -65,6 +65,197 @@ typedef enum _meshtastic_MemberRole { meshtastic_MemberRole_K9 = 8 } meshtastic_MemberRole; +/* CoT how field values. + Represents how the coordinates were generated. */ +typedef enum _meshtastic_CotHow { + /* Unspecified */ + meshtastic_CotHow_CotHow_Unspecified = 0, + /* Human entered */ + meshtastic_CotHow_CotHow_h_e = 1, + /* Machine generated */ + meshtastic_CotHow_CotHow_m_g = 2, + /* Human GPS/INS derived */ + meshtastic_CotHow_CotHow_h_g_i_g_o = 3, + /* Machine relayed (imported from another system/gateway) */ + meshtastic_CotHow_CotHow_m_r = 4, + /* Machine fused (corroborated from multiple sources) */ + meshtastic_CotHow_CotHow_m_f = 5, + /* Machine predicted */ + meshtastic_CotHow_CotHow_m_p = 6, + /* Machine simulated */ + meshtastic_CotHow_CotHow_m_s = 7 +} meshtastic_CotHow; + +/* Well-known CoT event types. + When the type is known, use the enum value for efficient encoding. + For unknown types, set cot_type_id to CotType_Other and populate cot_type_str. */ +typedef enum _meshtastic_CotType { + /* Unknown or unmapped type, use cot_type_str */ + meshtastic_CotType_CotType_Other = 0, + /* a-f-G-U-C: Friendly ground unit combat */ + meshtastic_CotType_CotType_a_f_G_U_C = 1, + /* a-f-G-U-C-I: Friendly ground unit combat infantry */ + meshtastic_CotType_CotType_a_f_G_U_C_I = 2, + /* a-n-A-C-F: Neutral aircraft civilian fixed-wing */ + meshtastic_CotType_CotType_a_n_A_C_F = 3, + /* a-n-A-C-H: Neutral aircraft civilian helicopter */ + meshtastic_CotType_CotType_a_n_A_C_H = 4, + /* a-n-A-C: Neutral aircraft civilian */ + meshtastic_CotType_CotType_a_n_A_C = 5, + /* a-f-A-M-H: Friendly aircraft military helicopter */ + meshtastic_CotType_CotType_a_f_A_M_H = 6, + /* a-f-A-M: Friendly aircraft military */ + meshtastic_CotType_CotType_a_f_A_M = 7, + /* a-f-A-M-F-F: Friendly aircraft military fixed-wing fighter */ + meshtastic_CotType_CotType_a_f_A_M_F_F = 8, + /* a-f-A-M-H-A: Friendly aircraft military helicopter attack */ + meshtastic_CotType_CotType_a_f_A_M_H_A = 9, + /* a-f-A-M-H-U-M: Friendly aircraft military helicopter utility medium */ + meshtastic_CotType_CotType_a_f_A_M_H_U_M = 10, + /* a-h-A-M-F-F: Hostile aircraft military fixed-wing fighter */ + meshtastic_CotType_CotType_a_h_A_M_F_F = 11, + /* a-h-A-M-H-A: Hostile aircraft military helicopter attack */ + meshtastic_CotType_CotType_a_h_A_M_H_A = 12, + /* a-u-A-C: Unknown aircraft civilian */ + meshtastic_CotType_CotType_a_u_A_C = 13, + /* t-x-d-d: Tasking delete/disconnect */ + meshtastic_CotType_CotType_t_x_d_d = 14, + /* a-f-G-E-S-E: Friendly ground equipment sensor */ + meshtastic_CotType_CotType_a_f_G_E_S_E = 15, + /* a-f-G-E-V-C: Friendly ground equipment vehicle */ + meshtastic_CotType_CotType_a_f_G_E_V_C = 16, + /* a-f-S: Friendly sea */ + meshtastic_CotType_CotType_a_f_S = 17, + /* a-f-A-M-F: Friendly aircraft military fixed-wing */ + meshtastic_CotType_CotType_a_f_A_M_F = 18, + /* a-f-A-M-F-C-H: Friendly aircraft military fixed-wing cargo heavy */ + meshtastic_CotType_CotType_a_f_A_M_F_C_H = 19, + /* a-f-A-M-F-U-L: Friendly aircraft military fixed-wing utility light */ + meshtastic_CotType_CotType_a_f_A_M_F_U_L = 20, + /* a-f-A-M-F-L: Friendly aircraft military fixed-wing liaison */ + meshtastic_CotType_CotType_a_f_A_M_F_L = 21, + /* a-f-A-M-F-P: Friendly aircraft military fixed-wing patrol */ + meshtastic_CotType_CotType_a_f_A_M_F_P = 22, + /* a-f-A-C-H: Friendly aircraft civilian helicopter */ + meshtastic_CotType_CotType_a_f_A_C_H = 23, + /* a-n-A-M-F-Q: Neutral aircraft military fixed-wing drone */ + meshtastic_CotType_CotType_a_n_A_M_F_Q = 24, + /* b-t-f: GeoChat message */ + meshtastic_CotType_CotType_b_t_f = 25, + /* b-r-f-h-c: CASEVAC/MEDEVAC report */ + meshtastic_CotType_CotType_b_r_f_h_c = 26, + /* b-a-o-pan: Ring the bell / alert all */ + meshtastic_CotType_CotType_b_a_o_pan = 27, + /* b-a-o-opn: Troops in contact */ + meshtastic_CotType_CotType_b_a_o_opn = 28, + /* b-a-o-can: Cancel alert */ + meshtastic_CotType_CotType_b_a_o_can = 29, + /* b-a-o-tbl: 911 alert */ + meshtastic_CotType_CotType_b_a_o_tbl = 30, + /* b-a-g: Geofence breach alert */ + meshtastic_CotType_CotType_b_a_g = 31, + /* a-f-G: Friendly ground (generic) */ + meshtastic_CotType_CotType_a_f_G = 32, + /* a-f-G-U: Friendly ground unit (generic) */ + meshtastic_CotType_CotType_a_f_G_U = 33, + /* a-h-G: Hostile ground (generic) */ + meshtastic_CotType_CotType_a_h_G = 34, + /* a-u-G: Unknown ground (generic) */ + meshtastic_CotType_CotType_a_u_G = 35, + /* a-n-G: Neutral ground (generic) */ + meshtastic_CotType_CotType_a_n_G = 36, + /* b-m-r: Route */ + meshtastic_CotType_CotType_b_m_r = 37, + /* b-m-p-w: Route waypoint */ + meshtastic_CotType_CotType_b_m_p_w = 38, + /* b-m-p-s-p-i: Self-position marker */ + meshtastic_CotType_CotType_b_m_p_s_p_i = 39, + /* u-d-f: Freeform shape (line/polygon) */ + meshtastic_CotType_CotType_u_d_f = 40, + /* u-d-r: Rectangle */ + meshtastic_CotType_CotType_u_d_r = 41, + /* u-d-c-c: Circle */ + meshtastic_CotType_CotType_u_d_c_c = 42, + /* u-rb-a: Range/bearing line */ + meshtastic_CotType_CotType_u_rb_a = 43, + /* a-h-A: Hostile aircraft (generic) */ + meshtastic_CotType_CotType_a_h_A = 44, + /* a-u-A: Unknown aircraft (generic) */ + meshtastic_CotType_CotType_a_u_A = 45, + /* a-f-A-M-H-Q: Friendly aircraft military helicopter observation */ + meshtastic_CotType_CotType_a_f_A_M_H_Q = 46, + /* a-f-A-C-F: Friendly aircraft civilian fixed-wing */ + meshtastic_CotType_CotType_a_f_A_C_F = 47, + /* a-f-A-C: Friendly aircraft civilian (generic) */ + meshtastic_CotType_CotType_a_f_A_C = 48, + /* a-f-A-C-L: Friendly aircraft civilian lighter-than-air */ + meshtastic_CotType_CotType_a_f_A_C_L = 49, + /* a-f-A: Friendly aircraft (generic) */ + meshtastic_CotType_CotType_a_f_A = 50, + /* a-f-A-M-H-C: Friendly aircraft military helicopter cargo */ + meshtastic_CotType_CotType_a_f_A_M_H_C = 51, + /* a-n-A-M-F-F: Neutral aircraft military fixed-wing fighter */ + meshtastic_CotType_CotType_a_n_A_M_F_F = 52, + /* a-u-A-C-F: Unknown aircraft civilian fixed-wing */ + meshtastic_CotType_CotType_a_u_A_C_F = 53, + /* a-f-G-U-C-F-T-A: Friendly ground unit combat forces theater aviation */ + meshtastic_CotType_CotType_a_f_G_U_C_F_T_A = 54, + /* a-f-G-U-C-V-S: Friendly ground unit combat vehicle support */ + meshtastic_CotType_CotType_a_f_G_U_C_V_S = 55, + /* a-f-G-U-C-R-X: Friendly ground unit combat reconnaissance exploitation */ + meshtastic_CotType_CotType_a_f_G_U_C_R_X = 56, + /* a-f-G-U-C-I-Z: Friendly ground unit combat infantry mechanized */ + meshtastic_CotType_CotType_a_f_G_U_C_I_Z = 57, + /* a-f-G-U-C-E-C-W: Friendly ground unit combat engineer construction wheeled */ + meshtastic_CotType_CotType_a_f_G_U_C_E_C_W = 58, + /* a-f-G-U-C-I-L: Friendly ground unit combat infantry light */ + meshtastic_CotType_CotType_a_f_G_U_C_I_L = 59, + /* a-f-G-U-C-R-O: Friendly ground unit combat reconnaissance other */ + meshtastic_CotType_CotType_a_f_G_U_C_R_O = 60, + /* a-f-G-U-C-R-V: Friendly ground unit combat reconnaissance cavalry */ + meshtastic_CotType_CotType_a_f_G_U_C_R_V = 61, + /* a-f-G-U-H: Friendly ground unit headquarters */ + meshtastic_CotType_CotType_a_f_G_U_H = 62, + /* a-f-G-U-U-M-S-E: Friendly ground unit support medical surgical evacuation */ + meshtastic_CotType_CotType_a_f_G_U_U_M_S_E = 63, + /* a-f-G-U-S-M-C: Friendly ground unit support maintenance collection */ + meshtastic_CotType_CotType_a_f_G_U_S_M_C = 64, + /* a-f-G-E-S: Friendly ground equipment sensor (generic) */ + meshtastic_CotType_CotType_a_f_G_E_S = 65, + /* a-f-G-E: Friendly ground equipment (generic) */ + meshtastic_CotType_CotType_a_f_G_E = 66, + /* a-f-G-E-V-C-U: Friendly ground equipment vehicle utility */ + meshtastic_CotType_CotType_a_f_G_E_V_C_U = 67, + /* a-f-G-E-V-C-ps: Friendly ground equipment vehicle public safety */ + meshtastic_CotType_CotType_a_f_G_E_V_C_ps = 68, + /* a-u-G-E-V: Unknown ground equipment vehicle */ + meshtastic_CotType_CotType_a_u_G_E_V = 69, + /* a-f-S-N-N-R: Friendly sea surface non-naval rescue */ + meshtastic_CotType_CotType_a_f_S_N_N_R = 70, + /* a-f-F-B: Friendly force boundary */ + meshtastic_CotType_CotType_a_f_F_B = 71, + /* b-m-p-s-p-loc: Self-position location marker */ + meshtastic_CotType_CotType_b_m_p_s_p_loc = 72, + /* b-i-v: Imagery/video */ + meshtastic_CotType_CotType_b_i_v = 73, + /* b-f-t-r: File transfer request */ + meshtastic_CotType_CotType_b_f_t_r = 74, + /* b-f-t-a: File transfer acknowledgment */ + meshtastic_CotType_CotType_b_f_t_a = 75 +} meshtastic_CotType; + +/* Geopoint and altitude source */ +typedef enum _meshtastic_GeoPointSource { + /* Unspecified */ + meshtastic_GeoPointSource_GeoPointSource_Unspecified = 0, + /* GPS derived */ + meshtastic_GeoPointSource_GeoPointSource_GPS = 1, + /* User entered */ + meshtastic_GeoPointSource_GeoPointSource_USER = 2, + /* Network/external */ + meshtastic_GeoPointSource_GeoPointSource_NETWORK = 3 +} meshtastic_GeoPointSource; + /* Struct definitions */ /* ATAK GeoChat message */ typedef struct _meshtastic_GeoChat { @@ -146,6 +337,95 @@ typedef struct _meshtastic_TAKPacket { } payload_variant; } meshtastic_TAKPacket; +/* Aircraft track information from ADS-B or military air tracking. + Covers the majority of observed real-world CoT traffic. */ +typedef struct _meshtastic_AircraftTrack { + /* ICAO hex identifier (e.g. "AD237C") */ + char icao[8]; + /* Aircraft registration (e.g. "N946AK") */ + char registration[16]; + /* Flight number/callsign (e.g. "ASA864") */ + char flight[16]; + /* ICAO aircraft type designator (e.g. "B39M") */ + char aircraft_type[8]; + /* Transponder squawk code (0-7777 octal) */ + uint16_t squawk; + /* ADS-B emitter category (e.g. "A3") */ + char category[4]; + /* Received signal strength * 10 (e.g. -194 for -19.4 dBm) */ + int32_t rssi_x10; + /* Whether receiver has GPS fix */ + bool gps; + /* CoT host ID for source attribution */ + char cot_host_id[64]; +} meshtastic_AircraftTrack; + +typedef PB_BYTES_ARRAY_T(220) meshtastic_TAKPacketV2_raw_detail_t; +/* ATAK v2 packet with expanded CoT field support and zstd dictionary compression. + Sent on ATAK_PLUGIN_V2 port. The wire payload is: + [1 byte flags][zstd-compressed TAKPacketV2 protobuf] + Flags byte: bits 0-5 = dictionary ID, bits 6-7 = reserved. */ +typedef struct _meshtastic_TAKPacketV2 { + /* Well-known CoT event type enum. + Use CotType_Other with cot_type_str for unknown types. */ + meshtastic_CotType cot_type_id; + /* How the coordinates were generated */ + meshtastic_CotHow how; + /* Callsign */ + char callsign[120]; + /* Team color assignment */ + meshtastic_Team team; + /* Role of the group member */ + meshtastic_MemberRole role; + /* Latitude, multiply by 1e-7 to get degrees in floating point */ + int32_t latitude_i; + /* Longitude, multiply by 1e-7 to get degrees in floating point */ + int32_t longitude_i; + /* Altitude in meters (HAE) */ + int32_t altitude; + /* Speed in cm/s */ + uint32_t speed; + /* Course in degrees * 100 (0-36000) */ + uint16_t course; + /* Battery level 0-100 */ + uint8_t battery; + /* Geopoint source */ + meshtastic_GeoPointSource geo_src; + /* Altitude source */ + meshtastic_GeoPointSource alt_src; + /* Device UID (UUID string or device ID like "ANDROID-xxxx") */ + char uid[48]; + /* Device callsign */ + char device_callsign[120]; + /* Stale time as seconds offset from event time */ + uint16_t stale_seconds; + /* TAK client version string */ + char tak_version[64]; + /* TAK device model */ + char tak_device[32]; + /* TAK platform (ATAK-CIV, WebTAK, etc.) */ + char tak_platform[32]; + /* TAK OS version */ + char tak_os[16]; + /* Connection endpoint */ + char endpoint[32]; + /* Phone number */ + char phone[20]; + /* CoT event type string, only populated when cot_type_id is CotType_Other */ + char cot_type_str[32]; + pb_size_t which_payload_variant; + union { + /* Position report (true = PLI, no extra fields beyond the common ones above) */ + bool pli; + /* ATAK GeoChat message */ + meshtastic_GeoChat chat; + /* Aircraft track data (ADS-B, military air) */ + meshtastic_AircraftTrack aircraft; + /* Generic CoT detail XML for unmapped types */ + meshtastic_TAKPacketV2_raw_detail_t raw_detail; + } payload_variant; +} meshtastic_TAKPacketV2; + #ifdef __cplusplus extern "C" { @@ -160,6 +440,18 @@ extern "C" { #define _meshtastic_MemberRole_MAX meshtastic_MemberRole_K9 #define _meshtastic_MemberRole_ARRAYSIZE ((meshtastic_MemberRole)(meshtastic_MemberRole_K9+1)) +#define _meshtastic_CotHow_MIN meshtastic_CotHow_CotHow_Unspecified +#define _meshtastic_CotHow_MAX meshtastic_CotHow_CotHow_m_s +#define _meshtastic_CotHow_ARRAYSIZE ((meshtastic_CotHow)(meshtastic_CotHow_CotHow_m_s+1)) + +#define _meshtastic_CotType_MIN meshtastic_CotType_CotType_Other +#define _meshtastic_CotType_MAX meshtastic_CotType_CotType_b_f_t_a +#define _meshtastic_CotType_ARRAYSIZE ((meshtastic_CotType)(meshtastic_CotType_CotType_b_f_t_a+1)) + +#define _meshtastic_GeoPointSource_MIN meshtastic_GeoPointSource_GeoPointSource_Unspecified +#define _meshtastic_GeoPointSource_MAX meshtastic_GeoPointSource_GeoPointSource_NETWORK +#define _meshtastic_GeoPointSource_ARRAYSIZE ((meshtastic_GeoPointSource)(meshtastic_GeoPointSource_GeoPointSource_NETWORK+1)) + #define meshtastic_Group_role_ENUMTYPE meshtastic_MemberRole @@ -169,6 +461,14 @@ extern "C" { +#define meshtastic_TAKPacketV2_cot_type_id_ENUMTYPE meshtastic_CotType +#define meshtastic_TAKPacketV2_how_ENUMTYPE meshtastic_CotHow +#define meshtastic_TAKPacketV2_team_ENUMTYPE meshtastic_Team +#define meshtastic_TAKPacketV2_role_ENUMTYPE meshtastic_MemberRole +#define meshtastic_TAKPacketV2_geo_src_ENUMTYPE meshtastic_GeoPointSource +#define meshtastic_TAKPacketV2_alt_src_ENUMTYPE meshtastic_GeoPointSource + + /* Initializer values for message structs */ #define meshtastic_TAKPacket_init_default {0, false, meshtastic_Contact_init_default, false, meshtastic_Group_init_default, false, meshtastic_Status_init_default, 0, {meshtastic_PLI_init_default}} #define meshtastic_GeoChat_init_default {"", false, "", false, ""} @@ -176,12 +476,16 @@ extern "C" { #define meshtastic_Status_init_default {0} #define meshtastic_Contact_init_default {"", ""} #define meshtastic_PLI_init_default {0, 0, 0, 0, 0} +#define meshtastic_AircraftTrack_init_default {"", "", "", "", 0, "", 0, 0, ""} +#define meshtastic_TAKPacketV2_init_default {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", 0, {0}} #define meshtastic_TAKPacket_init_zero {0, false, meshtastic_Contact_init_zero, false, meshtastic_Group_init_zero, false, meshtastic_Status_init_zero, 0, {meshtastic_PLI_init_zero}} #define meshtastic_GeoChat_init_zero {"", false, "", false, ""} #define meshtastic_Group_init_zero {_meshtastic_MemberRole_MIN, _meshtastic_Team_MIN} #define meshtastic_Status_init_zero {0} #define meshtastic_Contact_init_zero {"", ""} #define meshtastic_PLI_init_zero {0, 0, 0, 0, 0} +#define meshtastic_AircraftTrack_init_zero {"", "", "", "", 0, "", 0, 0, ""} +#define meshtastic_TAKPacketV2_init_zero {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", 0, {0}} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_GeoChat_message_tag 1 @@ -204,6 +508,42 @@ extern "C" { #define meshtastic_TAKPacket_pli_tag 5 #define meshtastic_TAKPacket_chat_tag 6 #define meshtastic_TAKPacket_detail_tag 7 +#define meshtastic_AircraftTrack_icao_tag 1 +#define meshtastic_AircraftTrack_registration_tag 2 +#define meshtastic_AircraftTrack_flight_tag 3 +#define meshtastic_AircraftTrack_aircraft_type_tag 4 +#define meshtastic_AircraftTrack_squawk_tag 5 +#define meshtastic_AircraftTrack_category_tag 6 +#define meshtastic_AircraftTrack_rssi_x10_tag 7 +#define meshtastic_AircraftTrack_gps_tag 8 +#define meshtastic_AircraftTrack_cot_host_id_tag 9 +#define meshtastic_TAKPacketV2_cot_type_id_tag 1 +#define meshtastic_TAKPacketV2_how_tag 2 +#define meshtastic_TAKPacketV2_callsign_tag 3 +#define meshtastic_TAKPacketV2_team_tag 4 +#define meshtastic_TAKPacketV2_role_tag 5 +#define meshtastic_TAKPacketV2_latitude_i_tag 6 +#define meshtastic_TAKPacketV2_longitude_i_tag 7 +#define meshtastic_TAKPacketV2_altitude_tag 8 +#define meshtastic_TAKPacketV2_speed_tag 9 +#define meshtastic_TAKPacketV2_course_tag 10 +#define meshtastic_TAKPacketV2_battery_tag 11 +#define meshtastic_TAKPacketV2_geo_src_tag 12 +#define meshtastic_TAKPacketV2_alt_src_tag 13 +#define meshtastic_TAKPacketV2_uid_tag 14 +#define meshtastic_TAKPacketV2_device_callsign_tag 15 +#define meshtastic_TAKPacketV2_stale_seconds_tag 16 +#define meshtastic_TAKPacketV2_tak_version_tag 17 +#define meshtastic_TAKPacketV2_tak_device_tag 18 +#define meshtastic_TAKPacketV2_tak_platform_tag 19 +#define meshtastic_TAKPacketV2_tak_os_tag 20 +#define meshtastic_TAKPacketV2_endpoint_tag 21 +#define meshtastic_TAKPacketV2_phone_tag 22 +#define meshtastic_TAKPacketV2_cot_type_str_tag 23 +#define meshtastic_TAKPacketV2_pli_tag 30 +#define meshtastic_TAKPacketV2_chat_tag 31 +#define meshtastic_TAKPacketV2_aircraft_tag 32 +#define meshtastic_TAKPacketV2_raw_detail_tag 33 /* Struct field encoding specification for nanopb */ #define meshtastic_TAKPacket_FIELDLIST(X, a) \ @@ -255,12 +595,60 @@ X(a, STATIC, SINGULAR, UINT32, course, 5) #define meshtastic_PLI_CALLBACK NULL #define meshtastic_PLI_DEFAULT NULL +#define meshtastic_AircraftTrack_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, icao, 1) \ +X(a, STATIC, SINGULAR, STRING, registration, 2) \ +X(a, STATIC, SINGULAR, STRING, flight, 3) \ +X(a, STATIC, SINGULAR, STRING, aircraft_type, 4) \ +X(a, STATIC, SINGULAR, UINT32, squawk, 5) \ +X(a, STATIC, SINGULAR, STRING, category, 6) \ +X(a, STATIC, SINGULAR, SINT32, rssi_x10, 7) \ +X(a, STATIC, SINGULAR, BOOL, gps, 8) \ +X(a, STATIC, SINGULAR, STRING, cot_host_id, 9) +#define meshtastic_AircraftTrack_CALLBACK NULL +#define meshtastic_AircraftTrack_DEFAULT NULL + +#define meshtastic_TAKPacketV2_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, cot_type_id, 1) \ +X(a, STATIC, SINGULAR, UENUM, how, 2) \ +X(a, STATIC, SINGULAR, STRING, callsign, 3) \ +X(a, STATIC, SINGULAR, UENUM, team, 4) \ +X(a, STATIC, SINGULAR, UENUM, role, 5) \ +X(a, STATIC, SINGULAR, SFIXED32, latitude_i, 6) \ +X(a, STATIC, SINGULAR, SFIXED32, longitude_i, 7) \ +X(a, STATIC, SINGULAR, SINT32, altitude, 8) \ +X(a, STATIC, SINGULAR, UINT32, speed, 9) \ +X(a, STATIC, SINGULAR, UINT32, course, 10) \ +X(a, STATIC, SINGULAR, UINT32, battery, 11) \ +X(a, STATIC, SINGULAR, UENUM, geo_src, 12) \ +X(a, STATIC, SINGULAR, UENUM, alt_src, 13) \ +X(a, STATIC, SINGULAR, STRING, uid, 14) \ +X(a, STATIC, SINGULAR, STRING, device_callsign, 15) \ +X(a, STATIC, SINGULAR, UINT32, stale_seconds, 16) \ +X(a, STATIC, SINGULAR, STRING, tak_version, 17) \ +X(a, STATIC, SINGULAR, STRING, tak_device, 18) \ +X(a, STATIC, SINGULAR, STRING, tak_platform, 19) \ +X(a, STATIC, SINGULAR, STRING, tak_os, 20) \ +X(a, STATIC, SINGULAR, STRING, endpoint, 21) \ +X(a, STATIC, SINGULAR, STRING, phone, 22) \ +X(a, STATIC, SINGULAR, STRING, cot_type_str, 23) \ +X(a, STATIC, ONEOF, BOOL, (payload_variant,pli,payload_variant.pli), 30) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,chat,payload_variant.chat), 31) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,aircraft,payload_variant.aircraft), 32) \ +X(a, STATIC, ONEOF, BYTES, (payload_variant,raw_detail,payload_variant.raw_detail), 33) +#define meshtastic_TAKPacketV2_CALLBACK NULL +#define meshtastic_TAKPacketV2_DEFAULT NULL +#define meshtastic_TAKPacketV2_payload_variant_chat_MSGTYPE meshtastic_GeoChat +#define meshtastic_TAKPacketV2_payload_variant_aircraft_MSGTYPE meshtastic_AircraftTrack + extern const pb_msgdesc_t meshtastic_TAKPacket_msg; extern const pb_msgdesc_t meshtastic_GeoChat_msg; extern const pb_msgdesc_t meshtastic_Group_msg; extern const pb_msgdesc_t meshtastic_Status_msg; extern const pb_msgdesc_t meshtastic_Contact_msg; extern const pb_msgdesc_t meshtastic_PLI_msg; +extern const pb_msgdesc_t meshtastic_AircraftTrack_msg; +extern const pb_msgdesc_t meshtastic_TAKPacketV2_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ #define meshtastic_TAKPacket_fields &meshtastic_TAKPacket_msg @@ -269,14 +657,18 @@ extern const pb_msgdesc_t meshtastic_PLI_msg; #define meshtastic_Status_fields &meshtastic_Status_msg #define meshtastic_Contact_fields &meshtastic_Contact_msg #define meshtastic_PLI_fields &meshtastic_PLI_msg +#define meshtastic_AircraftTrack_fields &meshtastic_AircraftTrack_msg +#define meshtastic_TAKPacketV2_fields &meshtastic_TAKPacketV2_msg /* Maximum encoded size of messages (where known) */ -#define MESHTASTIC_MESHTASTIC_ATAK_PB_H_MAX_SIZE meshtastic_TAKPacket_size +#define MESHTASTIC_MESHTASTIC_ATAK_PB_H_MAX_SIZE meshtastic_TAKPacketV2_size +#define meshtastic_AircraftTrack_size 134 #define meshtastic_Contact_size 242 #define meshtastic_GeoChat_size 444 #define meshtastic_Group_size 4 #define meshtastic_PLI_size 31 #define meshtastic_Status_size 3 +#define meshtastic_TAKPacketV2_size 1027 #define meshtastic_TAKPacket_size 705 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index 477c3b31b..fc6931d73 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -308,6 +308,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_TDISPLAY_S3_PRO = 126, /* Heltec Mesh Node T096 board features an nRF52840 CPU and a TFT screen. */ meshtastic_HardwareModel_HELTEC_MESH_NODE_T096 = 127, + /* Seeed studio T1000-E Pro tracker card. NRF52840 w/ LR2021 radio, GPS, button, buzzer, and sensors. */ + meshtastic_HardwareModel_TRACKER_T1000_E_PRO = 128, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index bd1fe48c4..a474e5b92 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -150,6 +150,10 @@ typedef enum _meshtastic_PortNum { arbitrary telemetry over meshtastic that is not covered by telemetry.proto ENCODING: CayenneLLP */ meshtastic_PortNum_CAYENNE_APP = 77, + /* ATAK Plugin V2 + Portnum for payloads from the official Meshtastic ATAK plugin using + TAKPacketV2 with zstd dictionary compression. */ + meshtastic_PortNum_ATAK_PLUGIN_V2 = 78, /* GroupAlarm integration Used for transporting GroupAlarm-related messages between Meshtastic nodes and companion applications/services. */ From 7fdee353b5fe280fa0c92cd0cbb5947da37f140e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 21:16:56 -0500 Subject: [PATCH 041/150] Update meshtastic-esp32_https_server digest to 0c71f38 (#10081) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32/esp32-common.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32/esp32-common.ini b/variants/esp32/esp32-common.ini index bf8459f24..db826b3f9 100644 --- a/variants/esp32/esp32-common.ini +++ b/variants/esp32/esp32-common.ini @@ -68,7 +68,7 @@ lib_deps = ${environmental_extra.lib_deps} ${radiolib_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-esp32_https_server packageName=https://github.com/meshtastic/esp32_https_server gitBranch=master - https://github.com/meshtastic/esp32_https_server/archive/b78f12c86ea65c3ca08968840ff554ff7ed69b60.zip + https://github.com/meshtastic/esp32_https_server/archive/0c71f380390ad483ff134ad938e07f6cf1226c5b.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@1.4.3 # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master From 2c633b6458271912004bb8117588d19b97755944 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 06:28:05 -0500 Subject: [PATCH 042/150] Upgrade trunk (#10096) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 05f1bb22e..d0cbaa8bc 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,10 +8,10 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.513 - - renovate@43.104.6 + - checkov@3.2.517 + - renovate@43.110.9 - prettier@3.8.1 - - trufflehog@3.94.2 + - trufflehog@3.94.3 - yamllint@1.38.0 - bandit@1.9.4 - trivy@0.69.3 From 216655f05f38bc64d31e901ea78ec55fd2dfa3de Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 19:37:00 -0500 Subject: [PATCH 043/150] Update meshtastic-st7789 digest to 222554e (#10121) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32s3/heltec_vision_master_t190/platformio.ini | 2 +- variants/esp32s3/m5stack_cardputer_adv/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_node_t114/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_solar/platformio.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini index 44e8b2f2d..e5d15efc6 100644 --- a/variants/esp32s3/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -20,5 +20,5 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/9ee76d6b18b9a8f45a2c5cae06b1134a587691eb.zip + https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip upload_speed = 921600 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index e2411bc6e..17c33ce1d 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/9ee76d6b18b9a8f45a2c5cae06b1134a587691eb.zip + https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index 7cbc5f6a9..6a2f4e74a 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -23,4 +23,4 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/9ee76d6b18b9a8f45a2c5cae06b1134a587691eb.zip + https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini index 6935920cd..0d6be29f7 100644 --- a/variants/nrf52840/heltec_mesh_solar/platformio.ini +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -132,4 +132,4 @@ build_flags = ${heltec_mesh_solar_base.build_flags} lib_deps = ${heltec_mesh_solar_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/9ee76d6b18b9a8f45a2c5cae06b1134a587691eb.zip + https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip From 839cf554b7fe0d81c0f4579c2492d806ab7aaf11 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 10 Apr 2026 12:21:23 -0400 Subject: [PATCH 044/150] meshtasticd: Add configs for ebyte-ecb41-pge (mPWRD-OS) (#10086) These configs were generated programatically by Opus 4.6. See: https://github.com/vidplace7/meshtasticd-40pin Tested with MeshAdv-Pi, other pinmaps are untested but should work. --- .../lora-ecb41-pge-MeshAdv-900M30S.yaml | 39 +++++++++++++++++++ .../lora-ecb41-pge-MeshAdv-Mini-900M22S.yaml | 33 ++++++++++++++++ .../lora-ecb41-pge-RAK6421-13300-slot1.yaml | 38 ++++++++++++++++++ .../lora-ecb41-pge-RAK6421-13300-slot2.yaml | 36 +++++++++++++++++ .../lora-ecb41-pge-RAK6421-13302-slot1.yaml | 39 +++++++++++++++++++ .../lora-ecb41-pge-RAK6421-13302-slot2.yaml | 37 ++++++++++++++++++ .../lora-ecb41-pge-waveshare-sxxx.yaml | 30 ++++++++++++++ 7 files changed, 252 insertions(+) create mode 100644 bin/config.d/lora-ecb41-pge-MeshAdv-900M30S.yaml create mode 100644 bin/config.d/lora-ecb41-pge-MeshAdv-Mini-900M22S.yaml create mode 100644 bin/config.d/lora-ecb41-pge-RAK6421-13300-slot1.yaml create mode 100644 bin/config.d/lora-ecb41-pge-RAK6421-13300-slot2.yaml create mode 100644 bin/config.d/lora-ecb41-pge-RAK6421-13302-slot1.yaml create mode 100644 bin/config.d/lora-ecb41-pge-RAK6421-13302-slot2.yaml create mode 100644 bin/config.d/lora-ecb41-pge-waveshare-sxxx.yaml diff --git a/bin/config.d/lora-ecb41-pge-MeshAdv-900M30S.yaml b/bin/config.d/lora-ecb41-pge-MeshAdv-900M30S.yaml new file mode 100644 index 000000000..25fd5e359 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-MeshAdv-900M30S.yaml @@ -0,0 +1,39 @@ +# MeshAdv-Pi E22-900M30S +# https://github.com/chrismyers2000/MeshAdv-Pi-Hat +Meta: + name: MeshAdv-Pi E22-900M30S + support: community + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 + CS: # GPIO0_A1 (physical 40) + pin: 1 + gpiochip: 0 + line: 1 + IRQ: # GPIO0_A3 (physical 36) + pin: 3 + gpiochip: 0 + line: 3 + Busy: # GPIO0_A0 (physical 38) + pin: 0 + gpiochip: 0 + line: 0 + Reset: # GPIO0_B4 (physical 12) + pin: 12 + gpiochip: 0 + line: 12 + TXen: # GPIO1_D1 (physical 33) + pin: 57 + gpiochip: 1 + line: 25 + RXen: # GPIO1_B3 (physical 32) + pin: 43 + gpiochip: 1 + line: 11 + DIO3_TCXO_VOLTAGE: true + # Only for E22-900M33S: + # Limit the output power to 8 dBm + # SX126X_MAX_POWER: 8 + spidev: spidev0.0 diff --git a/bin/config.d/lora-ecb41-pge-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-ecb41-pge-MeshAdv-Mini-900M22S.yaml new file mode 100644 index 000000000..e1f385312 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-MeshAdv-Mini-900M22S.yaml @@ -0,0 +1,33 @@ +# MeshAdv Mini E22-900M22S +# https://github.com/chrismyers2000/MeshAdv-Mini +Meta: + name: MeshAdv Mini E22-900M22S + support: community + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 # Ebyte E22-900M22S + CS: # GPIO0_B6 (physical 24, SPI1_CSN0) + pin: 14 + gpiochip: 0 + line: 14 + IRQ: # GPIO0_A3 (physical 36) + pin: 3 + gpiochip: 0 + line: 3 + Busy: # GPIO0_A0 (physical 38) + pin: 0 + gpiochip: 0 + line: 0 + Reset: # GPIO1_C3 (physical 18) + pin: 51 + gpiochip: 1 + line: 19 + RXen: # GPIO1_B3 (physical 32) + pin: 43 + gpiochip: 1 + line: 11 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + spidev: spidev0.0 diff --git a/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot1.yaml b/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot1.yaml new file mode 100644 index 000000000..8782876ac --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot1.yaml @@ -0,0 +1,38 @@ +Meta: + name: RAK6421 + RAK13300 Slot 1 + support: community # Promote when tested + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_A5 (IO6, physical 15) + pin: 5 + gpiochip: 0 + line: 5 + Reset: # GPIO0_A3 (IO4, physical 36) + pin: 3 + gpiochip: 0 + line: 3 + Busy: # GPIO1_C3 (IO5, physical 18) + pin: 51 + gpiochip: 1 + line: 19 + # Ant_sw: # GPIO1_C2 (IO3, physical 16) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 43 # GPIO1_B3 (physical 32) + gpiochip: 1 + line: 11 + - pin: 57 # GPIO1_D1 (physical 33) + gpiochip: 1 + line: 25 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_B6 (SPI1_CSN0, physical 24) + # pin: 14 + # gpiochip: 0 + # line: 14 diff --git a/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot2.yaml b/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot2.yaml new file mode 100644 index 000000000..e0ef946d9 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-RAK6421-13300-slot2.yaml @@ -0,0 +1,36 @@ +Meta: + name: RAK6421 + RAK13300 Slot 2 + support: community # Promote when tested + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B4 (IO6, physical 12) + pin: 12 + gpiochip: 0 + line: 12 + Reset: # GPIO1_C3 (IO4, physical 18) + pin: 51 + gpiochip: 1 + line: 19 + Busy: # GPIO0_B3 (IO5, physical 35) + pin: 11 + gpiochip: 0 + line: 11 + # Ant_sw: # GPIO1_C2 (IO3, physical 16) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 2 # GPIO0_A2 (physical 37) + gpiochip: 0 + line: 2 + - pin: 50 # GPIO1_C2 (physical 16) + gpiochip: 1 + line: 18 + spidev: spidev0.1 + # CS: # GPIO0_A7 (SPI1_CSN1, physical 26) + # pin: 7 + # gpiochip: 0 + # line: 7 diff --git a/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot1.yaml b/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot1.yaml new file mode 100644 index 000000000..374be8e35 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot1.yaml @@ -0,0 +1,39 @@ +Meta: + name: RAK6421 + RAK13302 Slot 1 + support: community # Promote when tested + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_A5 (IO6, physical 15) + pin: 5 + gpiochip: 0 + line: 5 + Reset: # GPIO0_A3 (IO4, physical 36) + pin: 3 + gpiochip: 0 + line: 3 + Busy: # GPIO1_C3 (IO5, physical 18) + pin: 51 + gpiochip: 1 + line: 19 + # Ant_sw: # GPIO1_C2 (IO3, physical 16) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 43 # GPIO1_B3 (physical 32) + gpiochip: 1 + line: 11 + - pin: 57 # GPIO1_D1 (physical 33) + gpiochip: 1 + line: 25 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_B6 (SPI1_CSN0, physical 24) + # pin: 14 + # gpiochip: 0 + # line: 14 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot2.yaml b/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot2.yaml new file mode 100644 index 000000000..5548bc5c7 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-RAK6421-13302-slot2.yaml @@ -0,0 +1,37 @@ +Meta: + name: RAK6421 + RAK13302 Slot 2 + support: community # Promote when tested + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B4 (IO6, physical 12) + pin: 12 + gpiochip: 0 + line: 12 + Reset: # GPIO1_C3 (IO4, physical 18) + pin: 51 + gpiochip: 1 + line: 19 + Busy: # GPIO0_B3 (IO5, physical 35) + pin: 11 + gpiochip: 0 + line: 11 + # Ant_sw: # GPIO1_C2 (IO3, physical 16) + # pin: 50 + # gpiochip: 1 + # line: 18 + Enable_Pins: + - pin: 2 # GPIO0_A2 (physical 37) + gpiochip: 0 + line: 2 + - pin: 50 # GPIO1_C2 (physical 16) + gpiochip: 1 + line: 18 + spidev: spidev0.1 + # CS: # GPIO0_A7 (SPI1_CSN1, physical 26) + # pin: 7 + # gpiochip: 0 + # line: 7 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-ecb41-pge-waveshare-sxxx.yaml b/bin/config.d/lora-ecb41-pge-waveshare-sxxx.yaml new file mode 100644 index 000000000..1253d3e31 --- /dev/null +++ b/bin/config.d/lora-ecb41-pge-waveshare-sxxx.yaml @@ -0,0 +1,30 @@ +Meta: + name: Waveshare SX1262 + support: deprecated + compatible: + - ebyte-ecb41-pge # Armbian + +Lora: + Module: sx1262 # Waveshare SX126X XXXM + DIO2_AS_RF_SWITCH: true + CS: # GPIO0_A1 (physical 40) + pin: 1 + gpiochip: 0 + line: 1 + IRQ: # GPIO0_A3 (physical 36) + pin: 3 + gpiochip: 0 + line: 3 + Busy: # GPIO0_A0 (physical 38) + pin: 0 + gpiochip: 0 + line: 0 + Reset: # GPIO0_B4 (physical 12) + pin: 12 + gpiochip: 0 + line: 12 + SX126X_ANT_SW: # GPIO1_B2 (physical 31) + pin: 42 + gpiochip: 1 + line: 10 + spidev: spidev0.0 From 3cd3fd3386d4c84ae889877c4466cc63abde1d3d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 11:21:51 -0500 Subject: [PATCH 045/150] Update actions/github-script action to v9 (#10122) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/models_issue_triage.yml | 10 +++++----- .github/workflows/models_pr_triage.yml | 6 +++--- .github/workflows/pr_enforce_labels.yml | 2 +- .github/workflows/pr_tests.yml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/models_issue_triage.yml b/.github/workflows/models_issue_triage.yml index ef12885f8..a02646ea0 100644 --- a/.github/workflows/models_issue_triage.yml +++ b/.github/workflows/models_issue_triage.yml @@ -38,7 +38,7 @@ jobs: - name: Apply quality label if needed if: steps.quality.outputs.response != '' && steps.quality.outputs.response != 'ok' - uses: actions/github-script@v8 + uses: actions/github-script@v9 env: QUALITY_LABEL: ${{ steps.quality.outputs.response }} with: @@ -80,7 +80,7 @@ jobs: # ───────────────────────────────────────────────────────────────────────── - name: Determine if completeness check should be skipped if: steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == '' - uses: actions/github-script@v8 + uses: actions/github-script@v9 id: check-skip with: script: | @@ -134,7 +134,7 @@ jobs: - name: Process analysis result if: (steps.quality.outputs.response == 'ok' || steps.quality.outputs.response == '') && steps.check-skip.outputs.should_skip != 'true' && steps.analysis.outputs.response != '' - uses: actions/github-script@v8 + uses: actions/github-script@v9 id: process env: AI_RESPONSE: ${{ steps.analysis.outputs.response }} @@ -174,7 +174,7 @@ jobs: - name: Apply triage label if: steps.process.outputs.label != '' && steps.process.outputs.label != 'none' - uses: actions/github-script@v8 + uses: actions/github-script@v9 env: LABEL_NAME: ${{ steps.process.outputs.label }} with: @@ -200,7 +200,7 @@ jobs: - name: Comment on issue if: steps.process.outputs.should_comment == 'true' - uses: actions/github-script@v8 + uses: actions/github-script@v9 env: COMMENT_BODY: ${{ steps.process.outputs.comment_body }} with: diff --git a/.github/workflows/models_pr_triage.yml b/.github/workflows/models_pr_triage.yml index d4c8509d2..f39ee4845 100644 --- a/.github/workflows/models_pr_triage.yml +++ b/.github/workflows/models_pr_triage.yml @@ -22,7 +22,7 @@ jobs: # Step 1: Check if PR already has automation/type labels (skip if so) # ───────────────────────────────────────────────────────────────────────── - name: Check existing labels - uses: actions/github-script@v8 + uses: actions/github-script@v9 id: check-labels with: script: | @@ -58,7 +58,7 @@ jobs: - name: Apply quality label if needed if: steps.check-labels.outputs.skip_all != 'true' && steps.quality.outputs.response != '' && steps.quality.outputs.response != 'ok' - uses: actions/github-script@v8 + uses: actions/github-script@v9 id: quality-label env: QUALITY_LABEL: ${{ steps.quality.outputs.response }} @@ -113,7 +113,7 @@ jobs: - name: Apply type label if: steps.check-labels.outputs.skip_all != 'true' && steps.check-labels.outputs.has_type_label != 'true' && steps.classify.outputs.response != '' - uses: actions/github-script@v8 + uses: actions/github-script@v9 env: TYPE_LABEL: ${{ steps.classify.outputs.response }} with: diff --git a/.github/workflows/pr_enforce_labels.yml b/.github/workflows/pr_enforce_labels.yml index d60c9c8ca..bf2239f63 100644 --- a/.github/workflows/pr_enforce_labels.yml +++ b/.github/workflows/pr_enforce_labels.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check for PR labels - uses: actions/github-script@v8 + uses: actions/github-script@v9 with: script: | const labels = context.payload.pull_request.labels.map(label => label.name); diff --git a/.github/workflows/pr_tests.yml b/.github/workflows/pr_tests.yml index 3556226ba..e3321712e 100644 --- a/.github/workflows/pr_tests.yml +++ b/.github/workflows/pr_tests.yml @@ -177,7 +177,7 @@ jobs: - name: Comment test results on PR if: github.event_name == 'pull_request' && needs.native-tests.result != 'skipped' - uses: actions/github-script@v8 + uses: actions/github-script@v9 with: script: | const fs = require('fs'); From ae5019bec69801f72f1ed7bc633250b192be25e3 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 10 Apr 2026 17:49:36 -0400 Subject: [PATCH 046/150] meshtasticd: Add configs for forlinx-ok3506-s12 (mPWRD-OS) (#10087) These configs were generated programatically by Opus 4.6. See: https://github.com/vidplace7/meshtasticd-40pin Tested with MeshAdv-Pi, other pinmaps are untested but should work. --- bin/config.d/lora-ok3506-MeshAdv-900M30S.yaml | 41 +++++++++++++++++++ .../lora-ok3506-MeshAdv-Mini-900M22S.yaml | 35 ++++++++++++++++ .../lora-ok3506-RAK6421-13300-slot1.yaml | 40 ++++++++++++++++++ .../lora-ok3506-RAK6421-13300-slot2.yaml | 38 +++++++++++++++++ .../lora-ok3506-RAK6421-13302-slot1.yaml | 41 +++++++++++++++++++ .../lora-ok3506-RAK6421-13302-slot2.yaml | 39 ++++++++++++++++++ bin/config.d/lora-ok3506-waveshare-sxxx.yaml | 32 +++++++++++++++ 7 files changed, 266 insertions(+) create mode 100644 bin/config.d/lora-ok3506-MeshAdv-900M30S.yaml create mode 100644 bin/config.d/lora-ok3506-MeshAdv-Mini-900M22S.yaml create mode 100644 bin/config.d/lora-ok3506-RAK6421-13300-slot1.yaml create mode 100644 bin/config.d/lora-ok3506-RAK6421-13300-slot2.yaml create mode 100644 bin/config.d/lora-ok3506-RAK6421-13302-slot1.yaml create mode 100644 bin/config.d/lora-ok3506-RAK6421-13302-slot2.yaml create mode 100644 bin/config.d/lora-ok3506-waveshare-sxxx.yaml diff --git a/bin/config.d/lora-ok3506-MeshAdv-900M30S.yaml b/bin/config.d/lora-ok3506-MeshAdv-900M30S.yaml new file mode 100644 index 000000000..c39a07ccd --- /dev/null +++ b/bin/config.d/lora-ok3506-MeshAdv-900M30S.yaml @@ -0,0 +1,41 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +# MeshAdv-Pi E22-900M30S +# https://github.com/chrismyers2000/MeshAdv-Pi-Hat +Meta: + name: MeshAdv-Pi E22-900M30S + support: community + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 + CS: # GPIO0_B0 (physical 40) + pin: 8 + gpiochip: 0 + line: 8 + IRQ: # GPIO3_B0 (physical 36) + pin: 104 + gpiochip: 3 + line: 8 + Busy: # GPIO0_B1 (physical 38) + pin: 9 + gpiochip: 0 + line: 9 + Reset: # GPIO0_B6 (physical 12) + pin: 14 + gpiochip: 0 + line: 14 + TXen: # GPIO0_A3 (physical 33) + pin: 3 + gpiochip: 0 + line: 3 + RXen: # GPIO0_A2 (physical 32) + pin: 2 + gpiochip: 0 + line: 2 + DIO3_TCXO_VOLTAGE: true + # Only for E22-900M33S: + # Limit the output power to 8 dBm + # SX126X_MAX_POWER: 8 + spidev: spidev0.0 diff --git a/bin/config.d/lora-ok3506-MeshAdv-Mini-900M22S.yaml b/bin/config.d/lora-ok3506-MeshAdv-Mini-900M22S.yaml new file mode 100644 index 000000000..8f2c4a417 --- /dev/null +++ b/bin/config.d/lora-ok3506-MeshAdv-Mini-900M22S.yaml @@ -0,0 +1,35 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +# MeshAdv Mini E22-900M22S +# https://github.com/chrismyers2000/MeshAdv-Mini +Meta: + name: MeshAdv Mini E22-900M22S + support: community + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 # Ebyte E22-900M22S + CS: # GPIO0_C3 (physical 24, SPI0_CSN0) + pin: 19 + gpiochip: 0 + line: 19 + IRQ: # GPIO3_B0 (physical 36) + pin: 104 + gpiochip: 3 + line: 8 + Busy: # GPIO0_B1 (physical 38) + pin: 9 + gpiochip: 0 + line: 9 + Reset: # GPIO3_A6 (physical 18) + pin: 102 + gpiochip: 3 + line: 6 + RXen: # GPIO0_A2 (physical 32) + pin: 2 + gpiochip: 0 + line: 2 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + spidev: spidev0.0 diff --git a/bin/config.d/lora-ok3506-RAK6421-13300-slot1.yaml b/bin/config.d/lora-ok3506-RAK6421-13300-slot1.yaml new file mode 100644 index 000000000..d97bdd327 --- /dev/null +++ b/bin/config.d/lora-ok3506-RAK6421-13300-slot1.yaml @@ -0,0 +1,40 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +Meta: + name: RAK6421 + RAK13300 Slot 1 + support: community # Promote when tested + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO3_B5 (IO6, physical 15) + pin: 109 + gpiochip: 3 + line: 13 + Reset: # GPIO3_B0 (IO4, physical 36) + pin: 104 + gpiochip: 3 + line: 8 + Busy: # GPIO3_A6 (IO5, physical 18) + pin: 102 + gpiochip: 3 + line: 6 + # Ant_sw: # GPIO0_A3 (IO3, physical 33) + # pin: 3 + # gpiochip: 0 + # line: 3 + Enable_Pins: + - pin: 2 # GPIO0_A2 (physical 32) + gpiochip: 0 + line: 2 + - pin: 3 # GPIO0_A3 (physical 33) + gpiochip: 0 + line: 3 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_C3 (SPI0_CSN0, physical 24) + # pin: 19 + # gpiochip: 0 + # line: 19 diff --git a/bin/config.d/lora-ok3506-RAK6421-13300-slot2.yaml b/bin/config.d/lora-ok3506-RAK6421-13300-slot2.yaml new file mode 100644 index 000000000..969c20ad3 --- /dev/null +++ b/bin/config.d/lora-ok3506-RAK6421-13300-slot2.yaml @@ -0,0 +1,38 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +Meta: + name: RAK6421 + RAK13300 Slot 2 + support: community # Promote when tested + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B6 (IO6, physical 12) + pin: 14 + gpiochip: 0 + line: 14 + Reset: # GPIO3_A6 (IO4, physical 18) + pin: 102 + gpiochip: 3 + line: 6 + Busy: # GPIO0_B2 (IO5, physical 35) + pin: 10 + gpiochip: 0 + line: 10 + # Ant_sw: # GPIO3_A7 (IO3, physical 16) + # pin: 103 + # gpiochip: 3 + # line: 7 + Enable_Pins: + - pin: 106 # GPIO3_B2 (physical 37) + gpiochip: 3 + line: 10 + - pin: 103 # GPIO3_A7 (physical 16) + gpiochip: 3 + line: 7 + spidev: spidev0.1 + # CS: # GPIO0_B7 (SPI0_CSN1, physical 26) + # pin: 15 + # gpiochip: 0 + # line: 15 diff --git a/bin/config.d/lora-ok3506-RAK6421-13302-slot1.yaml b/bin/config.d/lora-ok3506-RAK6421-13302-slot1.yaml new file mode 100644 index 000000000..d73eaf7a0 --- /dev/null +++ b/bin/config.d/lora-ok3506-RAK6421-13302-slot1.yaml @@ -0,0 +1,41 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +Meta: + name: RAK6421 + RAK13302 Slot 1 + support: community # Promote when tested + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO3_B5 (IO6, physical 15) + pin: 109 + gpiochip: 3 + line: 13 + Reset: # GPIO3_B0 (IO4, physical 36) + pin: 104 + gpiochip: 3 + line: 8 + Busy: # GPIO3_A6 (IO5, physical 18) + pin: 102 + gpiochip: 3 + line: 6 + # Ant_sw: # GPIO0_A3 (IO3, physical 33) + # pin: 3 + # gpiochip: 0 + # line: 3 + Enable_Pins: + - pin: 2 # GPIO0_A2 (physical 32) + gpiochip: 0 + line: 2 + - pin: 3 # GPIO0_A3 (physical 33) + gpiochip: 0 + line: 3 + DIO3_TCXO_VOLTAGE: true + DIO2_AS_RF_SWITCH: true + spidev: spidev0.0 + # CS: # GPIO0_C3 (SPI0_CSN0, physical 24) + # pin: 19 + # gpiochip: 0 + # line: 19 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-ok3506-RAK6421-13302-slot2.yaml b/bin/config.d/lora-ok3506-RAK6421-13302-slot2.yaml new file mode 100644 index 000000000..36b70658b --- /dev/null +++ b/bin/config.d/lora-ok3506-RAK6421-13302-slot2.yaml @@ -0,0 +1,39 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +Meta: + name: RAK6421 + RAK13302 Slot 2 + support: community # Promote when tested + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 + IRQ: # GPIO0_B6 (IO6, physical 12) + pin: 14 + gpiochip: 0 + line: 14 + Reset: # GPIO3_A6 (IO4, physical 18) + pin: 102 + gpiochip: 3 + line: 6 + Busy: # GPIO0_B2 (IO5, physical 35) + pin: 10 + gpiochip: 0 + line: 10 + # Ant_sw: # GPIO3_A7 (IO3, physical 16) + # pin: 103 + # gpiochip: 3 + # line: 7 + Enable_Pins: + - pin: 106 # GPIO3_B2 (physical 37) + gpiochip: 3 + line: 10 + - pin: 103 # GPIO3_A7 (physical 16) + gpiochip: 3 + line: 7 + spidev: spidev0.1 + # CS: # GPIO0_B7 (SPI0_CSN1, physical 26) + # pin: 15 + # gpiochip: 0 + # line: 15 + TX_GAIN_LORA: [9, 9, 10, 11, 9, 8, 9, 10, 10, 10, 11, 12, 12, 12, 12, 12, 12, 12, 12, 10, 9, 8] diff --git a/bin/config.d/lora-ok3506-waveshare-sxxx.yaml b/bin/config.d/lora-ok3506-waveshare-sxxx.yaml new file mode 100644 index 000000000..1f5795f92 --- /dev/null +++ b/bin/config.d/lora-ok3506-waveshare-sxxx.yaml @@ -0,0 +1,32 @@ +# !! WARNING: Hats on the OK3506 board are installed "backwards" (facing outwards) + +Meta: + name: Waveshare SX1262 + support: deprecated + compatible: + - forlinx-ok3506-s12 # Armbian + +Lora: + Module: sx1262 # Waveshare SX126X XXXM + DIO2_AS_RF_SWITCH: true + CS: # GPIO0_B0 (physical 40) + pin: 8 + gpiochip: 0 + line: 8 + IRQ: # GPIO3_B0 (physical 36) + pin: 104 + gpiochip: 3 + line: 8 + Busy: # GPIO0_B1 (physical 38) + pin: 9 + gpiochip: 0 + line: 9 + Reset: # GPIO0_B6 (physical 12) + pin: 14 + gpiochip: 0 + line: 14 + SX126X_ANT_SW: # GPIO3_B3 (physical 31) + pin: 107 + gpiochip: 3 + line: 11 + spidev: spidev0.0 From 48ae4b6c7abfe66d86b21ca38633726b37302993 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:19:01 -0500 Subject: [PATCH 047/150] Update meshtastic-st7789 digest to 7228c49 (#10131) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32s3/heltec_vision_master_t190/platformio.ini | 2 +- variants/esp32s3/m5stack_cardputer_adv/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_node_t114/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_solar/platformio.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini index e5d15efc6..7a3db5d01 100644 --- a/variants/esp32s3/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -20,5 +20,5 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip + https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip upload_speed = 921600 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index 17c33ce1d..4b1f46bf7 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip + https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index 6a2f4e74a..1d8e641ab 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -23,4 +23,4 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip + https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini index 0d6be29f7..20a37ec97 100644 --- a/variants/nrf52840/heltec_mesh_solar/platformio.ini +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -132,4 +132,4 @@ build_flags = ${heltec_mesh_solar_base.build_flags} lib_deps = ${heltec_mesh_solar_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/222554e9f32e0226a70e3156858cb3f8726d700b.zip + https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip From e7c7af40ae17df3130332b08f761b982bd016655 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 20:09:08 -0500 Subject: [PATCH 048/150] Update meshtastic-st7789 digest to 4d957e7 (#10134) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32s3/heltec_vision_master_t190/platformio.ini | 2 +- variants/esp32s3/m5stack_cardputer_adv/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_node_t114/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_solar/platformio.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini index 7a3db5d01..250673a04 100644 --- a/variants/esp32s3/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -20,5 +20,5 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip + https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip upload_speed = 921600 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index 4b1f46bf7..421a2b843 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip + https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index 1d8e641ab..ad56face7 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -23,4 +23,4 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip + https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini index 20a37ec97..176977f92 100644 --- a/variants/nrf52840/heltec_mesh_solar/platformio.ini +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -132,4 +132,4 @@ build_flags = ${heltec_mesh_solar_base.build_flags} lib_deps = ${heltec_mesh_solar_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/7228c498001481a444e157413e1ea517dd6f436a.zip + https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip From a50cbdc95b1604e9c7f6e20d042c496d58b9ff4d Mon Sep 17 00:00:00 2001 From: Austin Lane Date: Sat, 11 Apr 2026 21:23:05 -0400 Subject: [PATCH 049/150] Docker: Pull images from Google/AWS during build Use Google / Amazon mirrors, not DockerHub, when pulling images for Docker builds. Should prevent Docker ratelimiting during CI (Actions) builds. --- .github/workflows/docker_build.yml | 33 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 72987c01e..d9b23a7e8 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -56,6 +56,25 @@ jobs: echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT id: version + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + with: + cache-image: true + + - name: Docker setup + uses: docker/setup-buildx-action@v4 + with: + # Add Google/Amazon DockerHub mirrors to buildkit config + # https://docs.docker.com/build/ci/github-actions/configure-builder/#registry-mirror + buildkitd-config-inline: | + [registry."docker.io"] + mirrors = ["mirror.gcr.io", "public.ecr.aws"] + + - name: Sanitize platform string + id: sanitize_platform + # Replace slashes with underscores + run: echo "cleaned_platform=${{ inputs.platform }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT + - name: Docker login if: ${{ inputs.push }} uses: docker/login-action@v4 @@ -63,17 +82,6 @@ jobs: username: meshtastic password: ${{ secrets.DOCKER_FIRMWARE_TOKEN }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v4 - - - name: Docker setup - uses: docker/setup-buildx-action@v4 - - - name: Sanitize platform string - id: sanitize_platform - # Replace slashes with underscores - run: echo "cleaned_platform=${{ inputs.platform }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT - - name: Docker tag id: meta uses: docker/metadata-action@v6 @@ -95,3 +103,6 @@ jobs: platforms: ${{ inputs.platform }} build-args: | PIO_ENV=${{ inputs.pio_env }} + # Cache image layers in GitHub Actions cache to speed up subsequent builds. + cache-from: type=gha + cache-to: type=gha,mode=max From 381cefa6b2222503cdfca4e44488697cfe4102f0 Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 12 Apr 2026 08:24:11 -0400 Subject: [PATCH 050/150] PPA: Use SFTP method for uploads (#10138) * Upload to PPA via SFTP * PPA-SFTP: Trust Launchpad's SSH Key * Move SSH key import next to GPG * Increase dput timeout... * Use env for inputs (address semgrep gripe) --- .github/workflows/package_ppa.yml | 47 +++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/.github/workflows/package_ppa.yml b/.github/workflows/package_ppa.yml index 334a7016d..c51e64e78 100644 --- a/.github/workflows/package_ppa.yml +++ b/.github/workflows/package_ppa.yml @@ -5,6 +5,8 @@ on: secrets: PPA_GPG_PRIVATE_KEY: required: true + PPA_SFTP_PRIVATE_KEY: + required: true inputs: ppa_repo: description: Meshtastic PPA to target @@ -27,6 +29,7 @@ jobs: build_location: ppa package-ppa: + if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }} runs-on: ubuntu-24.04 needs: build-debian-src steps: @@ -40,7 +43,7 @@ jobs: shell: bash run: | sudo apt-get update -y --fix-missing - sudo apt-get install -y dput + sudo apt-get install -y dput openssh-client - name: Import GPG key uses: crazy-max/ghaction-import-gpg@v7 @@ -65,8 +68,42 @@ jobs: - name: Display structure of downloaded files run: ls -lah - - name: Publish with dput - if: ${{ github.event_name != 'pull_request_target' && github.event_name != 'pull_request' }} - timeout-minutes: 15 # dput is terrible, sometimes runs 'forever' + - name: Trust Launchpad's SSH key run: | - dput ${{ inputs.ppa_repo }} meshtasticd_${{ steps.version.outputs.deb }}~${{ inputs.series }}_source.changes + mkdir -p ~/.ssh + ssh-keyscan -H ppa.launchpad.net >> ~/.ssh/known_hosts + + - name: Setup dput config + env: + ppa_login: meshtasticorg + run: | + sudo tee /etc/meshtastic-dput.cf >/dev/null < + dput -c /etc/meshtastic-dput.cf + ssh-${up_ppa_repo} + meshtasticd_${up_version}~${up_series}_source.changes From 0f2d224e744371cc3724c1397d728568dc4ad57e Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 12 Apr 2026 18:06:57 -0400 Subject: [PATCH 051/150] Switch PlatformIO deps from PIO Registry to tagged GitHub zips (#10142) --- platformio.ini | 172 +++++++++--------- .../betafpv_2400_tx_micro/platformio.ini | 4 - .../esp32c3/heltec_hru_3601/platformio.ini | 3 - .../esp32c6/m5stack_unitc6l/platformio.ini | 2 - .../diy/my_esp32s3_diy_eink/platformio.ini | 2 - .../diy/my_esp32s3_diy_oled/platformio.ini | 4 - variants/esp32s3/esp32-s3-pico/platformio.ini | 2 - .../esp32s3/heltec_sensor_hub/platformio.ini | 4 - .../m5stack_cardputer_adv/platformio.ini | 2 - variants/esp32s3/unphone/platformio.ini | 2 - variants/native/portduino.ini | 5 +- 11 files changed, 93 insertions(+), 109 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0f70795fc..437e6f34c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -131,107 +131,115 @@ lib_deps = ; Common libs for environmental measurements in telemetry module [environmental_base] lib_deps = - # renovate: datasource=custom.pio depName=Adafruit BusIO packageName=adafruit/library/Adafruit BusIO - adafruit/Adafruit BusIO@1.17.4 - # renovate: datasource=custom.pio depName=Adafruit Unified Sensor packageName=adafruit/library/Adafruit Unified Sensor - adafruit/Adafruit Unified Sensor@1.1.15 - # renovate: datasource=custom.pio depName=Adafruit BMP280 packageName=adafruit/library/Adafruit BMP280 Library - adafruit/Adafruit BMP280 Library@3.0.0 - # renovate: datasource=custom.pio depName=Adafruit BMP085 packageName=adafruit/library/Adafruit BMP085 Library - adafruit/Adafruit BMP085 Library@1.2.4 - # renovate: datasource=custom.pio depName=Adafruit BME280 packageName=adafruit/library/Adafruit BME280 Library - adafruit/Adafruit BME280 Library@2.3.0 - # renovate: datasource=custom.pio depName=Adafruit DPS310 packageName=adafruit/library/Adafruit DPS310 - adafruit/Adafruit DPS310@1.1.6 - # renovate: datasource=custom.pio depName=Adafruit MCP9808 packageName=adafruit/library/Adafruit MCP9808 Library - adafruit/Adafruit MCP9808 Library@2.0.2 - # renovate: datasource=custom.pio depName=Adafruit INA260 packageName=adafruit/library/Adafruit INA260 Library - adafruit/Adafruit INA260 Library@1.5.3 - # renovate: datasource=custom.pio depName=Adafruit INA219 packageName=adafruit/library/Adafruit INA219 - adafruit/Adafruit INA219@1.2.3 - # renovate: datasource=custom.pio depName=Adafruit MPU6050 packageName=adafruit/library/Adafruit MPU6050 - adafruit/Adafruit MPU6050@2.2.9 - # renovate: datasource=custom.pio depName=Adafruit LIS3DH packageName=adafruit/library/Adafruit LIS3DH - adafruit/Adafruit LIS3DH@1.3.0 - # renovate: datasource=custom.pio depName=Adafruit AHTX0 packageName=adafruit/library/Adafruit AHTX0 - adafruit/Adafruit AHTX0@2.0.6 - # renovate: datasource=custom.pio depName=Adafruit LSM6DS packageName=adafruit/library/Adafruit LSM6DS - adafruit/Adafruit LSM6DS@4.7.4 - # renovate: datasource=custom.pio depName=Adafruit TSL2591 packageName=adafruit/library/Adafruit TSL2591 Library - adafruit/Adafruit TSL2591 Library@1.4.5 - # renovate: datasource=custom.pio depName=EmotiBit MLX90632 packageName=emotibit/library/EmotiBit MLX90632 - emotibit/EmotiBit MLX90632@1.0.8 - # renovate: datasource=custom.pio depName=Adafruit MLX90614 packageName=adafruit/library/Adafruit MLX90614 Library - adafruit/Adafruit MLX90614 Library@2.1.6 + # renovate: datasource=github-tags depName=Adafruit BusIO packageName=adafruit/Adafruit_BusIO + https://github.com/adafruit/Adafruit_BusIO/archive/refs/tags/1.17.4.zip + # renovate: datasource=github-tags depName=Adafruit Unified Sensor packageName=adafruit/Adafruit_Sensor + https://github.com/adafruit/Adafruit_Sensor/archive/refs/tags/1.1.15.zip + # renovate: datasource=github-tags depName=Adafruit GFX packageName=adafruit/Adafruit-GFX-Library + https://github.com/adafruit/Adafruit-GFX-Library/archive/refs/tags/1.12.6.zip + # renovate: datasource=github-tags depName=NeoPixel packageName=adafruit/Adafruit_NeoPixel + https://github.com/adafruit/Adafruit_NeoPixel/archive/refs/tags/1.15.4.zip + # renovate: datasource=github-tags depName=Adafruit SSD1306 packageName=adafruit/Adafruit_SSD1306 + https://github.com/adafruit/Adafruit_SSD1306/archive/refs/tags/2.5.16.zip + # renovate: datasource=github-tags depName=Adafruit BMP280 packageName=adafruit/Adafruit_BMP280_Library + https://github.com/adafruit/Adafruit_BMP280_Library/archive/refs/tags/3.0.0.zip + # renovate: datasource=github-tags depName=Adafruit BMP085 packageName=adafruit/Adafruit-BMP085-Library + https://github.com/adafruit/Adafruit-BMP085-Library/archive/refs/tags/1.2.4.zip + # renovate: datasource=github-tags depName=Adafruit BME280 packageName=adafruit/Adafruit_BME280_Library + https://github.com/adafruit/Adafruit_BME280_Library/archive/refs/tags/2.3.0.zip + # renovate: datasource=github-tags depName=Adafruit DPS310 packageName=adafruit/Adafruit_DPS310 + https://github.com/adafruit/Adafruit_DPS310/archive/refs/tags/1.1.6.zip + # renovate: datasource=github-tags depName=Adafruit SH110x packageName=adafruit/Adafruit_SH110x + https://github.com/adafruit/Adafruit_SH110x/archive/refs/tags/2.1.14.zip + # renovate: datasource=github-tags depName=Adafruit MCP9808 packageName=adafruit/Adafruit_MCP9808_Library + https://github.com/adafruit/Adafruit_MCP9808_Library/archive/refs/tags/2.0.2.zip + # renovate: datasource=github-tags depName=Adafruit INA260 packageName=adafruit/Adafruit_INA260 + https://github.com/adafruit/Adafruit_INA260/archive/refs/tags/1.5.3.zip + # renovate: datasource=github-tags depName=Adafruit INA219 packageName=adafruit/Adafruit_INA219 + https://github.com/adafruit/Adafruit_INA219/archive/refs/tags/1.2.3.zip + # renovate: datasource=github-tags depName=Adafruit MPU6050 packageName=adafruit/Adafruit_MPU6050 + https://github.com/adafruit/Adafruit_MPU6050/archive/refs/tags/2.2.9.zip + # renovate: datasource=github-tags depName=Adafruit LIS3DH packageName=adafruit/Adafruit_LIS3DH + https://github.com/adafruit/Adafruit_LIS3DH/archive/refs/tags/1.3.0.zip + # renovate: datasource=github-tags depName=Adafruit AHTX0 packageName=adafruit/Adafruit_AHTX0 + https://github.com/adafruit/Adafruit_AHTX0/archive/refs/tags/2.0.6.zip + # renovate: datasource=github-tags depName=Adafruit LSM6DS packageName=adafruit/Adafruit_LSM6DS + https://github.com/adafruit/Adafruit_LSM6DS/archive/refs/tags/4.7.4.zip + # renovate: datasource=github-tags depName=Adafruit TSL2591 packageName=adafruit/Adafruit_TSL2591_Library + https://github.com/adafruit/Adafruit_TSL2591_Library/archive/refs/tags/1.4.5.zip + # renovate: datasource=github-tags depName=EmotiBit MLX90632 packageName=emotibit/EmotiBit_MLX90632 + https://github.com/EmotiBit/EmotiBit_MLX90632/archive/refs/tags/v1.0.8.zip + # renovate: datasource=github-tags depName=Adafruit MLX90614 packageName=adafruit/Adafruit_MLX90614 + https://github.com/adafruit/Adafruit-MLX90614-Library/archive/refs/tags/2.1.6.zip # renovate: datasource=git-refs depName=INA3221 packageName=https://github.com/sgtwilko/INA3221 gitBranch=FixOverflow https://github.com/sgtwilko/INA3221/archive/bb03d7e9bfcc74fc798838a54f4f99738f29fc6a.zip - # renovate: datasource=custom.pio depName=QMC5883L Compass packageName=mprograms/library/QMC5883LCompass - mprograms/QMC5883LCompass@1.2.3 - # renovate: datasource=custom.pio depName=DFRobot_RTU packageName=dfrobot/library/DFRobot_RTU - dfrobot/DFRobot_RTU@1.0.6 + # renovate: datasource=github-tags depName=QMC5883L Compass packageName=mprograms/QMC5883LCompass + https://github.com/mprograms/QMC5883LCompass/archive/refs/tags/v1.2.3.zip + # renovate: datasource=github-tags depName=DFRobot_RTU packageName=dfrobot/DFRobot_RTU + https://github.com/DFRobot/DFRobot_RTU/archive/refs/tags/V1.0.6.zip # renovate: datasource=git-refs depName=DFRobot_RainfallSensor packageName=https://github.com/DFRobot/DFRobot_RainfallSensor gitBranch=master https://github.com/DFRobot/DFRobot_RainfallSensor/archive/38fea5e02b40a5430be6dab39a99a6f6347d667e.zip - # renovate: datasource=custom.pio depName=INA226 packageName=robtillaart/library/INA226 - robtillaart/INA226@0.6.6 - # renovate: datasource=custom.pio depName=SparkFun MAX3010x packageName=sparkfun/library/SparkFun MAX3010x Pulse and Proximity Sensor Library - sparkfun/SparkFun MAX3010x Pulse and Proximity Sensor Library@1.1.2 - # renovate: datasource=custom.pio depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/library/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library - sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@1.3.2 - # renovate: datasource=custom.pio depName=Adafruit LTR390 Library packageName=adafruit/library/Adafruit LTR390 Library - adafruit/Adafruit LTR390 Library@1.1.2 - # renovate: datasource=custom.pio depName=Adafruit PCT2075 packageName=adafruit/library/Adafruit PCT2075 - adafruit/Adafruit PCT2075@1.0.6 - # renovate: datasource=custom.pio depName=DFRobot_BMM150 packageName=dfrobot/library/DFRobot_BMM150 - dfrobot/DFRobot_BMM150@1.0.0 - # renovate: datasource=custom.pio depName=Adafruit_TSL2561 packageName=adafruit/library/Adafruit TSL2561 - adafruit/Adafruit TSL2561@1.1.3 - # renovate: datasource=custom.pio depName=BH1750_WE packageName=wollewald/library/BH1750_WE - wollewald/BH1750_WE@1.1.10 + # renovate: datasource=github-tags depName=INA226 packageName=robtillaart/INA226 + https://github.com/RobTillaart/INA226/archive/refs/tags/0.6.6.zip + # renovate: datasource=github-tags depName=SparkFun MAX3010x packageName=sparkfun/SparkFun_MAX3010x_Sensor_Library + https://github.com/sparkfun/SparkFun_MAX3010x_Sensor_Library/archive/refs/tags/v1.1.2.zip + # renovate: datasource=github-tags depName=SparkFun 9DoF IMU Breakout ICM 20948 packageName=sparkfun/SparkFun_ICM-20948_ArduinoLibrary + https://github.com/sparkfun/SparkFun_ICM-20948_ArduinoLibrary/archive/refs/tags/v1.3.2.zip + # renovate: datasource=github-tags depName=Adafruit LTR390 Library packageName=adafruit/Adafruit_LTR390 + https://github.com/adafruit/Adafruit_LTR390/archive/refs/tags/1.1.2.zip + # renovate: datasource=github-tags depName=Adafruit PCT2075 packageName=adafruit/Adafruit_PCT2075 + https://github.com/adafruit/Adafruit_PCT2075/archive/refs/tags/1.0.6.zip + # renovate: datasource=github-tags depName=DFRobot_BMM150 packageName=dfrobot/DFRobot_BMM150 + https://github.com/DFRobot/DFRobot_BMM150/archive/refs/tags/V1.0.0.zip + # renovate: datasource=github-tags depName=Adafruit_TSL2561 packageName=adafruit/Adafruit_TSL2561 + https://github.com/adafruit/Adafruit_TSL2561/archive/refs/tags/1.1.3.zip + # renovate: datasource=github-tags depName=BH1750_WE packageName=wollewald/BH1750_WE + https://github.com/wollewald/BH1750_WE/archive/refs/tags/1.1.10.zip ; Common environmental sensor libraries (not included in native / portduino) [environmental_extra_common] lib_deps = - # renovate: datasource=custom.pio depName=Adafruit BMP3XX packageName=adafruit/library/Adafruit BMP3XX Library - adafruit/Adafruit BMP3XX Library@2.1.6 - # renovate: datasource=custom.pio depName=Adafruit MAX1704X packageName=adafruit/library/Adafruit MAX1704X - adafruit/Adafruit MAX1704X@1.0.3 - # renovate: datasource=custom.pio depName=Adafruit SHTC3 packageName=adafruit/library/Adafruit SHTC3 Library - adafruit/Adafruit SHTC3 Library@1.0.2 - # renovate: datasource=custom.pio depName=Adafruit LPS2X packageName=adafruit/library/Adafruit LPS2X - adafruit/Adafruit LPS2X@2.0.6 - # renovate: datasource=custom.pio depName=Adafruit SHT31 packageName=adafruit/library/Adafruit SHT31 Library - adafruit/Adafruit SHT31 Library@2.2.2 - # renovate: datasource=custom.pio depName=Adafruit VEML7700 packageName=adafruit/library/Adafruit VEML7700 Library - adafruit/Adafruit VEML7700 Library@2.1.6 - # renovate: datasource=custom.pio depName=Adafruit SHT4x packageName=adafruit/library/Adafruit SHT4x Library - adafruit/Adafruit SHT4x Library@1.0.5 - # renovate: datasource=custom.pio depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/library/SparkFun Qwiic Scale NAU7802 Arduino Library - sparkfun/SparkFun Qwiic Scale NAU7802 Arduino Library@1.0.6 + # renovate: datasource=github-tags depName=Adafruit BMP3XX packageName=adafruit/Adafruit_BMP3XX + https://github.com/adafruit/Adafruit_BMP3XX/archive/refs/tags/2.1.6.zip + # renovate: datasource=github-tags depName=Adafruit MAX1704X packageName=adafruit/Adafruit_MAX1704X + https://github.com/adafruit/Adafruit_MAX1704X/archive/refs/tags/1.0.3.zip + # renovate: datasource=github-tags depName=Adafruit SHTC3 packageName=adafruit/Adafruit_SHTC3 + https://github.com/adafruit/Adafruit_SHTC3/archive/refs/tags/1.0.2.zip + # renovate: datasource=github-tags depName=Adafruit LPS2X packageName=adafruit/Adafruit_LPS2X + https://github.com/adafruit/Adafruit_LPS2X/archive/refs/tags/2.0.6.zip + # renovate: datasource=github-tags depName=Adafruit SHT31 packageName=adafruit/Adafruit_SHT31 + https://github.com/adafruit/Adafruit_SHT31/archive/refs/tags/2.2.2.zip + # renovate: datasource=github-tags depName=Adafruit VEML7700 packageName=adafruit/Adafruit_VEML7700 + https://github.com/adafruit/Adafruit_VEML7700/archive/refs/tags/2.1.6.zip + # renovate: datasource=github-tags depName=Adafruit SHT4x packageName=adafruit/Adafruit_SHT4X + https://github.com/adafruit/Adafruit_SHT4X/archive/refs/tags/1.0.5.zip + # renovate: datasource=github-tags depName=SparkFun Qwiic Scale NAU7802 packageName=sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library + https://github.com/sparkfun/SparkFun_Qwiic_Scale_NAU7802_Arduino_Library/archive/refs/tags/v1.0.6.zip # renovate: datasource=custom.pio depName=ClosedCube OPT3001 packageName=closedcube/library/ClosedCube OPT3001 closedcube/ClosedCube OPT3001@1.1.2 # renovate: datasource=git-refs depName=meshtastic-DFRobot_LarkWeatherStation packageName=https://github.com/meshtastic/DFRobot_LarkWeatherStation gitBranch=master https://github.com/meshtastic/DFRobot_LarkWeatherStation/archive/4de3a9cadef0f6a5220a8a906cf9775b02b0040d.zip - # renovate: datasource=custom.pio depName=Sensirion Core packageName=sensirion/library/Sensirion Core - sensirion/Sensirion Core@0.7.3 - # renovate: datasource=custom.pio depName=Sensirion I2C SCD4x packageName=sensirion/library/Sensirion I2C SCD4x - sensirion/Sensirion I2C SCD4x@1.1.0 - # renovate: datasource=custom.pio depName=Sensirion I2C SFA3x packageName=sensirion/library/Sensirion I2C SFA3x - sensirion/Sensirion I2C SFA3x@1.0.0 - # renovate: datasource=custom.pio depName=Sensirion I2C SCD30 packageName=sensirion/library/Sensirion I2C SCD30 - sensirion/Sensirion I2C SCD30@1.0.0 + # renovate: datasource=github-tags depName=Sensirion Core packageName=sensirion/arduino-core + https://github.com/Sensirion/arduino-core/archive/refs/tags/0.7.3.zip + # renovate: datasource=github-tags depName=Sensirion I2C SCD4x packageName=sensirion/arduino-i2c-scd4x + https://github.com/Sensirion/arduino-i2c-scd4x/archive/refs/tags/1.1.0.zip + # renovate: datasource=github-tags depName=Sensirion I2C SFA3x packageName=sensirion/arduino-i2c-sfa3x + https://github.com/Sensirion/arduino-i2c-sfa3x/archive/refs/tags/1.0.0.zip + # renovate: datasource=github-tags depName=Sensirion I2C SCD30 packageName=sensirion/arduino-i2c-scd30 + https://github.com/Sensirion/arduino-i2c-scd30/archive/refs/tags/1.0.0.zip ; Environmental sensors with BSEC2 (Bosch proprietary IAQ) [environmental_extra] lib_deps = ${environmental_extra_common.lib_deps} - # renovate: datasource=custom.pio depName=Bosch BSEC2 packageName=boschsensortec/library/bsec2 - boschsensortec/bsec2@1.10.2610 - # renovate: datasource=custom.pio depName=Bosch BME68x packageName=boschsensortec/library/BME68x Sensor Library - boschsensortec/BME68x Sensor Library@1.3.40408 + # renovate: datasource=github-tags depName=Bosch BSEC2 packageName=boschsensortec/Bosch-BSEC2-Library + https://github.com/boschsensortec/Bosch-BSEC2-Library/archive/refs/tags/1.10.2610.zip + # renovate: datasource=github-tags depName=Bosch BME68x packageName=boschsensortec/Bosch-BME68x-Library + https://github.com/boschsensortec/Bosch-BME68x-Library/archive/refs/tags/v1.3.40408.zip ; Environmental sensors without BSEC (saves ~3.5KB DRAM for original ESP32 targets) [environmental_extra_no_bsec] lib_deps = ${environmental_extra_common.lib_deps} - # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library - adafruit/Adafruit BME680 Library@2.0.6 + # renovate: datasource=github-tags depName=Adafruit_BME680 packageName=adafruit/Adafruit_BME680 + https://github.com/adafruit/Adafruit_BME680/archive/refs/tags/2.0.6.zip diff --git a/variants/esp32/betafpv_2400_tx_micro/platformio.ini b/variants/esp32/betafpv_2400_tx_micro/platformio.ini index 068d71011..c2e89b333 100644 --- a/variants/esp32/betafpv_2400_tx_micro/platformio.ini +++ b/variants/esp32/betafpv_2400_tx_micro/platformio.ini @@ -13,7 +13,3 @@ board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyUSB0 upload_speed = 460800 -lib_deps = - ${esp32_base.lib_deps} - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 diff --git a/variants/esp32c3/heltec_hru_3601/platformio.ini b/variants/esp32c3/heltec_hru_3601/platformio.ini index aa62fb4fc..5eb1c9977 100644 --- a/variants/esp32c3/heltec_hru_3601/platformio.ini +++ b/variants/esp32c3/heltec_hru_3601/platformio.ini @@ -5,6 +5,3 @@ build_flags = ${esp32c3_base.build_flags} -D HELTEC_HRU_3601 -I variants/esp32c3/heltec_hru_3601 -lib_deps = ${esp32c3_base.lib_deps} - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 diff --git a/variants/esp32c6/m5stack_unitc6l/platformio.ini b/variants/esp32c6/m5stack_unitc6l/platformio.ini index 4c04d0c26..bf605ca61 100644 --- a/variants/esp32c6/m5stack_unitc6l/platformio.ini +++ b/variants/esp32c6/m5stack_unitc6l/platformio.ini @@ -23,8 +23,6 @@ build_unflags = -D HAS_WIFI lib_deps = ${esp32c6_base.lib_deps} - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@2.3.7 build_flags = diff --git a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini index c2805425b..90e4910f4 100644 --- a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini @@ -12,8 +12,6 @@ lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 zinggjm/GxEPD2@1.6.8 - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 diff --git a/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini index c53831c9f..60b030d42 100644 --- a/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_oled/platformio.ini @@ -8,10 +8,6 @@ board_build.f_cpu = 240000000L upload_protocol = esptool ;upload_port = /dev/ttyACM0 upload_speed = 921600 -lib_deps = - ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 diff --git a/variants/esp32s3/esp32-s3-pico/platformio.ini b/variants/esp32s3/esp32-s3-pico/platformio.ini index 07ca069f3..64f50f80e 100644 --- a/variants/esp32s3/esp32-s3-pico/platformio.ini +++ b/variants/esp32s3/esp32-s3-pico/platformio.ini @@ -24,5 +24,3 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 zinggjm/GxEPD2@1.6.8 - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 diff --git a/variants/esp32s3/heltec_sensor_hub/platformio.ini b/variants/esp32s3/heltec_sensor_hub/platformio.ini index 013280db1..9a5384ccd 100644 --- a/variants/esp32s3/heltec_sensor_hub/platformio.ini +++ b/variants/esp32s3/heltec_sensor_hub/platformio.ini @@ -8,7 +8,3 @@ build_flags = -I variants/esp32s3/heltec_sensor_hub -D HELTEC_SENSOR_HUB -ULED_BUILTIN - -lib_deps = ${esp32s3_base.lib_deps} - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index 421a2b843..0590b730d 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -23,5 +23,3 @@ lib_deps = https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM earlephilhower/ESP8266SAM@1.1.0 - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index 1d4af52f3..3c342e2ac 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -40,8 +40,6 @@ lib_deps = ${esp32s3_base.lib_deps} lovyan03/LovyanGFX@1.2.19 # TODO renovate https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic@9.0.0 https://gitlab.com/hamishcunningham/unphonelibrary/-/archive/meshtastic/unphonelibrary-meshtastic.zip - # renovate: datasource=custom.pio depName=NeoPixel packageName=adafruit/library/Adafruit NeoPixel - adafruit/Adafruit NeoPixel@1.15.4 [env:unphone-tft] board_level = extra diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index a247b0af1..86b1fe60a 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -34,8 +34,8 @@ lib_deps = adafruit/Adafruit seesaw Library@1.7.9 # renovate: datasource=git-refs depName=RAK12034-BMX160 packageName=https://github.com/RAKWireless/RAK12034-BMX160 gitBranch=main https://github.com/RAKWireless/RAK12034-BMX160/archive/dcead07ffa267d3c906e9ca4a1330ab989e957e2.zip - # renovate: datasource=custom.pio depName=Adafruit_BME680 packageName=adafruit/library/Adafruit BME680 Library - adafruit/Adafruit BME680 Library@2.0.6 + # renovate: datasource=github-tags depName=Adafruit_BME680 packageName=adafruit/Adafruit_BME680 + https://github.com/adafruit/Adafruit_BME680/archive/refs/tags/2.0.6.zip build_flags = ${arduino_base.build_flags} @@ -59,4 +59,5 @@ build_flags = lib_ignore = Adafruit NeoPixel Adafruit ST7735 and ST7789 Library + Adafruit SSD1306 SD From a1d6c6db62853c852b5526a36da5c7e2e8ed49dd Mon Sep 17 00:00:00 2001 From: Austin Date: Sun, 12 Apr 2026 20:38:44 -0400 Subject: [PATCH 052/150] Fix display method to use const qualifier for previousBuffer pointer (#10146) Addresses cppcheck `src/graphics/EInkParallelDisplay.cpp:205: [low:style] Variable 'prev' can be declared as pointer to const [constVariablePointer]` --- src/graphics/EInkParallelDisplay.cpp | 2 +- variants/esp32s3/mini-epaper-s3/nicheGraphics.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/EInkParallelDisplay.cpp b/src/graphics/EInkParallelDisplay.cpp index b870e111b..293f57e81 100644 --- a/src/graphics/EInkParallelDisplay.cpp +++ b/src/graphics/EInkParallelDisplay.cpp @@ -202,7 +202,7 @@ void EInkParallelDisplay::display(void) // Get pointers to internal buffers uint8_t *cur = epaper->currentBuffer(); - uint8_t *prev = epaper->previousBuffer(); // may be NULL on first init + const uint8_t *prev = epaper->previousBuffer(); // may be NULL on first init // Track changed row range while converting int newTop = h; // min changed row (initialized to out-of-range) diff --git a/variants/esp32s3/mini-epaper-s3/nicheGraphics.h b/variants/esp32s3/mini-epaper-s3/nicheGraphics.h index 86da4b8ce..0cbd6a192 100644 --- a/variants/esp32s3/mini-epaper-s3/nicheGraphics.h +++ b/variants/esp32s3/mini-epaper-s3/nicheGraphics.h @@ -98,7 +98,7 @@ void setupNicheGraphics() buttons->setTwoWayRockerPressHandlers( [inkhud]() { bool systemHandlingInput = false; - for (InkHUD::SystemApplet *sa : inkhud->systemApplets) { + for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) { if (sa->handleInput) { systemHandlingInput = true; break; @@ -112,7 +112,7 @@ void setupNicheGraphics() }, [inkhud]() { bool systemHandlingInput = false; - for (InkHUD::SystemApplet *sa : inkhud->systemApplets) { + for (const InkHUD::SystemApplet *sa : inkhud->systemApplets) { if (sa->handleInput) { systemHandlingInput = true; break; From a9acd506a8fcd624517bef226caf08f95a87a9d8 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 21:49:14 -0400 Subject: [PATCH 053/150] Update softprops/action-gh-release action to v3 (#10150) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/main_matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 1221c171f..f0b16a31f 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -309,7 +309,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create release - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 id: create_release with: draft: true From 323830c7ccac55b0f8644488f346b3505d572693 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 12 Apr 2026 22:09:25 -0400 Subject: [PATCH 054/150] Update pnpm/action-setup action to v6 (#10132) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index daa18e6af..be5142843 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -52,7 +52,7 @@ jobs: node-version: 24 - name: Setup pnpm - uses: pnpm/action-setup@v5 + uses: pnpm/action-setup@v6 with: version: latest From eeb95d6bff97a57e70f14bbe01ca107edefa8741 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 06:26:22 -0500 Subject: [PATCH 055/150] Update meshtastic-st7789 digest to a787bee (#10147) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32s3/heltec_vision_master_t190/platformio.ini | 2 +- variants/esp32s3/m5stack_cardputer_adv/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_node_t114/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_solar/platformio.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini index 250673a04..be1ea192d 100644 --- a/variants/esp32s3/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -20,5 +20,5 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip + https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip upload_speed = 921600 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index 0590b730d..7da039cd4 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip + https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index ad56face7..ef8bd4a17 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -23,4 +23,4 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip + https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini index 176977f92..1b15c0758 100644 --- a/variants/nrf52840/heltec_mesh_solar/platformio.ini +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -132,4 +132,4 @@ build_flags = ${heltec_mesh_solar_base.build_flags} lib_deps = ${heltec_mesh_solar_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/4d957e758eab3ac354e8f2a276c945f5fcbaaa03.zip + https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip From 197226365b61fd7c90fa43735ad4b6737b571cb2 Mon Sep 17 00:00:00 2001 From: Bob Iannucci Date: Sun, 12 Apr 2026 20:41:25 -0700 Subject: [PATCH 056/150] fix(native): implement BinarySemaphorePosix with proper pthread synchronization (#9895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(native): implement BinarySemaphorePosix with proper pthread synchronization The BinarySemaphorePosix class (used on all Linux/portduino/native builds) had stub implementations: give() was a no-op and take() just called delay(msec) and returned false. This broke the cooperative thread scheduler on native platforms — threads could not wake the main loop, radio RX interrupts were missed, and telemetry never transmitted over the mesh. Replace the stubs with a proper binary semaphore using pthread_mutex_t + pthread_cond_t + bool signaled: - take(msec): pthread_cond_timedwait with CLOCK_REALTIME timeout, consumes signal atomically (binary semaphore semantics) - give(): sets signaled=true, signals condition variable - giveFromISR(): delegates to give(), sets pxHigherPriorityTaskWoken Tested on Raspberry Pi 3 Model B (ARM64, Debian Bookworm) with Adafruit LoRa Radio Bonnet (SX1276). Before fix: no radio TX/RX, no telemetry on mesh. After fix: bidirectional LoRa, MQTT gateway, telemetry all working. Co-Authored-By: Claude Opus 4.6 * ARCH_PORTDUINO * Refactor BinarySemaphorePosix header for ARCH_PORTDUINO * Change preprocessor directive from ifndef to ifdef * Gate new Semaphore code to Portduino and fix STM compilation * Binary Semaphore Posix better error handling --------- Co-authored-by: Claude Opus 4.6 Co-authored-by: Ben Meadors Co-authored-by: Jonathan Bennett --- src/concurrency/BinarySemaphorePosix.cpp | 78 +++++++++++++++++++++++- src/concurrency/BinarySemaphorePosix.h | 13 +++- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/src/concurrency/BinarySemaphorePosix.cpp b/src/concurrency/BinarySemaphorePosix.cpp index dc49a489b..4bc60c31f 100644 --- a/src/concurrency/BinarySemaphorePosix.cpp +++ b/src/concurrency/BinarySemaphorePosix.cpp @@ -1,10 +1,85 @@ #include "concurrency/BinarySemaphorePosix.h" #include "configuration.h" +#include +#include + #ifndef HAS_FREE_RTOS namespace concurrency { +#ifdef ARCH_PORTDUINO + +BinarySemaphorePosix::BinarySemaphorePosix() +{ + if (pthread_mutex_init(&mutex, NULL) != 0) { + throw std::runtime_error("pthread_mutex_init failed"); + } + if (pthread_cond_init(&cond, NULL) != 0) { + pthread_mutex_destroy(&mutex); + throw std::runtime_error("pthread_cond_init failed"); + } + signaled = false; +} + +BinarySemaphorePosix::~BinarySemaphorePosix() +{ + pthread_cond_destroy(&cond); + pthread_mutex_destroy(&mutex); +} + +/** + * Returns false if we timed out + */ +bool BinarySemaphorePosix::take(uint32_t msec) +{ + pthread_mutex_lock(&mutex); + + if (!signaled) { + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + + ts.tv_sec += msec / 1000; + ts.tv_nsec += (msec % 1000) * 1000000L; + if (ts.tv_nsec >= 1000000000L) { + ts.tv_sec += 1; + ts.tv_nsec -= 1000000000L; + } + + while (!signaled) { + int rc = pthread_cond_timedwait(&cond, &mutex, &ts); + if (rc == ETIMEDOUT) + break; + if (rc != 0) { + // Some other error occurred + pthread_mutex_unlock(&mutex); + throw std::runtime_error("pthread_cond_timedwait failed: " + std::to_string(rc)); + } + } + } + + bool wasSignaled = signaled; + signaled = false; // consume the signal (binary semaphore) + + pthread_mutex_unlock(&mutex); + return wasSignaled; +} + +void BinarySemaphorePosix::give() +{ + pthread_mutex_lock(&mutex); + signaled = true; + pthread_cond_signal(&cond); + pthread_mutex_unlock(&mutex); +} + +IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken) +{ + give(); + if (pxHigherPriorityTaskWoken) + *pxHigherPriorityTaskWoken = true; +} +#else BinarySemaphorePosix::BinarySemaphorePosix() {} @@ -22,7 +97,8 @@ bool BinarySemaphorePosix::take(uint32_t msec) void BinarySemaphorePosix::give() {} IRAM_ATTR void BinarySemaphorePosix::giveFromISR(BaseType_t *pxHigherPriorityTaskWoken) {} +#endif } // namespace concurrency -#endif \ No newline at end of file +#endif diff --git a/src/concurrency/BinarySemaphorePosix.h b/src/concurrency/BinarySemaphorePosix.h index 475b29874..80edb567b 100644 --- a/src/concurrency/BinarySemaphorePosix.h +++ b/src/concurrency/BinarySemaphorePosix.h @@ -2,6 +2,10 @@ #include "../freertosinc.h" +#ifdef ARCH_PORTDUINO +#include +#endif + namespace concurrency { @@ -9,7 +13,12 @@ namespace concurrency class BinarySemaphorePosix { - // SemaphoreHandle_t semaphore; + +#ifdef ARCH_PORTDUINO + pthread_mutex_t mutex; + pthread_cond_t cond; + bool signaled; +#endif public: BinarySemaphorePosix(); @@ -27,4 +36,4 @@ class BinarySemaphorePosix #endif -} // namespace concurrency \ No newline at end of file +} // namespace concurrency From 752723313078d787b3c559889437afc3329fb3c1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 13 Apr 2026 06:43:11 -0500 Subject: [PATCH 057/150] Enhance release notes generation with commit range comparison --- .github/workflows/main_matrix.yml | 6 ++- bin/generate_release_notes.py | 83 ++++++++++++++++++++----------- 2 files changed, 58 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index f0b16a31f..88395600a 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -301,10 +301,12 @@ jobs: id: release_notes run: | chmod +x ./bin/generate_release_notes.py - NOTES=$(./bin/generate_release_notes.py ${{ needs.version.outputs.long }}) + NOTES=$(./bin/generate_release_notes.py ${{ needs.version.outputs.long }} --compare-ref HEAD 2>release_notes.log) echo "notes<> $GITHUB_OUTPUT echo "$NOTES" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + echo "### Release note range" >> $GITHUB_STEP_SUMMARY + cat release_notes.log >> $GITHUB_STEP_SUMMARY env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -466,7 +468,7 @@ jobs: - name: Generate release notes run: | chmod +x ./bin/generate_release_notes.py - ./bin/generate_release_notes.py ${{ needs.version.outputs.long }} > ./publish/release_notes.md + ./bin/generate_release_notes.py ${{ needs.version.outputs.long }} --compare-ref HEAD > ./publish/release_notes.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/bin/generate_release_notes.py b/bin/generate_release_notes.py index d0f1147da..533ff6909 100755 --- a/bin/generate_release_notes.py +++ b/bin/generate_release_notes.py @@ -1,25 +1,31 @@ #!/usr/bin/env python3 -""" -Generate release notes from merged PRs on develop and master branches. -Categorizes PRs into Enhancements and Bug Fixes/Maintenance sections. -""" +"""Generate release notes from the actual release commit range.""" -import subprocess -import re +import argparse import json +import re +import subprocess import sys -from datetime import datetime -def get_last_release_tag(): - """Get the most recent release tag.""" +def get_last_release_tag(compare_ref, exclude_tag=None): + """Get the most recent version tag merged into compare_ref.""" result = subprocess.run( - ["git", "describe", "--tags", "--abbrev=0"], + ["git", "tag", "--merged", compare_ref, "--sort=-version:refname", "v*"], capture_output=True, text=True, check=True, ) - return result.stdout.strip() + + for line in result.stdout.splitlines(): + candidate = line.strip() + if not candidate: + continue + if exclude_tag and candidate == exclude_tag: + continue + return candidate + + raise subprocess.CalledProcessError(result.returncode, result.args, output=result.stdout, stderr=result.stderr) def get_tag_date(tag): @@ -33,18 +39,18 @@ def get_tag_date(tag): return result.stdout.strip() -def get_merged_prs_since_tag(tag, branch): - """Get all merged PRs since the given tag on the specified branch.""" - # Get commits since tag on the branch - look for PR numbers in parentheses +def get_merged_prs_in_range(tag, compare_ref): + """Get all merged PRs in the git range between tag and compare_ref.""" result = subprocess.run( [ "git", "log", - f"{tag}..origin/{branch}", + f"{tag}..{compare_ref}", "--oneline", ], capture_output=True, text=True, + check=True, ) prs = [] @@ -65,6 +71,25 @@ def get_merged_prs_since_tag(tag, branch): return prs +def parse_args(): + """Parse CLI arguments.""" + parser = argparse.ArgumentParser( + description="Generate release notes from the actual release commit range." + ) + parser.add_argument("new_version", help="Version that will be tagged for this release") + parser.add_argument( + "--base-tag", + dest="base_tag", + help="Existing version tag to diff from. Defaults to the latest version tag merged into the compare ref.", + ) + parser.add_argument( + "--compare-ref", + default="HEAD", + help="Git ref to diff to. Defaults to HEAD.", + ) + return parser.parse_args() + + def get_pr_details(pr_number): """Get PR details from GitHub API via gh CLI.""" try: @@ -268,28 +293,28 @@ def get_new_contributors(pr_details_list, tag, repo="meshtastic/firmware"): def main(): - if len(sys.argv) < 2: - print("Usage: generate_release_notes.py ", file=sys.stderr) - sys.exit(1) - - new_version = sys.argv[1] + args = parse_args() + new_version = args.new_version + compare_ref = args.compare_ref + current_tag = f"v{new_version}" # Get last release tag try: - last_tag = get_last_release_tag() + last_tag = args.base_tag or get_last_release_tag(compare_ref, exclude_tag=current_tag) except subprocess.CalledProcessError: print("Error: Could not find last release tag", file=sys.stderr) sys.exit(1) - # Collect PRs from both branches - all_pr_numbers = set() + print( + f"Resolved release note range: {last_tag}..{compare_ref}", + file=sys.stderr, + ) - for branch in ["develop", "master"]: - try: - prs = get_merged_prs_since_tag(last_tag, branch) - all_pr_numbers.update(prs) - except Exception as e: - print(f"Warning: Could not get PRs from {branch}: {e}", file=sys.stderr) + try: + all_pr_numbers = set(get_merged_prs_in_range(last_tag, compare_ref)) + except subprocess.CalledProcessError as e: + print(f"Error: Could not get PRs for range {last_tag}..{compare_ref}: {e}", file=sys.stderr) + sys.exit(1) # Get details for all PRs enhancements = [] From e42ff3590c7aad731a0f382ad5f605e002a5d181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 13 Apr 2026 15:48:30 +0200 Subject: [PATCH 058/150] fix last cppcheck issue (#10154) --- src/input/CardputerKeyboard.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/input/CardputerKeyboard.cpp b/src/input/CardputerKeyboard.cpp index ec1ed383a..1bd695461 100644 --- a/src/input/CardputerKeyboard.cpp +++ b/src/input/CardputerKeyboard.cpp @@ -121,7 +121,6 @@ void CardputerKeyboard::pressed(uint8_t key) modifierFlag = 0; } - uint8_t next_key = 0; int row = (key - 1) / 10; int col = (key - 1) % 10; From 96dd647882fd04fb70f796552763b4fea2712047 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Mon, 13 Apr 2026 14:50:51 -0500 Subject: [PATCH 059/150] Fix heap blowout on TBeams (#10155) * Fix heap blowout on TBeams * Update src/graphics/draw/MessageRenderer.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Set MESSAGE_HISTORY_LIMIT to 10 for original ESP32 to optimize RAM usage * Optimize message frame allocation to prevent excessive memory usage * Refine message history limits for resource-constrained builds and cap cached lines to prevent heap overflow * Update src/graphics/draw/MessageRenderer.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/MessageStore.h | 7 +++++++ src/graphics/draw/MessageRenderer.cpp | 22 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/MessageStore.h b/src/MessageStore.h index 6203d8ed0..77271f1c9 100644 --- a/src/MessageStore.h +++ b/src/MessageStore.h @@ -21,8 +21,15 @@ // How many messages are stored (RAM + flash). // Define -DMESSAGE_HISTORY_LIMIT=N in build_flags to control memory usage. #ifndef MESSAGE_HISTORY_LIMIT +#if defined(ARCH_ESP32) && \ + !(defined(CONFIG_IDF_TARGET_ESP32C3) || defined(CONFIG_IDF_TARGET_ESP32S3) || defined(CONFIG_IDF_TARGET_ESP32S2)) +// Baseline ESP32 (non-PSRAM variants) has limited heap; reduce message history on resource-constrained builds. +// Override with -DMESSAGE_HISTORY_LIMIT=N if needed. +#define MESSAGE_HISTORY_LIMIT 10 +#else #define MESSAGE_HISTORY_LIMIT 20 #endif +#endif // Internal alias used everywhere in code – do NOT redefine elsewhere. #define MAX_MESSAGES_SAVED MESSAGE_HISTORY_LIMIT diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp index 501a7ae2c..2fd9bf541 100644 --- a/src/graphics/draw/MessageRenderer.cpp +++ b/src/graphics/draw/MessageRenderer.cpp @@ -422,6 +422,17 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 std::vector isMine; // track alignment std::vector isHeader; // track header lines std::vector ackForLine; + // Hard limit on total cached lines to prevent unbounded growth from a single long message. + // Reserve to the actual cache cap up front, because a single message can expand to many more + // wrapped display lines than a small per-message estimate would predict. For a display + // rendering only ~5-30 lines at a time, caching more than this limit wastes heap. Stop + // appending once we reach MAX_CACHED_LINES to prevent a single message from blowing out the + // heap. + constexpr size_t MAX_CACHED_LINES = 100U; // ~5-6KB for std::string overhead on 32-bit (if each ~50-60 bytes avg) + allLines.reserve(MAX_CACHED_LINES); + isMine.reserve(MAX_CACHED_LINES); + isHeader.reserve(MAX_CACHED_LINES); + ackForLine.reserve(MAX_CACHED_LINES); for (auto it = filtered.rbegin(); it != filtered.rend(); ++it) { const auto &m = *it; @@ -565,16 +576,23 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 int wrapWidth = mine ? rightTextWidth : leftTextWidth; std::vector wrapped = generateLines(display, "", msgText, wrapWidth); + // Per-message wrap-line limit: even if wrapping produces many lines, cap them to prevent + // a single long message from consuming most or all of the cache. + constexpr size_t MAX_WRAPPED_LINES_PER_MSG = 20U; + size_t wrappedCount = 0; for (auto &ln : wrapped) { - allLines.push_back(ln); + if (allLines.size() >= MAX_CACHED_LINES || wrappedCount >= MAX_WRAPPED_LINES_PER_MSG) + break; // Cache limit or per-message limit reached; stop adding lines from this message + allLines.emplace_back(std::move(ln)); isMine.push_back(mine); isHeader.push_back(false); ackForLine.push_back(AckStatus::NONE); + ++wrappedCount; } } // Cache lines and heights - cachedLines = allLines; + cachedLines.swap(allLines); cachedHeights = calculateLineHeights(cachedLines, emotes, isHeader); std::vector blocks = buildMessageBlocks(isHeader, isMine); From 47e129f4bdec33a5012851aa3546073aa87d9254 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2026 13:11:47 -0500 Subject: [PATCH 060/150] Automated version bumps (#10159) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- bin/org.meshtastic.meshtasticd.metainfo.xml | 3 +++ debian/changelog | 6 ++++++ version.properties | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/org.meshtastic.meshtasticd.metainfo.xml b/bin/org.meshtastic.meshtasticd.metainfo.xml index 0642fdb07..a1690186b 100644 --- a/bin/org.meshtastic.meshtasticd.metainfo.xml +++ b/bin/org.meshtastic.meshtasticd.metainfo.xml @@ -87,6 +87,9 @@ + + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.23 + https://github.com/meshtastic/firmware/releases?q=tag%3Av2.7.22 diff --git a/debian/changelog b/debian/changelog index b13a2ae9d..c3f1424a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +meshtasticd (2.7.23.0) unstable; urgency=medium + + * Version 2.7.23 + + -- GitHub Actions Tue, 14 Apr 2026 12:29:48 +0000 + meshtasticd (2.7.22.0) unstable; urgency=medium * Version 2.7.22 diff --git a/version.properties b/version.properties index 8621dd9c9..4ee342bb8 100644 --- a/version.properties +++ b/version.properties @@ -1,4 +1,4 @@ [VERSION] major = 2 minor = 7 -build = 22 +build = 23 From c1bee82bafd95a52289c5f603e91a8bbb2d36d2f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 14 Apr 2026 21:07:15 -0500 Subject: [PATCH 061/150] Update platform-native digest to 71ed55b (#10165) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/native/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 86b1fe60a..87d8431a3 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/f566d364204416cdbf298e349213f7d551f793d9.zip + https://github.com/meshtastic/platform-native/archive/71ed55bb95feb3c43ebde1ec1e2e17643a424c04.zip framework = arduino build_src_filter = From edf660ccb399cb6d9d4490af6d7737bcf5013271 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:19 -0500 Subject: [PATCH 062/150] Update variants/esp32s3/t-deck-pro-v1_1/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h index 8584fd8a1..af761d64d 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/variant.h +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -18,7 +18,7 @@ #define USE_POWERSAVE #define SLEEP_TIME 120 -// GNNS +// GNSS #define HAS_GPS 1 #define GPS_BAUDRATE 38400 #define PIN_GPS_EN 39 From 5cae9e0183b1f84ad9502c28eb175219decee7b4 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:35 -0500 Subject: [PATCH 063/150] Update src/platform/extra_variants/t_deck_pro/variant.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/platform/extra_variants/t_deck_pro/variant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index 77fba53b9..ff8e34ebd 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -80,7 +80,7 @@ bool readTouch(int16_t *x, int16_t *y) } -static void touchInterruptHandler(){ +static void IRAM_ATTR touchInterruptHandler(){ touch_isr = true; } From 7d957f8c7ba87905e1a7c25b652809642155cf6c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:50 -0500 Subject: [PATCH 064/150] Update variants/esp32s3/t-deck-pro-v1_1/platformio.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini index b76522934..1a9b20f76 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -30,7 +30,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.5 + zinggjm/GxEPD2@1.6.8 # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 From d5af07e4584cef54c28a5247830b426931b43dc8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:08 -0500 Subject: [PATCH 065/150] Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 6b714f1cf..937df88cb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -374,8 +374,10 @@ void setup() digitalWrite(SDCARD_CS, HIGH); pinMode(PIN_EINK_CS, OUTPUT); digitalWrite(PIN_EINK_CS, HIGH); +#if PIN_EINK_RES >= 0 pinMode(PIN_EINK_RES, OUTPUT); digitalWrite(PIN_EINK_RES, HIGH); +#endif pinMode(CST328_PIN_RST, OUTPUT); digitalWrite(CST328_PIN_RST, HIGH); #elif defined(T_LORA_PAGER) From 79e7ed30f1f7b44da205bb1e37e5ff0202318a00 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:34 -0500 Subject: [PATCH 066/150] Update src/graphics/EInkDisplay2.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/EInkDisplay2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 96321f9c4..28b956bb1 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -105,10 +105,12 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) void EInkDisplay::endUpdate() { #ifndef EINK_NOT_HIBERNATE - // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) + // By default, power off the E-Ink display hardware and enter hibernate(). + // Boards/panels that define EINK_NOT_HIBERNATE intentionally skip this step. + // Skipping hibernate() can help avoid panel-specific wake/refresh or ghosting issues, + // but it typically trades lower power savings for that compatibility. adafruitDisplay->hibernate(); #endif - } // Write the buffer to the display memory From 23f92c1cbd7eed5a2f2de097b68eb16789960cae Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 08:01:03 -0500 Subject: [PATCH 067/150] Add comprehensive guides for new module, sensor, and hardware variant development --- .github/copilot-instructions.md | 191 ++++++++++++++++++++++---- .github/prompts/new-module.prompt.md | 138 +++++++++++++++++++ .github/prompts/new-sensor.prompt.md | 149 ++++++++++++++++++++ .github/prompts/new-variant.prompt.md | 178 ++++++++++++++++++++++++ 4 files changed, 629 insertions(+), 27 deletions(-) create mode 100644 .github/prompts/new-module.prompt.md create mode 100644 .github/prompts/new-sensor.prompt.md create mode 100644 .github/prompts/new-variant.prompt.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 14601b058..24e11bd4d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -4,11 +4,11 @@ This document provides context and guidelines for AI assistants working with the ## Project Overview -Meshtastic is an open-source LoRa mesh networking project for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware enables text messaging, location sharing, and telemetry over a decentralized mesh network. +Meshtastic is an open-source LoRa mesh networking project for long-range, low-power communication without relying on internet or cellular infrastructure. The firmware enables text messaging, location sharing, and telemetry over a decentralized mesh network. The project uses **C++17** as its language standard across all platforms. ### Supported Hardware Platforms -- **ESP32** (ESP32, ESP32-S3, ESP32-C3) - Most common platform +- **ESP32** (ESP32, ESP32-S3, ESP32-C3, ESP32-C6) - Most common platform - **nRF52** (nRF52840, nRF52833) - Low power Nordic chips - **RP2040/RP2350** - Raspberry Pi Pico variants - **STM32WL** - STM32 with integrated LoRa @@ -80,21 +80,46 @@ firmware/ │ │ ├── NodeDB.* # Node database management │ │ ├── Router.* # Packet routing │ │ ├── Channels.* # Channel management +│ │ ├── CryptoEngine.* # AES-CCM encryption │ │ ├── *Interface.* # Radio interface implementations +│ │ ├── api/ # WiFi/Ethernet server APIs (ServerAPI, PacketAPI) +│ │ ├── http/ # HTTP server (WebServer, ContentHandler) +│ │ ├── wifi/ # WiFi support (WiFiAPClient) +│ │ ├── eth/ # Ethernet support (ethClient) +│ │ ├── udp/ # UDP multicast +│ │ ├── compression/ # Message compression (unishox2) │ │ └── generated/ # Protobuf generated code │ ├── modules/ # Feature modules (Position, Telemetry, etc.) +│ │ └── Telemetry/ # Telemetry subsystem +│ │ └── Sensor/ # 50+ I2C sensor drivers │ ├── gps/ # GPS handling │ ├── graphics/ # Display drivers and UI -│ ├── platform/ # Platform-specific code -│ ├── input/ # Input device handling -│ └── concurrency/ # Threading utilities +│ │ └── niche/ # Specialized UIs (InkHUD e-ink framework) +│ ├── platform/ # Platform-specific code (esp32, nrf52, rp2xx0, stm32wl, portduino) +│ ├── input/ # Input device handling (InputBroker, keyboards, buttons) +│ ├── detect/ # I2C hardware auto-detection (80+ device types) +│ ├── motion/ # Accelerometer drivers (BMA423, BMI270, MPU6050, etc.) +│ ├── mqtt/ # MQTT bridge client +│ ├── power/ # Power HAL +│ ├── nimble/ # BLE via NimBLE +│ ├── buzz/ # Audio/notification (buzzer, RTTTL) +│ ├── serialization/ # JSON serialization, COBS encoding +│ ├── watchdog/ # Hardware watchdog thread +│ ├── concurrency/ # Threading utilities (OSThread, Lock) +│ ├── PowerFSM.* # Power finite state machine +│ └── Observer.h # Observer/Observable event pattern ├── variants/ # Hardware variant definitions │ ├── esp32/ # ESP32 variants │ ├── esp32s3/ # ESP32-S3 variants -│ ├── nrf52/ # nRF52 variants -│ └── rp2xxx/ # RP2040/RP2350 variants +│ ├── esp32c3/ # ESP32-C3 variants +│ ├── esp32c6/ # ESP32-C6 variants +│ ├── nrf52840/ # nRF52 variants +│ ├── rp2040/ # RP2040/RP2350 variants +│ ├── stm32/ # STM32WL variants +│ └── native/ # Linux/Portduino variants ├── protobufs/ # Protocol buffer definitions ├── boards/ # Custom PlatformIO board definitions +├── test/ # Unit tests (12 test suites) └── bin/ # Build and utility scripts ``` @@ -105,6 +130,7 @@ firmware/ - Follow existing code style - run `trunk fmt` before commits - Prefer `LOG_DEBUG`, `LOG_INFO`, `LOG_WARN`, `LOG_ERROR` for logging - Use `assert()` for invariants that should never fail +- C++17 features are available (`std::optional`, structured bindings, `if constexpr`, etc.) ### Naming Conventions @@ -118,70 +144,151 @@ firmware/ #### Module System -Modules inherit from `MeshModule` or `ProtobufModule` and implement: +Modules use a three-tier class hierarchy: -- `handleReceivedProtobuf()` - Process incoming packets -- `allocReply()` - Generate response packets -- `runOnce()` - Periodic task execution (returns next run interval in ms) +1. **`MeshModule`** - Base class. Implement `wantPacket()` and `handleReceived()`. Returns `ProcessMessage::STOP` or `ProcessMessage::CONTINUE`. +2. **`SinglePortModule`** - Handles a single portnum. Simplified `wantPacket()` that checks `decoded.portnum`. +3. **`ProtobufModule`** - Template for protobuf-based modules. Handles encoding/decoding automatically. + +Most modules also inherit from **`OSThread`** for periodic tasks (the "mixin" pattern): ```cpp -class MyModule : public ProtobufModule +class MyModule : public ProtobufModule, private concurrency::OSThread { + public: + MyModule(); + protected: virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_MyMessage *msg) override; - virtual int32_t runOnce() override; + virtual meshtastic_MeshPacket *allocReply() override; // Generate response packets + virtual int32_t runOnce() override; // Periodic task (returns next interval in ms) + virtual bool alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtastic_MyMessage *msg); // Modify in-flight + virtual bool wantUIFrame(); // Request a UI display frame }; ``` +Modules are registered in `src/modules/Modules.cpp` guarded by `MESHTASTIC_EXCLUDE_*` flags. + +#### Observer/Observable Pattern + +Event-driven communication between subsystems uses `src/Observer.h`: + +```cpp +// Observable emits events +Observable newStatus; +newStatus.notifyObservers(&status); + +// Observer receives events via callback +CallbackObserver statusObserver = + CallbackObserver(this, &MyClass::handleStatusUpdate); +``` + #### Configuration Access - `config.*` - Device configuration (LoRa, position, power, etc.) - `moduleConfig.*` - Module-specific configuration - `channels.*` - Channel configuration and management +- `owner` - Device owner info +- `myNodeInfo` - Local node info #### Default Values Use the `Default` class helpers in `src/mesh/Default.h`: - `Default::getConfiguredOrDefaultMs(configured, default)` - Returns ms, using default if configured is 0 +- `Default::getConfiguredOrDefault(configured, default)` - Generic configured/default getter - `Default::getConfiguredOrMinimumValue(configured, min)` - Enforces minimum values - `Default::getConfiguredOrDefaultMsScaled(configured, default, numNodes)` - Scales based on network size #### Thread Safety -- Use `concurrency::Lock` for mutex protection +- Use `concurrency::Lock` and `concurrency::LockGuard` for mutex protection - Radio SPI access uses `SPILock` - Prefer `OSThread` for background tasks +### Hardware Detection + +`src/detect/ScanI2C` automatically enumerates 80+ I2C device types at boot including displays, sensors, RTCs, keyboards, PMUs, and touch controllers. This drives automatic initialization of the correct drivers. + +### Graphics/UI System + +Multiple display driver families in `src/graphics/`: + +- **OLED**: SSD1306, SH1106, ST7567 +- **TFT**: TFTDisplay (LovyanGFX-based) +- **E-Ink**: EInkDisplay2, EInkDynamicDisplay, EInkParallelDisplay + +**InkHUD** (`src/graphics/niche/InkHUD/`) is an event-driven e-ink UI framework: + +- Applet-based architecture — modular display tiles +- Read-only, static display optimized for minimal refreshes and low power +- Configured per-variant via `nicheGraphics.h` +- Separate PlatformIO config: `src/graphics/niche/InkHUD/PlatformioConfig.ini` + +### Input System + +`src/input/InputBroker` is the centralized input event dispatcher. Supports multiple input sources: buttons, keyboards (BBQ10, Cardputer, TCA8418), touch screens, rotary encoders, and matrix keyboards. + +### Power Management + +`src/PowerFSM.*` implements a finite state machine with states: `stateON`, `statePOWER`, `stateSERIAL`, `stateDARK`. Key events: `EVENT_PRESS`, `EVENT_WAKE_TIMER`, `EVENT_LOW_BATTERY`, `EVENT_RECEIVED_MSG`, `EVENT_SHUTDOWN`. Conditionally excluded with `MESHTASTIC_EXCLUDE_POWER_FSM` (falls back to `FakeFsm`). + +### Motion Sensors + +`src/motion/AccelerometerThread` provides background motion monitoring with automatic screen wake and double-tap button press detection. Supports 10+ accelerometer/gyroscope chips (BMA423, BMI270, MPU6050, LIS3DH, LSM6DS3, STK8XXX, QMA6100P, ICM20948, BMX160). + +### Telemetry Sensor Library + +`src/modules/Telemetry/Sensor/` contains 50+ I2C sensor drivers organized by category: + +- **Power monitoring**: INA219/226/260/3221, MAX17048 +- **Environmental**: BME280/680, SCD4X (CO₂), SEN5X (particulate) +- **Humidity/Temperature**: SHT3X/4X, AHT10, MCP9808, MLX90614 +- **Light**: BH1750, TSL2561/2591, VEML7700, LTR390UV, OPT3001 +- **Air quality**: PMSA003I, SFA30 +- **Specialized**: CGRadSens (radiation), NAU7802 (weight scale) + +### API/Networking + +`src/mesh/api/` provides a template-based `ServerAPI` for client communication over WiFi (`WiFiServerAPI`) and Ethernet (`ethServerAPI`). Default port: **4403**. HTTP server in `src/mesh/http/`. JSON serialization in `src/serialization/MeshPacketSerializer`. + ### Hardware Variants Each hardware variant has: - `variant.h` - Pin definitions and hardware capabilities - `platformio.ini` - Build configuration -- Optional: `pins_arduino.h`, `rfswitch.h` +- Optional: `pins_arduino.h`, `rfswitch.h`, `nicheGraphics.h` (for InkHUD variants) Key defines in variant.h: ```cpp #define USE_SX1262 // Radio chip selection #define HAS_GPS 1 // Hardware capabilities +#define HAS_SCREEN 1 // Display present #define LORA_CS 36 // Pin assignments #define SX126X_DIO1 14 // Radio-specific pins ``` ### Protobuf Messages -- Defined in `protobufs/meshtastic/*.proto` -- Generated code in `src/mesh/generated/` +- Defined in `protobufs/meshtastic/*.proto` (~32 proto files) +- Generated code in `src/mesh/generated/meshtastic/` - Regenerate with `bin/regen-protos.sh` - Message types prefixed with `meshtastic_` +- Nanopb `.options` files control field sizes and encoding ### Conditional Compilation ```cpp #if !MESHTASTIC_EXCLUDE_GPS // Feature exclusion +#if !MESHTASTIC_EXCLUDE_WIFI // Network feature exclusion +#if !MESHTASTIC_EXCLUDE_BLUETOOTH // BLE exclusion +#if !MESHTASTIC_EXCLUDE_POWER_FSM // Power FSM exclusion #ifdef ARCH_ESP32 // Architecture-specific +#ifdef ARCH_NRF52 // Nordic platform +#ifdef ARCH_RP2040 // Raspberry Pi Pico +#ifdef ARCH_PORTDUINO // Linux native #if defined(USE_SX1262) // Radio-specific #ifdef HAS_SCREEN // Hardware capability #if USERPREFS_EVENT_MODE // User preferences @@ -192,7 +299,7 @@ Key defines in variant.h: Uses **PlatformIO** with custom scripts: - `bin/platformio-pre.py` - Pre-build script -- `bin/platformio-custom.py` - Custom build logic +- `bin/platformio-custom.py` - Custom build logic, manifest generation Build commands: @@ -202,21 +309,38 @@ pio run -e tbeam -t upload # Build and upload pio run -e native # Build native/Linux version ``` +### Build Manifest + +`bin/platformio-custom.py` emits a build manifest with metadata: + +- `hasMui`, `hasInkHud` - UI capability flags (overridable via `custom_meshtastic_has_mui`, `custom_meshtastic_has_ink_hud`) +- Architecture normalization (e.g., `esp32s3` → `esp32-s3` for API compatibility) + ## Common Tasks ### Adding a New Module 1. Create `src/modules/MyModule.cpp` and `.h` -2. Inherit from appropriate base class -3. Register in `src/modules/Modules.cpp` -4. Add protobuf messages if needed in `protobufs/` +2. Inherit from appropriate base class (`MeshModule`, `SinglePortModule`, or `ProtobufModule`) +3. Mix in `concurrency::OSThread` if periodic work is needed +4. Register in `src/modules/Modules.cpp` guarded by `#if !MESHTASTIC_EXCLUDE_MYMODULE` +5. Add protobuf messages if needed in `protobufs/meshtastic/` +6. Add test suite in `test/test_mymodule/` if applicable ### Adding a New Hardware Variant 1. Create directory under `variants///` -2. Add `variant.h` with pin definitions -3. Add `platformio.ini` with build config -4. Reference common configs with `extends` +2. Add `variant.h` with pin definitions and hardware capability defines +3. Add `platformio.ini` with build config — use `extends` to reference common base (e.g., `esp32s3_base`) +4. Set `custom_meshtastic_support_level = 1` (PR builds) or `2` (merge builds) +5. For e-ink displays, add `nicheGraphics.h` for InkHUD configuration + +### Adding a New Telemetry Sensor + +1. Create driver in `src/modules/Telemetry/Sensor/` following existing sensor pattern +2. Register I2C address in `src/detect/ScanI2C` for auto-detection +3. Integrate with the appropriate telemetry module (Environment, Health, Power, AirQuality) +4. Add proto fields in `protobufs/meshtastic/telemetry.proto` if new data types are needed ### Modifying Configuration Defaults @@ -305,9 +429,22 @@ Most workflows can be triggered manually via `workflow_dispatch` for testing. ## Testing -- Unit tests in `test/` directory -- Run with `pio test -e native` -- Use `bin/test-simulator.sh` for simulation testing +Unit tests in `test/` directory with 12 test suites: + +- `test_crypto/` - Cryptography +- `test_mqtt/` - MQTT integration +- `test_radio/` - Radio interface +- `test_mesh_module/` - Module framework +- `test_meshpacket_serializer/` - Packet serialization +- `test_transmit_history/` - Retransmission tracking +- `test_atak/` - ATAK integration +- `test_default/` - Default configuration +- `test_http_content_handler/` - HTTP handling +- `test_serial/` - Serial communication + +Run with: `pio test -e native` + +Simulation testing: `bin/test-simulator.sh` ## Resources diff --git a/.github/prompts/new-module.prompt.md b/.github/prompts/new-module.prompt.md new file mode 100644 index 000000000..8569a622c --- /dev/null +++ b/.github/prompts/new-module.prompt.md @@ -0,0 +1,138 @@ +# New Meshtastic Module + +Guide for developing a new Meshtastic firmware module. + +## Module Hierarchy + +Choose the appropriate base class: + +1. **`MeshModule`** — Raw base class. Override `wantPacket()` and `handleReceived()`. Returns `ProcessMessage::STOP` or `ProcessMessage::CONTINUE`. +2. **`SinglePortModule`** — Handles a single `meshtastic_PortNum`. Constructor takes `(name, portNum)`. Simplified `wantPacket()` checking `decoded.portnum`. Use `allocDataPacket()` to create outgoing packets. +3. **`ProtobufModule`** — Template for protobuf-encoded modules. Constructor takes `(name, portNum, fields)`. Override `handleReceivedProtobuf()`. Use `allocDataProtobuf(payload)` to create outgoing packets. + +Most modules also mix in `concurrency::OSThread` for periodic background tasks. + +## Implementation Pattern + +```cpp +// src/modules/MyModule.h +#pragma once +#include "ProtobufModule.h" +#include "concurrency/OSThread.h" + +class MyModule : public ProtobufModule, private concurrency::OSThread +{ + public: + MyModule(); + + protected: + // Process incoming protobuf packet. Return true to stop further processing. + virtual bool handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshtastic_MyMessage *msg) override; + + // Generate response packet (optional) + virtual meshtastic_MeshPacket *allocReply() override; + + // Periodic task — return next run interval in ms, or disable() + virtual int32_t runOnce() override; + + // Modify packet in-flight before delivery (optional) + virtual bool alterReceivedProtobuf(meshtastic_MeshPacket &mp, meshtastic_MyMessage *msg); + + // Request a UI display frame (optional) + virtual bool wantUIFrame(); +}; +``` + +## Registration + +Register in `src/modules/Modules.cpp` inside `setupModules()`: + +```cpp +#if !MESHTASTIC_EXCLUDE_MYMODULE + new MyModule(); +#endif +``` + +If other code needs to reference the module instance: + +```cpp +#if !MESHTASTIC_EXCLUDE_MYMODULE + myModule = new MyModule(); +#endif +``` + +And declare the global in the header: + +```cpp +extern MyModule *myModule; +``` + +Some modules also conditionally instantiate based on `moduleConfig`: + +```cpp +#if !MESHTASTIC_EXCLUDE_MYMODULE + if (moduleConfig.has_my_module && moduleConfig.my_module.enabled) { + new MyModule(); + } +#endif +``` + +## Conditional Compilation + +Add a `MESHTASTIC_EXCLUDE_MYMODULE` guard. This allows the module to be excluded from constrained builds. The flag name must follow the pattern: `MESHTASTIC_EXCLUDE_` + uppercase module name. + +## Protobuf Messages (if needed) + +1. Define messages in `protobufs/meshtastic/` (e.g., `mymodule.proto`) +2. Add a `.options` file for nanopb field size constraints +3. Regenerate with `bin/regen-protos.sh` +4. Generated code appears in `src/mesh/generated/meshtastic/` +5. Assign a `meshtastic_PortNum` if the module uses a new port number + +## Timing and Defaults + +Use `Default` class helpers for configurable intervals: + +```cpp +int32_t MyModule::runOnce() +{ + uint32_t interval = Default::getConfiguredOrDefaultMs(moduleConfig.my_module.update_interval, + default_my_module_interval); + // ... do work ... + return interval; +} +``` + +On public/default channels, enforce minimums with `Default::getConfiguredOrMinimumValue()`. + +## Observer Pattern + +Subscribe to system events: + +```cpp +CallbackObserver statusObserver = + CallbackObserver(this, &MyModule::handleStatusUpdate); +``` + +## Testing + +Add test suite in `test/test_mymodule/`: + +``` +test/ +└── test_mymodule/ + └── test_main.cpp +``` + +Run with: `pio test -e native` + +## Checklist + +- [ ] Header and implementation files in `src/modules/` +- [ ] Inherit from appropriate base class (MeshModule / SinglePortModule / ProtobufModule) +- [ ] Mix in OSThread if periodic work is needed +- [ ] Register in `src/modules/Modules.cpp` with `MESHTASTIC_EXCLUDE_` guard +- [ ] Add protobuf definitions if needed (`protobufs/meshtastic/`) +- [ ] Use `Default::getConfiguredOrDefaultMs()` for timing +- [ ] Respect bandwidth limits on public channels +- [ ] Add test suite in `test/` diff --git a/.github/prompts/new-sensor.prompt.md b/.github/prompts/new-sensor.prompt.md new file mode 100644 index 000000000..e02fc2462 --- /dev/null +++ b/.github/prompts/new-sensor.prompt.md @@ -0,0 +1,149 @@ +# New Telemetry Sensor + +Guide for adding a new I2C telemetry sensor driver to Meshtastic firmware. + +## Overview + +Telemetry sensors live in `src/modules/Telemetry/Sensor/`. There are 50+ existing drivers organized by measurement type. Each sensor integrates with one of the telemetry modules: + +- **EnvironmentTelemetryModule** — Temperature, humidity, pressure, gas, light +- **AirQualityTelemetryModule** — Particulate matter, VOCs +- **PowerTelemetryModule** — Voltage, current, power monitoring +- **HealthTelemetryModule** — Heart rate, SpO2, body temperature + +## Sensor Driver Pattern + +Each sensor has a `.h` and `.cpp` file pair following this pattern: + +```cpp +// src/modules/Telemetry/Sensor/MySensor.h +#pragma once +#include "TelemetrySensor.h" +#include // Arduino/PlatformIO library + +class MySensor : virtual public TelemetrySensor +{ + private: + MySensorLibrary sensor; + + public: + MySensor() : TelemetrySensor(meshtastic_TelemetrySensorType_MY_SENSOR, "MySensor") {} + + // Initialize sensor hardware. Return true on success. + virtual void setup() override; + + // Read sensor data into the telemetry protobuf. Return true on success. + virtual bool getMetrics(meshtastic_Telemetry *measurement) override; +}; +``` + +```cpp +// src/modules/Telemetry/Sensor/MySensor.cpp +#include "MySensor.h" +#include "TelemetrySensor.h" + +void MySensor::setup() +{ + sensor.begin(); + // Configure sensor parameters... +} + +bool MySensor::getMetrics(meshtastic_Telemetry *measurement) +{ + // Read from hardware + float value = sensor.readValue(); + + // Populate the appropriate protobuf variant + measurement->variant.environment_metrics.temperature = value; + // ... other fields ... + + return true; +} +``` + +## I2C Address Registration + +Register the sensor's I2C address(es) in `src/detect/ScanI2C` so it's auto-detected at boot: + +1. Add a `DeviceType` enum entry in `src/detect/ScanI2C.h` +2. Add the I2C address mapping in `src/detect/ScanI2CTwoWire.cpp` + +The scan runs at boot and populates a device map that telemetry modules use to decide which sensors to initialize. + +## Protobuf Fields + +If the sensor provides data not covered by existing telemetry fields: + +1. Add fields to the appropriate message in `protobufs/meshtastic/telemetry.proto`: + - `EnvironmentMetrics` — Environmental measurements + - `AirQualityMetrics` — Air quality data + - `PowerMetrics` — Power/energy data + - `HealthMetrics` — Health/biometric data +2. Add a `.options` constraint if needed (field sizes for nanopb) +3. Regenerate: `bin/regen-protos.sh` + +## Sensor Type Enum + +Add the sensor to `meshtastic_TelemetrySensorType` enum in `protobufs/meshtastic/telemetry.proto`: + +```protobuf +enum TelemetrySensorType { + // ... existing entries ... + MY_SENSOR = XX; +} +``` + +## Integration with Telemetry Module + +Wire the sensor into the appropriate telemetry module. For environment sensors, this is typically in `src/modules/Telemetry/EnvironmentTelemetry.cpp`: + +1. Include the sensor header +2. Add initialization in `setupSensor()` guarded by detection results +3. Call `getMetrics()` in the measurement collection path + +Example pattern from existing sensors: + +```cpp +#include "Sensor/MySensor.h" + +MySensor mySensor; + +// In setup: +if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MY_SENSOR].first > 0) { + mySensor.setup(); +} + +// In measurement collection: +if (nodeTelemetrySensorsMap[meshtastic_TelemetrySensorType_MY_SENSOR].first > 0) { + mySensor.getMetrics(&measurement); +} +``` + +## Library Dependencies + +If the sensor needs an external library, add it to the `lib_deps` in the relevant base platformio.ini configs: + +```ini +lib_deps = + ${env.lib_deps} + mysensorlibrary@^1.0.0 +``` + +Or use a conditional dependency if it's platform-specific. + +## Unit Conversions + +If the sensor reports values in non-standard units, use `src/modules/Telemetry/UnitConversions.h` for conversion helpers (e.g., Celsius ↔ Fahrenheit, hPa ↔ inHg). + +## Checklist + +- [ ] Create `src/modules/Telemetry/Sensor/MySensor.h` and `.cpp` +- [ ] Inherit from `TelemetrySensor` base class +- [ ] Implement `setup()` and `getMetrics()` methods +- [ ] Add `meshtastic_TelemetrySensorType` enum entry in `telemetry.proto` +- [ ] Add I2C address to `src/detect/ScanI2C` for auto-detection +- [ ] Add protobuf fields in `telemetry.proto` if new data types needed +- [ ] Regenerate protos: `bin/regen-protos.sh` +- [ ] Wire into the appropriate telemetry module (Environment/AirQuality/Power/Health) +- [ ] Add library dependency if external library required +- [ ] Test on hardware or native build diff --git a/.github/prompts/new-variant.prompt.md b/.github/prompts/new-variant.prompt.md new file mode 100644 index 000000000..1a324cea9 --- /dev/null +++ b/.github/prompts/new-variant.prompt.md @@ -0,0 +1,178 @@ +# New Hardware Variant + +Guide for adding a new Meshtastic hardware variant to the firmware. + +## Directory Structure + +Create under `variants///`: + +``` +variants/ +├── esp32/ # ESP32 +├── esp32s3/ # ESP32-S3 +├── esp32c3/ # ESP32-C3 +├── esp32c6/ # ESP32-C6 +├── nrf52840/ # nRF52840 +├── rp2040/ # RP2040/RP2350 +├── stm32/ # STM32WL +└── native/ # Linux/Portduino +``` + +Each variant needs at minimum: + +- `variant.h` — Pin definitions and hardware capabilities +- `platformio.ini` — Build configuration + +Optional files: + +- `pins_arduino.h` — Arduino pin mapping overrides +- `rfswitch.h` — RF switch control for multi-band radios +- `nicheGraphics.h` — InkHUD e-ink configuration + +## variant.h Template + +```cpp +// Pin definitions +#define I2C_SDA 21 +#define I2C_SCL 22 + +// LoRa radio +#define USE_SX1262 // Radio chip: USE_SX1262, USE_SX1268, USE_SX1280, USE_RF95, USE_LLCC68, USE_LR1110, USE_LR1120, USE_LR1121 +#define LORA_CS 18 +#define LORA_SCK 5 +#define LORA_MOSI 27 +#define LORA_MISO 19 +#define LORA_DIO1 33 // SX126x: DIO1, SX128x: DIO1, RF95: IRQ +#define LORA_RESET 23 +#define LORA_BUSY 32 // SX126x/SX128x only +#define SX126X_DIO2_AS_RF_SWITCH // Common for SX1262 boards + +// GPS +#define HAS_GPS 1 +#define GPS_RX_PIN 34 +#define GPS_TX_PIN 12 +// #define PIN_GPS_EN 47 // Optional GPS enable pin +// #define GPS_BAUDRATE 9600 // Override default 9600 + +// Display +#define HAS_SCREEN 1 +// #define USE_SSD1306 // OLED type +// #define USE_SH1106 // Alternative OLED +// #define USE_ST7789 // TFT type +// #define SCREEN_WIDTH 128 +// #define SCREEN_HEIGHT 64 + +// LEDs +#define LED_PIN 2 // Status LED (optional) +// #define HAS_NEOPIXEL 1 // WS2812 support + +// Buttons +#define BUTTON_PIN 38 +// #define BUTTON_PIN_ALT 0 // Secondary button + +// Power management +// #define HAS_AXP192 1 // AXP192 PMU (T-Beam v1.0) +// #define HAS_AXP2101 1 // AXP2101 PMU (T-Beam v1.2+) +// #define BATTERY_PIN 35 // ADC battery voltage pin +// #define ADC_MULTIPLIER 2.0 // Voltage divider ratio + +// Optional I2C devices +// #define HAS_RTC 1 // Real-time clock +// #define HAS_TELEMETRY 1 // Enable telemetry sensor support +// #define HAS_SENSOR 1 // I2C sensors present +``` + +## platformio.ini Template + +```ini +[env:my_variant] +extends = esp32s3_base ; Use architecture-specific base +board = esp32-s3-devkitc-1 ; PlatformIO board definition (or custom in boards/) +board_level = extra ; Build level: extra, or omit for default +custom_meshtastic_support_level = 1 ; 1 = PR builds, 2 = merge builds only + +build_flags = + ${esp32s3_base.build_flags} + -D MY_VARIANT_SPECIFIC_FLAG=1 + -I variants/esp32s3/my_variant ; Include path for variant.h + +upload_speed = 921600 +``` + +### Common Base Configs + +- `esp32_base` / `esp32-common.ini` — ESP32 +- `esp32s3_base` — ESP32-S3 +- `esp32c3_base` — ESP32-C3 +- `esp32c6_base` — ESP32-C6 +- `nrf52840_base` / `nrf52.ini` — nRF52840 +- `rp2040_base` — RP2040/RP2350 + +### Support Levels + +- `custom_meshtastic_support_level = 1` — Built on every PR (actively supported) +- `custom_meshtastic_support_level = 2` — Built only on merge to main branches +- `board_level = extra` — Only built on full releases + +## Build Manifest Metadata + +`bin/platformio-custom.py` emits UI capability flags in the build manifest: + +- `custom_meshtastic_has_mui = true/false` — Override MUI detection +- `custom_meshtastic_has_ink_hud = true/false` — Override InkHUD detection +- Architecture names are normalized (e.g., `esp32s3` → `esp32-s3`) + +## InkHUD E-Ink Variants + +For e-ink display variants using the InkHUD framework, add `nicheGraphics.h`: + +```cpp +// nicheGraphics.h — InkHUD configuration for this variant +#define INKHUD // Enable InkHUD +// Configure display, applets, and refresh behavior per device +``` + +InkHUD has its own PlatformIO config: `src/graphics/niche/InkHUD/PlatformioConfig.ini` + +## I2C Device Detection + +If the variant has I2C devices, ensure `src/detect/ScanI2C` will detect them. The auto-detection system handles 80+ device types including displays, sensors, RTCs, keyboards, PMUs, and touch controllers at boot. + +## Custom Board Definitions + +If the PlatformIO board doesn't exist, create a custom board JSON in `boards/`: + +```json +{ + "build": { + "arduino": { "ldscript": "esp32s3_out.ld" }, + "core": "esp32", + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "mcu": "esp32s3", + "variant": "esp32s3" + }, + "connectivity": ["wifi", "bluetooth"], + "frameworks": ["arduino", "espidf"], + "name": "My Custom Board", + "upload": { + "flash_size": "8MB", + "maximum_ram_size": 327680, + "maximum_size": 8388608 + }, + "url": "https://example.com", + "vendor": "MyVendor" +} +``` + +## Checklist + +- [ ] Create `variants///variant.h` with pin definitions +- [ ] Create `variants///platformio.ini` extending correct base +- [ ] Set `custom_meshtastic_support_level` (1 or 2) +- [ ] Verify radio chip define matches hardware (`USE_SX1262`, etc.) +- [ ] Set hardware capability flags (`HAS_GPS`, `HAS_SCREEN`, etc.) +- [ ] Add custom board JSON in `boards/` if needed +- [ ] Test build: `pio run -e my_variant` +- [ ] For e-ink: add `nicheGraphics.h` with InkHUD config From 92263859a76ed8e5ec1b8c2800642b029c0c41bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 20:19:17 -0500 Subject: [PATCH 068/150] Update protobufs (#10184) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/atak.pb.cpp | 62 + src/mesh/generated/meshtastic/atak.pb.h | 1205 +++++++++++++++++- src/mesh/generated/meshtastic/mesh.pb.cpp | 5 + src/mesh/generated/meshtastic/mesh.pb.h | 88 +- src/mesh/generated/meshtastic/portnums.pb.h | 2 + src/mesh/generated/meshtastic/telemetry.pb.h | 21 +- 7 files changed, 1360 insertions(+), 25 deletions(-) diff --git a/protobufs b/protobufs index e30092e61..4d5b500df 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit e30092e6168b13341c2b7ec4be19c789ad5cd77f +Subproject commit 4d5b500df5af68a4f57d3e19705cc3bb1136358c diff --git a/src/mesh/generated/meshtastic/atak.pb.cpp b/src/mesh/generated/meshtastic/atak.pb.cpp index bbafa33e2..dda9fddaf 100644 --- a/src/mesh/generated/meshtastic/atak.pb.cpp +++ b/src/mesh/generated/meshtastic/atak.pb.cpp @@ -27,6 +27,42 @@ PB_BIND(meshtastic_PLI, meshtastic_PLI, AUTO) PB_BIND(meshtastic_AircraftTrack, meshtastic_AircraftTrack, AUTO) +PB_BIND(meshtastic_CotGeoPoint, meshtastic_CotGeoPoint, AUTO) + + +PB_BIND(meshtastic_DrawnShape, meshtastic_DrawnShape, 2) + + +PB_BIND(meshtastic_Marker, meshtastic_Marker, AUTO) + + +PB_BIND(meshtastic_RangeAndBearing, meshtastic_RangeAndBearing, AUTO) + + +PB_BIND(meshtastic_Route, meshtastic_Route, 2) + + +PB_BIND(meshtastic_Route_Link, meshtastic_Route_Link, AUTO) + + +PB_BIND(meshtastic_CasevacReport, meshtastic_CasevacReport, 2) + + +PB_BIND(meshtastic_ZMistEntry, meshtastic_ZMistEntry, AUTO) + + +PB_BIND(meshtastic_EmergencyAlert, meshtastic_EmergencyAlert, AUTO) + + +PB_BIND(meshtastic_TaskRequest, meshtastic_TaskRequest, AUTO) + + +PB_BIND(meshtastic_TAKEnvironment, meshtastic_TAKEnvironment, AUTO) + + +PB_BIND(meshtastic_SensorFov, meshtastic_SensorFov, AUTO) + + PB_BIND(meshtastic_TAKPacketV2, meshtastic_TAKPacketV2, 2) @@ -41,3 +77,29 @@ PB_BIND(meshtastic_TAKPacketV2, meshtastic_TAKPacketV2, 2) + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesh/generated/meshtastic/atak.pb.h b/src/mesh/generated/meshtastic/atak.pb.h index c12b042f4..d69b14009 100644 --- a/src/mesh/generated/meshtastic/atak.pb.h +++ b/src/mesh/generated/meshtastic/atak.pb.h @@ -241,7 +241,91 @@ typedef enum _meshtastic_CotType { /* b-f-t-r: File transfer request */ meshtastic_CotType_CotType_b_f_t_r = 74, /* b-f-t-a: File transfer acknowledgment */ - meshtastic_CotType_CotType_b_f_t_a = 75 + meshtastic_CotType_CotType_b_f_t_a = 75, + /* u-d-f-m: Freehand telestration / annotation. Anchor at event point, + geometry carried via DrawnShape.vertices. May be truncated to + MAX_VERTICES by the sender. */ + meshtastic_CotType_CotType_u_d_f_m = 76, + /* u-d-p: Closed polygon. Geometry carried via DrawnShape.vertices, + implicitly closed (receiver duplicates first vertex as needed). */ + meshtastic_CotType_CotType_u_d_p = 77, + /* b-m-p-s-m: Spot map marker (colored dot at a point of interest). */ + meshtastic_CotType_CotType_b_m_p_s_m = 78, + /* b-m-p-c: Checkpoint (intermediate route control point). */ + meshtastic_CotType_CotType_b_m_p_c = 79, + /* u-r-b-c-c: Ranging circle (range rings centered on the event point). */ + meshtastic_CotType_CotType_u_r_b_c_c = 80, + /* u-r-b-bullseye: Bullseye with configurable range rings and bearing + reference (magnetic / true / grid). */ + meshtastic_CotType_CotType_u_r_b_bullseye = 81, + /* a-f-G-E-V-A: Friendly armored vehicle, user-selectable self PLI. */ + meshtastic_CotType_CotType_a_f_G_E_V_A = 82, + /* a-n-A: Neutral aircraft (friendly/hostile/unknown already present). */ + meshtastic_CotType_CotType_a_n_A = 83, + /* --- 2525 quick-drop: artillery (4) ---------------------------------- */ + meshtastic_CotType_CotType_a_u_G_U_C_F = 84, + meshtastic_CotType_CotType_a_n_G_U_C_F = 85, + meshtastic_CotType_CotType_a_h_G_U_C_F = 86, + meshtastic_CotType_CotType_a_f_G_U_C_F = 87, + /* --- 2525 quick-drop: building (4) ----------------------------------- */ + meshtastic_CotType_CotType_a_u_G_I = 88, + meshtastic_CotType_CotType_a_n_G_I = 89, + meshtastic_CotType_CotType_a_h_G_I = 90, + meshtastic_CotType_CotType_a_f_G_I = 91, + /* --- 2525 quick-drop: mine (4) --------------------------------------- */ + meshtastic_CotType_CotType_a_u_G_E_X_M = 92, + meshtastic_CotType_CotType_a_n_G_E_X_M = 93, + meshtastic_CotType_CotType_a_h_G_E_X_M = 94, + meshtastic_CotType_CotType_a_f_G_E_X_M = 95, + /* --- 2525 quick-drop: ship (3; a-f-S already at 17) ------------------ */ + meshtastic_CotType_CotType_a_u_S = 96, + meshtastic_CotType_CotType_a_n_S = 97, + meshtastic_CotType_CotType_a_h_S = 98, + /* --- 2525 quick-drop: sniper (4) ------------------------------------- */ + meshtastic_CotType_CotType_a_u_G_U_C_I_d = 99, + meshtastic_CotType_CotType_a_n_G_U_C_I_d = 100, + meshtastic_CotType_CotType_a_h_G_U_C_I_d = 101, + meshtastic_CotType_CotType_a_f_G_U_C_I_d = 102, + /* --- 2525 quick-drop: tank (4) --------------------------------------- */ + meshtastic_CotType_CotType_a_u_G_E_V_A_T = 103, + meshtastic_CotType_CotType_a_n_G_E_V_A_T = 104, + meshtastic_CotType_CotType_a_h_G_E_V_A_T = 105, + meshtastic_CotType_CotType_a_f_G_E_V_A_T = 106, + /* --- 2525 quick-drop: troops (3; a-f-G-U-C-I already at 2) ----------- */ + meshtastic_CotType_CotType_a_u_G_U_C_I = 107, + meshtastic_CotType_CotType_a_n_G_U_C_I = 108, + meshtastic_CotType_CotType_a_h_G_U_C_I = 109, + /* --- 2525 quick-drop: generic vehicle (3; a-u-G-E-V already at 69) --- */ + meshtastic_CotType_CotType_a_n_G_E_V = 110, + meshtastic_CotType_CotType_a_h_G_E_V = 111, + meshtastic_CotType_CotType_a_f_G_E_V = 112, + /* b-m-p-w-GOTO: Go To / bloodhound navigation target. */ + meshtastic_CotType_CotType_b_m_p_w_GOTO = 113, + /* b-m-p-c-ip: Initial point (mission planning). */ + meshtastic_CotType_CotType_b_m_p_c_ip = 114, + /* b-m-p-c-cp: Contact point (mission planning). */ + meshtastic_CotType_CotType_b_m_p_c_cp = 115, + /* b-m-p-s-p-op: Observation post. */ + meshtastic_CotType_CotType_b_m_p_s_p_op = 116, + /* u-d-v: 2D vehicle outline drawn on the map. */ + meshtastic_CotType_CotType_u_d_v = 117, + /* u-d-v-m: 3D vehicle model reference. */ + meshtastic_CotType_CotType_u_d_v_m = 118, + /* u-d-c-e: Non-circular ellipse (circle with distinct major/minor axes). */ + meshtastic_CotType_CotType_u_d_c_e = 119, + /* b-i-x-i: Quick Pic geotagged image marker. The image itself does not + ride on LoRa; this event references the image via iconset metadata. */ + meshtastic_CotType_CotType_b_i_x_i = 120, + /* b-t-f-d: GeoChat delivered receipt. Carried on the existing `chat` + payload_variant via GeoChat.receipt_for_uid + receipt_type. */ + meshtastic_CotType_CotType_b_t_f_d = 121, + /* b-t-f-r: GeoChat read receipt. Same wire slot as b-t-f-d. */ + meshtastic_CotType_CotType_b_t_f_r = 122, + /* b-a-o-c: Custom / generic emergency beacon. */ + meshtastic_CotType_CotType_b_a_o_c = 123, + /* t-s: Task / engage request. Structured payload carried via the new + TaskRequest typed variant. */ + meshtastic_CotType_CotType_t_s = 124 } meshtastic_CotType; /* Geopoint and altitude source */ @@ -256,10 +340,204 @@ typedef enum _meshtastic_GeoPointSource { meshtastic_GeoPointSource_GeoPointSource_NETWORK = 3 } meshtastic_GeoPointSource; +/* Receipt discriminator. Set alongside cot_type_id = b-t-f-d (delivered) + or b-t-f-r (read). ReceiptType_None is the default for a normal chat + message (cot_type_id = b-t-f). + + Receivers can detect a receipt by checking receipt_type != ReceiptType_None + without re-parsing the envelope cot_type_id. */ +typedef enum _meshtastic_GeoChat_ReceiptType { + meshtastic_GeoChat_ReceiptType_ReceiptType_None = 0, /* normal chat message */ + meshtastic_GeoChat_ReceiptType_ReceiptType_Delivered = 1, /* b-t-f-d delivered receipt */ + meshtastic_GeoChat_ReceiptType_ReceiptType_Read = 2 /* b-t-f-r read receipt */ +} meshtastic_GeoChat_ReceiptType; + +/* Shape kind discriminator. Drives receiver rendering and also controls + which optional fields below are meaningful. */ +typedef enum _meshtastic_DrawnShape_Kind { + /* Unspecified (do not use on the wire) */ + meshtastic_DrawnShape_Kind_Kind_Unspecified = 0, + /* u-d-c-c: User-drawn circle (uses major/minor/angle, anchor = event point) */ + meshtastic_DrawnShape_Kind_Kind_Circle = 1, + /* u-d-r: User-drawn rectangle (uses vertices = 4 corners) */ + meshtastic_DrawnShape_Kind_Kind_Rectangle = 2, + /* u-d-f: User-drawn polyline (uses vertices, not closed) */ + meshtastic_DrawnShape_Kind_Kind_Freeform = 3, + /* u-d-f-m: Freehand telestration / annotation (uses vertices, may be truncated) */ + meshtastic_DrawnShape_Kind_Kind_Telestration = 4, + /* u-d-p: Closed polygon (uses vertices, implicitly closed) */ + meshtastic_DrawnShape_Kind_Kind_Polygon = 5, + /* u-r-b-c-c: Ranging circle (major/minor/angle, stroke + optional fill) */ + meshtastic_DrawnShape_Kind_Kind_RangingCircle = 6, + /* u-r-b-bullseye: Bullseye ring with range rings and bearing reference */ + meshtastic_DrawnShape_Kind_Kind_Bullseye = 7, + /* u-d-c-e: Ellipse with distinct major/minor axes (same storage as + Kind_Circle — uses major_cm/minor_cm/angle_deg — but receivers + render it as a non-circular ellipse rather than a round circle). */ + meshtastic_DrawnShape_Kind_Kind_Ellipse = 8, + /* u-d-v: 2D vehicle outline drawn on the map. Vertices carry the + outline polygon; receivers draw it as a filled polygon. */ + meshtastic_DrawnShape_Kind_Kind_Vehicle2D = 9, + /* u-d-v-m: 3D vehicle model reference. Same vertex polygon as + Kind_Vehicle2D; receivers that support 3D rendering extrude it. */ + meshtastic_DrawnShape_Kind_Kind_Vehicle3D = 10 +} meshtastic_DrawnShape_Kind; + +/* Explicit stroke/fill/both discriminator. + + ATAK's source XML distinguishes "stroke-only polyline" from "closed shape + with both stroke and fill" by the presence of the element. + Both states can hash to all-zero color fields, so we carry the signal + explicitly. Parser sets this from (sawStrokeColor, sawFillColor) at the + end of parse; builder uses it to decide which of / + to emit in the reconstructed XML. */ +typedef enum _meshtastic_DrawnShape_StyleMode { + /* Unspecified — receiver infers from which color fields are non-zero. */ + meshtastic_DrawnShape_StyleMode_StyleMode_Unspecified = 0, + /* Stroke only. No in the source XML. Used for polylines, + ranging lines, bullseye rings. */ + meshtastic_DrawnShape_StyleMode_StyleMode_StrokeOnly = 1, + /* Fill only. No in the source XML. Rare but valid in + ATAK (solid region with no outline). */ + meshtastic_DrawnShape_StyleMode_StyleMode_FillOnly = 2, + /* Both stroke and fill present. Closed shapes: circle, rectangle, + polygon, ranging circle. */ + meshtastic_DrawnShape_StyleMode_StyleMode_StrokeAndFill = 3 +} meshtastic_DrawnShape_StyleMode; + +/* Marker kind. Used to pick sensible receiver defaults when the CoT type + alone is ambiguous (e.g. a-u-G could be a 2525 symbol or a custom icon + depending on the iconset path). */ +typedef enum _meshtastic_Marker_Kind { + /* Unspecified — fall back to TAKPacketV2.cot_type_id */ + meshtastic_Marker_Kind_Kind_Unspecified = 0, + /* b-m-p-s-m: Spot map marker */ + meshtastic_Marker_Kind_Kind_Spot = 1, + /* b-m-p-w: Route waypoint */ + meshtastic_Marker_Kind_Kind_Waypoint = 2, + /* b-m-p-c: Checkpoint */ + meshtastic_Marker_Kind_Kind_Checkpoint = 3, + /* b-m-p-s-p-i / b-m-p-s-p-loc: Self-position marker */ + meshtastic_Marker_Kind_Kind_SelfPosition = 4, + /* 2525B/C military symbol (iconsetpath = COT_MAPPING_2525B/...) */ + meshtastic_Marker_Kind_Kind_Symbol2525 = 5, + /* COT_MAPPING_SPOTMAP icon (e.g. colored dot) */ + meshtastic_Marker_Kind_Kind_SpotMap = 6, + /* Custom icon set (UUID/GroupName/filename.png) */ + meshtastic_Marker_Kind_Kind_CustomIcon = 7, + /* b-m-p-w-GOTO: Go To / bloodhound navigation waypoint. */ + meshtastic_Marker_Kind_Kind_GoToPoint = 8, + /* b-m-p-c-ip: Initial point (mission planning control point). */ + meshtastic_Marker_Kind_Kind_InitialPoint = 9, + /* b-m-p-c-cp: Contact point (mission planning control point). */ + meshtastic_Marker_Kind_Kind_ContactPoint = 10, + /* b-m-p-s-p-op: Observation post. */ + meshtastic_Marker_Kind_Kind_ObservationPost = 11, + /* b-i-x-i: Quick Pic geotagged image marker. iconset carries the + image reference (local filename or remote URL); the image itself + does not ride on the LoRa wire. */ + meshtastic_Marker_Kind_Kind_ImageMarker = 12 +} meshtastic_Marker_Kind; + +/* Travel method for the route. */ +typedef enum _meshtastic_Route_Method { + /* Unspecified / unknown */ + meshtastic_Route_Method_Method_Unspecified = 0, + /* Driving / vehicle */ + meshtastic_Route_Method_Method_Driving = 1, + /* Walking / foot */ + meshtastic_Route_Method_Method_Walking = 2, + /* Flying */ + meshtastic_Route_Method_Method_Flying = 3, + /* Swimming (individual) */ + meshtastic_Route_Method_Method_Swimming = 4, + /* Watercraft (boat) */ + meshtastic_Route_Method_Method_Watercraft = 5 +} meshtastic_Route_Method; + +/* Route direction (infil = ingress, exfil = egress). */ +typedef enum _meshtastic_Route_Direction { + /* Unspecified */ + meshtastic_Route_Direction_Direction_Unspecified = 0, + /* Infiltration (ingress) */ + meshtastic_Route_Direction_Direction_Infil = 1, + /* Exfiltration (egress) */ + meshtastic_Route_Direction_Direction_Exfil = 2 +} meshtastic_Route_Direction; + +/* Line 3: precedence / urgency. */ +typedef enum _meshtastic_CasevacReport_Precedence { + meshtastic_CasevacReport_Precedence_Precedence_Unspecified = 0, + meshtastic_CasevacReport_Precedence_Precedence_Urgent = 1, /* A - immediate, life-threatening */ + meshtastic_CasevacReport_Precedence_Precedence_UrgentSurgical = 2, /* B - needs surgery */ + meshtastic_CasevacReport_Precedence_Precedence_Priority = 3, /* C - within 4 hours */ + meshtastic_CasevacReport_Precedence_Precedence_Routine = 4, /* D - within 24 hours */ + meshtastic_CasevacReport_Precedence_Precedence_Convenience = 5 /* E - convenience */ +} meshtastic_CasevacReport_Precedence; + +/* Line 7: HLZ marking method. */ +typedef enum _meshtastic_CasevacReport_HlzMarking { + meshtastic_CasevacReport_HlzMarking_HlzMarking_Unspecified = 0, + meshtastic_CasevacReport_HlzMarking_HlzMarking_Panels = 1, + meshtastic_CasevacReport_HlzMarking_HlzMarking_PyroSignal = 2, + meshtastic_CasevacReport_HlzMarking_HlzMarking_Smoke = 3, + meshtastic_CasevacReport_HlzMarking_HlzMarking_None = 4, + meshtastic_CasevacReport_HlzMarking_HlzMarking_Other = 5 +} meshtastic_CasevacReport_HlzMarking; + +/* Line 6: security situation at the pickup zone. */ +typedef enum _meshtastic_CasevacReport_Security { + meshtastic_CasevacReport_Security_Security_Unspecified = 0, + meshtastic_CasevacReport_Security_Security_NoEnemy = 1, /* N - no enemy activity */ + meshtastic_CasevacReport_Security_Security_PossibleEnemy = 2, /* P - possible enemy */ + meshtastic_CasevacReport_Security_Security_EnemyInArea = 3, /* E - enemy, approach with caution */ + meshtastic_CasevacReport_Security_Security_EnemyInArmedContact = 4 /* X - armed escort required */ +} meshtastic_CasevacReport_Security; + +typedef enum _meshtastic_EmergencyAlert_Type { + meshtastic_EmergencyAlert_Type_Type_Unspecified = 0, + meshtastic_EmergencyAlert_Type_Type_Alert911 = 1, /* b-a-o-tbl */ + meshtastic_EmergencyAlert_Type_Type_RingTheBell = 2, /* b-a-o-pan */ + meshtastic_EmergencyAlert_Type_Type_InContact = 3, /* b-a-o-opn */ + meshtastic_EmergencyAlert_Type_Type_GeoFenceBreached = 4, /* b-a-g */ + meshtastic_EmergencyAlert_Type_Type_Custom = 5, /* b-a-o-c */ + meshtastic_EmergencyAlert_Type_Type_Cancel = 6 /* b-a-o-can */ +} meshtastic_EmergencyAlert_Type; + +typedef enum _meshtastic_TaskRequest_Priority { + meshtastic_TaskRequest_Priority_Priority_Unspecified = 0, + meshtastic_TaskRequest_Priority_Priority_Low = 1, + meshtastic_TaskRequest_Priority_Priority_Normal = 2, + meshtastic_TaskRequest_Priority_Priority_High = 3, + meshtastic_TaskRequest_Priority_Priority_Critical = 4 +} meshtastic_TaskRequest_Priority; + +typedef enum _meshtastic_TaskRequest_Status { + meshtastic_TaskRequest_Status_Status_Unspecified = 0, + meshtastic_TaskRequest_Status_Status_Pending = 1, /* assigned, not yet acknowledged */ + meshtastic_TaskRequest_Status_Status_Acknowledged = 2, /* assignee has seen it */ + meshtastic_TaskRequest_Status_Status_InProgress = 3, /* assignee is working it */ + meshtastic_TaskRequest_Status_Status_Completed = 4, /* task done */ + meshtastic_TaskRequest_Status_Status_Cancelled = 5 /* cancelled before completion */ +} meshtastic_TaskRequest_Status; + +/* Coarse sensor category, inferred from `model` on parse when the source + XML doesn't label it. Receivers that render differently per sensor + class (thermal overlay vs daylight cone) use this. */ +typedef enum _meshtastic_SensorFov_SensorType { + meshtastic_SensorFov_SensorType_SensorType_Unspecified = 0, + meshtastic_SensorFov_SensorType_SensorType_Camera = 1, /* daylight / general optical */ + meshtastic_SensorFov_SensorType_SensorType_Thermal = 2, /* FLIR, thermal imager */ + meshtastic_SensorFov_SensorType_SensorType_Laser = 3, /* rangefinder, LRF, designator */ + meshtastic_SensorFov_SensorType_SensorType_Nvg = 4, /* night vision goggles */ + meshtastic_SensorFov_SensorType_SensorType_Rf = 5, /* radio/radar direction-finding */ + meshtastic_SensorFov_SensorType_SensorType_Other = 6 +} meshtastic_SensorFov_SensorType; + /* Struct definitions */ /* ATAK GeoChat message */ typedef struct _meshtastic_GeoChat { - /* The text message */ + /* The text message. Empty for receipts. */ char message[200]; /* Uid recipient of the message */ bool has_to; @@ -267,6 +545,14 @@ typedef struct _meshtastic_GeoChat { /* Callsign of the recipient for the message */ bool has_to_callsign; char to_callsign[120]; + /* UID of the chat message this event is acknowledging. Empty for a + normal chat message; set for delivered / read receipts. Paired with + receipt_type so receivers can match the ack back to the original + outbound GeoChat by its event uid. */ + char receipt_for_uid[48]; + /* Receipt kind discriminator. See ReceiptType doc. Default ReceiptType_None + means this is a regular chat message, not a receipt. */ + meshtastic_GeoChat_ReceiptType receipt_type; } meshtastic_GeoChat; /* ATAK Group @@ -360,6 +646,428 @@ typedef struct _meshtastic_AircraftTrack { char cot_host_id[64]; } meshtastic_AircraftTrack; +/* Compact geographic vertex used by repeated vertex lists in TAK geometry + payloads. Named with a `Cot` prefix to avoid a namespace collision with + `meshtastic.GeoPoint` in `device_ui.proto`, which is an unrelated zoom/ + latitude/longitude type used by the on-device map UI. + + Encoded as a signed DELTA from TAKPacketV2.latitude_i / longitude_i (the + enclosing event's anchor point). The absolute coordinate is recovered by + the receiver as `event.latitude_i + vertex.lat_delta_i` (and likewise for + longitude). + + Why deltas: a 32-vertex telestration with vertices clustered within a few + hundred meters of the anchor has per-vertex deltas in the ±10^4 range. + Under sint32+zigzag those encode as 2 bytes each (tag+varint), versus the + 4 bytes that sfixed32 would always require. At 32 vertices that is ~128 + bytes of savings — the difference between fitting under the LoRa MTU or + not. Absolute coordinates (values ~10^9) would cost sint32 varint 5 bytes + per field, which is why TAKPacketV2's top-level latitude_i / longitude_i + stay sfixed32 — only small values win with sint32. */ +typedef struct _meshtastic_CotGeoPoint { + /* Latitude delta from TAKPacketV2.latitude_i, in 1e-7 degree units. + Add to the enclosing event's latitude_i to recover the absolute latitude. */ + int32_t lat_delta_i; + /* Longitude delta from TAKPacketV2.longitude_i, in 1e-7 degree units. */ + int32_t lon_delta_i; +} meshtastic_CotGeoPoint; + +/* User-drawn tactical graphic: circle, rectangle, polygon, polyline, freehand + telestration, ranging circle, or bullseye. + + Covers CoT types u-d-c-c, u-d-r, u-d-f, u-d-f-m, u-d-p, u-r-b-c-c, + u-r-b-bullseye. The shape's anchor position is carried on + TAKPacketV2.latitude_i/longitude_i; polyline/polygon vertices are in the + `vertices` repeated field as `CotGeoPoint` deltas from that anchor. + + Colors use the Team enum as a 14-color palette (see color encoding below) + with a fixed32 exact-ARGB fallback for custom user-picked colors that + don't map to a palette entry. */ +typedef struct _meshtastic_DrawnShape { + /* Shape kind (circle, rectangle, freeform, etc.) */ + meshtastic_DrawnShape_Kind kind; + /* Explicit stroke/fill/both discriminator. See StyleMode doc. */ + meshtastic_DrawnShape_StyleMode style; + /* Ellipse major radius in centimeters. 0 for non-ellipse kinds. */ + uint32_t major_cm; + /* Ellipse minor radius in centimeters. 0 for non-ellipse kinds. */ + uint32_t minor_cm; + /* Ellipse rotation angle in degrees. Valid values are 0..360 inclusive; + 0 and 360 are equivalent rotations. In proto3, an unset uint32 reads + as 0, so senders should emit 0 when the angle is unspecified. */ + uint16_t angle_deg; + /* Stroke color as a named palette entry from the Team enum. If + Unspecifed_Color, the exact ARGB is carried in stroke_argb. + Valid only when style is StrokeOnly or StrokeAndFill. */ + meshtastic_Team stroke_color; + /* Stroke color as an exact 32-bit ARGB bit pattern. Always populated + on the wire; readers MUST use this value when stroke_color == + Unspecifed_Color and MAY use it to recover the exact original bytes + even when a palette entry is set. */ + uint32_t stroke_argb; + /* Stroke weight in tenths of a unit (e.g. 30 = 3.0). Typical ATAK + range 10..60. */ + uint16_t stroke_weight_x10; + /* Fill color as a named palette entry. See stroke_color docs. + Valid only when style is FillOnly or StrokeAndFill. */ + meshtastic_Team fill_color; + /* Fill color exact ARGB fallback. See stroke_argb docs. */ + uint32_t fill_argb; + /* Whether labels are rendered on this shape. */ + bool labels_on; + /* Vertex list for polyline/polygon/rectangle shapes. Capped at 32 by + the nanopb pool; senders MUST truncate longer inputs and set + `truncated = true`. */ + pb_size_t vertices_count; + meshtastic_CotGeoPoint vertices[32]; + /* True if the sender truncated `vertices` to fit the pool. */ + bool truncated; /* --- Bullseye-only fields. All ignored unless kind == Kind_Bullseye. --- */ + /* Bullseye distance in meters * 10 (e.g. 3285 = 328.5 m). 0 = unset. */ + uint32_t bullseye_distance_dm; + /* Bullseye bearing reference: 0 unset, 1 Magnetic, 2 True, 3 Grid. */ + uint8_t bullseye_bearing_ref; + /* Bullseye attribute bit flags: + bit 0: rangeRingVisible + bit 1: hasRangeRings + bit 2: edgeToCenter + bit 3: mils */ + uint8_t bullseye_flags; + /* Bullseye reference UID (anchor marker). Empty = anchor is self. */ + char bullseye_uid_ref[48]; +} meshtastic_DrawnShape; + +/* Fixed point of interest: spot marker, waypoint, checkpoint, 2525 symbol, + or custom icon. + + Covers CoT types b-m-p-s-m, b-m-p-w, b-m-p-c, b-m-p-s-p-i, b-m-p-s-p-loc, + plus a-u-G / a-f-G / a-h-G / a-n-G with iconset paths. The marker position + is carried on TAKPacketV2.latitude_i/longitude_i; fields below carry only + the marker-specific metadata. */ +typedef struct _meshtastic_Marker { + /* Marker kind */ + meshtastic_Marker_Kind kind; + /* Marker color as a named palette entry. If Unspecifed_Color, the exact + ARGB is in color_argb. */ + meshtastic_Team color; + /* Marker color exact ARGB bit pattern. Always populated on the wire. */ + uint32_t color_argb; + /* Status readiness flag (ATAK ). */ + bool readiness; + /* Parent link UID (ATAK ). Empty = no parent. + For spot/waypoint markers this is typically the producing TAK user's UID. */ + char parent_uid[48]; + /* Parent CoT type (e.g. "a-f-G-U-C"). Usually the parent TAK user's type. */ + char parent_type[24]; + /* Parent callsign (e.g. "HOPE"). */ + char parent_callsign[24]; + /* Iconset path stored verbatim. ATAK emits three flavors: + Kind_Symbol2525 -> "COT_MAPPING_2525B//" + Kind_SpotMap -> "COT_MAPPING_SPOTMAP//" + Kind_CustomIcon -> "//.png" + Stored end-to-end without prefix stripping; the ~19 bytes saved by + stripping well-known prefixes are not worth the builder-side bug + surface, and the dict compresses the repetition effectively. */ + char iconset[80]; +} meshtastic_Marker; + +/* Range and bearing measurement line from the event anchor to a target point. + + Covers CoT type u-rb-a. The anchor position is on + TAKPacketV2.latitude_i/longitude_i; the target endpoint is carried as a + CotGeoPoint — same delta-from-anchor encoding used by DrawnShape.vertices + so a self-anchored RAB (common case) encodes in zero bytes. */ +typedef struct _meshtastic_RangeAndBearing { + /* Target/anchor endpoint (delta-encoded from TAKPacketV2.latitude_i/longitude_i). */ + bool has_anchor; + meshtastic_CotGeoPoint anchor; + /* Anchor UID (from ). Empty = free-standing. */ + char anchor_uid[48]; + /* Range in centimeters (value * 100). Range 0..4294 km. */ + uint32_t range_cm; + /* Bearing in degrees * 100 (0..36000). */ + uint16_t bearing_cdeg; + /* Stroke color as a Team palette entry. See DrawnShape.stroke_color doc. */ + meshtastic_Team stroke_color; + /* Stroke color exact ARGB fallback. */ + uint32_t stroke_argb; + /* Stroke weight * 10 (e.g. 30 = 3.0). */ + uint16_t stroke_weight_x10; +} meshtastic_RangeAndBearing; + +/* Route waypoint or control point. Each link corresponds to one ATAK + entry inside the b-m-r event. */ +typedef struct _meshtastic_Route_Link { + /* Waypoint position (delta-encoded from TAKPacketV2.latitude_i/longitude_i). */ + bool has_point; + meshtastic_CotGeoPoint point; + /* Optional UID (empty = receiver derives). */ + char uid[48]; + /* Optional display callsign (e.g. "CP1"). Empty for unnamed control points. */ + char callsign[16]; + /* Link role: 0 = waypoint (b-m-p-w), 1 = checkpoint (b-m-p-c). */ + uint8_t link_type; +} meshtastic_Route_Link; + +/* Named route consisting of ordered waypoints and control points. + + Covers CoT type b-m-r. The first waypoint's position is on + TAKPacketV2.latitude_i/longitude_i; subsequent waypoints and checkpoints + are in `links`. Link count is capped at 16 by the nanopb pool; senders + MUST truncate longer routes and set `truncated = true`. */ +typedef struct _meshtastic_Route { + /* Travel method */ + meshtastic_Route_Method method; + /* Direction (infil/exfil) */ + meshtastic_Route_Direction direction; + /* Waypoint name prefix (e.g. "CP"). */ + char prefix[8]; + /* Stroke weight * 10 (e.g. 30 = 3.0). 0 = default. */ + uint16_t stroke_weight_x10; + /* Ordered list of route control points. Capped at 16. */ + pb_size_t links_count; + meshtastic_Route_Link links[16]; + /* True if the sender truncated `links` to fit the pool. */ + bool truncated; +} meshtastic_Route; + +/* 9-line MEDEVAC request (CoT type b-r-f-h-c). + + Mirrors the ATAK MedLine tool's <_medevac_> detail element. Every field + is optional (proto3 default); senders omit lines they don't have. The + envelope (TAKPacketV2.uid, cot_type_id=b-r-f-h-c, latitude_i/longitude_i, + altitude, callsign) carries Line 1 (location) and Line 2 (callsign). + + All numeric fields are tight varints so a complete 9-line request fits + in well under 100 bytes of proto on the wire. */ +typedef struct _meshtastic_CasevacReport { + /* Line 3: precedence / urgency. */ + meshtastic_CasevacReport_Precedence precedence; + /* Line 4: special equipment required, as a bitfield. + bit 0: none + bit 1: hoist + bit 2: extraction equipment + bit 3: ventilator + bit 4: blood */ + uint8_t equipment_flags; + /* Line 5: number of litter (stretcher-bound) patients. */ + uint8_t litter_patients; + /* Line 5: number of ambulatory (walking-wounded) patients. */ + uint8_t ambulatory_patients; + /* Line 6: security situation at the PZ. */ + meshtastic_CasevacReport_Security security; + /* Line 7: HLZ marking method. */ + meshtastic_CasevacReport_HlzMarking hlz_marking; + /* Line 7 supplementary: short free-text describing the zone marker + (e.g. "Green smoke", "VS-17 panel west"). Capped tight in options. */ + char zone_marker[16]; + /* --- Line 8: patient nationality counts --- */ + uint8_t us_military; + uint8_t us_civilian; + uint8_t non_us_military; + uint8_t non_us_civilian; + uint8_t epw; /* enemy prisoner of war */ + uint8_t child; + /* Line 9: terrain and obstacles at the PZ, as a bitfield. + bit 0: slope + bit 1: rough + bit 2: loose + bit 3: trees + bit 4: wires + bit 5: other */ + uint8_t terrain_flags; + /* Line 2: radio frequency / callsign metadata (e.g. "38.90 Mhz" or + "Victor 6"). Capped tight in options. */ + char frequency[16]; + /* Short title / MEDEVAC identifier (e.g. "EAGLE.15.181230"). Usually the + same as the envelope callsign but ATAK sometimes carries a distinct + ops-number here. */ + pb_callback_t title; + /* Primary medline free-text — the single most clinically important line + on a MEDLINE form (e.g. "2 urgent litter patients, smoke on approach"). + MUST be preserved under MTU pressure as long as any casevac is sent. */ + pb_callback_t medline_remarks; + /* Line 3 (newer ATAK format): patient counts by precedence level. + Coexists with the enum-style `precedence` field (tag 1) — older ATAK + emits a single enum, newer ATAK emits these counts, and both can be + set simultaneously. Senders populate whichever style(s) the source + XML had; receivers prefer counts when non-zero. */ + uint32_t urgent_count; + uint32_t urgent_surgical_count; + uint32_t priority_count; + uint32_t routine_count; + uint32_t convenience_count; + /* Line 4 supplementary: free-text description of non-standard equipment + (e.g. "Blood warmer"). Pairs with the `equipment_flags` bitfield. */ + pb_callback_t equipment_detail; + /* Line 1 override: MGRS grid when distinct from the event anchor point + (e.g. "34T CQ 12345 67890"). Event lat/lon/hae still carries the + numeric location; this field preserves the exact MGRS string the + medic entered. */ + pb_callback_t zone_protected_coord; + /* Line 9 supplementary: slope direction (e.g. "N", "NE", "SSW") when + `terrain_flags` bit 0 (slope) is set. */ + pb_callback_t terrain_slope_dir; + /* Line 9 supplementary: free-text description of "other" terrain hazards + (e.g. "Loose debris on west edge") when `terrain_flags` bit 5 (other) + is set. Tier-2 strippable under MTU pressure. */ + pb_callback_t terrain_other_detail; + /* Line 7 supplementary: how the zone is being marked right now + (e.g. "Orange smoke", "VS-17 panel"). Complements the structured + `hlz_marking` enum with a specific human-readable description. */ + pb_callback_t marked_by; + /* Nearby obstacles on the approach (e.g. "Power lines north of HLZ"). */ + pb_callback_t obstacles; + /* Wind direction and speed (e.g. "270 at 12 kts"). */ + pb_callback_t winds_are_from; + /* Friendly forces posture near the pickup zone + (e.g. "Squad east of HLZ"). */ + pb_callback_t friendlies; + /* Known or suspected enemy positions near the pickup zone + (e.g. "Possible enemy on south ridge"). */ + pb_callback_t enemy; + /* Free-text description of the HLZ itself + (e.g. "Primary HLZ is soccer field"). */ + pb_callback_t hlz_remarks; + /* Per-patient clinical records. Each entry is one patient's ZMIST card + (Zap number / Mechanism / Injuries / Signs / Treatment). Repeatable — + a mass-casualty event can carry 1-6 entries in practice, limited by + the 237 B LoRa MTU. */ + pb_callback_t zmist; +} meshtastic_CasevacReport; + +/* Per-patient clinical summary record — one entry per patient in a CASEVAC. + Maps directly to ATAK's child element inside . + All fields are optional free-text; senders populate what they have. */ +typedef struct _meshtastic_ZMistEntry { + /* Patient identifier / sequence label (e.g. "ZMIST-1", "ZMIST-2"). */ + pb_callback_t title; + /* Zap number — unique patient tracking ID (often a terse code like + "Gunshot" or a serial). */ + pb_callback_t z; + /* Mechanism of injury (e.g. "Penetrating trauma", "Blast injury"). */ + pb_callback_t m; + /* Injuries observed (e.g. "Left thigh", "Concussion"). */ + pb_callback_t i; + /* Signs / vital stats (e.g. "Stable", "Priority", "BP 110/70"). */ + pb_callback_t s; + /* Treatment given (e.g. "Tourniquet 1810Z", "O2 administered"). */ + pb_callback_t t; +} meshtastic_ZMistEntry; + +/* Emergency alert / 911 beacon (CoT types b-a-o-tbl, b-a-o-pan, b-a-o-opn, + b-a-o-can, b-a-o-c, b-a-g). + + Small, high-priority structured record. The CoT type string is still set + on cot_type_id so receivers that ignore payload_variant can still display + the alert from the enum alone; the typed fields let modern receivers show + the authoring unit and handle cancel-referencing without XML parsing. */ +typedef struct _meshtastic_EmergencyAlert { + /* Alert discriminator. */ + meshtastic_EmergencyAlert_Type type; + /* UID of the unit that raised the alert. Often the same as + TAKPacketV2.uid but can be a parent device uid when a tracker raises + an alert on behalf of a dismount. */ + char authoring_uid[48]; + /* For Type_Cancel: the uid of the alert being cancelled. Empty for + non-cancel alert types. */ + char cancel_reference_uid[48]; +} meshtastic_EmergencyAlert; + +/* Task / engage request (CoT type t-s). + + Mirrors ATAK's TaskCotReceiver / CotTaskBuilder workflow. The envelope + carries the task's originating uid (implicit requester), position, and + creation time; the fields below carry structured metadata the raw-detail + fallback currently loses. + + Fields are deliberately lean — this variant is closer to the MTU ceiling + than the others, so every string is capped in options. */ +typedef struct _meshtastic_TaskRequest { + /* Short tag for the task category (e.g. "engage", "observe", "recon", + "rescue"). Free text on the wire so ATAK-specific task taxonomies + don't need proto coordination; capped tight in options. */ + char task_type[12]; + /* UID of the target / map item being tasked. */ + char target_uid[32]; + /* UID of the assigned unit. Empty = unassigned / broadcast task. */ + char assignee_uid[32]; + meshtastic_TaskRequest_Priority priority; + meshtastic_TaskRequest_Status status; + /* Optional short note (reason, constraints, grid reference). Capped + tight in options to keep the worst-case under the LoRa MTU. */ + char note[48]; +} meshtastic_TaskRequest; + +/* Weather annotation from CoT detail element. + + Attaches to any TAKPacketV2 regardless of payload_variant — an Aircraft, + PLI, or Marker can all carry observed conditions at the emitting station. + ATAK-CIV ships an XSD for but no dedicated handler, so the + element round-trips through the generic detail pipeline; this message + promotes it to a first-class structured field. + + Target wire cost: ~6-8 bytes compressed with a fully populated instance. + + Named `TAKEnvironment` (not just `Environment`) because the bare name + collides with `SwiftUI.Environment` — every SwiftUI view in a consuming + iOS app uses the `@Environment` property wrapper, and importing the + generated proto module would make `Environment` ambiguous in every one + of those files. The `TAK` prefix matches the convention used by the + outer `TAKPacketV2` wrapper and is unambiguous across all target + languages (Swift, Kotlin, Python, TypeScript, C#). */ +typedef struct _meshtastic_TAKEnvironment { + /* Temperature in deci-degrees Celsius. 225 = 22.5°C. + Range covers -50°C to +50°C (-500 to +500) which spans every realistic + outdoor TAK deployment. sint32 because negative temps are common in + cold-weather ops. */ + int32_t temperature_c_x10; + /* Wind direction in whole degrees, 0-359. "Direction FROM" per + meteorological convention (matches CoT / ATAK). */ + uint32_t wind_direction_deg; + /* Wind speed in cm/s. Matches the unit of TAKPacketV2.speed for + consistency. 1200 = 12.00 m/s = ~27 mph. */ + uint32_t wind_speed_cm_s; +} meshtastic_TAKEnvironment; + +/* Sensor field-of-view cone from CoT detail element. + + Encodes the 8 geometry attributes that ATAK-CIV's SensorDetailHandler + reads from the wire; drops the 9 visual-styling attributes that are + receiver-side render hints (fovAlpha, fovRed/Green/Blue, strokeColor, + strokeWeight, displayMagneticReference, hideFov, fovLabels, rangeLines). + The receiving ATAK client restores those from its own defaults, same as + every other CoT carried over Meshtastic today. + + Attaches to any TAKPacketV2 — a PLI with a sensor on the operator's head, + an Aircraft with a FLIR turret, a Marker dropped on a UAV. + Target wire cost: ~7-14 bytes compressed (dominated by model string). */ +typedef struct _meshtastic_SensorFov { + meshtastic_SensorFov_SensorType type; + /* Azimuth in whole degrees, 0-359. "Pointing direction" of the cone axis, + measured clockwise from true north. Whole degrees match ATAK-CIV's + SensorDetailHandler default (270°) and save varint bytes over centi-deg. */ + uint32_t azimuth_deg; + /* Maximum range of the cone in meters. + Optional — if unset, receivers should use the ATAK-CIV default of 100m. */ + bool has_range_m; + uint32_t range_m; + /* Horizontal field of view in whole degrees (cone's angular width). + ATAK-CIV default is 45°. */ + uint32_t fov_horizontal_deg; + /* Vertical field of view in whole degrees. ATAK-CIV default is 45°. + Optional — a value of 0 means "not set / use horizontal FOV". */ + uint32_t fov_vertical_deg; + /* Elevation angle in whole degrees. Positive = up, negative = down. + Range -90 to +90. sint32 for varint efficiency on small negatives. */ + int32_t elevation_deg; + /* Roll (camera tilt) in whole degrees, -180 to +180. + Optional — use 0 if the sensor doesn't track roll. */ + int32_t roll_deg; + /* Free-form device model identifier, e.g. "FLIR-Boson-640", "SEEK". + Optional — empty string means "unknown model" (ATAK-CIV default). */ + pb_callback_t model; +} meshtastic_SensorFov; + typedef PB_BYTES_ARRAY_T(220) meshtastic_TAKPacketV2_raw_detail_t; /* ATAK v2 packet with expanded CoT field support and zstd dictionary compression. Sent on ATAK_PLUGIN_V2 port. The wire payload is: @@ -413,6 +1121,20 @@ typedef struct _meshtastic_TAKPacketV2 { char phone[20]; /* CoT event type string, only populated when cot_type_id is CotType_Other */ char cot_type_str[32]; + /* Optional remarks / free-text annotation from the element. + Populated for non-GeoChat payload types (shapes, markers, routes, etc.) + when the original CoT event carried non-empty remarks text. + GeoChat messages carry their text in GeoChat.message instead. + Empty string (proto3 default) means no remarks were present. */ + pb_callback_t remarks; + /* Observed weather conditions (temperature, wind). From . + Type is `TAKEnvironment`, not `Environment`, to avoid colliding with + SwiftUI's `@Environment` property wrapper in iOS consumers. */ + bool has_environment; + meshtastic_TAKEnvironment environment; + /* Sensor field-of-view cone (camera, FLIR, laser, etc.). From . */ + bool has_sensor_fov; + meshtastic_SensorFov sensor_fov; pb_size_t which_payload_variant; union { /* Position report (true = PLI, no extra fields beyond the common ones above) */ @@ -421,8 +1143,26 @@ typedef struct _meshtastic_TAKPacketV2 { meshtastic_GeoChat chat; /* Aircraft track data (ADS-B, military air) */ meshtastic_AircraftTrack aircraft; - /* Generic CoT detail XML for unmapped types */ + /* Generic CoT detail XML for unmapped types. Kept as a fallback for CoT + types not yet promoted to a typed variant; drawings, markers, ranging + tools, and routes have dedicated variants below and should not land here. */ meshtastic_TAKPacketV2_raw_detail_t raw_detail; + /* User-drawn tactical graphic: circle, rectangle, polygon, polyline, + telestration, ranging circle, or bullseye. See DrawnShape. */ + meshtastic_DrawnShape shape; + /* Fixed point of interest: spot marker, waypoint, checkpoint, 2525 + symbol, or custom icon. See Marker. */ + meshtastic_Marker marker; + /* Range and bearing measurement line. See RangeAndBearing. */ + meshtastic_RangeAndBearing rab; + /* Named route with ordered waypoints and control points. See Route. */ + meshtastic_Route route; + /* 9-line MEDEVAC request. See CasevacReport. */ + meshtastic_CasevacReport casevac; + /* Emergency beacon / 911 alert. See EmergencyAlert. */ + meshtastic_EmergencyAlert emergency; + /* Task / engage request. See TaskRequest. */ + meshtastic_TaskRequest task; } payload_variant; } meshtastic_TAKPacketV2; @@ -445,14 +1185,67 @@ extern "C" { #define _meshtastic_CotHow_ARRAYSIZE ((meshtastic_CotHow)(meshtastic_CotHow_CotHow_m_s+1)) #define _meshtastic_CotType_MIN meshtastic_CotType_CotType_Other -#define _meshtastic_CotType_MAX meshtastic_CotType_CotType_b_f_t_a -#define _meshtastic_CotType_ARRAYSIZE ((meshtastic_CotType)(meshtastic_CotType_CotType_b_f_t_a+1)) +#define _meshtastic_CotType_MAX meshtastic_CotType_CotType_t_s +#define _meshtastic_CotType_ARRAYSIZE ((meshtastic_CotType)(meshtastic_CotType_CotType_t_s+1)) #define _meshtastic_GeoPointSource_MIN meshtastic_GeoPointSource_GeoPointSource_Unspecified #define _meshtastic_GeoPointSource_MAX meshtastic_GeoPointSource_GeoPointSource_NETWORK #define _meshtastic_GeoPointSource_ARRAYSIZE ((meshtastic_GeoPointSource)(meshtastic_GeoPointSource_GeoPointSource_NETWORK+1)) +#define _meshtastic_GeoChat_ReceiptType_MIN meshtastic_GeoChat_ReceiptType_ReceiptType_None +#define _meshtastic_GeoChat_ReceiptType_MAX meshtastic_GeoChat_ReceiptType_ReceiptType_Read +#define _meshtastic_GeoChat_ReceiptType_ARRAYSIZE ((meshtastic_GeoChat_ReceiptType)(meshtastic_GeoChat_ReceiptType_ReceiptType_Read+1)) +#define _meshtastic_DrawnShape_Kind_MIN meshtastic_DrawnShape_Kind_Kind_Unspecified +#define _meshtastic_DrawnShape_Kind_MAX meshtastic_DrawnShape_Kind_Kind_Vehicle3D +#define _meshtastic_DrawnShape_Kind_ARRAYSIZE ((meshtastic_DrawnShape_Kind)(meshtastic_DrawnShape_Kind_Kind_Vehicle3D+1)) + +#define _meshtastic_DrawnShape_StyleMode_MIN meshtastic_DrawnShape_StyleMode_StyleMode_Unspecified +#define _meshtastic_DrawnShape_StyleMode_MAX meshtastic_DrawnShape_StyleMode_StyleMode_StrokeAndFill +#define _meshtastic_DrawnShape_StyleMode_ARRAYSIZE ((meshtastic_DrawnShape_StyleMode)(meshtastic_DrawnShape_StyleMode_StyleMode_StrokeAndFill+1)) + +#define _meshtastic_Marker_Kind_MIN meshtastic_Marker_Kind_Kind_Unspecified +#define _meshtastic_Marker_Kind_MAX meshtastic_Marker_Kind_Kind_ImageMarker +#define _meshtastic_Marker_Kind_ARRAYSIZE ((meshtastic_Marker_Kind)(meshtastic_Marker_Kind_Kind_ImageMarker+1)) + +#define _meshtastic_Route_Method_MIN meshtastic_Route_Method_Method_Unspecified +#define _meshtastic_Route_Method_MAX meshtastic_Route_Method_Method_Watercraft +#define _meshtastic_Route_Method_ARRAYSIZE ((meshtastic_Route_Method)(meshtastic_Route_Method_Method_Watercraft+1)) + +#define _meshtastic_Route_Direction_MIN meshtastic_Route_Direction_Direction_Unspecified +#define _meshtastic_Route_Direction_MAX meshtastic_Route_Direction_Direction_Exfil +#define _meshtastic_Route_Direction_ARRAYSIZE ((meshtastic_Route_Direction)(meshtastic_Route_Direction_Direction_Exfil+1)) + +#define _meshtastic_CasevacReport_Precedence_MIN meshtastic_CasevacReport_Precedence_Precedence_Unspecified +#define _meshtastic_CasevacReport_Precedence_MAX meshtastic_CasevacReport_Precedence_Precedence_Convenience +#define _meshtastic_CasevacReport_Precedence_ARRAYSIZE ((meshtastic_CasevacReport_Precedence)(meshtastic_CasevacReport_Precedence_Precedence_Convenience+1)) + +#define _meshtastic_CasevacReport_HlzMarking_MIN meshtastic_CasevacReport_HlzMarking_HlzMarking_Unspecified +#define _meshtastic_CasevacReport_HlzMarking_MAX meshtastic_CasevacReport_HlzMarking_HlzMarking_Other +#define _meshtastic_CasevacReport_HlzMarking_ARRAYSIZE ((meshtastic_CasevacReport_HlzMarking)(meshtastic_CasevacReport_HlzMarking_HlzMarking_Other+1)) + +#define _meshtastic_CasevacReport_Security_MIN meshtastic_CasevacReport_Security_Security_Unspecified +#define _meshtastic_CasevacReport_Security_MAX meshtastic_CasevacReport_Security_Security_EnemyInArmedContact +#define _meshtastic_CasevacReport_Security_ARRAYSIZE ((meshtastic_CasevacReport_Security)(meshtastic_CasevacReport_Security_Security_EnemyInArmedContact+1)) + +#define _meshtastic_EmergencyAlert_Type_MIN meshtastic_EmergencyAlert_Type_Type_Unspecified +#define _meshtastic_EmergencyAlert_Type_MAX meshtastic_EmergencyAlert_Type_Type_Cancel +#define _meshtastic_EmergencyAlert_Type_ARRAYSIZE ((meshtastic_EmergencyAlert_Type)(meshtastic_EmergencyAlert_Type_Type_Cancel+1)) + +#define _meshtastic_TaskRequest_Priority_MIN meshtastic_TaskRequest_Priority_Priority_Unspecified +#define _meshtastic_TaskRequest_Priority_MAX meshtastic_TaskRequest_Priority_Priority_Critical +#define _meshtastic_TaskRequest_Priority_ARRAYSIZE ((meshtastic_TaskRequest_Priority)(meshtastic_TaskRequest_Priority_Priority_Critical+1)) + +#define _meshtastic_TaskRequest_Status_MIN meshtastic_TaskRequest_Status_Status_Unspecified +#define _meshtastic_TaskRequest_Status_MAX meshtastic_TaskRequest_Status_Status_Cancelled +#define _meshtastic_TaskRequest_Status_ARRAYSIZE ((meshtastic_TaskRequest_Status)(meshtastic_TaskRequest_Status_Status_Cancelled+1)) + +#define _meshtastic_SensorFov_SensorType_MIN meshtastic_SensorFov_SensorType_SensorType_Unspecified +#define _meshtastic_SensorFov_SensorType_MAX meshtastic_SensorFov_SensorType_SensorType_Other +#define _meshtastic_SensorFov_SensorType_ARRAYSIZE ((meshtastic_SensorFov_SensorType)(meshtastic_SensorFov_SensorType_SensorType_Other+1)) + + +#define meshtastic_GeoChat_receipt_type_ENUMTYPE meshtastic_GeoChat_ReceiptType #define meshtastic_Group_role_ENUMTYPE meshtastic_MemberRole #define meshtastic_Group_team_ENUMTYPE meshtastic_Team @@ -461,6 +1254,34 @@ extern "C" { + +#define meshtastic_DrawnShape_kind_ENUMTYPE meshtastic_DrawnShape_Kind +#define meshtastic_DrawnShape_style_ENUMTYPE meshtastic_DrawnShape_StyleMode +#define meshtastic_DrawnShape_stroke_color_ENUMTYPE meshtastic_Team +#define meshtastic_DrawnShape_fill_color_ENUMTYPE meshtastic_Team + +#define meshtastic_Marker_kind_ENUMTYPE meshtastic_Marker_Kind +#define meshtastic_Marker_color_ENUMTYPE meshtastic_Team + +#define meshtastic_RangeAndBearing_stroke_color_ENUMTYPE meshtastic_Team + +#define meshtastic_Route_method_ENUMTYPE meshtastic_Route_Method +#define meshtastic_Route_direction_ENUMTYPE meshtastic_Route_Direction + + +#define meshtastic_CasevacReport_precedence_ENUMTYPE meshtastic_CasevacReport_Precedence +#define meshtastic_CasevacReport_security_ENUMTYPE meshtastic_CasevacReport_Security +#define meshtastic_CasevacReport_hlz_marking_ENUMTYPE meshtastic_CasevacReport_HlzMarking + + +#define meshtastic_EmergencyAlert_type_ENUMTYPE meshtastic_EmergencyAlert_Type + +#define meshtastic_TaskRequest_priority_ENUMTYPE meshtastic_TaskRequest_Priority +#define meshtastic_TaskRequest_status_ENUMTYPE meshtastic_TaskRequest_Status + + +#define meshtastic_SensorFov_type_ENUMTYPE meshtastic_SensorFov_SensorType + #define meshtastic_TAKPacketV2_cot_type_id_ENUMTYPE meshtastic_CotType #define meshtastic_TAKPacketV2_how_ENUMTYPE meshtastic_CotHow #define meshtastic_TAKPacketV2_team_ENUMTYPE meshtastic_Team @@ -471,26 +1292,52 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_TAKPacket_init_default {0, false, meshtastic_Contact_init_default, false, meshtastic_Group_init_default, false, meshtastic_Status_init_default, 0, {meshtastic_PLI_init_default}} -#define meshtastic_GeoChat_init_default {"", false, "", false, ""} +#define meshtastic_GeoChat_init_default {"", false, "", false, "", "", _meshtastic_GeoChat_ReceiptType_MIN} #define meshtastic_Group_init_default {_meshtastic_MemberRole_MIN, _meshtastic_Team_MIN} #define meshtastic_Status_init_default {0} #define meshtastic_Contact_init_default {"", ""} #define meshtastic_PLI_init_default {0, 0, 0, 0, 0} #define meshtastic_AircraftTrack_init_default {"", "", "", "", 0, "", 0, 0, ""} -#define meshtastic_TAKPacketV2_init_default {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", 0, {0}} +#define meshtastic_CotGeoPoint_init_default {0, 0} +#define meshtastic_DrawnShape_init_default {_meshtastic_DrawnShape_Kind_MIN, _meshtastic_DrawnShape_StyleMode_MIN, 0, 0, 0, _meshtastic_Team_MIN, 0, 0, _meshtastic_Team_MIN, 0, 0, 0, {meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default, meshtastic_CotGeoPoint_init_default}, 0, 0, 0, 0, ""} +#define meshtastic_Marker_init_default {_meshtastic_Marker_Kind_MIN, _meshtastic_Team_MIN, 0, 0, "", "", "", ""} +#define meshtastic_RangeAndBearing_init_default {false, meshtastic_CotGeoPoint_init_default, "", 0, 0, _meshtastic_Team_MIN, 0, 0} +#define meshtastic_Route_init_default {_meshtastic_Route_Method_MIN, _meshtastic_Route_Direction_MIN, "", 0, 0, {meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default, meshtastic_Route_Link_init_default}, 0} +#define meshtastic_Route_Link_init_default {false, meshtastic_CotGeoPoint_init_default, "", "", 0} +#define meshtastic_CasevacReport_init_default {_meshtastic_CasevacReport_Precedence_MIN, 0, 0, 0, _meshtastic_CasevacReport_Security_MIN, _meshtastic_CasevacReport_HlzMarking_MIN, "", 0, 0, 0, 0, 0, 0, 0, "", {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define meshtastic_ZMistEntry_init_default {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define meshtastic_EmergencyAlert_init_default {_meshtastic_EmergencyAlert_Type_MIN, "", ""} +#define meshtastic_TaskRequest_init_default {"", "", "", _meshtastic_TaskRequest_Priority_MIN, _meshtastic_TaskRequest_Status_MIN, ""} +#define meshtastic_TAKEnvironment_init_default {0, 0, 0} +#define meshtastic_SensorFov_init_default {_meshtastic_SensorFov_SensorType_MIN, 0, false, 0, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_TAKPacketV2_init_default {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", {{NULL}, NULL}, false, meshtastic_TAKEnvironment_init_default, false, meshtastic_SensorFov_init_default, 0, {0}} #define meshtastic_TAKPacket_init_zero {0, false, meshtastic_Contact_init_zero, false, meshtastic_Group_init_zero, false, meshtastic_Status_init_zero, 0, {meshtastic_PLI_init_zero}} -#define meshtastic_GeoChat_init_zero {"", false, "", false, ""} +#define meshtastic_GeoChat_init_zero {"", false, "", false, "", "", _meshtastic_GeoChat_ReceiptType_MIN} #define meshtastic_Group_init_zero {_meshtastic_MemberRole_MIN, _meshtastic_Team_MIN} #define meshtastic_Status_init_zero {0} #define meshtastic_Contact_init_zero {"", ""} #define meshtastic_PLI_init_zero {0, 0, 0, 0, 0} #define meshtastic_AircraftTrack_init_zero {"", "", "", "", 0, "", 0, 0, ""} -#define meshtastic_TAKPacketV2_init_zero {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", 0, {0}} +#define meshtastic_CotGeoPoint_init_zero {0, 0} +#define meshtastic_DrawnShape_init_zero {_meshtastic_DrawnShape_Kind_MIN, _meshtastic_DrawnShape_StyleMode_MIN, 0, 0, 0, _meshtastic_Team_MIN, 0, 0, _meshtastic_Team_MIN, 0, 0, 0, {meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero, meshtastic_CotGeoPoint_init_zero}, 0, 0, 0, 0, ""} +#define meshtastic_Marker_init_zero {_meshtastic_Marker_Kind_MIN, _meshtastic_Team_MIN, 0, 0, "", "", "", ""} +#define meshtastic_RangeAndBearing_init_zero {false, meshtastic_CotGeoPoint_init_zero, "", 0, 0, _meshtastic_Team_MIN, 0, 0} +#define meshtastic_Route_init_zero {_meshtastic_Route_Method_MIN, _meshtastic_Route_Direction_MIN, "", 0, 0, {meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero, meshtastic_Route_Link_init_zero}, 0} +#define meshtastic_Route_Link_init_zero {false, meshtastic_CotGeoPoint_init_zero, "", "", 0} +#define meshtastic_CasevacReport_init_zero {_meshtastic_CasevacReport_Precedence_MIN, 0, 0, 0, _meshtastic_CasevacReport_Security_MIN, _meshtastic_CasevacReport_HlzMarking_MIN, "", 0, 0, 0, 0, 0, 0, 0, "", {{NULL}, NULL}, {{NULL}, NULL}, 0, 0, 0, 0, 0, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define meshtastic_ZMistEntry_init_zero {{{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}, {{NULL}, NULL}} +#define meshtastic_EmergencyAlert_init_zero {_meshtastic_EmergencyAlert_Type_MIN, "", ""} +#define meshtastic_TaskRequest_init_zero {"", "", "", _meshtastic_TaskRequest_Priority_MIN, _meshtastic_TaskRequest_Status_MIN, ""} +#define meshtastic_TAKEnvironment_init_zero {0, 0, 0} +#define meshtastic_SensorFov_init_zero {_meshtastic_SensorFov_SensorType_MIN, 0, false, 0, 0, 0, 0, 0, {{NULL}, NULL}} +#define meshtastic_TAKPacketV2_init_zero {_meshtastic_CotType_MIN, _meshtastic_CotHow_MIN, "", _meshtastic_Team_MIN, _meshtastic_MemberRole_MIN, 0, 0, 0, 0, 0, 0, _meshtastic_GeoPointSource_MIN, _meshtastic_GeoPointSource_MIN, "", "", 0, "", "", "", "", "", "", "", {{NULL}, NULL}, false, meshtastic_TAKEnvironment_init_zero, false, meshtastic_SensorFov_init_zero, 0, {0}} /* Field tags (for use in manual encoding/decoding) */ #define meshtastic_GeoChat_message_tag 1 #define meshtastic_GeoChat_to_tag 2 #define meshtastic_GeoChat_to_callsign_tag 3 +#define meshtastic_GeoChat_receipt_for_uid_tag 4 +#define meshtastic_GeoChat_receipt_type_tag 5 #define meshtastic_Group_role_tag 1 #define meshtastic_Group_team_tag 2 #define meshtastic_Status_battery_tag 1 @@ -517,6 +1364,109 @@ extern "C" { #define meshtastic_AircraftTrack_rssi_x10_tag 7 #define meshtastic_AircraftTrack_gps_tag 8 #define meshtastic_AircraftTrack_cot_host_id_tag 9 +#define meshtastic_CotGeoPoint_lat_delta_i_tag 1 +#define meshtastic_CotGeoPoint_lon_delta_i_tag 2 +#define meshtastic_DrawnShape_kind_tag 1 +#define meshtastic_DrawnShape_style_tag 2 +#define meshtastic_DrawnShape_major_cm_tag 3 +#define meshtastic_DrawnShape_minor_cm_tag 4 +#define meshtastic_DrawnShape_angle_deg_tag 5 +#define meshtastic_DrawnShape_stroke_color_tag 6 +#define meshtastic_DrawnShape_stroke_argb_tag 7 +#define meshtastic_DrawnShape_stroke_weight_x10_tag 8 +#define meshtastic_DrawnShape_fill_color_tag 9 +#define meshtastic_DrawnShape_fill_argb_tag 10 +#define meshtastic_DrawnShape_labels_on_tag 11 +#define meshtastic_DrawnShape_vertices_tag 12 +#define meshtastic_DrawnShape_truncated_tag 13 +#define meshtastic_DrawnShape_bullseye_distance_dm_tag 14 +#define meshtastic_DrawnShape_bullseye_bearing_ref_tag 15 +#define meshtastic_DrawnShape_bullseye_flags_tag 16 +#define meshtastic_DrawnShape_bullseye_uid_ref_tag 17 +#define meshtastic_Marker_kind_tag 1 +#define meshtastic_Marker_color_tag 2 +#define meshtastic_Marker_color_argb_tag 3 +#define meshtastic_Marker_readiness_tag 4 +#define meshtastic_Marker_parent_uid_tag 5 +#define meshtastic_Marker_parent_type_tag 6 +#define meshtastic_Marker_parent_callsign_tag 7 +#define meshtastic_Marker_iconset_tag 8 +#define meshtastic_RangeAndBearing_anchor_tag 1 +#define meshtastic_RangeAndBearing_anchor_uid_tag 2 +#define meshtastic_RangeAndBearing_range_cm_tag 3 +#define meshtastic_RangeAndBearing_bearing_cdeg_tag 4 +#define meshtastic_RangeAndBearing_stroke_color_tag 5 +#define meshtastic_RangeAndBearing_stroke_argb_tag 6 +#define meshtastic_RangeAndBearing_stroke_weight_x10_tag 7 +#define meshtastic_Route_Link_point_tag 1 +#define meshtastic_Route_Link_uid_tag 2 +#define meshtastic_Route_Link_callsign_tag 3 +#define meshtastic_Route_Link_link_type_tag 4 +#define meshtastic_Route_method_tag 1 +#define meshtastic_Route_direction_tag 2 +#define meshtastic_Route_prefix_tag 3 +#define meshtastic_Route_stroke_weight_x10_tag 4 +#define meshtastic_Route_links_tag 5 +#define meshtastic_Route_truncated_tag 6 +#define meshtastic_CasevacReport_precedence_tag 1 +#define meshtastic_CasevacReport_equipment_flags_tag 2 +#define meshtastic_CasevacReport_litter_patients_tag 3 +#define meshtastic_CasevacReport_ambulatory_patients_tag 4 +#define meshtastic_CasevacReport_security_tag 5 +#define meshtastic_CasevacReport_hlz_marking_tag 6 +#define meshtastic_CasevacReport_zone_marker_tag 7 +#define meshtastic_CasevacReport_us_military_tag 8 +#define meshtastic_CasevacReport_us_civilian_tag 9 +#define meshtastic_CasevacReport_non_us_military_tag 10 +#define meshtastic_CasevacReport_non_us_civilian_tag 11 +#define meshtastic_CasevacReport_epw_tag 12 +#define meshtastic_CasevacReport_child_tag 13 +#define meshtastic_CasevacReport_terrain_flags_tag 14 +#define meshtastic_CasevacReport_frequency_tag 15 +#define meshtastic_CasevacReport_title_tag 16 +#define meshtastic_CasevacReport_medline_remarks_tag 17 +#define meshtastic_CasevacReport_urgent_count_tag 18 +#define meshtastic_CasevacReport_urgent_surgical_count_tag 19 +#define meshtastic_CasevacReport_priority_count_tag 20 +#define meshtastic_CasevacReport_routine_count_tag 21 +#define meshtastic_CasevacReport_convenience_count_tag 22 +#define meshtastic_CasevacReport_equipment_detail_tag 23 +#define meshtastic_CasevacReport_zone_protected_coord_tag 24 +#define meshtastic_CasevacReport_terrain_slope_dir_tag 25 +#define meshtastic_CasevacReport_terrain_other_detail_tag 26 +#define meshtastic_CasevacReport_marked_by_tag 27 +#define meshtastic_CasevacReport_obstacles_tag 28 +#define meshtastic_CasevacReport_winds_are_from_tag 29 +#define meshtastic_CasevacReport_friendlies_tag 30 +#define meshtastic_CasevacReport_enemy_tag 31 +#define meshtastic_CasevacReport_hlz_remarks_tag 32 +#define meshtastic_CasevacReport_zmist_tag 33 +#define meshtastic_ZMistEntry_title_tag 1 +#define meshtastic_ZMistEntry_z_tag 2 +#define meshtastic_ZMistEntry_m_tag 3 +#define meshtastic_ZMistEntry_i_tag 4 +#define meshtastic_ZMistEntry_s_tag 5 +#define meshtastic_ZMistEntry_t_tag 6 +#define meshtastic_EmergencyAlert_type_tag 1 +#define meshtastic_EmergencyAlert_authoring_uid_tag 2 +#define meshtastic_EmergencyAlert_cancel_reference_uid_tag 3 +#define meshtastic_TaskRequest_task_type_tag 1 +#define meshtastic_TaskRequest_target_uid_tag 2 +#define meshtastic_TaskRequest_assignee_uid_tag 3 +#define meshtastic_TaskRequest_priority_tag 4 +#define meshtastic_TaskRequest_status_tag 5 +#define meshtastic_TaskRequest_note_tag 6 +#define meshtastic_TAKEnvironment_temperature_c_x10_tag 1 +#define meshtastic_TAKEnvironment_wind_direction_deg_tag 2 +#define meshtastic_TAKEnvironment_wind_speed_cm_s_tag 3 +#define meshtastic_SensorFov_type_tag 1 +#define meshtastic_SensorFov_azimuth_deg_tag 2 +#define meshtastic_SensorFov_range_m_tag 3 +#define meshtastic_SensorFov_fov_horizontal_deg_tag 4 +#define meshtastic_SensorFov_fov_vertical_deg_tag 5 +#define meshtastic_SensorFov_elevation_deg_tag 6 +#define meshtastic_SensorFov_roll_deg_tag 7 +#define meshtastic_SensorFov_model_tag 8 #define meshtastic_TAKPacketV2_cot_type_id_tag 1 #define meshtastic_TAKPacketV2_how_tag 2 #define meshtastic_TAKPacketV2_callsign_tag 3 @@ -540,10 +1490,20 @@ extern "C" { #define meshtastic_TAKPacketV2_endpoint_tag 21 #define meshtastic_TAKPacketV2_phone_tag 22 #define meshtastic_TAKPacketV2_cot_type_str_tag 23 +#define meshtastic_TAKPacketV2_remarks_tag 24 +#define meshtastic_TAKPacketV2_environment_tag 25 +#define meshtastic_TAKPacketV2_sensor_fov_tag 26 #define meshtastic_TAKPacketV2_pli_tag 30 #define meshtastic_TAKPacketV2_chat_tag 31 #define meshtastic_TAKPacketV2_aircraft_tag 32 #define meshtastic_TAKPacketV2_raw_detail_tag 33 +#define meshtastic_TAKPacketV2_shape_tag 34 +#define meshtastic_TAKPacketV2_marker_tag 35 +#define meshtastic_TAKPacketV2_rab_tag 36 +#define meshtastic_TAKPacketV2_route_tag 37 +#define meshtastic_TAKPacketV2_casevac_tag 38 +#define meshtastic_TAKPacketV2_emergency_tag 39 +#define meshtastic_TAKPacketV2_task_tag 40 /* Struct field encoding specification for nanopb */ #define meshtastic_TAKPacket_FIELDLIST(X, a) \ @@ -565,7 +1525,9 @@ X(a, STATIC, ONEOF, BYTES, (payload_variant,detail,payload_variant.detai #define meshtastic_GeoChat_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, STRING, message, 1) \ X(a, STATIC, OPTIONAL, STRING, to, 2) \ -X(a, STATIC, OPTIONAL, STRING, to_callsign, 3) +X(a, STATIC, OPTIONAL, STRING, to_callsign, 3) \ +X(a, STATIC, SINGULAR, STRING, receipt_for_uid, 4) \ +X(a, STATIC, SINGULAR, UENUM, receipt_type, 5) #define meshtastic_GeoChat_CALLBACK NULL #define meshtastic_GeoChat_DEFAULT NULL @@ -608,6 +1570,162 @@ X(a, STATIC, SINGULAR, STRING, cot_host_id, 9) #define meshtastic_AircraftTrack_CALLBACK NULL #define meshtastic_AircraftTrack_DEFAULT NULL +#define meshtastic_CotGeoPoint_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, SINT32, lat_delta_i, 1) \ +X(a, STATIC, SINGULAR, SINT32, lon_delta_i, 2) +#define meshtastic_CotGeoPoint_CALLBACK NULL +#define meshtastic_CotGeoPoint_DEFAULT NULL + +#define meshtastic_DrawnShape_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, kind, 1) \ +X(a, STATIC, SINGULAR, UENUM, style, 2) \ +X(a, STATIC, SINGULAR, UINT32, major_cm, 3) \ +X(a, STATIC, SINGULAR, UINT32, minor_cm, 4) \ +X(a, STATIC, SINGULAR, UINT32, angle_deg, 5) \ +X(a, STATIC, SINGULAR, UENUM, stroke_color, 6) \ +X(a, STATIC, SINGULAR, FIXED32, stroke_argb, 7) \ +X(a, STATIC, SINGULAR, UINT32, stroke_weight_x10, 8) \ +X(a, STATIC, SINGULAR, UENUM, fill_color, 9) \ +X(a, STATIC, SINGULAR, FIXED32, fill_argb, 10) \ +X(a, STATIC, SINGULAR, BOOL, labels_on, 11) \ +X(a, STATIC, REPEATED, MESSAGE, vertices, 12) \ +X(a, STATIC, SINGULAR, BOOL, truncated, 13) \ +X(a, STATIC, SINGULAR, UINT32, bullseye_distance_dm, 14) \ +X(a, STATIC, SINGULAR, UINT32, bullseye_bearing_ref, 15) \ +X(a, STATIC, SINGULAR, UINT32, bullseye_flags, 16) \ +X(a, STATIC, SINGULAR, STRING, bullseye_uid_ref, 17) +#define meshtastic_DrawnShape_CALLBACK NULL +#define meshtastic_DrawnShape_DEFAULT NULL +#define meshtastic_DrawnShape_vertices_MSGTYPE meshtastic_CotGeoPoint + +#define meshtastic_Marker_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, kind, 1) \ +X(a, STATIC, SINGULAR, UENUM, color, 2) \ +X(a, STATIC, SINGULAR, FIXED32, color_argb, 3) \ +X(a, STATIC, SINGULAR, BOOL, readiness, 4) \ +X(a, STATIC, SINGULAR, STRING, parent_uid, 5) \ +X(a, STATIC, SINGULAR, STRING, parent_type, 6) \ +X(a, STATIC, SINGULAR, STRING, parent_callsign, 7) \ +X(a, STATIC, SINGULAR, STRING, iconset, 8) +#define meshtastic_Marker_CALLBACK NULL +#define meshtastic_Marker_DEFAULT NULL + +#define meshtastic_RangeAndBearing_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, MESSAGE, anchor, 1) \ +X(a, STATIC, SINGULAR, STRING, anchor_uid, 2) \ +X(a, STATIC, SINGULAR, UINT32, range_cm, 3) \ +X(a, STATIC, SINGULAR, UINT32, bearing_cdeg, 4) \ +X(a, STATIC, SINGULAR, UENUM, stroke_color, 5) \ +X(a, STATIC, SINGULAR, FIXED32, stroke_argb, 6) \ +X(a, STATIC, SINGULAR, UINT32, stroke_weight_x10, 7) +#define meshtastic_RangeAndBearing_CALLBACK NULL +#define meshtastic_RangeAndBearing_DEFAULT NULL +#define meshtastic_RangeAndBearing_anchor_MSGTYPE meshtastic_CotGeoPoint + +#define meshtastic_Route_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, method, 1) \ +X(a, STATIC, SINGULAR, UENUM, direction, 2) \ +X(a, STATIC, SINGULAR, STRING, prefix, 3) \ +X(a, STATIC, SINGULAR, UINT32, stroke_weight_x10, 4) \ +X(a, STATIC, REPEATED, MESSAGE, links, 5) \ +X(a, STATIC, SINGULAR, BOOL, truncated, 6) +#define meshtastic_Route_CALLBACK NULL +#define meshtastic_Route_DEFAULT NULL +#define meshtastic_Route_links_MSGTYPE meshtastic_Route_Link + +#define meshtastic_Route_Link_FIELDLIST(X, a) \ +X(a, STATIC, OPTIONAL, MESSAGE, point, 1) \ +X(a, STATIC, SINGULAR, STRING, uid, 2) \ +X(a, STATIC, SINGULAR, STRING, callsign, 3) \ +X(a, STATIC, SINGULAR, UINT32, link_type, 4) +#define meshtastic_Route_Link_CALLBACK NULL +#define meshtastic_Route_Link_DEFAULT NULL +#define meshtastic_Route_Link_point_MSGTYPE meshtastic_CotGeoPoint + +#define meshtastic_CasevacReport_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, precedence, 1) \ +X(a, STATIC, SINGULAR, UINT32, equipment_flags, 2) \ +X(a, STATIC, SINGULAR, UINT32, litter_patients, 3) \ +X(a, STATIC, SINGULAR, UINT32, ambulatory_patients, 4) \ +X(a, STATIC, SINGULAR, UENUM, security, 5) \ +X(a, STATIC, SINGULAR, UENUM, hlz_marking, 6) \ +X(a, STATIC, SINGULAR, STRING, zone_marker, 7) \ +X(a, STATIC, SINGULAR, UINT32, us_military, 8) \ +X(a, STATIC, SINGULAR, UINT32, us_civilian, 9) \ +X(a, STATIC, SINGULAR, UINT32, non_us_military, 10) \ +X(a, STATIC, SINGULAR, UINT32, non_us_civilian, 11) \ +X(a, STATIC, SINGULAR, UINT32, epw, 12) \ +X(a, STATIC, SINGULAR, UINT32, child, 13) \ +X(a, STATIC, SINGULAR, UINT32, terrain_flags, 14) \ +X(a, STATIC, SINGULAR, STRING, frequency, 15) \ +X(a, CALLBACK, SINGULAR, STRING, title, 16) \ +X(a, CALLBACK, SINGULAR, STRING, medline_remarks, 17) \ +X(a, STATIC, SINGULAR, UINT32, urgent_count, 18) \ +X(a, STATIC, SINGULAR, UINT32, urgent_surgical_count, 19) \ +X(a, STATIC, SINGULAR, UINT32, priority_count, 20) \ +X(a, STATIC, SINGULAR, UINT32, routine_count, 21) \ +X(a, STATIC, SINGULAR, UINT32, convenience_count, 22) \ +X(a, CALLBACK, SINGULAR, STRING, equipment_detail, 23) \ +X(a, CALLBACK, SINGULAR, STRING, zone_protected_coord, 24) \ +X(a, CALLBACK, SINGULAR, STRING, terrain_slope_dir, 25) \ +X(a, CALLBACK, SINGULAR, STRING, terrain_other_detail, 26) \ +X(a, CALLBACK, SINGULAR, STRING, marked_by, 27) \ +X(a, CALLBACK, SINGULAR, STRING, obstacles, 28) \ +X(a, CALLBACK, SINGULAR, STRING, winds_are_from, 29) \ +X(a, CALLBACK, SINGULAR, STRING, friendlies, 30) \ +X(a, CALLBACK, SINGULAR, STRING, enemy, 31) \ +X(a, CALLBACK, SINGULAR, STRING, hlz_remarks, 32) \ +X(a, CALLBACK, REPEATED, MESSAGE, zmist, 33) +#define meshtastic_CasevacReport_CALLBACK pb_default_field_callback +#define meshtastic_CasevacReport_DEFAULT NULL +#define meshtastic_CasevacReport_zmist_MSGTYPE meshtastic_ZMistEntry + +#define meshtastic_ZMistEntry_FIELDLIST(X, a) \ +X(a, CALLBACK, SINGULAR, STRING, title, 1) \ +X(a, CALLBACK, SINGULAR, STRING, z, 2) \ +X(a, CALLBACK, SINGULAR, STRING, m, 3) \ +X(a, CALLBACK, SINGULAR, STRING, i, 4) \ +X(a, CALLBACK, SINGULAR, STRING, s, 5) \ +X(a, CALLBACK, SINGULAR, STRING, t, 6) +#define meshtastic_ZMistEntry_CALLBACK pb_default_field_callback +#define meshtastic_ZMistEntry_DEFAULT NULL + +#define meshtastic_EmergencyAlert_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, type, 1) \ +X(a, STATIC, SINGULAR, STRING, authoring_uid, 2) \ +X(a, STATIC, SINGULAR, STRING, cancel_reference_uid, 3) +#define meshtastic_EmergencyAlert_CALLBACK NULL +#define meshtastic_EmergencyAlert_DEFAULT NULL + +#define meshtastic_TaskRequest_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, STRING, task_type, 1) \ +X(a, STATIC, SINGULAR, STRING, target_uid, 2) \ +X(a, STATIC, SINGULAR, STRING, assignee_uid, 3) \ +X(a, STATIC, SINGULAR, UENUM, priority, 4) \ +X(a, STATIC, SINGULAR, UENUM, status, 5) \ +X(a, STATIC, SINGULAR, STRING, note, 6) +#define meshtastic_TaskRequest_CALLBACK NULL +#define meshtastic_TaskRequest_DEFAULT NULL + +#define meshtastic_TAKEnvironment_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, SINT32, temperature_c_x10, 1) \ +X(a, STATIC, SINGULAR, UINT32, wind_direction_deg, 2) \ +X(a, STATIC, SINGULAR, UINT32, wind_speed_cm_s, 3) +#define meshtastic_TAKEnvironment_CALLBACK NULL +#define meshtastic_TAKEnvironment_DEFAULT NULL + +#define meshtastic_SensorFov_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, type, 1) \ +X(a, STATIC, SINGULAR, UINT32, azimuth_deg, 2) \ +X(a, STATIC, OPTIONAL, UINT32, range_m, 3) \ +X(a, STATIC, SINGULAR, UINT32, fov_horizontal_deg, 4) \ +X(a, STATIC, SINGULAR, UINT32, fov_vertical_deg, 5) \ +X(a, STATIC, SINGULAR, SINT32, elevation_deg, 6) \ +X(a, STATIC, SINGULAR, SINT32, roll_deg, 7) \ +X(a, CALLBACK, SINGULAR, STRING, model, 8) +#define meshtastic_SensorFov_CALLBACK pb_default_field_callback +#define meshtastic_SensorFov_DEFAULT NULL + #define meshtastic_TAKPacketV2_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UENUM, cot_type_id, 1) \ X(a, STATIC, SINGULAR, UENUM, how, 2) \ @@ -632,14 +1750,33 @@ X(a, STATIC, SINGULAR, STRING, tak_os, 20) \ X(a, STATIC, SINGULAR, STRING, endpoint, 21) \ X(a, STATIC, SINGULAR, STRING, phone, 22) \ X(a, STATIC, SINGULAR, STRING, cot_type_str, 23) \ +X(a, CALLBACK, SINGULAR, STRING, remarks, 24) \ +X(a, STATIC, OPTIONAL, MESSAGE, environment, 25) \ +X(a, STATIC, OPTIONAL, MESSAGE, sensor_fov, 26) \ X(a, STATIC, ONEOF, BOOL, (payload_variant,pli,payload_variant.pli), 30) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,chat,payload_variant.chat), 31) \ X(a, STATIC, ONEOF, MESSAGE, (payload_variant,aircraft,payload_variant.aircraft), 32) \ -X(a, STATIC, ONEOF, BYTES, (payload_variant,raw_detail,payload_variant.raw_detail), 33) -#define meshtastic_TAKPacketV2_CALLBACK NULL +X(a, STATIC, ONEOF, BYTES, (payload_variant,raw_detail,payload_variant.raw_detail), 33) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,shape,payload_variant.shape), 34) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,marker,payload_variant.marker), 35) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,rab,payload_variant.rab), 36) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,route,payload_variant.route), 37) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,casevac,payload_variant.casevac), 38) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,emergency,payload_variant.emergency), 39) \ +X(a, STATIC, ONEOF, MESSAGE, (payload_variant,task,payload_variant.task), 40) +#define meshtastic_TAKPacketV2_CALLBACK pb_default_field_callback #define meshtastic_TAKPacketV2_DEFAULT NULL +#define meshtastic_TAKPacketV2_environment_MSGTYPE meshtastic_TAKEnvironment +#define meshtastic_TAKPacketV2_sensor_fov_MSGTYPE meshtastic_SensorFov #define meshtastic_TAKPacketV2_payload_variant_chat_MSGTYPE meshtastic_GeoChat #define meshtastic_TAKPacketV2_payload_variant_aircraft_MSGTYPE meshtastic_AircraftTrack +#define meshtastic_TAKPacketV2_payload_variant_shape_MSGTYPE meshtastic_DrawnShape +#define meshtastic_TAKPacketV2_payload_variant_marker_MSGTYPE meshtastic_Marker +#define meshtastic_TAKPacketV2_payload_variant_rab_MSGTYPE meshtastic_RangeAndBearing +#define meshtastic_TAKPacketV2_payload_variant_route_MSGTYPE meshtastic_Route +#define meshtastic_TAKPacketV2_payload_variant_casevac_MSGTYPE meshtastic_CasevacReport +#define meshtastic_TAKPacketV2_payload_variant_emergency_MSGTYPE meshtastic_EmergencyAlert +#define meshtastic_TAKPacketV2_payload_variant_task_MSGTYPE meshtastic_TaskRequest extern const pb_msgdesc_t meshtastic_TAKPacket_msg; extern const pb_msgdesc_t meshtastic_GeoChat_msg; @@ -648,6 +1785,18 @@ extern const pb_msgdesc_t meshtastic_Status_msg; extern const pb_msgdesc_t meshtastic_Contact_msg; extern const pb_msgdesc_t meshtastic_PLI_msg; extern const pb_msgdesc_t meshtastic_AircraftTrack_msg; +extern const pb_msgdesc_t meshtastic_CotGeoPoint_msg; +extern const pb_msgdesc_t meshtastic_DrawnShape_msg; +extern const pb_msgdesc_t meshtastic_Marker_msg; +extern const pb_msgdesc_t meshtastic_RangeAndBearing_msg; +extern const pb_msgdesc_t meshtastic_Route_msg; +extern const pb_msgdesc_t meshtastic_Route_Link_msg; +extern const pb_msgdesc_t meshtastic_CasevacReport_msg; +extern const pb_msgdesc_t meshtastic_ZMistEntry_msg; +extern const pb_msgdesc_t meshtastic_EmergencyAlert_msg; +extern const pb_msgdesc_t meshtastic_TaskRequest_msg; +extern const pb_msgdesc_t meshtastic_TAKEnvironment_msg; +extern const pb_msgdesc_t meshtastic_SensorFov_msg; extern const pb_msgdesc_t meshtastic_TAKPacketV2_msg; /* Defines for backwards compatibility with code written before nanopb-0.4.0 */ @@ -658,18 +1807,42 @@ extern const pb_msgdesc_t meshtastic_TAKPacketV2_msg; #define meshtastic_Contact_fields &meshtastic_Contact_msg #define meshtastic_PLI_fields &meshtastic_PLI_msg #define meshtastic_AircraftTrack_fields &meshtastic_AircraftTrack_msg +#define meshtastic_CotGeoPoint_fields &meshtastic_CotGeoPoint_msg +#define meshtastic_DrawnShape_fields &meshtastic_DrawnShape_msg +#define meshtastic_Marker_fields &meshtastic_Marker_msg +#define meshtastic_RangeAndBearing_fields &meshtastic_RangeAndBearing_msg +#define meshtastic_Route_fields &meshtastic_Route_msg +#define meshtastic_Route_Link_fields &meshtastic_Route_Link_msg +#define meshtastic_CasevacReport_fields &meshtastic_CasevacReport_msg +#define meshtastic_ZMistEntry_fields &meshtastic_ZMistEntry_msg +#define meshtastic_EmergencyAlert_fields &meshtastic_EmergencyAlert_msg +#define meshtastic_TaskRequest_fields &meshtastic_TaskRequest_msg +#define meshtastic_TAKEnvironment_fields &meshtastic_TAKEnvironment_msg +#define meshtastic_SensorFov_fields &meshtastic_SensorFov_msg #define meshtastic_TAKPacketV2_fields &meshtastic_TAKPacketV2_msg /* Maximum encoded size of messages (where known) */ -#define MESHTASTIC_MESHTASTIC_ATAK_PB_H_MAX_SIZE meshtastic_TAKPacketV2_size +/* meshtastic_CasevacReport_size depends on runtime parameters */ +/* meshtastic_ZMistEntry_size depends on runtime parameters */ +/* meshtastic_SensorFov_size depends on runtime parameters */ +/* meshtastic_TAKPacketV2_size depends on runtime parameters */ +#define MESHTASTIC_MESHTASTIC_ATAK_PB_H_MAX_SIZE meshtastic_Route_size #define meshtastic_AircraftTrack_size 134 #define meshtastic_Contact_size 242 -#define meshtastic_GeoChat_size 444 +#define meshtastic_CotGeoPoint_size 12 +#define meshtastic_DrawnShape_size 553 +#define meshtastic_EmergencyAlert_size 100 +#define meshtastic_GeoChat_size 495 #define meshtastic_Group_size 4 +#define meshtastic_Marker_size 191 #define meshtastic_PLI_size 31 +#define meshtastic_RangeAndBearing_size 84 +#define meshtastic_Route_Link_size 83 +#define meshtastic_Route_size 1379 #define meshtastic_Status_size 3 -#define meshtastic_TAKPacketV2_size 1027 -#define meshtastic_TAKPacket_size 705 +#define meshtastic_TAKEnvironment_size 18 +#define meshtastic_TAKPacket_size 756 +#define meshtastic_TaskRequest_size 132 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/mesh.pb.cpp b/src/mesh/generated/meshtastic/mesh.pb.cpp index 7f1a738c6..3648d8850 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.cpp +++ b/src/mesh/generated/meshtastic/mesh.pb.cpp @@ -27,6 +27,9 @@ PB_BIND(meshtastic_KeyVerification, meshtastic_KeyVerification, AUTO) PB_BIND(meshtastic_StoreForwardPlusPlus, meshtastic_StoreForwardPlusPlus, 2) +PB_BIND(meshtastic_RemoteShell, meshtastic_RemoteShell, AUTO) + + PB_BIND(meshtastic_Waypoint, meshtastic_Waypoint, AUTO) @@ -129,6 +132,8 @@ PB_BIND(meshtastic_ChunkedPayloadResponse, meshtastic_ChunkedPayloadResponse, AU + + diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index fc6931d73..d7ff32cb4 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -308,8 +308,13 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_TDISPLAY_S3_PRO = 126, /* Heltec Mesh Node T096 board features an nRF52840 CPU and a TFT screen. */ meshtastic_HardwareModel_HELTEC_MESH_NODE_T096 = 127, - /* Seeed studio T1000-E Pro tracker card. NRF52840 w/ LR2021 radio, GPS, button, buzzer, and sensors. */ + /* Seeed studio T1000-E Pro tracker card. NRF52840 w/ LR2021 radio, + GPS, button, buzzer, and sensors. */ meshtastic_HardwareModel_TRACKER_T1000_E_PRO = 128, + /* Elecrow ThinkNode M7, M8 and M9 */ + meshtastic_HardwareModel_THINKNODE_M7 = 129, + meshtastic_HardwareModel_THINKNODE_M8 = 130, + meshtastic_HardwareModel_THINKNODE_M9 = 131, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ @@ -513,6 +518,27 @@ typedef enum _meshtastic_StoreForwardPlusPlus_SFPP_message_type { meshtastic_StoreForwardPlusPlus_SFPP_message_type_LINK_PROVIDE_SECONDHALF = 6 } meshtastic_StoreForwardPlusPlus_SFPP_message_type; +/* Frame op code for PTY session control and stream transport. + + Values 1-63 are client->server requests. + Values 64-127 are server->client responses/events. */ +typedef enum _meshtastic_RemoteShell_OpCode { + meshtastic_RemoteShell_OpCode_OP_UNSET = 0, + /* Client -> server */ + meshtastic_RemoteShell_OpCode_OPEN = 1, + meshtastic_RemoteShell_OpCode_INPUT = 2, + meshtastic_RemoteShell_OpCode_RESIZE = 3, + meshtastic_RemoteShell_OpCode_CLOSE = 4, + meshtastic_RemoteShell_OpCode_PING = 5, + meshtastic_RemoteShell_OpCode_ACK = 6, + /* Server -> client */ + meshtastic_RemoteShell_OpCode_OPEN_OK = 64, + meshtastic_RemoteShell_OpCode_OUTPUT = 65, + meshtastic_RemoteShell_OpCode_CLOSED = 66, + meshtastic_RemoteShell_OpCode_ERROR = 67, + meshtastic_RemoteShell_OpCode_PONG = 68 +} meshtastic_RemoteShell_OpCode; + /* The priority of this message for sending. Higher priorities are sent first (when managing the transmit queue). This field is never sent over the air, it is only used internally inside of a local device node. @@ -845,6 +871,31 @@ typedef struct _meshtastic_StoreForwardPlusPlus { uint32_t chain_count; } meshtastic_StoreForwardPlusPlus; +typedef PB_BYTES_ARRAY_T(200) meshtastic_RemoteShell_payload_t; +/* The actual over-the-mesh message doing RemoteShell */ +typedef struct _meshtastic_RemoteShell { + /* Structured frame operation. */ + meshtastic_RemoteShell_OpCode op; + /* Logical PTY session identifier. */ + uint32_t session_id; + /* Monotonic sequence number for this frame. */ + uint32_t seq; + /* Cumulative ack sequence number. */ + uint32_t ack_seq; + /* Opaque bytes payload for INPUT/OUTPUT/ERROR and other frame bodies. */ + meshtastic_RemoteShell_payload_t payload; + /* Terminal size columns used for OPEN/RESIZE signaling. */ + uint32_t cols; + /* Terminal size rows used for OPEN/RESIZE signaling. */ + uint32_t rows; + /* Bit flags for protocol extensions. */ + uint32_t flags; + /* The last sequence number TX'd. */ + uint32_t last_tx_seq; + /* The last sequence number RX'd. */ + uint32_t last_rx_seq; +} meshtastic_RemoteShell; + /* Waypoint message, used to share arbitrary locations across the mesh */ typedef struct _meshtastic_Waypoint { /* Id of the waypoint */ @@ -1385,6 +1436,10 @@ extern "C" { #define _meshtastic_StoreForwardPlusPlus_SFPP_message_type_MAX meshtastic_StoreForwardPlusPlus_SFPP_message_type_LINK_PROVIDE_SECONDHALF #define _meshtastic_StoreForwardPlusPlus_SFPP_message_type_ARRAYSIZE ((meshtastic_StoreForwardPlusPlus_SFPP_message_type)(meshtastic_StoreForwardPlusPlus_SFPP_message_type_LINK_PROVIDE_SECONDHALF+1)) +#define _meshtastic_RemoteShell_OpCode_MIN meshtastic_RemoteShell_OpCode_OP_UNSET +#define _meshtastic_RemoteShell_OpCode_MAX meshtastic_RemoteShell_OpCode_PONG +#define _meshtastic_RemoteShell_OpCode_ARRAYSIZE ((meshtastic_RemoteShell_OpCode)(meshtastic_RemoteShell_OpCode_PONG+1)) + #define _meshtastic_MeshPacket_Priority_MIN meshtastic_MeshPacket_Priority_UNSET #define _meshtastic_MeshPacket_Priority_MAX meshtastic_MeshPacket_Priority_MAX #define _meshtastic_MeshPacket_Priority_ARRAYSIZE ((meshtastic_MeshPacket_Priority)(meshtastic_MeshPacket_Priority_MAX+1)) @@ -1415,6 +1470,8 @@ extern "C" { #define meshtastic_StoreForwardPlusPlus_sfpp_message_type_ENUMTYPE meshtastic_StoreForwardPlusPlus_SFPP_message_type +#define meshtastic_RemoteShell_op_ENUMTYPE meshtastic_RemoteShell_OpCode + @@ -1459,6 +1516,7 @@ extern "C" { #define meshtastic_Data_init_default {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} #define meshtastic_KeyVerification_init_default {0, {0, {0}}, {0, {0}}} #define meshtastic_StoreForwardPlusPlus_init_default {_meshtastic_StoreForwardPlusPlus_SFPP_message_type_MIN, {0, {0}}, {0, {0}}, {0, {0}}, {0, {0}}, 0, 0, 0, 0, 0} +#define meshtastic_RemoteShell_init_default {_meshtastic_RemoteShell_OpCode_MIN, 0, 0, 0, {0, {0}}, 0, 0, 0, 0, 0} #define meshtastic_Waypoint_init_default {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_StatusMessage_init_default {""} #define meshtastic_MqttClientProxyMessage_init_default {"", 0, {{0, {0}}}, 0} @@ -1492,6 +1550,7 @@ extern "C" { #define meshtastic_Data_init_zero {_meshtastic_PortNum_MIN, {0, {0}}, 0, 0, 0, 0, 0, 0, false, 0} #define meshtastic_KeyVerification_init_zero {0, {0, {0}}, {0, {0}}} #define meshtastic_StoreForwardPlusPlus_init_zero {_meshtastic_StoreForwardPlusPlus_SFPP_message_type_MIN, {0, {0}}, {0, {0}}, {0, {0}}, {0, {0}}, 0, 0, 0, 0, 0} +#define meshtastic_RemoteShell_init_zero {_meshtastic_RemoteShell_OpCode_MIN, 0, 0, 0, {0, {0}}, 0, 0, 0, 0, 0} #define meshtastic_Waypoint_init_zero {0, false, 0, false, 0, 0, 0, "", "", 0} #define meshtastic_StatusMessage_init_zero {""} #define meshtastic_MqttClientProxyMessage_init_zero {"", 0, {{0, {0}}}, 0} @@ -1581,6 +1640,16 @@ extern "C" { #define meshtastic_StoreForwardPlusPlus_encapsulated_from_tag 8 #define meshtastic_StoreForwardPlusPlus_encapsulated_rxtime_tag 9 #define meshtastic_StoreForwardPlusPlus_chain_count_tag 10 +#define meshtastic_RemoteShell_op_tag 1 +#define meshtastic_RemoteShell_session_id_tag 2 +#define meshtastic_RemoteShell_seq_tag 3 +#define meshtastic_RemoteShell_ack_seq_tag 4 +#define meshtastic_RemoteShell_payload_tag 5 +#define meshtastic_RemoteShell_cols_tag 6 +#define meshtastic_RemoteShell_rows_tag 7 +#define meshtastic_RemoteShell_flags_tag 8 +#define meshtastic_RemoteShell_last_tx_seq_tag 9 +#define meshtastic_RemoteShell_last_rx_seq_tag 10 #define meshtastic_Waypoint_id_tag 1 #define meshtastic_Waypoint_latitude_i_tag 2 #define meshtastic_Waypoint_longitude_i_tag 3 @@ -1813,6 +1882,20 @@ X(a, STATIC, SINGULAR, UINT32, chain_count, 10) #define meshtastic_StoreForwardPlusPlus_CALLBACK NULL #define meshtastic_StoreForwardPlusPlus_DEFAULT NULL +#define meshtastic_RemoteShell_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UENUM, op, 1) \ +X(a, STATIC, SINGULAR, UINT32, session_id, 2) \ +X(a, STATIC, SINGULAR, UINT32, seq, 3) \ +X(a, STATIC, SINGULAR, UINT32, ack_seq, 4) \ +X(a, STATIC, SINGULAR, BYTES, payload, 5) \ +X(a, STATIC, SINGULAR, UINT32, cols, 6) \ +X(a, STATIC, SINGULAR, UINT32, rows, 7) \ +X(a, STATIC, SINGULAR, UINT32, flags, 8) \ +X(a, STATIC, SINGULAR, UINT32, last_tx_seq, 9) \ +X(a, STATIC, SINGULAR, UINT32, last_rx_seq, 10) +#define meshtastic_RemoteShell_CALLBACK NULL +#define meshtastic_RemoteShell_DEFAULT NULL + #define meshtastic_Waypoint_FIELDLIST(X, a) \ X(a, STATIC, SINGULAR, UINT32, id, 1) \ X(a, STATIC, OPTIONAL, SFIXED32, latitude_i, 2) \ @@ -2095,6 +2178,7 @@ extern const pb_msgdesc_t meshtastic_Routing_msg; extern const pb_msgdesc_t meshtastic_Data_msg; extern const pb_msgdesc_t meshtastic_KeyVerification_msg; extern const pb_msgdesc_t meshtastic_StoreForwardPlusPlus_msg; +extern const pb_msgdesc_t meshtastic_RemoteShell_msg; extern const pb_msgdesc_t meshtastic_Waypoint_msg; extern const pb_msgdesc_t meshtastic_StatusMessage_msg; extern const pb_msgdesc_t meshtastic_MqttClientProxyMessage_msg; @@ -2130,6 +2214,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_Data_fields &meshtastic_Data_msg #define meshtastic_KeyVerification_fields &meshtastic_KeyVerification_msg #define meshtastic_StoreForwardPlusPlus_fields &meshtastic_StoreForwardPlusPlus_msg +#define meshtastic_RemoteShell_fields &meshtastic_RemoteShell_msg #define meshtastic_Waypoint_fields &meshtastic_Waypoint_msg #define meshtastic_StatusMessage_fields &meshtastic_StatusMessage_msg #define meshtastic_MqttClientProxyMessage_fields &meshtastic_MqttClientProxyMessage_msg @@ -2185,6 +2270,7 @@ extern const pb_msgdesc_t meshtastic_ChunkedPayloadResponse_msg; #define meshtastic_NodeRemoteHardwarePin_size 29 #define meshtastic_Position_size 144 #define meshtastic_QueueStatus_size 23 +#define meshtastic_RemoteShell_size 253 #define meshtastic_RouteDiscovery_size 256 #define meshtastic_Routing_size 259 #define meshtastic_StatusMessage_size 81 diff --git a/src/mesh/generated/meshtastic/portnums.pb.h b/src/mesh/generated/meshtastic/portnums.pb.h index a474e5b92..494ef4a54 100644 --- a/src/mesh/generated/meshtastic/portnums.pb.h +++ b/src/mesh/generated/meshtastic/portnums.pb.h @@ -76,6 +76,8 @@ typedef enum _meshtastic_PortNum { meshtastic_PortNum_ALERT_APP = 11, /* Module/port for handling key verification requests. */ meshtastic_PortNum_KEY_VERIFICATION_APP = 12, + /* Module/port for handling primitive remote shell access. */ + meshtastic_PortNum_REMOTE_SHELL_APP = 13, /* Provides a 'ping' service that replies to any packet it receives. Also serves as a small example module. ENCODING: ASCII Plaintext */ diff --git a/src/mesh/generated/meshtastic/telemetry.pb.h b/src/mesh/generated/meshtastic/telemetry.pb.h index f48d946a4..8c0fdd563 100644 --- a/src/mesh/generated/meshtastic/telemetry.pb.h +++ b/src/mesh/generated/meshtastic/telemetry.pb.h @@ -113,7 +113,9 @@ typedef enum _meshtastic_TelemetrySensorType { /* SCD30 CO2, humidity, temperature sensor */ meshtastic_TelemetrySensorType_SCD30 = 49, /* SHT family of sensors for temperature and humidity */ - meshtastic_TelemetrySensorType_SHTXX = 50 + meshtastic_TelemetrySensorType_SHTXX = 50, + /* DS248X Bridge for one-wire temperature sensors */ + meshtastic_TelemetrySensorType_DS248X = 51 } meshtastic_TelemetrySensorType; /* Struct definitions */ @@ -206,6 +208,9 @@ typedef struct _meshtastic_EnvironmentMetrics { /* Soil temperature measured (*C) */ bool has_soil_temperature; float soil_temperature; + /* One-wire temperature (*C) */ + pb_size_t one_wire_temperature_count; + float one_wire_temperature[8]; } meshtastic_EnvironmentMetrics; /* Power Metrics (voltage / current / etc) */ @@ -491,8 +496,8 @@ extern "C" { /* Helper constants for enums */ #define _meshtastic_TelemetrySensorType_MIN meshtastic_TelemetrySensorType_SENSOR_UNSET -#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_SHTXX -#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_SHTXX+1)) +#define _meshtastic_TelemetrySensorType_MAX meshtastic_TelemetrySensorType_DS248X +#define _meshtastic_TelemetrySensorType_ARRAYSIZE ((meshtastic_TelemetrySensorType)(meshtastic_TelemetrySensorType_DS248X+1)) @@ -508,7 +513,7 @@ extern "C" { /* Initializer values for message structs */ #define meshtastic_DeviceMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_EnvironmentMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_PowerMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_default {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_default {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} @@ -519,7 +524,7 @@ extern "C" { #define meshtastic_Nau7802Config_init_default {0, 0} #define meshtastic_SEN5XState_init_default {0, 0, 0, false, 0, false, 0, false, 0} #define meshtastic_DeviceMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0} -#define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} +#define meshtastic_EnvironmentMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, 0, {0, 0, 0, 0, 0, 0, 0, 0}} #define meshtastic_PowerMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_AirQualityMetrics_init_zero {false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0, false, 0} #define meshtastic_LocalStats_init_zero {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} @@ -558,6 +563,7 @@ extern "C" { #define meshtastic_EnvironmentMetrics_rainfall_24h_tag 20 #define meshtastic_EnvironmentMetrics_soil_moisture_tag 21 #define meshtastic_EnvironmentMetrics_soil_temperature_tag 22 +#define meshtastic_EnvironmentMetrics_one_wire_temperature_tag 23 #define meshtastic_PowerMetrics_ch1_voltage_tag 1 #define meshtastic_PowerMetrics_ch1_current_tag 2 #define meshtastic_PowerMetrics_ch2_voltage_tag 3 @@ -683,7 +689,8 @@ X(a, STATIC, OPTIONAL, FLOAT, radiation, 18) \ X(a, STATIC, OPTIONAL, FLOAT, rainfall_1h, 19) \ X(a, STATIC, OPTIONAL, FLOAT, rainfall_24h, 20) \ X(a, STATIC, OPTIONAL, UINT32, soil_moisture, 21) \ -X(a, STATIC, OPTIONAL, FLOAT, soil_temperature, 22) +X(a, STATIC, OPTIONAL, FLOAT, soil_temperature, 22) \ +X(a, STATIC, REPEATED, FLOAT, one_wire_temperature, 23) #define meshtastic_EnvironmentMetrics_CALLBACK NULL #define meshtastic_EnvironmentMetrics_DEFAULT NULL @@ -852,7 +859,7 @@ extern const pb_msgdesc_t meshtastic_SEN5XState_msg; #define MESHTASTIC_MESHTASTIC_TELEMETRY_PB_H_MAX_SIZE meshtastic_Telemetry_size #define meshtastic_AirQualityMetrics_size 150 #define meshtastic_DeviceMetrics_size 27 -#define meshtastic_EnvironmentMetrics_size 113 +#define meshtastic_EnvironmentMetrics_size 161 #define meshtastic_HealthMetrics_size 11 #define meshtastic_HostMetrics_size 264 #define meshtastic_LocalStats_size 87 From f14ef121ef2afb0b1a9fcd356cdf9aa7766ff55c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 20:19:30 -0500 Subject: [PATCH 069/150] Update meshtastic-st7789 digest to 92bae2e (#10182) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32s3/heltec_vision_master_t190/platformio.ini | 2 +- variants/esp32s3/m5stack_cardputer_adv/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_node_t114/platformio.ini | 2 +- variants/nrf52840/heltec_mesh_solar/platformio.ini | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/variants/esp32s3/heltec_vision_master_t190/platformio.ini b/variants/esp32s3/heltec_vision_master_t190/platformio.ini index be1ea192d..3dab9f93c 100644 --- a/variants/esp32s3/heltec_vision_master_t190/platformio.ini +++ b/variants/esp32s3/heltec_vision_master_t190/platformio.ini @@ -20,5 +20,5 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip + https://github.com/meshtastic/st7789/archive/92bae2e4a307afb430c3b0bc3d661c55ee1565f0.zip upload_speed = 921600 diff --git a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini index 7da039cd4..3b378ed94 100644 --- a/variants/esp32s3/m5stack_cardputer_adv/platformio.ini +++ b/variants/esp32s3/m5stack_cardputer_adv/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip + https://github.com/meshtastic/st7789/archive/92bae2e4a307afb430c3b0bc3d661c55ee1565f0.zip # renovate: datasource=github-tags depName=pschatzmann_arduino-audio-driver packageName=pschatzmann/arduino-audio-driver https://github.com/pschatzmann/arduino-audio-driver/archive/v0.2.1.zip # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix diff --git a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini index ef8bd4a17..c9f998240 100644 --- a/variants/nrf52840/heltec_mesh_node_t114/platformio.ini +++ b/variants/nrf52840/heltec_mesh_node_t114/platformio.ini @@ -23,4 +23,4 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/heltec_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip + https://github.com/meshtastic/st7789/archive/92bae2e4a307afb430c3b0bc3d661c55ee1565f0.zip diff --git a/variants/nrf52840/heltec_mesh_solar/platformio.ini b/variants/nrf52840/heltec_mesh_solar/platformio.ini index 1b15c0758..1b6f59a68 100644 --- a/variants/nrf52840/heltec_mesh_solar/platformio.ini +++ b/variants/nrf52840/heltec_mesh_solar/platformio.ini @@ -132,4 +132,4 @@ build_flags = ${heltec_mesh_solar_base.build_flags} lib_deps = ${heltec_mesh_solar_base.lib_deps} # renovate: datasource=git-refs depName=meshtastic-st7789 packageName=https://github.com/meshtastic/st7789 gitBranch=main - https://github.com/meshtastic/st7789/archive/a787beea5c6c8f864ba6787eb432bbefc575e6ad.zip + https://github.com/meshtastic/st7789/archive/92bae2e4a307afb430c3b0bc3d661c55ee1565f0.zip From 8e55a6e4c1c46500af964197f4c944226bfa03ff Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 20:19:52 -0500 Subject: [PATCH 070/150] Update meshtastic/device-ui digest to 5305670 (#10183) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 437e6f34c..3cd0cc9d0 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/1897dd17fceb1f101bb1a3245680aa3439edcfdd.zip + https://github.com/meshtastic/device-ui/archive/5305670b68eb5b92d14e62b5b536969ca4bb441f.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 2c8dec2fbdaea2860851841a0fbd38eb129da13c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 19:48:07 -0500 Subject: [PATCH 071/150] Update meshtastic/device-ui digest to 56e1da4 (#10195) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 3cd0cc9d0..4d66cf538 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/5305670b68eb5b92d14e62b5b536969ca4bb441f.zip + https://github.com/meshtastic/device-ui/archive/56e1da4e7d30abcd746a2092a30e422f8cf5fc2b.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From d31d0f85fe789649e292478ea426ea29e2744b19 Mon Sep 17 00:00:00 2001 From: lewisxhe Date: Wed, 21 Jan 2026 17:33:50 +0800 Subject: [PATCH 072/150] Added compatibility with LilyGo T-Deck-Pro V1.1 --- src/detect/ScanI2C.h | 3 +- src/detect/ScanI2CTwoWire.cpp | 26 +++- src/graphics/EInkDisplay2.cpp | 3 + src/main.cpp | 60 +++++++++ .../extra_variants/t_deck_pro/variant.cpp | 116 +++++++++++++++++- .../esp32s3/t-deck-pro-v1_1/pins_arduino.h | 19 +++ .../esp32s3/t-deck-pro-v1_1/platformio.ini | 41 +++++++ variants/esp32s3/t-deck-pro-v1_1/variant.h | 106 ++++++++++++++++ 8 files changed, 367 insertions(+), 7 deletions(-) create mode 100644 variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h create mode 100644 variants/esp32s3/t-deck-pro-v1_1/platformio.ini create mode 100644 variants/esp32s3/t-deck-pro-v1_1/variant.h diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index cc83a8d7b..5eb9217cc 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -94,7 +94,8 @@ class ScanI2C SFA30, CW2015, SCD30, - ADS1115 + ADS1115, + CST3530, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 2e00c11ce..e992fb276 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -585,7 +585,31 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize) SCAN_SIMPLE_CASE(PCT2075_ADDR, PCT2075, "PCT2075", (uint8_t)addr.address); SCAN_SIMPLE_CASE(SCD30_ADDR, SCD30, "SCD30", (uint8_t)addr.address); case CST328_ADDR: - // Do we have the CST328 or the CST226SE + // Do we have the CST328 or the CST226SE,CST3530 + { + // T-Deck pro V1.1 new touch panel use CST3530 + int retry = 5; + while (retry--) { + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0, 0x03, 0x00, 0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(r_cmd, sizeof(r_cmd)); + if (i2cBus->endTransmission() == 0) { + i2cBus->requestFrom((int)addr.address, 7); + i2cBus->readBytes(buffer, 7); + if (buffer[2] == 0xCA && buffer[3] == 0xCA) { + logFoundDevice("CST3530", (uint8_t)addr.address); + type = CST3530; + break; + } + } + uint8_t cmd1[] = {0xD0, 0x00, 0x04, 0x00}; + i2cBus->beginTransmission(addr.address); + i2cBus->write(cmd1, sizeof(cmd1)); + i2cBus->endTransmission(); + delay(50); + } + } registerValue = getRegisterValue(ScanI2CTwoWire::RegisterLocation(addr, 0xAB), 1); if (registerValue == 0xA9) { type = CST226SE; diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 704487bc8..96321f9c4 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -104,8 +104,11 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) // End the update process - virtual method, overridden in derived class void EInkDisplay::endUpdate() { +#ifndef EINK_NOT_HIBERNATE // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) adafruitDisplay->hibernate(); +#endif + } // Write the buffer to the display memory diff --git a/src/main.cpp b/src/main.cpp index 6f78c0b96..cc7d25ed9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -343,6 +343,66 @@ void setup() digitalWrite(BLE_LED, LED_STATE_OFF); #endif +#if defined(T_DECK) + // GPIO10 manages all peripheral power supplies + // Turn on peripheral power immediately after MUC starts. + // If some boards are turned on late, ESP32 will reset due to low voltage. + // ESP32-C3(Keyboard) , MAX98357A(Audio Power Amplifier) , + // TF Card , Display backlight(AW9364DNR) , AN48841B(Trackball) , ES7210(Decoder) + pinMode(KB_POWERON, OUTPUT); + digitalWrite(KB_POWERON, HIGH); + // T-Deck has all three SPI peripherals (TFT, SD, LoRa) attached to the same SPI bus + // We need to initialize all CS pins in advance otherwise there will be SPI communication issues + // e.g. when detecting the SD card + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(TFT_CS, OUTPUT); + digitalWrite(TFT_CS, HIGH); + delay(100); +#elif defined(T_DECK_PRO) + pinMode(LORA_EN, OUTPUT); + digitalWrite(LORA_EN, HIGH); + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(PIN_EINK_CS, OUTPUT); + digitalWrite(PIN_EINK_CS, HIGH); + pinMode(PIN_EINK_RES, OUTPUT); + digitalWrite(PIN_EINK_RES, HIGH); + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); +#elif defined(T_LORA_PAGER) + pinMode(LORA_CS, OUTPUT); + digitalWrite(LORA_CS, HIGH); + pinMode(SDCARD_CS, OUTPUT); + digitalWrite(SDCARD_CS, HIGH); + pinMode(TFT_CS, OUTPUT); + digitalWrite(TFT_CS, HIGH); + pinMode(KB_INT, INPUT_PULLUP); + // io expander + io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); + io.pinMode(EXPANDS_DRV_EN, OUTPUT); + io.digitalWrite(EXPANDS_DRV_EN, HIGH); + io.pinMode(EXPANDS_AMP_EN, OUTPUT); + io.digitalWrite(EXPANDS_AMP_EN, LOW); + io.pinMode(EXPANDS_LORA_EN, OUTPUT); + io.digitalWrite(EXPANDS_LORA_EN, HIGH); + io.pinMode(EXPANDS_GPS_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPS_EN, HIGH); + io.pinMode(EXPANDS_KB_EN, OUTPUT); + io.digitalWrite(EXPANDS_KB_EN, HIGH); + io.pinMode(EXPANDS_SD_EN, OUTPUT); + io.digitalWrite(EXPANDS_SD_EN, HIGH); + io.pinMode(EXPANDS_GPIO_EN, OUTPUT); + io.digitalWrite(EXPANDS_GPIO_EN, HIGH); + io.pinMode(EXPANDS_SD_PULLEN, INPUT); +#elif defined(HACKADAY_COMMUNICATOR) + pinMode(KB_INT, INPUT); +#endif + concurrency::hasBeenSetup = true; #if HAS_SCREEN meshtastic_Config_DisplayConfig_OledType screen_model = diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index eae9335ce..77fba53b9 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -8,20 +8,126 @@ CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, CST328_PIN_INT); +static bool is_cst3530 = false; +volatile bool touch_isr = false; +#define CST3530_ADDR 0x1A + +bool read_cst3530_touch(int16_t *x, int16_t *y) { + uint8_t buffer[9] = {0}; + uint8_t r_cmd[] = {0xD0, 0x07, 0x00, 0x00}; + uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 I2C send addr failed"); + return false; + } + + int read_len = Wire.requestFrom((int)CST3530_ADDR, sizeof(buffer)); + if (read_len != sizeof(buffer)) { + LOG_DEBUG("CST3530 read len error: %d (expect 9)", read_len); + return false; + } + int actual_read = Wire.readBytes(buffer, sizeof(buffer)); + if (actual_read != sizeof(buffer)) { + LOG_DEBUG("CST3530 read bytes error: %d (expect 9)", actual_read); + return false; + } + + uint8_t report_typ = buffer[2]; + if (report_typ != 0xFF) { + return false; + } + + uint8_t touch_points = buffer[3] & 0x0F; + if (touch_points == 0 || touch_points > 1) { + LOG_DEBUG("CST3530 touch points invalid: %d", touch_points); + return false; + } + + *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); + *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); + + // LOG_DEBUG("CST3530 touch: num:%d x=%d,y=%d", touch_points, *x, *y); + + Wire.beginTransmission(CST3530_ADDR); + Wire.write(clear_cmd, sizeof(clear_cmd)); + if (Wire.endTransmission() != 0) { + LOG_DEBUG("CST3530 clear cmd failed"); + } + + return true; +} + bool readTouch(int16_t *x, int16_t *y) { - if (tsPanel.getTouches()) { - *x = tsPanel.getPoint(0).x; - *y = tsPanel.getPoint(0).y; - return true; + + if(is_cst3530){ + if(touch_isr){ + touch_isr = false; + return read_cst3530_touch(x, y); + } + return false; + }else{ + if (tsPanel.getTouches()) { + *x = tsPanel.getPoint(0).x; + *y = tsPanel.getPoint(0).y; + return true; + } } return false; } + +static void touchInterruptHandler(){ + touch_isr = true; +} + // T-Deck Pro specific init void lateInitVariant() { - tsPanel.begin(); + // Reset touch + pinMode(CST328_PIN_RST, OUTPUT); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + digitalWrite(CST328_PIN_RST, LOW); + delay(80); + digitalWrite(CST328_PIN_RST, HIGH); + delay(20); + + int retry = 5; + uint8_t buffer[7]; + uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + + // Probe touch chip + while(retry--) { + Wire.beginTransmission(CST3530_ADDR); + Wire.write(r_cmd, sizeof(r_cmd)); + if(Wire.endTransmission() == 0){ + Wire.requestFrom((int)CST3530_ADDR,7); + Wire.readBytes(buffer,7); + if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + LOG_DEBUG("CST3530 detected"); + is_cst3530 = true; + + // The CST3530 will automatically enter sleep mode; + // polling should not be used, but rather an interrupt method should be employed. + pinMode(CST328_PIN_INT, INPUT); + attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchInterruptHandler, FALLING); + + break; + }else{ + LOG_DEBUG("CST3530 not response ~!"); + } + } + uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + Wire.beginTransmission(CST3530_ADDR); + Wire.write(cmd1, sizeof(cmd1)); + Wire.endTransmission(); + delay(50); + } + touchScreenImpl1 = new TouchScreenImpl1(EINK_WIDTH, EINK_HEIGHT, readTouch); touchScreenImpl1->init(); } diff --git a/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h new file mode 100644 index 000000000..af0ba80b3 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/pins_arduino.h @@ -0,0 +1,19 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +// used for keyboard, touch controller, beam sensor, and gyroscope +static const uint8_t SDA = 13; +static const uint8_t SCL = 14; + +// Default SPI will be mapped to Radio +static const uint8_t SS = 3; +static const uint8_t MOSI = 33; +static const uint8_t MISO = 47; +static const uint8_t SCK = 36; + +#endif /* Pins_Arduino_h */ diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini new file mode 100644 index 000000000..b76522934 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -0,0 +1,41 @@ +[env:t-deck-pro-v1_1] +custom_meshtastic_hw_model = 102 +custom_meshtastic_hw_model_slug = T_DECK_PRO +custom_meshtastic_architecture = esp32-s3 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = LILYGO T-Deck Pro +custom_meshtastic_images = tdeck_pro.svg +custom_meshtastic_tags = LilyGo +custom_meshtastic_requires_dfu = true +custom_meshtastic_partition_scheme = 16MB + +extends = esp32s3_base +board = t-deck-pro +board_check = true +upload_protocol = esptool + +build_flags = + ${esp32s3_base.build_flags} -I variants/esp32s3/t-deck-pro-v1_1 + -D T_DECK_PRO + -D USE_EINK + -D EINK_DISPLAY_MODEL=GxEPD2_310_GDEQ031T10 + -D EINK_WIDTH=240 + -D EINK_HEIGHT=320 + ;-D USE_EINK_DYNAMICDISPLAY ; Enable Dynamic EInk + -D EINK_LIMIT_FASTREFRESH=10 ; How many consecutive fast-refreshes are permitted + -D EINK_LIMIT_GHOSTING_PX=2000 ; (Optional) How much image ghosting is tolerated + -D EINK_NOT_HIBERNATE ; Disable hibernate to avoid issues with elink + +lib_deps = + ${esp32s3_base.lib_deps} + # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 + zinggjm/GxEPD2@1.6.5 + # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main + https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip + # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 + https://github.com/CIRCUITSTATE/CSE_CST328/archive/refs/tags/v0.0.4.zip + # renovate: datasource=git-refs depName=BQ27220 packageName=https://github.com/mverch67/BQ27220 gitBranch=main + https://github.com/mverch67/BQ27220/archive/07d92be846abd8a0258a50c23198dac0858b22ed.zip + # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library + adafruit/Adafruit DRV2605 Library@1.2.4 diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h new file mode 100644 index 000000000..8584fd8a1 --- /dev/null +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -0,0 +1,106 @@ +// Display (E-Ink) +#define PIN_EINK_CS 34 +#define PIN_EINK_BUSY 37 +#define PIN_EINK_DC 35 +#define PIN_EINK_RES 16 +#define PIN_EINK_SCLK 36 +#define PIN_EINK_MOSI 47 +#define TFT_BL 45 // option , default not backlight + +#define I2C_SDA SDA +#define I2C_SCL SCL + +// CST328 touch screen (implementation in src/platform/extra_variants/t_deck_pro/variant.cpp) +#define HAS_TOUCHSCREEN 1 +#define CST328_PIN_INT 12 +#define CST328_PIN_RST 38 + +#define USE_POWERSAVE +#define SLEEP_TIME 120 + +// GNNS +#define HAS_GPS 1 +#define GPS_BAUDRATE 38400 +#define PIN_GPS_EN 39 +#define GPS_EN_ACTIVE 1 +#define GPS_RX_PIN 44 +#define GPS_TX_PIN 43 +#define PIN_GPS_PPS 1 + +#define BUTTON_PIN 0 + +// vibration motor +#define HAS_DRV2605 +#define PIN_DRV_EN 2 + +// Have SPI interface SD card slot +#define HAS_SDCARD +#define SDCARD_USE_SPI1 +#define SPI_MOSI (33) +#define SPI_SCK (36) +#define SPI_MISO (47) +#define SPI_CS (48) +#define SDCARD_CS SPI_CS +#define SD_SPI_FREQUENCY 75000000U + +// TCA8418 keyboard +#define KB_BL_PIN 42 +#define CANNED_MESSAGE_MODULE_ENABLE 1 + +// microphone PCM5102A +#define PCM5102A_SCK 47 +#define PCM5102A_DIN 17 +#define PCM5102A_LRCK 18 + +// LTR_553ALS light sensor +#define HAS_LTR553ALS + +// gyroscope BHI260AP +// #define BOARD_1V8_EN 38 //Deck-Pro remove 1.8v en pin +#define HAS_BHI260AP + +// battery charger BQ25896 +#define HAS_PPM 1 +#define XPOWERS_CHIP_BQ25896 + +// battery quality management BQ27220 +#define HAS_BQ27220 1 +#define BQ27220_I2C_SDA SDA +#define BQ27220_I2C_SCL SCL +#define BQ27220_DESIGN_CAPACITY 1400 + +// LoRa +#define USE_SX1262 +#define USE_SX1268 + +#define LORA_EN 46 // LoRa enable pin +#define LORA_SCK 36 +#define LORA_MISO 47 +#define LORA_MOSI 33 +#define LORA_CS 3 + +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 4 +#define LORA_DIO1 5 // SX1262 IRQ +#define LORA_DIO2 6 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TXCO is enabled + +#define SX126X_CS LORA_CS // FIXME - we really should define LORA_CS instead +#define SX126X_DIO1 LORA_DIO1 +#define SX126X_BUSY LORA_DIO2 +#define SX126X_RESET LORA_RESET +// Not really an E22 but TTGO seems to be trying to clone that +#define SX126X_DIO2_AS_RF_SWITCH +#define SX126X_DIO3_TCXO_VOLTAGE 2.4 +// Internally the TTGO module hooks the SX1262-DIO2 in to control the TX/RX switch (which is the default for the sx1262interface +// code) + +#define MODEM_POWER_EN 41 +#define MODEM_PWRKEY 40 +#define MODEM_RST 9 +#define MODEM_RI 7 +#define MODEM_DTR 8 +#define MODEM_RX 10 +#define MODEM_TX 11 + +#define HAS_PHYSICAL_KEYBOARD 1 \ No newline at end of file From d0cd8ec366402e260df6761220eeb71bacea5d91 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:19 -0500 Subject: [PATCH 073/150] Update variants/esp32s3/t-deck-pro-v1_1/variant.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/variant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h index 8584fd8a1..af761d64d 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/variant.h +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -18,7 +18,7 @@ #define USE_POWERSAVE #define SLEEP_TIME 120 -// GNNS +// GNSS #define HAS_GPS 1 #define GPS_BAUDRATE 38400 #define PIN_GPS_EN 39 From 2beebea453a0e6e7cc82cad6769eb528ff0792fa Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:35 -0500 Subject: [PATCH 074/150] Update src/platform/extra_variants/t_deck_pro/variant.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/platform/extra_variants/t_deck_pro/variant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index 77fba53b9..ff8e34ebd 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -80,7 +80,7 @@ bool readTouch(int16_t *x, int16_t *y) } -static void touchInterruptHandler(){ +static void IRAM_ATTR touchInterruptHandler(){ touch_isr = true; } From 84bb90943721bb399ee41e798aaa5f277e8fb5f8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:48:50 -0500 Subject: [PATCH 075/150] Update variants/esp32s3/t-deck-pro-v1_1/platformio.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- variants/esp32s3/t-deck-pro-v1_1/platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini index b76522934..1a9b20f76 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -30,7 +30,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.5 + zinggjm/GxEPD2@1.6.8 # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 From 9e26cc3795365251b2d4dbc32c46a1a9cbe964fb Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:08 -0500 Subject: [PATCH 076/150] Update src/main.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index cc7d25ed9..76b9bb13a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -370,8 +370,10 @@ void setup() digitalWrite(SDCARD_CS, HIGH); pinMode(PIN_EINK_CS, OUTPUT); digitalWrite(PIN_EINK_CS, HIGH); +#if PIN_EINK_RES >= 0 pinMode(PIN_EINK_RES, OUTPUT); digitalWrite(PIN_EINK_RES, HIGH); +#endif pinMode(CST328_PIN_RST, OUTPUT); digitalWrite(CST328_PIN_RST, HIGH); #elif defined(T_LORA_PAGER) From a277108c842fe4f97a1ed09938d295f6c777934c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 16 Apr 2026 07:49:34 -0500 Subject: [PATCH 077/150] Update src/graphics/EInkDisplay2.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/graphics/EInkDisplay2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/graphics/EInkDisplay2.cpp b/src/graphics/EInkDisplay2.cpp index 96321f9c4..28b956bb1 100644 --- a/src/graphics/EInkDisplay2.cpp +++ b/src/graphics/EInkDisplay2.cpp @@ -105,10 +105,12 @@ bool EInkDisplay::forceDisplay(uint32_t msecLimit) void EInkDisplay::endUpdate() { #ifndef EINK_NOT_HIBERNATE - // Power off display hardware, then deep-sleep (Except Wireless Paper V1.1, no deep-sleep) + // By default, power off the E-Ink display hardware and enter hibernate(). + // Boards/panels that define EINK_NOT_HIBERNATE intentionally skip this step. + // Skipping hibernate() can help avoid panel-specific wake/refresh or ghosting issues, + // but it typically trades lower power savings for that compatibility. adafruitDisplay->hibernate(); #endif - } // Write the buffer to the display memory From e589de2d6e86cede7890acc468d9e1693190695f Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 18 Apr 2026 11:12:05 -0500 Subject: [PATCH 078/150] Tronk --- .../extra_variants/t_deck_pro/variant.cpp | 45 ++++++++++--------- variants/esp32s3/t-deck-pro-v1_1/variant.h | 2 +- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/platform/extra_variants/t_deck_pro/variant.cpp b/src/platform/extra_variants/t_deck_pro/variant.cpp index ff8e34ebd..2915ff363 100644 --- a/src/platform/extra_variants/t_deck_pro/variant.cpp +++ b/src/platform/extra_variants/t_deck_pro/variant.cpp @@ -10,13 +10,14 @@ CSE_CST328 tsPanel = CSE_CST328(EINK_WIDTH, EINK_HEIGHT, &Wire, CST328_PIN_RST, static bool is_cst3530 = false; volatile bool touch_isr = false; -#define CST3530_ADDR 0x1A +#define CST3530_ADDR 0x1A -bool read_cst3530_touch(int16_t *x, int16_t *y) { +bool read_cst3530_touch(int16_t *x, int16_t *y) +{ uint8_t buffer[9] = {0}; uint8_t r_cmd[] = {0xD0, 0x07, 0x00, 0x00}; - uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; - + uint8_t clear_cmd[] = {0xD0, 0x00, 0x02, 0xAB}; + Wire.beginTransmission(CST3530_ADDR); Wire.write(r_cmd, sizeof(r_cmd)); if (Wire.endTransmission() != 0) { @@ -41,13 +42,13 @@ bool read_cst3530_touch(int16_t *x, int16_t *y) { } uint8_t touch_points = buffer[3] & 0x0F; - if (touch_points == 0 || touch_points > 1) { + if (touch_points == 0 || touch_points > 1) { LOG_DEBUG("CST3530 touch points invalid: %d", touch_points); return false; } - *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); - *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); + *x = buffer[4] + ((uint16_t)(buffer[7] & 0x0F) << 8); + *y = buffer[5] + ((uint16_t)(buffer[7] & 0xF0) << 4); // LOG_DEBUG("CST3530 touch: num:%d x=%d,y=%d", touch_points, *x, *y); @@ -63,13 +64,13 @@ bool read_cst3530_touch(int16_t *x, int16_t *y) { bool readTouch(int16_t *x, int16_t *y) { - if(is_cst3530){ - if(touch_isr){ + if (is_cst3530) { + if (touch_isr) { touch_isr = false; return read_cst3530_touch(x, y); } return false; - }else{ + } else { if (tsPanel.getTouches()) { *x = tsPanel.getPoint(0).x; *y = tsPanel.getPoint(0).y; @@ -79,8 +80,8 @@ bool readTouch(int16_t *x, int16_t *y) return false; } - -static void IRAM_ATTR touchInterruptHandler(){ +static void IRAM_ATTR touchInterruptHandler() +{ touch_isr = true; } @@ -98,30 +99,30 @@ void lateInitVariant() int retry = 5; uint8_t buffer[7]; - uint8_t r_cmd[] = {0x0d0,0x03,0x00,0x00}; + uint8_t r_cmd[] = {0x0d0, 0x03, 0x00, 0x00}; // Probe touch chip - while(retry--) { + while (retry--) { Wire.beginTransmission(CST3530_ADDR); Wire.write(r_cmd, sizeof(r_cmd)); - if(Wire.endTransmission() == 0){ - Wire.requestFrom((int)CST3530_ADDR,7); - Wire.readBytes(buffer,7); - if(buffer[2] == 0xCA && buffer[3] == 0xCA){ + if (Wire.endTransmission() == 0) { + Wire.requestFrom((int)CST3530_ADDR, 7); + Wire.readBytes(buffer, 7); + if (buffer[2] == 0xCA && buffer[3] == 0xCA) { LOG_DEBUG("CST3530 detected"); is_cst3530 = true; - // The CST3530 will automatically enter sleep mode; - // polling should not be used, but rather an interrupt method should be employed. + // The CST3530 will automatically enter sleep mode; + // polling should not be used, but rather an interrupt method should be employed. pinMode(CST328_PIN_INT, INPUT); attachInterrupt(digitalPinToInterrupt(CST328_PIN_INT), touchInterruptHandler, FALLING); break; - }else{ + } else { LOG_DEBUG("CST3530 not response ~!"); } } - uint8_t cmd1[] = {0xD0,0x00,0x04,0x00}; + uint8_t cmd1[] = {0xD0, 0x00, 0x04, 0x00}; Wire.beginTransmission(CST3530_ADDR); Wire.write(cmd1, sizeof(cmd1)); Wire.endTransmission(); diff --git a/variants/esp32s3/t-deck-pro-v1_1/variant.h b/variants/esp32s3/t-deck-pro-v1_1/variant.h index af761d64d..d7accfe82 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/variant.h +++ b/variants/esp32s3/t-deck-pro-v1_1/variant.h @@ -5,7 +5,7 @@ #define PIN_EINK_RES 16 #define PIN_EINK_SCLK 36 #define PIN_EINK_MOSI 47 -#define TFT_BL 45 // option , default not backlight +#define TFT_BL 45 // option , default not backlight #define I2C_SDA SDA #define I2C_SCL SCL From 6b15571e1407e53f6fe371ca611029f83d524693 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 18 Apr 2026 08:17:44 -0500 Subject: [PATCH 079/150] Add MCP server for interacting with meshtastic devices and testing framework / TUI (#10194) * Start of MCP server and test suite * Add MCP server for interacting with meshtastic devices and testing framework / TUI * Update mcp-server/README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix mcp-server review feedback from thread Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/91dc128a-ed50-4d07-8bb2-3dc6623a05f7 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Enhance StreamAPI and PhoneAPI for improved log record handling and concurrency control * Semgrep fixes * Trunk and semgrep fixes * optimize pio streaming tee file writes Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * chore: remove redundant log handle assignment Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/04e26c6b-6a2b-45be-bbeb-79ae4d0be633 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Consolidate type imports and remove placeholder test files * Add tests for config persistence and more exchange messages * Refactor position test to validate on-demand request/reply behavior * Remove position request/reply test and update README for telemetry behavior * Fix transmit history file to get removed on factory reset --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- .claude/commands/README.md | 49 + .claude/commands/diagnose.md | 55 + .claude/commands/repro.md | 65 + .claude/commands/test.md | 42 + .github/copilot-instructions.md | 160 ++ .github/prompts/mcp-diagnose.prompt.md | 57 + .github/prompts/mcp-repro.prompt.md | 67 + .github/prompts/mcp-test.prompt.md | 51 + .gitignore | 2 + .mcp.json | 11 + .trunk/configs/.bandit | 28 +- AGENTS.md | 113 ++ mcp-server/.gitignore | 26 + mcp-server/README.md | 270 +++ mcp-server/pyproject.toml | 39 + mcp-server/run-tests.sh | 236 +++ mcp-server/src/meshtastic_mcp/__init__.py | 3 + mcp-server/src/meshtastic_mcp/__main__.py | 11 + mcp-server/src/meshtastic_mcp/admin.py | 377 ++++ mcp-server/src/meshtastic_mcp/boards.py | 159 ++ mcp-server/src/meshtastic_mcp/cli/__init__.py | 6 + .../src/meshtastic_mcp/cli/_flashlog.py | 73 + mcp-server/src/meshtastic_mcp/cli/_fwlog.py | 96 + mcp-server/src/meshtastic_mcp/cli/_history.py | 127 ++ .../src/meshtastic_mcp/cli/_reproducer.py | 214 ++ mcp-server/src/meshtastic_mcp/cli/test_tui.py | 1782 +++++++++++++++++ mcp-server/src/meshtastic_mcp/config.py | 137 ++ mcp-server/src/meshtastic_mcp/connection.py | 84 + mcp-server/src/meshtastic_mcp/devices.py | 75 + mcp-server/src/meshtastic_mcp/flash.py | 447 +++++ mcp-server/src/meshtastic_mcp/hw_tools.py | 243 +++ mcp-server/src/meshtastic_mcp/info.py | 103 + mcp-server/src/meshtastic_mcp/pio.py | 295 +++ mcp-server/src/meshtastic_mcp/registry.py | 98 + .../src/meshtastic_mcp/serial_session.py | 216 ++ mcp-server/src/meshtastic_mcp/server.py | 590 ++++++ mcp-server/src/meshtastic_mcp/userprefs.py | 532 +++++ mcp-server/tests/README.md | 116 ++ mcp-server/tests/__init__.py | 0 mcp-server/tests/_port_discovery.py | 118 ++ mcp-server/tests/admin/__init__.py | 0 .../tests/admin/test_channel_url_roundtrip.py | 57 + .../tests/admin/test_config_roundtrip.py | 106 + .../tests/admin/test_owner_survives_reboot.py | 59 + mcp-server/tests/conftest.py | 1041 ++++++++++ mcp-server/tests/fleet/__init__.py | 0 .../fleet/test_psk_seed_isolates_runs.py | 43 + mcp-server/tests/mesh/__init__.py | 0 mcp-server/tests/mesh/_receive.py | 220 ++ mcp-server/tests/mesh/test_bidirectional.py | 83 + .../tests/mesh/test_broadcast_delivers.py | 45 + mcp-server/tests/mesh/test_direct_with_ack.py | 105 + mcp-server/tests/mesh/test_mesh_formation.py | 39 + mcp-server/tests/mesh/test_traceroute.py | 147 ++ mcp-server/tests/monitor/__init__.py | 0 .../tests/monitor/test_boot_log_no_panic.py | 63 + mcp-server/tests/provisioning/__init__.py | 0 .../provisioning/test_admin_key_baked.py | 83 + .../test_bake_region_modem_slot.py | 60 + .../test_unset_region_blocks_tx.py | 108 + .../test_userprefs_survive_factory_reset.py | 90 + mcp-server/tests/telemetry/__init__.py | 0 .../test_device_telemetry_broadcast.py | 77 + .../telemetry/test_telemetry_request_reply.py | 187 ++ mcp-server/tests/test_00_bake.py | 291 +++ mcp-server/tests/tool_coverage.py | 145 ++ mcp-server/tests/unit/__init__.py | 0 mcp-server/tests/unit/test_boards.py | 72 + mcp-server/tests/unit/test_pio_wrapper.py | 61 + mcp-server/tests/unit/test_testing_profile.py | 120 ++ mcp-server/tests/unit/test_userprefs_parse.py | 115 ++ src/mesh/NodeDB.cpp | 7 + src/mesh/PhoneAPI.cpp | 20 +- src/mesh/StreamAPI.cpp | 45 +- src/mesh/StreamAPI.h | 24 + src/mesh/TransmitHistory.cpp | 21 + src/mesh/TransmitHistory.h | 7 + 77 files changed, 10701 insertions(+), 13 deletions(-) create mode 100644 .claude/commands/README.md create mode 100644 .claude/commands/diagnose.md create mode 100644 .claude/commands/repro.md create mode 100644 .claude/commands/test.md create mode 100644 .github/prompts/mcp-diagnose.prompt.md create mode 100644 .github/prompts/mcp-repro.prompt.md create mode 100644 .github/prompts/mcp-test.prompt.md create mode 100644 .mcp.json create mode 100644 AGENTS.md create mode 100644 mcp-server/.gitignore create mode 100644 mcp-server/README.md create mode 100644 mcp-server/pyproject.toml create mode 100755 mcp-server/run-tests.sh create mode 100644 mcp-server/src/meshtastic_mcp/__init__.py create mode 100644 mcp-server/src/meshtastic_mcp/__main__.py create mode 100644 mcp-server/src/meshtastic_mcp/admin.py create mode 100644 mcp-server/src/meshtastic_mcp/boards.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/__init__.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/_flashlog.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/_fwlog.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/_history.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/_reproducer.py create mode 100644 mcp-server/src/meshtastic_mcp/cli/test_tui.py create mode 100644 mcp-server/src/meshtastic_mcp/config.py create mode 100644 mcp-server/src/meshtastic_mcp/connection.py create mode 100644 mcp-server/src/meshtastic_mcp/devices.py create mode 100644 mcp-server/src/meshtastic_mcp/flash.py create mode 100644 mcp-server/src/meshtastic_mcp/hw_tools.py create mode 100644 mcp-server/src/meshtastic_mcp/info.py create mode 100644 mcp-server/src/meshtastic_mcp/pio.py create mode 100644 mcp-server/src/meshtastic_mcp/registry.py create mode 100644 mcp-server/src/meshtastic_mcp/serial_session.py create mode 100644 mcp-server/src/meshtastic_mcp/server.py create mode 100644 mcp-server/src/meshtastic_mcp/userprefs.py create mode 100644 mcp-server/tests/README.md create mode 100644 mcp-server/tests/__init__.py create mode 100644 mcp-server/tests/_port_discovery.py create mode 100644 mcp-server/tests/admin/__init__.py create mode 100644 mcp-server/tests/admin/test_channel_url_roundtrip.py create mode 100644 mcp-server/tests/admin/test_config_roundtrip.py create mode 100644 mcp-server/tests/admin/test_owner_survives_reboot.py create mode 100644 mcp-server/tests/conftest.py create mode 100644 mcp-server/tests/fleet/__init__.py create mode 100644 mcp-server/tests/fleet/test_psk_seed_isolates_runs.py create mode 100644 mcp-server/tests/mesh/__init__.py create mode 100644 mcp-server/tests/mesh/_receive.py create mode 100644 mcp-server/tests/mesh/test_bidirectional.py create mode 100644 mcp-server/tests/mesh/test_broadcast_delivers.py create mode 100644 mcp-server/tests/mesh/test_direct_with_ack.py create mode 100644 mcp-server/tests/mesh/test_mesh_formation.py create mode 100644 mcp-server/tests/mesh/test_traceroute.py create mode 100644 mcp-server/tests/monitor/__init__.py create mode 100644 mcp-server/tests/monitor/test_boot_log_no_panic.py create mode 100644 mcp-server/tests/provisioning/__init__.py create mode 100644 mcp-server/tests/provisioning/test_admin_key_baked.py create mode 100644 mcp-server/tests/provisioning/test_bake_region_modem_slot.py create mode 100644 mcp-server/tests/provisioning/test_unset_region_blocks_tx.py create mode 100644 mcp-server/tests/provisioning/test_userprefs_survive_factory_reset.py create mode 100644 mcp-server/tests/telemetry/__init__.py create mode 100644 mcp-server/tests/telemetry/test_device_telemetry_broadcast.py create mode 100644 mcp-server/tests/telemetry/test_telemetry_request_reply.py create mode 100644 mcp-server/tests/test_00_bake.py create mode 100644 mcp-server/tests/tool_coverage.py create mode 100644 mcp-server/tests/unit/__init__.py create mode 100644 mcp-server/tests/unit/test_boards.py create mode 100644 mcp-server/tests/unit/test_pio_wrapper.py create mode 100644 mcp-server/tests/unit/test_testing_profile.py create mode 100644 mcp-server/tests/unit/test_userprefs_parse.py diff --git a/.claude/commands/README.md b/.claude/commands/README.md new file mode 100644 index 000000000..3767dac98 --- /dev/null +++ b/.claude/commands/README.md @@ -0,0 +1,49 @@ +# Claude Code slash commands for the mcp-server test suite + +Three AI-assisted workflows wrapping `mcp-server/run-tests.sh` and the meshtastic MCP tools. Each one has a twin in `.github/prompts/` for Copilot users. + +| Slash command | What it does | Copilot equivalent | +| --------------------- | ------------------------------------------------------------------------- | ---------------------------------------- | +| `/test [args]` | Runs the test suite (auto-detects hardware) and interprets failures | `.github/prompts/mcp-test.prompt.md` | +| `/diagnose [role]` | Read-only device health report via the meshtastic MCP tools | `.github/prompts/mcp-diagnose.prompt.md` | +| `/repro [n=5]` | Re-runs one test N times, diffs firmware logs between passes and failures | `.github/prompts/mcp-repro.prompt.md` | + +## Why two surfaces + +The Claude Code commands and Copilot prompts cover the same three workflows but each speaks its host's idiom: + +- **Claude Code** (`/test`) uses `$ARGUMENTS` for pass-through, has direct access to Bash + all MCP tools registered in the user's settings, and runs in the terminal context. +- **Copilot** (`/mcp-test`) runs in VS Code's agent mode; it has terminal + MCP access too but typically asks the operator to confirm inputs interactively. + +A contributor using either IDE gets equivalent assistance. Keep the two in sync when behavior changes — the diff of intent should be minimal. + +## House rules + +- **No destructive writes without explicit operator approval.** Skills that could reflash, factory-reset, or reboot a device must describe the action and stop — the operator authorizes. +- **Interpret failures, don't just echo them.** The skill body should pull firmware log lines from `mcp-server/tests/report.html` (the `Meshtastic debug` section, attached by `tests/conftest.py::pytest_runtest_makereport`) and classify the failure. +- **Keep MCP tool calls sequential per port.** SerialInterface holds an exclusive port lock; two parallel tool calls on the same port deadlock. +- **Never speculate about root cause.** If the evidence doesn't support a classification, say "unknown" and list what you'd need to disambiguate. + +## Adding a new command + +1. Write the Claude Code version at `.claude/commands/.md` with YAML frontmatter: + + ```yaml + --- + description: one-line purpose (used for auto-invocation by the model) + argument-hint: [optional-hint] + --- + ``` + +2. Write the Copilot equivalent at `.github/prompts/mcp-.prompt.md` with: + + ```yaml + --- + mode: agent + description: ... + --- + ``` + +3. Add the row to the table above. Cross-link in both bodies. + +4. Smoke-test on Claude Code first (`/` should appear in autocomplete), then in VS Code Copilot (`/mcp-` in Chat). diff --git a/.claude/commands/diagnose.md b/.claude/commands/diagnose.md new file mode 100644 index 000000000..45aa937a5 --- /dev/null +++ b/.claude/commands/diagnose.md @@ -0,0 +1,55 @@ +--- +description: Produce a device health report using the meshtastic MCP tools (device_info, list_nodes, get_config, short serial log capture) +argument-hint: [role=all|nrf52|esp32s3|] +--- + +# `/diagnose` — device health report + +Call the meshtastic MCP tool bundle and format a structured health report for one or all detected devices. Zero guesswork for the operator. + +## What to do + +1. **Enumerate hardware.** Call `mcp__meshtastic__list_devices(include_unknown=True)`. For each entry where `likely_meshtastic=True`, capture `port`, `vid`, `pid`, `description`. + +2. **Filter by `$ARGUMENTS`**: + - No args, `all` → every likely-meshtastic device. + - `nrf52` → only devices with `vid == 0x239a`. + - `esp32s3` → only devices with `vid == 0x303a` or `vid == 0x10c4`. + - A `/dev/cu.*` path → only that one port. + - Anything else → treat as a substring match against the `port` string. + +3. **For each selected device, in sequence (NOT parallel — SerialInterface holds an exclusive port lock):** + - `mcp__meshtastic__device_info(port=

)` — captures `my_node_num`, `long_name`, `short_name`, `firmware_version`, `hw_model`, `region`, `num_nodes`, `primary_channel`. + - `mcp__meshtastic__list_nodes(port=

)` — count of peers, which ones have `publicKey` set, SNR/RSSI distribution. + - `mcp__meshtastic__get_config(section="lora", port=

)` — region, preset, channel_num, tx_power, hop_limit. + - Optionally, if the device seems unhappy (fails to connect, `num_nodes==1` when ≥2 are plugged in, missing firmware*version), open a short firmware log window: `mcp__meshtastic__serial_open(port=

, env=)`, wait 3s, `serial_read(session_id=, max_lines=100)`, `serial_close(session_id=)`. The env should be inferred from the VID map in `mcp-server/run-tests.sh` (nrf52 → rak4631, esp32s3 → heltec-v3) unless `MESHTASTIC_MCP_ENV*` is set. + +4. **Render per-device report** as: + + ```text + [nrf52 @ /dev/cu.usbmodem1101] fw=2.7.23.bce2825, hw=RAK4631 + owner : Meshtastic 40eb / 40eb + region/band : US, channel 88, LONG_FAST + tx_power : 30 dBm, hop_limit=3 + peers : 1 (esp32s3 0x433c2428, pubkey ✓, SNR 6.0 / RSSI -24 dBm) + primary ch : McpTest + firmware : no panics in last 3s; NodeInfoModule emitted 2 broadcasts + ``` + + Keep it scannable. If a field is missing or abnormal (no pubkey for a known peer, region=UNSET, num_nodes inconsistent with the hub), flag it inline with a short `⚠︎ `. + +5. **Cross-device correlation** (only when >1 device is inspected): + - Do both sides see each other in `nodesByNum`? If one does and the other doesn't, that's asymmetric NodeInfo — flag it. + - Do the LoRa configs match? (region, channel_num, modem_preset should all agree; mismatch = no mesh) + - Do the primary channel NAMES match? Mismatch = different PSK = no decode. + +6. **Suggest next actions only for specific, recognisable failure modes**: + - Stale PKI pubkey one-way → "run `/test tests/mesh/test_direct_with_ack.py` — the retry + nodeinfo-ping heals this in the test path." + - Region mismatch → "re-bake one side via `./mcp-server/run-tests.sh --force-bake`." + - Device unreachable → point at touch_1200bps + the CP2102-wedged-driver note in run-tests.sh. + +## What NOT to do + +- No writes. No `set_config`, no `reboot`, no `factory_reset`. This is a read-only diagnostic skill — if the operator wants to change state, they'll ask explicitly. +- No `flash` / `erase_and_flash`. Those are separate escalations. +- No holding SerialInterface across tool calls — open, query, close; next device. The port lock is exclusive. diff --git a/.claude/commands/repro.md b/.claude/commands/repro.md new file mode 100644 index 000000000..52dcf222b --- /dev/null +++ b/.claude/commands/repro.md @@ -0,0 +1,65 @@ +--- +description: Re-run a specific test N times in isolation to triage flakes, diff firmware logs between passes and failures +argument-hint: [count=5] +--- + +# `/repro` — flakiness triage for one test + +Re-run a single pytest node ID N times in isolation, track pass rate, and surface what's _different_ in the firmware logs between the passing attempts and the failing ones. Turns "it's flaky, I guess" into "it fails when X, passes when Y." + +## What to do + +1. **Parse `$ARGUMENTS`**: first token is the pytest node id (e.g. `tests/mesh/test_direct_with_ack.py::test_direct_with_ack_roundtrip[nrf52->esp32s3]`); second token is an integer count (default `5`, cap at `20`). If the first token doesn't look like a test path (no `::` and no `tests/` prefix), treat the whole `$ARGUMENTS` as a `-k` filter instead. + +2. **Sanity-check the hub first** (so we're not measuring "nothing plugged in" N times): call `mcp__meshtastic__list_devices`. If the test name contains `nrf52` or `esp32s3` and the matching VID isn't present, stop and report — re-running won't help. + +3. **Loop N times**. For each iteration: + + ```bash + ./mcp-server/run-tests.sh --tb=short -p no:cacheprovider + ``` + + Capture: exit code, duration, and (on failure) the `Meshtastic debug` firmware log section from `mcp-server/tests/report.html`. `-p no:cacheprovider` suppresses pytest's `.pytest_cache` writes so iterations don't influence each other. + +4. **Track a small structured tally**: + + ```text + attempt 1: PASS (42s) + attempt 2: FAIL (128s) ← firmware log 200-line tail captured + attempt 3: PASS (39s) + attempt 4: FAIL (121s) + attempt 5: PASS (41s) + -------------------------------------- + pass rate: 3/5 (60%) | mean duration: 74s + ``` + +5. **On mixed outcomes**: diff the firmware log tails between a representative passing attempt and a representative failing attempt. Focus on: + - Error-level lines only present in failures (`PKI_UNKNOWN_PUBKEY`, `Alloc an err=`, `Skip send`, `No suitable channel`) + - Timing around the assertion event — did a broadcast go out, was there an ACK, did NAK fire? + - Device state fields that changed (nodesByNum entries, region/preset, channel_num) + + Surface the top 3 differences as a "passes when / fails when" table. Don't dump full logs — pull specific lines with uptime timestamps. + +6. **Classify the flake** into one of: + - **LoRa airtime collision** → pass rate improves with fewer concurrent transmitters; propose a `time.sleep` gap or retry bump in the test body. + - **PKI key staleness** → fails on first attempt, passes after self-heal; existing retry loop in `test_direct_with_ack.py` handles this. + - **NodeInfo cooldown** → `Skip send NodeInfo since we sent it <600s ago` in fail-only logs; needs `broadcast_nodeinfo_ping()` warmup. + - **Hardware-specific** (one direction fails, other passes; one device's firmware is older; driver wedged) → specific recovery pointer. + - **Genuinely unknown** → say so; don't invent a root cause. + +7. **Report back** with: + - Pass rate and mean duration. + - Classification + evidence (the specific log lines that support it). + - A suggested next step (re-run with specific args, open `/diagnose`, edit a specific test file, nothing). + +## Examples + +- `/repro tests/mesh/test_direct_with_ack.py::test_direct_with_ack_roundtrip[esp32s3->nrf52] 10` — runs 10 times, diffs firmware logs. +- `/repro broadcast_delivers` — no `::`, no `tests/`, so interpreted as `-k broadcast_delivers`; runs every matching test the default 5 times. +- `/repro tests/telemetry/test_device_telemetry_broadcast.py 3` — shorter run for a slow test. + +## Constraints + +- Don't exceed `count=20` per invocation — airtime and USB wear add up. If the user asks for 50, negotiate down. +- Don't rebuild firmware as part of triage; flakes that only reproduce under different firmware belong in a separate session. +- If the FIRST attempt fails AND the rest all pass, that's a classic "state leak from a prior test" → say so and suggest running with `--force-bake` or starting from a clean state rather than chasing the first failure. diff --git a/.claude/commands/test.md b/.claude/commands/test.md new file mode 100644 index 000000000..986ee1f31 --- /dev/null +++ b/.claude/commands/test.md @@ -0,0 +1,42 @@ +--- +description: Run the mcp-server test suite (auto-detects devices) and interpret the results +argument-hint: [pytest-args] +--- + +# `/test` — mcp-server test runner with interpretation + +Run `mcp-server/run-tests.sh` and make sense of the output so the operator doesn't have to. + +## What to do + +1. **Invoke the wrapper.** From the firmware repo root, run: + + ```bash + ./mcp-server/run-tests.sh $ARGUMENTS + ``` + + The wrapper auto-detects connected Meshtastic devices, maps each to its PlatformIO env, exports the required `MESHTASTIC_MCP_ENV_*` env vars, and invokes pytest. If the user passed no arguments, the wrapper supplies a sensible default set (`tests/ --html=tests/report.html --self-contained-html --junitxml=tests/junit.xml -v --tb=short`). A `--report-log=tests/reportlog.jsonl` arg is always appended (unless the operator passed their own). `--assume-baked` is deliberately NOT in the defaults — `test_00_bake.py` has its own skip-if-already-baked check and runs the ~8 s verification by default. Operators can opt into the fast path with `--assume-baked`, or force a reflash with `--force-bake`. + +2. **Read the pre-flight header.** First ~6 lines print the detected hub (role → port → env). If that line reads `detected hub : (none)`, the wrapper will narrow to `tests/unit` only — say so explicitly in your summary so the operator knows hardware tiers were skipped. + +3. **On pass**: one-line summary of the form `N passed, M skipped in `. Don't enumerate the 52 test names — the user can read those. Do mention if any test was SKIPPED for a NON-placeholder reason (e.g. "role not present on hub" is worth flagging). + +4. **On failure**: for every FAILED test, open `mcp-server/tests/report.html` and extract the `Meshtastic debug` section for that test. pytest-html embeds the firmware log stream + device state dump there; the 200-line firmware log tail is usually enough to explain the failure. Summarise: which test, one-line assertion message, the firmware log lines that matter (things like `PKI_UNKNOWN_PUBKEY`, `Skip send NodeInfo`, `Error=`, `Guru Meditation`, `assertion failed`). + +5. **Classify the failure** as one of: + - **Transient/flake**: LoRa collision, timing-sensitive assertion, first-attempt NAK + successful retry pattern. Propose `/repro ` to confirm. + - **Environmental**: device unreachable, port busy, CP2102 driver wedged. Suggest the specific recovery (replug USB, `touch_1200bps`, check `git status userPrefs.jsonc`). + - **Regression**: same assertion fails repeatedly, firmware log shows a new/unusual error. Surface the diff between expected and observed, identify the module likely responsible. + +6. **Never run destructive recovery automatically.** If a failure looks like it needs a reflash, factory*reset, or USB replug, \_describe what to do* — don't execute. The operator decides. + +## Arguments handling + +- No args → wrapper's defaults (full suite). +- `$ARGUMENTS` passed verbatim to the wrapper, which passes them to pytest. +- Common operator invocations: `/test tests/mesh`, `/test tests/mesh/test_direct_with_ack.py::test_direct_with_ack_roundtrip`, `/test --force-bake`, `/test -k telemetry`. + +## Side-effects to mention in summary + +- The session fixture snapshots `userPrefs.jsonc` at session start and restores at teardown (plus on `atexit`). After a clean run, `git status userPrefs.jsonc` should be empty. If the wrapper's pre-flight printed a warning about a stale sidecar, call that out — means a prior session crashed. +- `mcp-server/tests/report.html` and `junit.xml` are regenerated on every run; the HTML is self-contained (shareable). diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 24e11bd4d..d12244229 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -429,6 +429,8 @@ Most workflows can be triggered manually via `workflow_dispatch` for testing. ## Testing +### Native unit tests (C++) + Unit tests in `test/` directory with 12 test suites: - `test_crypto/` - Cryptography @@ -446,6 +448,164 @@ Run with: `pio test -e native` Simulation testing: `bin/test-simulator.sh` +### Hardware-in-the-loop tests (`mcp-server/tests/`) + +Separate pytest suite that exercises real USB-connected Meshtastic devices. See the **MCP Server & Hardware Test Harness** section below for invocation, tier layout, and agent usage rules. + +## MCP Server & Hardware Test Harness + +The `mcp-server/` directory houses a firmware-aware [MCP](https://modelcontextprotocol.io/) server plus a pytest-based integration suite. AI agents that speak MCP get a well-defined tool surface for flashing, configuring, and inspecting physical Meshtastic devices — use it instead of hand-rolling `pio` or `meshtastic --port` calls where possible. `mcp-server/README.md` is the operator-facing setup doc; this section is the agent-facing usage contract. + +The repo registers the server via `.mcp.json` at the repo root — Claude Code picks it up automatically once `mcp-server/.venv/` is built (`cd mcp-server && python3 -m venv .venv && .venv/bin/pip install -e '.[test]'`). + +### When to use which surface + +| Goal | Tool | +| ------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| Find a connected device | `mcp__meshtastic__list_devices` | +| Read a live node's config/state | `mcp__meshtastic__device_info`, `list_nodes`, `get_config` | +| Mutate a device (owner, region, channels, reboot) | `set_owner`, `set_config`, `set_channel_url`, `reboot`, `shutdown`, `factory_reset` — all require `confirm=True` | +| Flash firmware to a variant | `pio_flash` (any arch) or `erase_and_flash` (ESP32 factory install) | +| Stream serial logs while debugging | `serial_open` → `serial_read` loop → `serial_close` | +| Administer `userPrefs.jsonc` build-time constants | `userprefs_get`, `userprefs_set`, `userprefs_reset`, `userprefs_manifest` | +| Run the regression suite | `./mcp-server/run-tests.sh` (or `/test` slash command) | +| Diagnose a specific device | `/diagnose [role]` slash command (read-only) | +| Triage a flaky test | `/repro [count]` slash command | + +**One MCP call per port at a time.** `SerialInterface` holds an exclusive OS-level lock on the serial port for its lifetime. If a `serial_*` session is open on `/dev/cu.usbmodem101`, calling `device_info` on the same port will fail fast pointing at the active session. Sequence calls: open → read/mutate → close, then next device. Never parallelize tool calls on the same port. + +### MCP tool surface (~32 tools) + +Grouped by purpose. Full argument shapes in `mcp-server/README.md`; a few high-value signatures are called out here. + +- **Discovery & metadata**: `list_devices`, `list_boards`, `get_board` +- **Build & flash**: `build`, `clean`, `pio_flash`, `erase_and_flash` (ESP32 only), `update_flash` (ESP32 OTA), `touch_1200bps` +- **Serial sessions** (long-running, 10k-line ring buffer): `serial_open`, `serial_read`, `serial_list`, `serial_close` +- **Device reads**: `device_info`, `list_nodes` +- **Device writes** (all require `confirm=True`): `set_owner`, `get_config`, `set_config`, `get_channel_url`, `set_channel_url`, `send_text`, `reboot`, `shutdown`, `factory_reset`, `set_debug_log_api` +- **userPrefs admin** (build-time constants, not runtime config): `userprefs_get`, `userprefs_set`, `userprefs_reset`, `userprefs_manifest`, `userprefs_testing_profile` +- **Vendor escape hatches**: `esptool_chip_info`, `esptool_erase_flash`, `esptool_raw`, `nrfutil_dfu`, `nrfutil_raw`, `picotool_info`, `picotool_load`, `picotool_raw` + +`confirm=True` is a tool-level gate on top of whatever permission prompt your MCP host shows. **Don't bypass it** by asking the host to auto-approve — it exists specifically because MCP hosts sometimes remember "always allow this tool" and that's dangerous for `factory_reset` and `erase_and_flash`. + +### Hardware test suite (`mcp-server/run-tests.sh`) + +The wrapper auto-detects connected devices (VID → role map: `0x239A` → `nrf52`, `0x303A`/`0x10C4` → `esp32s3`), maps each role to a PlatformIO env (`nrf52` → `rak4631`, `esp32s3` → `heltec-v3`, overridable via `MESHTASTIC_MCP_ENV_`), then invokes pytest. Zero pre-flight config needed from the operator. + +Suite tiers (collected + run in this order via `pytest_collection_modifyitems`): + +1. `tests/unit/` — pure Python (boards parse, pio wrapper, userPrefs parse, testing profile). No hardware. +2. `tests/test_00_bake.py` — flashes each detected device with current `userPrefs.jsonc` merged with the session's test profile. Has its own skip-if-already-baked check comparing region + primary channel to the session profile; skips cheaply on warm devices. +3. `tests/mesh/` — multi-device mesh: bidirectional send, broadcast delivery, direct-with-ACK, mesh formation within 60s. Parametrized `[nrf52->esp32s3]` and `[esp32s3->nrf52]`. +4. `tests/telemetry/` — `DEVICE_METRICS_APP` broadcast timing. +5. `tests/monitor/` — boot-log panic check. +6. `tests/fleet/` — PSK seed session isolation. +7. `tests/admin/` — channel URL roundtrip, owner persistence across reboot. +8. `tests/provisioning/` — region + modem + slot bake, admin key presence, `UNSET` region blocks TX, userPrefs survive factory reset. + +Invocation patterns: + +```bash +./mcp-server/run-tests.sh # full suite (auto-bake-if-needed) +./mcp-server/run-tests.sh --force-bake # reflash before testing +./mcp-server/run-tests.sh --assume-baked # skip bake (caller vouches for device state) +./mcp-server/run-tests.sh tests/mesh # one tier +./mcp-server/run-tests.sh tests/mesh/test_direct_with_ack.py # one file +./mcp-server/run-tests.sh -k telemetry # name filter +``` + +**No hardware detected?** The wrapper auto-narrows to `tests/unit/` only and prints `detected hub : (none)` in the pre-flight header. Agents interpreting the output should call this out explicitly — a 52-test green run without hardware is qualitatively different from a 12-unit-test green run. + +**Artifacts every run produces:** + +- `mcp-server/tests/report.html` — self-contained pytest-html. Each test gets a `Meshtastic debug` section with the tail of firmware log + device state dump. **Open this first** on failures; it's the canonical evidence source. +- `mcp-server/tests/junit.xml` — CI-parseable. +- `mcp-server/tests/reportlog.jsonl` — pytest-reportlog stream (`$report_type` keyed JSONL). Consumed by the live TUI. +- `mcp-server/tests/fwlog.jsonl` — firmware log mirror from the `meshtastic.log.line` pubsub topic. Populated by the `_firmware_log_stream` autouse session fixture. + +### Live TUI (`meshtastic-mcp-test-tui`) + +A Textual-based live view that wraps `run-tests.sh`. Tails reportlog for per-test state, streams firmware logs, polls device state at startup + post-run (gated out of the active run because `hub_devices` holds exclusive port locks). Key bindings: + +| Key | Action | +| --- | ------------------------------------------------------------------------------------------------------------ | +| `r` | re-run focused test (leaf → that node id; internal node → directory or `-k`) | +| `f` | filter tree by substring | +| `d` | failure detail modal (pulls `longrepr` + captured stdout from the reportlog) | +| `g` | export reproducer bundle (tar.gz with README, test_report.json, time-filtered fwlog, devices.json, env.json) | +| `l` | toggle firmware log pane | +| `x` | tool coverage modal | +| `c` | cross-run history sparkline | +| `q` | quit (SIGINT → SIGTERM → SIGKILL escalation, 5-s windows each) | + +Launch: + +```bash +cd mcp-server +.venv/bin/meshtastic-mcp-test-tui # full suite +.venv/bin/meshtastic-mcp-test-tui tests/mesh # args pass through to pytest +``` + +The plain CLI stays primary; the TUI is for operators who want a live dashboard. Both consume the same `run-tests.sh`. + +### Slash commands (Claude Code + Copilot) + +Three AI-assisted workflows wrap the test harness. Claude Code operators get `/test`, `/diagnose`, `/repro`; Copilot operators get `/mcp-test`, `/mcp-diagnose`, `/mcp-repro`. Bodies: + +- `.claude/commands/{test,diagnose,repro}.md` +- `.github/prompts/mcp-{test,diagnose,repro}.prompt.md` + +`.claude/commands/README.md` is the index. + +House rules for agents running these prompts: + +- **Interpret failures, don't just echo them.** Pull firmware log tails from `report.html` and classify each failure as transient / environmental / regression. Use the exact format in `.claude/commands/test.md`. +- **No destructive writes without operator approval.** Any skill that could reflash, factory-reset, or reboot a device must describe the action and stop. The operator authorizes. +- **Sequential MCP calls per port.** See above. +- **"Unknown" is a valid classification.** If evidence doesn't support a root cause, say so and list what would disambiguate. Do not invent. + +### Key fixtures (test authors + agents debugging) + +`mcp-server/tests/conftest.py` provides: + +- **`_session_userprefs`** (autouse session) — snapshots `userPrefs.jsonc` at session start, merges the session test profile via `userprefs.merge_active(test_profile)`, restores at teardown. Four layers of safety: pytest teardown + `atexit` + sidecar file (`userPrefs.jsonc.mcp-session-bak`) + startup self-heal in `run-tests.sh`. **Do not edit `userPrefs.jsonc` from inside a test.** +- **`_firmware_log_stream`** (autouse session) — subscribes to `meshtastic.log.line` pubsub on every connected `SerialInterface` and mirrors lines to `tests/fwlog.jsonl`. Drives the TUI firmware-log pane. +- **`_debug_log_buffer`** (autouse per-test) — captures last 200 firmware log lines + device state for attachment to the pytest-html `Meshtastic debug` section on failure. +- **`hub_devices`** (session) — `dict[role, SerialInterface]` with session-long exclusive port locks. Reason the TUI's device poller is gated to startup + post-run only. +- **`baked_mesh`** — parametrized mesh-pair fixture; depends on `test_00_bake`. `pytest_generate_tests` in `conftest.py` auto-generates `[nrf52->esp32s3]` and `[esp32s3->nrf52]` variants. +- **`test_profile`** — session-scoped dict: region, primary channel, admin key, PSK seed. Derived from `MESHTASTIC_MCP_SEED` (defaults to `mcp--`). + +### Firmware integration points tied to the test harness + +Two firmware changes exist specifically so the test harness works reliably. **Keep these in mind when touching related code.** + +- **`src/mesh/StreamAPI.cpp` + `StreamAPI.h`** — `emitLogRecord` uses a dedicated `fromRadioScratchLog` + `txBufLog` pair and a `concurrency::Lock streamLock`. Before this fix, `debug_log_api_enabled=true` would tear `FromRadio` protobufs on the serial transport because `emitTxBuffer` and `emitLogRecord` shared a single scratch buffer. The conftest enables the log stream session-wide; without this fix the device would corrupt its own FromRadio replies mid-session. +- **`src/mesh/PhoneAPI.cpp`** — `ToRadio` `Heartbeat(nonce=1)` triggers `nodeInfoModule->sendOurNodeInfo(NODENUM_BROADCAST, true, 0, true)` for serial clients, mirroring the pre-existing behavior for TCP/UDP clients in `PacketAPI.cpp`. The mesh tests rely on this to force a NodeInfo broadcast right after connect so the peer discovers them before the test's first assertion. + +If you're modifying `StreamAPI`, `PhoneAPI`, `NodeInfoModule`, or `userPrefs` flow, run `./mcp-server/run-tests.sh` at minimum before asking for review. + +### Recovery playbooks + +| Symptom | First check | Fix | +| ---------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userPrefs.jsonc` dirty after test run | `git status --porcelain userPrefs.jsonc` | If non-empty, re-run `./mcp-server/run-tests.sh` once — the pre-flight self-heal restores from sidecar. If still dirty, `git checkout userPrefs.jsonc`. | +| Port busy / wedged CP2102 on macOS | `lsof /dev/cu.usbserial-0001` | Kill the holder. USB replug if the kernel still reports busy. Often a stale `pio device monitor` or zombie `meshtastic_mcp` process. | +| nRF52 appears unresponsive | `list_devices` shows VID `0x239A` but `device_info` times out | `touch_1200bps(port=...)` drops it into the DFU bootloader → `pio_flash` re-installs. | +| Multiple MCP server processes | `ps aux \| grep meshtastic_mcp` shows >1 | Kill all but the one your MCP host spawned. Zombies hold ports and break tests. | +| Mesh formation fails, one side sees peer but other doesn't | `/diagnose` (or `list_nodes` on both sides) | Asymmetric NodeInfo. `test_direct_with_ack` has a heal path; `/repro` it a few times. If persistent, both devices' clocks may be out of sync with their NodeInfo cooldown. | +| "role not present on hub" in skip reasons | `list_devices` | Expected if a device is unplugged. Reconnect before re-running the tier. | +| Tests fail only on first attempt then pass on rerun | — | State leak from a prior session. Run with `--force-bake` to reset to a known state. | + +### Never do these without asking + +- `factory_reset` — wipes node identity; regenerates PKI keypair. Mesh peers will reject old DMs until re-exchange. Legitimate only when the operator explicitly wants it. +- `erase_and_flash` — full chip erase; destroys all on-device state. +- `esptool_erase_flash` / `esptool_raw` write/erase — bypasses pio's safety chain. +- `set_config` on `lora.region` — changes regulatory domain; requires physical-location context the operator has and the agent doesn't. +- `reboot` / `shutdown` mid-test — breaks fixture invariants. +- `push -f`, `rebase -i`, `reset --hard`, or any history-rewriting git operation. +- Clicking computer-use tools on web links in Mail/Messages/PDFs — open URLs via the claude-in-chrome MCP so the extension's link-safety checks apply. + ## Resources - [Documentation](https://meshtastic.org/docs/) diff --git a/.github/prompts/mcp-diagnose.prompt.md b/.github/prompts/mcp-diagnose.prompt.md new file mode 100644 index 000000000..c86826030 --- /dev/null +++ b/.github/prompts/mcp-diagnose.prompt.md @@ -0,0 +1,57 @@ +--- +mode: agent +description: Device health report via the meshtastic MCP tools (Copilot equivalent of the Claude Code /diagnose slash command) +--- + +# `/mcp-diagnose` — device health report + +Equivalent of `.claude/commands/diagnose.md`. Use when the operator asks to "check the devices", "what's the mesh looking like", "is nrf52 alive", etc. + +This prompt assumes the meshtastic MCP server is registered with your VS Code Copilot agent. If it isn't, fall back to running `./mcp-server/run-tests.sh tests/unit` plus a short `device_info` script via the terminal. + +## What to do + +1. **Enumerate hardware** via the `list_devices` MCP tool (with `include_unknown=True`). For each entry where `likely_meshtastic=True`, capture `port`, `vid`, `pid`, `description`. + +2. **Apply the operator's filter** (if any): + - No filter → every likely-meshtastic device. + - `nrf52` → `vid == 0x239a` + - `esp32s3` → `vid == 0x303a` or `vid == 0x10c4` + - A `/dev/cu.*` path → only that port. + - Anything else → substring match on port. + +3. **For each selected device, in sequence (don't parallelize — SerialInterface holds an exclusive port lock):** + - `device_info(port=

)` → `my_node_num`, `long_name`, `short_name`, `firmware_version`, `hw_model`, `region`, `num_nodes`, `primary_channel` + - `list_nodes(port=

)` → peer count, which peers have `publicKey`, SNR/RSSI distribution + - `get_config(section="lora", port=

)` → region, preset, channel_num, tx_power, hop_limit + - If anything looks off (can't connect, `num_nodes` wrong, missing `firmware_version`), open a short firmware-log window: `serial_open(port=

, env=)`, wait 3 seconds, `serial_read(session_id, max_lines=100)`, `serial_close(session_id)`. Infer env from VID (0x239a → `rak4631`, 0x303a/0x10c4 → `heltec-v3`) unless an `MESHTASTIC_MCP_ENV_` env var overrides it. + +4. **Render per-device report** as a compact block: + + ```text + [nrf52 @ /dev/cu.usbmodem1101] fw=2.7.23.bce2825, hw=RAK4631 + owner : Meshtastic 40eb / 40eb + region/band : US, channel 88, LONG_FAST + tx_power : 30 dBm, hop_limit=3 + peers : 1 (esp32s3 0x433c2428, pubkey ✓, SNR 6.0 / RSSI -24 dBm) + primary ch : McpTest + firmware : no panics in last 3s + ``` + + Flag abnormalities inline with `⚠︎ ` — missing pubkey on a known peer, region UNSET, mismatched channel name, etc. + +5. **Cross-device correlation** (when >1 device selected): + - Do both see each other in `nodesByNum`? + - Do `region`, `channel_num`, `modem_preset` match across devices? + - Do the primary channel names match? (Different name → different PSK → no decode.) + +6. **Suggest next steps only for recognizable failure modes**, never speculatively: + - Stale PKI one-way → "`/mcp-test tests/mesh/test_direct_with_ack.py` — the test's retry+nodeinfo-ping heals this." + - Region mismatch → "re-bake one side via `./mcp-server/run-tests.sh --force-bake`." + - Device unreachable → refer operator to the touch_1200bps + CP2102-wedged-driver notes in `run-tests.sh`. + +## Hard constraints + +- **Read-only.** No `set_config`, no `reboot`, no `factory_reset`, no `flash`. If the operator wants mutation, they'll escalate explicitly. +- **Open/query/close per device.** Never hold multiple SerialInterfaces to the same port. The port lock is exclusive. +- **Don't infer env beyond the VID map** — if the operator has an unusual board, ask them which env to use rather than guessing. diff --git a/.github/prompts/mcp-repro.prompt.md b/.github/prompts/mcp-repro.prompt.md new file mode 100644 index 000000000..be2963c33 --- /dev/null +++ b/.github/prompts/mcp-repro.prompt.md @@ -0,0 +1,67 @@ +--- +mode: agent +description: Re-run a specific test N times to triage flakes; diff firmware logs between passes and failures (Copilot equivalent of the Claude Code /repro slash command) +--- + +# `/mcp-repro` — flakiness triage for one test + +Equivalent of `.claude/commands/repro.md`. Use when the operator says "that one test is flaky — dig in", "repro the direct_with_ack failure", "why does X sometimes fail?". + +## What to do + +1. **Parse the operator's input** into two pieces: + - **Test identifier** — either a pytest node id (has `::` or starts with `tests/`) or a `-k`-style filter (plain substring like `direct_with_ack`). + - **Count** — integer, default `5`, cap at `20`. If the operator asks for 50, negotiate down and explain (airtime + USB wear). + +2. **Sanity-check the hub** via the `list_devices` MCP tool. If the test name references `nrf52` or `esp32s3` and the matching VID isn't present, stop and report — re-running won't help. + +3. **Loop** N times. Each iteration: + + ```bash + ./mcp-server/run-tests.sh --tb=short -p no:cacheprovider + ``` + + `-p no:cacheprovider` keeps pytest from caching anything between iterations. Capture: exit code, duration, and (on failure) the `Meshtastic debug` firmware-log section from `mcp-server/tests/report.html`. + +4. **Tally** results as you go: + + ```text + attempt 1: PASS (42s) + attempt 2: FAIL (128s) ← fw log captured + attempt 3: PASS (39s) + attempt 4: FAIL (121s) + attempt 5: PASS (41s) + -------------------------------------------------- + pass rate: 3/5 (60%) | mean duration: 74s + ``` + +5. **On mixed outcomes, diff the firmware logs** between one representative pass and one representative fail. Focus on: + - Error-level lines present only in failures (`PKI_UNKNOWN_PUBKEY`, `Alloc an err=`, `Skip send`, `No suitable channel`, `NAK`) + - Timing around the assertion point (broadcast sent? ACK received? retry fired?) + - Device-state fields that changed between attempts + + Surface the top 3 differences as a compact "passes when / fails when" table with uptime timestamps. Don't dump full logs. + +6. **Classify** the flake into one of: + - **LoRa airtime collision** — pass rate improves with fewer concurrent transmitters. Suggest a `time.sleep` gap or retry bump in the test body. + - **PKI key staleness** — first attempt fails, subsequent ones pass; existing retry-loop pattern in `test_direct_with_ack.py` is the fix. + - **NodeInfo cooldown** — `Skip send NodeInfo since we sent it <600s ago` in fail-only logs; needs a `broadcast_nodeinfo_ping()` warmup. + - **Hardware-specific** — one direction consistently fails, firmware versions differ, CP2102 driver wedged, etc. + - **Unknown** — say so. Don't invent a root cause. + +7. **Report back** with: + - Pass rate + mean duration. + - Classification + the specific log evidence for it. + - A concrete next step (tighter assertion, more retries, open `/mcp-diagnose`, file a bug, nothing). + +## Examples + +- `tests/mesh/test_direct_with_ack.py::test_direct_with_ack_roundtrip[esp32s3->nrf52] 10` — 10 runs of that parametrized case. +- `broadcast_delivers` — no `::`, no `tests/`; treat as `-k broadcast_delivers`; runs every match 5 times. +- `tests/telemetry/test_device_telemetry_broadcast.py 3` — shorter count for a slow test. + +## Notes + +- If the FIRST attempt fails and the rest pass, that's a state-leak signature — suggest starting from `--force-bake` or a clean device state rather than chasing the first-failure firmware logs. +- If ALL N fail, this isn't a flake — it's a regression. Say so, stop iterating, escalate to `/mcp-test` for full-suite context. +- Don't rebuild firmware during triage. Flakes that only reproduce under different firmware belong in a separate session with a plan. diff --git a/.github/prompts/mcp-test.prompt.md b/.github/prompts/mcp-test.prompt.md new file mode 100644 index 000000000..092ad3d85 --- /dev/null +++ b/.github/prompts/mcp-test.prompt.md @@ -0,0 +1,51 @@ +--- +mode: agent +description: Run the mcp-server test suite and interpret results (Copilot equivalent of the Claude Code /test slash command) +--- + +# `/mcp-test` — mcp-server test runner with interpretation + +Equivalent of the Claude Code `/test` slash command in `.claude/commands/test.md`. Use this when the operator asks you to "run the tests", "check the mcp test suite", "run the mesh tests", etc. + +## What to do + +1. **Invoke the wrapper** from the firmware repo root: + + ```bash + ./mcp-server/run-tests.sh [pytest-args] + ``` + + If the operator specified a subset (e.g. "just the mesh tests"), pass it through as `tests/mesh` or a pytest `-k filter`. If they said nothing, use the wrapper's defaults (full suite with pytest-html report). + + The wrapper auto-detects connected Meshtastic devices, maps each to its PlatformIO env, exports the required env vars, and invokes pytest. Zero pre-flight config needed from the operator. + +2. **Read the pre-flight header** (first few lines of wrapper output). The `detected hub :` line lists role → port → env mappings. If it reads `(none)`, the wrapper narrowed to `tests/unit` only — call that out explicitly so the operator knows hardware tiers were skipped. + +3. **On pass**: one-line summary like `N passed, M skipped in `. Don't enumerate test names. DO mention any non-placeholder SKIPs (things like "role not present on hub") because they indicate missing hardware or setup issues. + +4. **On failure**: open `mcp-server/tests/report.html` (pytest-html output, self-contained) and extract the `Meshtastic debug` section for each failed test. That section includes a firmware log stream (last 200 lines) and device state dump. For each failure, summarise: + - test name + - one-line assertion message + - the specific firmware log lines that explain why (look for `PKI_UNKNOWN_PUBKEY`, `Skip send NodeInfo`, `Error=`, `Guru Meditation`, `assertion failed`, `No suitable channel`) + +5. **Classify each failure** as one of: + - **Transient flake** — LoRa collision, first-attempt NAK with self-heal pattern, timing-sensitive assertion. Suggest `/mcp-repro ` to confirm. + - **Environmental** — device unreachable, port busy, CP2102 driver wedged on macOS. Suggest specific recovery (USB replug, `touch_1200bps`, `git status userPrefs.jsonc`). + - **Regression** — same assertion fails repeatedly on re-runs, firmware log shows novel errors. Identify the firmware module likely responsible. + +6. **Do NOT run destructive recovery automatically**. If a failure looks like it needs a reflash, factory*reset, or replug — \_describe the steps* and let the operator decide. Never burn airtime or flash cycles without approval. + +## Arguments convention + +Operators generally invoke this prompt either with no arguments (full suite) or with a specific subset. Examples: + +- `tests/mesh` — one tier +- `tests/mesh/test_direct_with_ack.py::test_direct_with_ack_roundtrip` — one test +- `--force-bake` — reflash devices first +- `-k telemetry` — name-filter + +## Side-effects to confirm in your summary + +- `userPrefs.jsonc` should be clean after a successful run. The session fixture in `mcp-server/tests/conftest.py` (`_session_userprefs`) snapshots and restores. Check `git status --porcelain userPrefs.jsonc` and report if it's non-empty. +- `mcp-server/tests/report.html` and `junit.xml` regenerate on every run. +- The wrapper prints a warning if a `.mcp-session-bak` sidecar was left over from a crashed prior session and auto-restores from it — mention that if it happened. diff --git a/.gitignore b/.gitignore index 43cee78db..f1eb9d852 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,5 @@ CMakeLists.txt # PYTHONPATH used by the Nix shell .python3 +.claude/scheduled_tasks.lock +userPrefs.jsonc.mcp-session-bak diff --git a/.mcp.json b/.mcp.json new file mode 100644 index 000000000..c5cf2e55e --- /dev/null +++ b/.mcp.json @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "meshtastic": { + "command": "./mcp-server/.venv/bin/python", + "args": ["-m", "meshtastic_mcp"], + "env": { + "MESHTASTIC_FIRMWARE_ROOT": "." + } + } + } +} diff --git a/.trunk/configs/.bandit b/.trunk/configs/.bandit index d286ded89..c70e7743b 100644 --- a/.trunk/configs/.bandit +++ b/.trunk/configs/.bandit @@ -1,2 +1,28 @@ [bandit] -skips = B101 \ No newline at end of file +# Rule IDs: https://bandit.readthedocs.io/en/latest/plugins/index.html +# +# B101 assert_used +# pytest assertions + internal invariants; required for pytest. +# B110 try_except_pass +# best-effort cleanup paths (atexit handlers, pubsub unsubscribe, +# session-end file close, socket shutdown). Logging inside the +# except block would be worse than the silent pass — teardown is +# already at end-of-session and the surrounding caller has context. +# B112 try_except_continue +# defensive loops over flaky sources (pubsub handlers, device +# re-enumeration polls). One failed iteration shouldn't abort the loop. +# B404 import_subprocess +# mcp-server wraps PlatformIO, esptool, nrfutil, picotool, and the +# pytest test-runner — subprocess is a load-bearing import here, not +# a smell. The "consider possible security implications" advisory is +# redundant given the file-level review already applied. +# B603 subprocess_without_shell_equals_true +# all subprocess calls use a static argv list; `shell=False` is the +# default and we never string-interpolate user input into the command. +# B606 start_process_with_no_shell +# same invariant as B603 — running a binary via argv list (not +# `shell=True`) is the safe pattern bandit is asking for. +# +# Higher-severity checks (B102 exec_used, B301 pickle, B307 eval, +# B602 shell=True, etc.) remain enabled. +skips = B101,B110,B112,B404,B603,B606 \ No newline at end of file diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 000000000..cd043c087 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,113 @@ +# Agent instructions + +This repository is the [Meshtastic](https://meshtastic.org) firmware — a C++17 embedded codebase targeting ESP32 / nRF52 / RP2040 / STM32WL / Linux-Portduino LoRa mesh radios — plus a Python MCP server in `mcp-server/` that AI agents use to flash, configure, and test connected devices. + +## Primary instruction file + +**Read `.github/copilot-instructions.md` first.** That file is the canonical agent-facing document for this repo. It covers project layout, coding conventions (naming, module framework, Observer pattern, thread safety), the build system, CI/CD, the native C++ test suite, and — most importantly for automation work — the **MCP Server & Hardware Test Harness** section. Read it top-to-bottom before starting any non-trivial change. + +This file (`AGENTS.md`) is a short pointer + quick reference for agents that don't read `.github/copilot-instructions.md` by default. + +## Quick command reference + +| Action | Command | +| -------------------------------- | ----------------------------------------------------------------------------------- | +| Build a firmware variant | `pio run -e ` (e.g. `pio run -e rak4631`, `pio run -e heltec-v3`) | +| Clean + rebuild | `pio run -e -t clean && pio run -e ` | +| Flash a device | `pio run -e -t upload --upload-port ` (or use the `pio_flash` MCP tool) | +| Run firmware unit tests (native) | `pio test -e native` | +| Run MCP hardware tests | `./mcp-server/run-tests.sh` | +| Live TUI test runner | `mcp-server/.venv/bin/meshtastic-mcp-test-tui` | +| Format before commit | `trunk fmt` | +| Regenerate protobuf bindings | `bin/regen-protos.sh` | +| Generate CI matrix | `./bin/generate_ci_matrix.py all [--level pr]` | + +## MCP server (device + test automation) + +The `mcp-server/` package exposes ~32 MCP tools for device discovery, building, flashing, serial monitoring, and live-node administration. Tools are grouped as: + +- **Discovery**: `list_devices`, `list_boards`, `get_board` +- **Build & flash**: `build`, `clean`, `pio_flash`, `erase_and_flash` (ESP32 factory), `update_flash` (ESP32 OTA), `touch_1200bps` +- **Serial sessions**: `serial_open`, `serial_read`, `serial_list`, `serial_close` +- **Device reads**: `device_info`, `list_nodes` +- **Device writes** (require `confirm=True`): `set_owner`, `get_config`, `set_config`, `get_channel_url`, `set_channel_url`, `send_text`, `reboot`, `shutdown`, `factory_reset`, `set_debug_log_api` +- **userPrefs admin**: `userprefs_get`, `userprefs_set`, `userprefs_reset`, `userprefs_manifest`, `userprefs_testing_profile` +- **Vendor escape hatches**: `esptool_*`, `nrfutil_*`, `picotool_*` + +Setup: `cd mcp-server && python3 -m venv .venv && .venv/bin/pip install -e '.[test]'`. The repo registers the server via `.mcp.json` — Claude Code picks it up automatically. + +See `mcp-server/README.md` for argument shapes and the **MCP Server & Hardware Test Harness** section of `.github/copilot-instructions.md` for agent usage rules (tool surface, fixture contract, firmware integration points, recovery playbooks). + +## Slash commands (AI-assisted workflows) + +Three test-and-diagnose workflows exist as slash commands: + +- **`/test` (Claude Code) / `/mcp-test` (Copilot)** — run the hardware test suite and interpret failures +- **`/diagnose` / `/mcp-diagnose`** — read-only device health report +- **`/repro` / `/mcp-repro`** — flakiness triage: re-run one test N times, diff firmware logs between passes and failures + +Bodies live in `.claude/commands/` and `.github/prompts/` respectively. `.claude/commands/README.md` is the index. + +## House rules + +- **No destructive device operations without operator approval.** `factory_reset`, `erase_and_flash`, `reboot`, `shutdown`, history-rewriting git ops — describe the action and stop. Operator authorizes. +- **One MCP call per serial port at a time.** The port lock is exclusive; concurrent calls deadlock. Sequence: open → read/mutate → close, then next device. +- **`userPrefs.jsonc` is session state during tests.** The `_session_userprefs` fixture snapshots + restores it; never edit it from inside a test. +- **Don't speculate about firmware root causes.** When evidence doesn't support a classification, say "unknown" and list what would disambiguate. +- **Run `trunk fmt` before proposing a commit.** The `trunk_check` CI gate will reject unformatted code. +- **`confirm=True` on destructive MCP tools is a real gate, not a formality.** Don't bypass it via auto-approve settings. + +## Typical agent workflows + +### Flashing a device + +1. `list_devices` → find the port + likely VID +2. `list_boards` → confirm the env, or use the known default for the hardware +3. `pio_flash(env=..., port=..., confirm=True)` for any arch, or `erase_and_flash(env=..., port=..., confirm=True)` for an ESP32 factory install + +### Inspecting live node state + +1. `device_info(port=...)` — short summary (node num, firmware version, region, peer count) +2. `list_nodes(port=...)` — full peer table (SNR, RSSI, pubkey presence, last_heard) +3. `get_config(section="lora", port=...)` — LoRa settings for cross-device comparison + +Sequence these; don't parallelize on the same port. + +### Testing a firmware change + +1. Build locally: `pio run -e ` +2. Flash the test device: `pio_flash(env=..., port=..., confirm=True)` +3. Run the suite: `./mcp-server/run-tests.sh tests/` or `/test tests/` +4. On failure, open `mcp-server/tests/report.html` → `Meshtastic debug` section for the firmware log tail + device state dump +5. Iterate + +### Debugging a flaky test + +1. `/repro [count]` — re-runs the test N times, diffs firmware logs between passes and failures +2. If the first attempt always fails and the rest pass, that's a state-leak pattern → suggest `--force-bake` or a clean device state, don't chase the first failure +3. If all N fail, this isn't a flake — it's a regression. Stop iterating and escalate to `/test` for full-suite context. + +## Where to look + +| Path | What's there | +| --------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `src/` | Firmware C++ source (`mesh/`, `modules/`, `platform/`, `graphics/`, `gps/`, `motion/`, `mqtt/`, …) | +| `src/mesh/` | Core: NodeDB, Router, Channels, CryptoEngine, radio interfaces, StreamAPI, PhoneAPI | +| `src/modules/` | Feature modules; `Telemetry/Sensor/` has 50+ I2C sensor drivers | +| `variants/` | 200+ hardware variant definitions (`variant.h` + `platformio.ini` per board) | +| `protobufs/` | `.proto` definitions; regenerate with `bin/regen-protos.sh` | +| `test/` | Firmware unit tests (12 suites; `pio test -e native`) | +| `mcp-server/` | Python MCP server + pytest hardware integration tests | +| `mcp-server/tests/` | Tiered pytest suite: `unit/`, `mesh/`, `telemetry/`, `monitor/`, `fleet/`, `admin/`, `provisioning/` | +| `.claude/commands/` | Claude Code slash command bodies | +| `.github/prompts/` | Copilot prompt bodies (mirrors of the Claude Code ones) | +| `.github/copilot-instructions.md` | **Primary agent instructions — read this** | +| `.github/workflows/` | CI pipelines | +| `.mcp.json` | MCP server registration for Claude Code | + +## Recovery one-liners + +- **`userPrefs.jsonc` dirty after a test run?** Re-run `./mcp-server/run-tests.sh` once (pre-flight self-heals from the sidecar). If still dirty: `git checkout userPrefs.jsonc`. +- **nRF52 not responding?** `mcp__meshtastic__touch_1200bps(port=...)` drops it into the DFU bootloader, then `pio_flash` re-installs. +- **Port busy?** `lsof ` to find the holder. Usually a stale `pio device monitor` or zombie `meshtastic_mcp` process. Kill it. +- **Multiple MCP servers running?** `ps aux | grep meshtastic_mcp` — zombies hold ports. Kill all but the one your host spawned. diff --git a/mcp-server/.gitignore b/mcp-server/.gitignore new file mode 100644 index 000000000..f5180bc71 --- /dev/null +++ b/mcp-server/.gitignore @@ -0,0 +1,26 @@ +.venv/ +__pycache__/ +*.py[cod] +*.egg-info/ +.pytest_cache/ +.mypy_cache/ +dist/ +build/ + +# Test harness artifacts +tests/report.html +tests/junit.xml +tests/reportlog.jsonl +tests/fwlog.jsonl +# Subprocess-output tee from pio/esptool/nrfutil/picotool (live flash +# progress for the TUI; also a post-run diagnostic for plain CLI runs). +tests/flash.log +tests/tool_coverage.json +tests/.coverage +htmlcov/ +# Persistent run counter for meshtastic-mcp-test-tui header. +tests/.tui-runs +# Cross-run history (TUI duration sparkline). +tests/.history/ +# Reproducer bundles (TUI `x` export on failed tests). +tests/reproducers/ diff --git a/mcp-server/README.md b/mcp-server/README.md new file mode 100644 index 000000000..7d5fc551a --- /dev/null +++ b/mcp-server/README.md @@ -0,0 +1,270 @@ +# Meshtastic MCP Server + +An [MCP](https://modelcontextprotocol.io) server for working with the Meshtastic firmware repo and connected devices. Lets Claude Code / Claude Desktop: + +- Discover USB-connected Meshtastic devices +- Enumerate PlatformIO board variants (166+) with Meshtastic metadata +- Build, clean, flash, erase-and-flash (factory), and OTA-update firmware +- Read serial logs via `pio device monitor` (with board-specific exception decoders) +- Trigger 1200bps touch-reset for bootloader entry (nRF52, ESP32-S3, RP2040) +- Query and administer a running node via the [`meshtastic` Python API](https://github.com/meshtastic/python): owner name, config (LocalConfig + ModuleConfig), channels, messaging, reboot/shutdown/factory-reset +- Call `esptool`, `nrfutil`, `picotool` directly when PlatformIO doesn't cover the operation + +## Design principle + +**PlatformIO first.** Its `pio run -t upload` knows the correct protocol, offsets, and post-build chain for every variant in `variants/`. Direct vendor-tool wrappers (`esptool_*`, `nrfutil_*`, `picotool_*`) exist as escape hatches for operations pio doesn't cover (blank-chip erase, DFU `.zip` packages, BOOTSEL-mode inspection). + +## Prerequisites + +- Python ≥ 3.11 +- [PlatformIO Core](https://platformio.org/install/cli) — `pio` on `$PATH` or at `~/.platformio/penv/bin/pio` +- The Meshtastic firmware repo checked out somewhere (set via `MESHTASTIC_FIRMWARE_ROOT`) +- Optional: `esptool`, `nrfutil`, `picotool` on `$PATH` (or under the firmware venv at `.venv/bin/`) if you want to use the direct-tool wrappers + +## Install + +```bash +cd /mcp-server +python3 -m venv .venv +.venv/bin/pip install -e . +``` + +Verify: + +```bash +MESHTASTIC_FIRMWARE_ROOT= .venv/bin/python -m meshtastic_mcp +``` + +The server blocks on stdin (that's correct — it speaks MCP over stdio). Ctrl-C to exit. + +## Register with Claude Code + +Edit `~/.claude/settings.json` (global) or `/.claude/settings.local.json` (project-only): + +```json +{ + "mcpServers": { + "meshtastic": { + "command": "/mcp-server/.venv/bin/python", + "args": ["-m", "meshtastic_mcp"], + "env": { + "MESHTASTIC_FIRMWARE_ROOT": "" + } + } + } +} +``` + +Replace `` with the absolute path, e.g. `/Users/you/GitHub/firmware`. Restart Claude Code after editing. + +## Register with Claude Desktop + +Same `mcpServers` block, but in `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). + +## Tools (38) + +### Discovery & metadata + +| Tool | What it does | +| -------------- | ------------------------------------------------------------------------------------------ | +| `list_devices` | USB/serial port listing, flags likely-Meshtastic candidates | +| `list_boards` | PlatformIO envs with `custom_meshtastic_*` metadata; filters by arch/supported/query/level | +| `get_board` | Full env dict incl. raw pio config | + +### Build & flash + +| Tool | What it does | +| ----------------- | -------------------------------------------------------------------- | +| `build` | `pio run -e ` (+ mtjson target) | +| `clean` | `pio run -e -t clean` | +| `pio_flash` | `pio run -e -t upload --upload-port ` — any architecture | +| `erase_and_flash` | ESP32 full factory flash via `bin/device-install.sh` | +| `update_flash` | ESP32 OTA app-partition update via `bin/device-update.sh` | +| `touch_1200bps` | 1200-baud open/close to trigger USB CDC bootloader entry | + +### Serial log sessions + +Backed by long-running `pio device monitor` subprocesses with a 10k-line ring buffer per session and board-specific filters (`esp32_exception_decoder` auto-selected when you pass `env=`). + +| Tool | What it does | +| -------------- | ------------------------------------------------------------------ | +| `serial_open` | Start a monitor session; returns `session_id` | +| `serial_read` | Cursor-based pull; reports `dropped` if lines aged out of the ring | +| `serial_list` | All active sessions | +| `serial_close` | Terminate a session | + +### Device reads + +| Tool | What it does | +| ------------- | --------------------------------------------------------------------------- | +| `device_info` | my_node_num, long/short name, firmware version, region, channel, node count | +| `list_nodes` | Full node database with position, SNR, RSSI, last_heard, battery | + +_The tool tables below document 38 currently registered MCP server tools._ + +### Device writes + +| Tool | What it does | +| ------------------- | -------------------------------------------------------------------------- | +| `set_owner` | Long name + optional short name (≤4 chars) | +| `get_config` | One section or all (LocalConfig + ModuleConfig) | +| `set_config` | Dot-path field write: `lora.region`=`"US"`, `device.role`=`"ROUTER"`, etc. | +| `get_channel_url` | Primary-only or include_all=admin URL | +| `set_channel_url` | Import channels from a Meshtastic URL | +| `set_debug_log_api` | Enable or disable debug logging for the Meshtastic Python API client | +| `send_text` | Broadcast or direct text message | +| `reboot` | `localNode.reboot(secs)` — requires `confirm=True` | +| `shutdown` | `localNode.shutdown(secs)` — requires `confirm=True` | +| `factory_reset` | `localNode.factoryReset(full?)` — requires `confirm=True` | + +### Direct hardware tools (escape hatches) + +| Tool | What it does | +| --------------------- | --------------------------------------------------------- | +| `esptool_chip_info` | Read chip, MAC, crystal, flash size | +| `esptool_erase_flash` | Full-chip erase (destructive) | +| `esptool_raw` | Pass-through; confirm=True required for write/erase/merge | +| `nrfutil_dfu` | DFU-flash a `.zip` package | +| `nrfutil_raw` | Pass-through | +| `picotool_info` | Read Pico BOOTSEL-mode info | +| `picotool_load` | Load a UF2 | +| `picotool_raw` | Pass-through | + +## Safety + +- **All destructive flash/admin tools require `confirm=True`** as a tool-level gate, on top of any permission prompt from Claude. +- **Serial port is exclusive.** If a `serial_*` session is active on a port, `device_info`/admin tools on the same port will fail fast with a pointer at the active `session_id`. Close the session first. +- **Flash confirmation by architecture**: `erase_and_flash` / `update_flash` error if the env's architecture isn't ESP32 — use `pio_flash` for nRF52/RP2040/STM32. + +## Environment variables + +| Var | Default | Purpose | +| -------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------- | +| `MESHTASTIC_FIRMWARE_ROOT` | walks up from cwd for `platformio.ini` | Pin the firmware repo | +| `MESHTASTIC_PIO_BIN` | `~/.platformio/penv/bin/pio` → `$PATH` `pio` → `platformio` | Override `pio` location | +| `MESHTASTIC_ESPTOOL_BIN` | `/.venv/bin/esptool` → `$PATH` | Override esptool | +| `MESHTASTIC_NRFUTIL_BIN` | `$PATH` | Override nrfutil | +| `MESHTASTIC_PICOTOOL_BIN` | `$PATH` | Override picotool | +| `MESHTASTIC_MCP_SEED` | `mcp--` | PSK seed for test-harness session (CI override) | +| `MESHTASTIC_MCP_FLASH_LOG` | `/tests/flash.log` | Tee target for pio/esptool/nrfutil subprocess output (TUI tails it) | + +## Hardware Test Suite + +`mcp-server/tests/` holds a pytest-based integration suite that exercises +real USB-connected Meshtastic devices against the MCP server surface. Separate +from the native C++ unit tests in the firmware repo's top-level `test/` +directory — this one validates the device-facing behavior end-to-end. + +### Invocation + +```bash +./mcp-server/run-tests.sh # full suite (auto-detect + auto-bake-if-needed) +./mcp-server/run-tests.sh --force-bake # reflash devices before testing +./mcp-server/run-tests.sh --assume-baked # skip the bake step (caller vouches for state) +./mcp-server/run-tests.sh tests/mesh # one tier +./mcp-server/run-tests.sh tests/mesh/test_traceroute.py # one file +./mcp-server/run-tests.sh -k telemetry # pytest name filter +``` + +The wrapper auto-detects connected devices (VID `0x239A` → `nrf52` → env +`rak4631`; `0x303A` or `0x10C4` → `esp32s3` → env `heltec-v3`), exports +`MESHTASTIC_MCP_ENV_` env vars, and invokes pytest. Overrides via +per-role env vars: `MESHTASTIC_MCP_ENV_NRF52=heltec-mesh-node-t114 ./run-tests.sh`. + +No hardware connected? The wrapper narrows to `tests/unit/` only and says so +in the pre-flight header. + +### Tiers (run in this order) + +- **`bake`** (`tests/test_00_bake.py`) — flashes both hub roles with the + session's test profile. Has a skip-if-already-baked check (region + channel + match); `--force-bake` overrides. +- **`unit`** — pure Python, no hardware. boards / PIO wrapper / + userPrefs-parse / testing-profile fixtures. +- **`mesh`** — 2-device mesh: formation, broadcast delivery, direct+ACK, + traceroute, bidirectional. Parametrized over both directions. +- **`telemetry`** — periodic telemetry broadcast + on-demand request/reply + (`TELEMETRY_APP` with `wantResponse=True`). +- **`monitor`** — boot log has no panic markers within 60 s of reboot. +- **`fleet`** — PSK-seed isolation: two labs with different seeds never + overlap. +- **`admin`** — owner persistence across reboot, channel URL round-trip, + `lora.hop_limit` persistence. +- **`provisioning`** — region/channel baking, userPrefs survive + `factory_reset(full=False)`. + +### Artifacts (regenerated every run, under `tests/`) + +- `report.html` — self-contained pytest-html report. Each test gets a + **Meshtastic debug** section attached on failure with a 200-line firmware + log tail + device-state dump. Open this first on failures. +- `junit.xml` — CI-parseable. +- `reportlog.jsonl` — `pytest-reportlog` event stream; consumed by the TUI. +- `fwlog.jsonl` — firmware log mirror (`meshtastic.log.line` pubsub → JSONL). +- `flash.log` — tee of all pio / esptool / nrfutil / picotool subprocess + output during the run (driven by `MESHTASTIC_MCP_FLASH_LOG`). + +### Live TUI + +```bash +.venv/bin/meshtastic-mcp-test-tui +.venv/bin/meshtastic-mcp-test-tui tests/mesh # pytest args pass through +``` + +Textual-based wrapper over `run-tests.sh` with a live test tree, tier +counters, pytest output pane, firmware-log pane, and a device-status strip. +Key bindings: `r` re-run focused, `f` filter, `d` failure detail, `g` open +`report.html`, `x` export reproducer bundle, `l` cycle fw-log filter, `q` +quit (SIGINT → SIGTERM → SIGKILL escalation). + +### Slash commands + +Three AI-assisted workflows are wired up for Claude Code operators +(`.claude/commands/`) and Copilot operators (`.github/prompts/`): +`/test` (run + interpret), `/diagnose` (read-only health report), `/repro` +(flake triage, N-times re-run with log diff). + +### House rules (for human + agent contributors) + +- Session-scoped fixtures in `tests/conftest.py` snapshot + restore + `userPrefs.jsonc`; **never edit `userPrefs.jsonc` from inside a test**. + Use the `test_profile` / `no_region_profile` fixtures for ephemeral + overrides. +- `SerialInterface` holds an **exclusive port lock**; sequence calls + open → mutate → close, then next device. No parallel calls to the + same port. +- Directed PKI-encrypted sends need **bilateral NodeInfo warmup** — + both sides must hold the other's current pubkey. See + `tests/mesh/_receive.py::nudge_nodeinfo_port` and the three directed- + send tests (`test_direct_with_ack`, `test_traceroute`, + `test_telemetry_request_reply`) for the canonical pattern. + +## Layout + +```text +mcp-server/ +├── pyproject.toml +├── README.md +└── src/meshtastic_mcp/ + ├── __main__.py # entry: python -m meshtastic_mcp + ├── server.py # FastMCP app + @app.tool() registrations (thin) + ├── config.py # firmware_root, pio_bin, esptool_bin, etc. + ├── pio.py # subprocess wrapper (timeouts, JSON, tail_lines) + ├── devices.py # list_devices (findPorts + comports) + ├── boards.py # list_boards / get_board (pio project config parse + cache) + ├── flash.py # build, clean, flash, erase_and_flash, update_flash, touch_1200bps + ├── serial_session.py # SerialSession + reader thread + ring buffer + ├── registry.py # session registry + per-port locks + ├── connection.py # connect(port) ctx mgr — SerialInterface + port lock + ├── info.py # device_info, list_nodes + ├── admin.py # set_owner, get/set_config, channels, send_text, reboot/shutdown/factory_reset + └── hw_tools.py # esptool / nrfutil / picotool wrappers +``` + +## Troubleshooting + +- **"Could not locate Meshtastic firmware root"** — set `MESHTASTIC_FIRMWARE_ROOT`. +- **"Could not find `pio`"** — install PlatformIO or set `MESHTASTIC_PIO_BIN`. +- **"Port is held by serial session ..."** — call `serial_close(session_id)` or `serial_list` to find it. +- **`factory.bin` not found after build** — the env may not be ESP32; only ESP32 envs produce a `.factory.bin`. +- **`touch_1200bps` reported `new_port: null`** — the device may not have 1200bps-reset stdio, or the bootloader re-uses the same port name. Check `list_devices` manually. diff --git a/mcp-server/pyproject.toml b/mcp-server/pyproject.toml new file mode 100644 index 000000000..d73bf795f --- /dev/null +++ b/mcp-server/pyproject.toml @@ -0,0 +1,39 @@ +[project] +name = "meshtastic-mcp" +version = "0.1.0" +description = "MCP server for Meshtastic firmware development: device discovery, PlatformIO tooling, flashing, serial monitoring, and device administration via the meshtastic Python API." +readme = "README.md" +requires-python = ">=3.11" +license = { text = "GPL-3.0-only" } +authors = [{ name = "thebentern" }] +dependencies = ["mcp>=1.2", "pyserial>=3.5", "meshtastic>=2.7.8"] + +[project.optional-dependencies] +dev = ["pytest>=7"] +test = [ + "pytest>=8", + "pytest-html>=4", + "pytest-reportlog>=0.4", + "pytest-timeout>=2.3", + "coverage[toml]>=7", + "pyyaml>=6", + # textual is required by the `meshtastic-mcp-test-tui` script (see + # `src/meshtastic_mcp/cli/test_tui.py`). Bundled into `test` rather than a + # separate `[tui]` extra because v1 expects test operators are the only + # consumers; revisit if install cost pushes back. + "textual>=0.50", +] + +[project.scripts] +meshtastic-mcp = "meshtastic_mcp.__main__:main" +# Live TUI wrapping run-tests.sh — shells out to the same script the plain +# CLI uses, tails pytest-reportlog for per-test state, and polls the device +# list at startup + post-run (port lock forces it to stay idle during the run). +meshtastic-mcp-test-tui = "meshtastic_mcp.cli.test_tui:main" + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[tool.hatch.build.targets.wheel] +packages = ["src/meshtastic_mcp"] diff --git a/mcp-server/run-tests.sh b/mcp-server/run-tests.sh new file mode 100755 index 000000000..292e6e3a2 --- /dev/null +++ b/mcp-server/run-tests.sh @@ -0,0 +1,236 @@ +#!/usr/bin/env bash +# mcp-server hardware test runner. +# +# Auto-detects connected Meshtastic devices, maps each to its PlatformIO env +# via the same role table the pytest fixtures use, exports the right +# MESHTASTIC_MCP_ENV_* env vars, and invokes pytest. +# +# Usage: +# ./run-tests.sh # full suite, default pytest args +# ./run-tests.sh tests/mesh # subset (any pytest args pass through) +# ./run-tests.sh --force-bake # override one default with another +# MESHTASTIC_MCP_ENV_NRF52=foo ./run-tests.sh # override env per role +# MESHTASTIC_MCP_SEED=ci-run-42 ./run-tests.sh # override PSK seed +# +# If zero supported devices are detected, only the unit tier runs. +# +# Also restores `userPrefs.jsonc` from the session-backup sidecar if a prior +# run exited abnormally (belt to conftest.py's atexit suspenders). + +set -euo pipefail + +# cd to the script's directory so relative paths resolve consistently no +# matter where the user invoked from. +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +cd "$SCRIPT_DIR" + +VENV_PY="$SCRIPT_DIR/.venv/bin/python" +if [[ ! -x $VENV_PY ]]; then + echo "error: $VENV_PY not found or not executable." >&2 + echo " Bootstrap the venv first:" >&2 + echo " cd $SCRIPT_DIR && python3 -m venv .venv && .venv/bin/pip install -e '.[test]'" >&2 + exit 2 +fi + +# Resolve firmware root the same way conftest.py does (this script sits in +# mcp-server/, firmware repo root is one level up). +FIRMWARE_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +USERPREFS_PATH="$FIRMWARE_ROOT/userPrefs.jsonc" +USERPREFS_SIDECAR="$USERPREFS_PATH.mcp-session-bak" + +# ---------- Pre-flight: recover stale userPrefs.jsonc from prior crash ---- +# If conftest.py's atexit hook didn't fire (SIGKILL, kernel panic, OS +# restart), the sidecar is the ground truth. Self-heal before running so we +# don't bake the previous run's dirty state into this run's firmware. +if [[ -f $USERPREFS_SIDECAR ]]; then + echo "[pre-flight] found $USERPREFS_SIDECAR from a prior abnormal exit;" >&2 + echo " restoring userPrefs.jsonc before starting." >&2 + cp "$USERPREFS_SIDECAR" "$USERPREFS_PATH" + rm -f "$USERPREFS_SIDECAR" +fi + +# If userPrefs.jsonc has uncommitted changes BEFORE the run starts, that's +# worth warning about — tests will snapshot this dirty state and restore to +# it at the end, which may not be what the operator wants. +if command -v git >/dev/null 2>&1; then + cd "$FIRMWARE_ROOT" + # Capture the git status into a local first — SC2312 flags command + # substitution inside `[[ -n ... ]]` because the exit code of `git + # status` is masked. A two-step assignment makes the failure path + # explicit (non-git, missing file) and keeps the bracket test clean. + _git_status_porcelain="$(git status --porcelain userPrefs.jsonc 2>/dev/null || true)" + if [[ -n $_git_status_porcelain ]]; then + echo "[pre-flight] warning: userPrefs.jsonc has uncommitted changes." >&2 + echo " Tests will snapshot THIS state and restore to it" >&2 + echo " at teardown. If that's not intended, run:" >&2 + echo " git checkout userPrefs.jsonc" >&2 + echo " and re-invoke." >&2 + fi + cd "$SCRIPT_DIR" +fi + +# ---------- Seed default -------------------------------------------------- +# Per-machine default so repeated runs from the same operator land on the +# same PSK (makes --assume-baked valid across invocations). Operator can +# override with an explicit env var if they want isolation (e.g. CI). +if [[ -z ${MESHTASTIC_MCP_SEED-} ]]; then + WHO="$(whoami 2>/dev/null || echo anon)" + HOST="$(hostname -s 2>/dev/null || echo host)" + export MESHTASTIC_MCP_SEED="mcp-${WHO}-${HOST}" +fi + +# ---------- Flash progress log -------------------------------------------- +# pio.py / hw_tools.py tee subprocess output (pio run -t upload, esptool, +# nrfutil, picotool) to this file line-by-line as it arrives when this env +# var is set. The TUI tails it so the operator sees live flash progress +# instead of 3 minutes of silence during `test_00_bake.py`. Plain CLI users +# also benefit — the log is a post-run diagnostic even without the TUI. +# Truncate at session start so each run gets a clean log. +export MESHTASTIC_MCP_FLASH_LOG="$SCRIPT_DIR/tests/flash.log" +: >"$MESHTASTIC_MCP_FLASH_LOG" + +# ---------- Detect connected hardware ------------------------------------- +# In-process call to the same Python API the test fixtures use, so the +# script never drifts from what pytest sees. Returns a JSON object +# {role: port, ...}. +ROLES_JSON="$( + "$VENV_PY" - <<'PY' +import json +import sys + +sys.path.insert(0, "src") +from meshtastic_mcp import devices + +# Role → canonical VID map. Kept in sync with +# `tests/conftest.py::hub_profile` defaults; if that changes, this must too. +ROLE_BY_VID = { + 0x239A: "nrf52", # Adafruit / RAK nRF52 native USB (app + DFU) + 0x303A: "esp32s3", # Espressif native USB (ESP32-S3) + 0x10C4: "esp32s3", # CP2102 USB-UART (common on Heltec/LilyGO ESP32 boards) +} + +out: dict[str, str] = {} +for dev in devices.list_devices(include_unknown=True): + vid_raw = dev.get("vid") or "" + try: + if isinstance(vid_raw, str) and vid_raw.startswith("0x"): + vid = int(vid_raw, 16) + else: + vid = int(vid_raw) + except (TypeError, ValueError): + continue + role = ROLE_BY_VID.get(vid) + # First port wins per role — matches hub_devices fixture semantics. + if role and role not in out: + out[role] = dev["port"] + +json.dump(out, sys.stdout) +PY +)" + +# ---------- Map role → pio env -------------------------------------------- +# Honor MESHTASTIC_MCP_ENV_ operator overrides; fall back to the +# same defaults hardcoded in tests/conftest.py::_DEFAULT_ROLE_ENVS. +resolve_env() { + local role="$1" + local default="$2" + local upper + upper="$(echo "$role" | tr '[:lower:]' '[:upper:]')" + local var="MESHTASTIC_MCP_ENV_${upper}" + eval "local override=\${$var:-}" + if [[ -n $override ]]; then + echo "$override" + else + echo "$default" + fi +} + +NRF52_PORT="$(echo "$ROLES_JSON" | "$VENV_PY" -c 'import json,sys; print(json.loads(sys.stdin.read()).get("nrf52", ""))')" +ESP32S3_PORT="$(echo "$ROLES_JSON" | "$VENV_PY" -c 'import json,sys; print(json.loads(sys.stdin.read()).get("esp32s3", ""))')" + +DETECTED="" +if [[ -n $NRF52_PORT ]]; then + NRF52_ENV="$(resolve_env nrf52 rak4631)" + export MESHTASTIC_MCP_ENV_NRF52="$NRF52_ENV" + DETECTED="${DETECTED} nrf52 @ ${NRF52_PORT} -> env=${NRF52_ENV}\n" +fi +if [[ -n $ESP32S3_PORT ]]; then + ESP32S3_ENV="$(resolve_env esp32s3 heltec-v3)" + export MESHTASTIC_MCP_ENV_ESP32S3="$ESP32S3_ENV" + DETECTED="${DETECTED} esp32s3 @ ${ESP32S3_PORT} -> env=${ESP32S3_ENV}\n" +fi + +# ---------- Pre-flight summary -------------------------------------------- +# Surface what pytest is about to do with respect to the bake phase: the +# operator should see "will verify + bake if needed" by default, so a +# 3-minute flash appearing mid-run isn't a surprise. Detection of the +# explicit overrides is best-effort — we just scan $@ for the known flags. +_bake_mode="auto (verify + bake if needed)" +for _arg in "$@"; do + case "$_arg" in + --assume-baked) _bake_mode="skip (--assume-baked)" ;; + --force-bake) _bake_mode="force (--force-bake)" ;; + *) ;; # any other arg: pass-through; bake mode unchanged + esac +done + +echo "mcp-server test runner" +echo " firmware root : $FIRMWARE_ROOT" +echo " seed : $MESHTASTIC_MCP_SEED" +echo " bake : $_bake_mode" +if [[ -n $DETECTED ]]; then + echo " detected hub :" + printf "%b" "$DETECTED" +else + echo " detected hub : (none)" +fi +echo + +# ---------- Invoke pytest ------------------------------------------------- +# If no devices detected, only the unit tier would produce meaningful +# PASS/FAIL — every hardware test would SKIP with "role not present". We +# narrow to tests/unit explicitly so the summary reads as "no hardware, +# unit suite only" instead of "big skip count looks suspicious". +if [[ -z $DETECTED && $# -eq 0 ]]; then + echo "[pre-flight] no supported devices detected; running unit tier only." + echo + exec "$VENV_PY" -m pytest tests/unit -v --report-log=tests/reportlog.jsonl +fi + +# Default pytest args when the user passed none. Power users can invoke +# `./run-tests.sh tests/mesh -v --tb=long` and skip all of these defaults. +# +# NOTE: `--assume-baked` is DELIBERATELY omitted here. `tests/test_00_bake.py` +# has an internal skip-if-already-baked check (`_bake_role`: query device_info, +# compare region + primary_channel to the session profile, skip on match). +# So the fast path is ~8-10 s of verification overhead when the devices are +# already baked — negligible next to the 2-6 min suite runtime. Letting +# test_00_bake.py run means a fresh device, a re-seeded session, or a post- +# factory-reset device gets flashed automatically instead of silently +# skipping half the hardware tests with "not baked with session profile" +# errors. Power users who know their hardware is current and want to shave +# those seconds can pass `--assume-baked` explicitly. +if [[ $# -eq 0 ]]; then + set -- tests/ \ + --html=tests/report.html --self-contained-html \ + --junitxml=tests/junit.xml \ + -v --tb=short +fi + +# Always emit `tests/reportlog.jsonl` (unless the operator explicitly passed +# their own `--report-log=...`). Consumers — notably the +# `meshtastic-mcp-test-tui` TUI — tail the reportlog for live per-test state. +# Appending here means power-user invocations like `./run-tests.sh tests/mesh` +# also produce it, not just the all-defaults invocation. +_has_report_log=0 +for _arg in "$@"; do + case "$_arg" in + --report-log | --report-log=*) _has_report_log=1 ;; + *) ;; # any other arg: no-op; loop continues + esac +done +if [[ $_has_report_log -eq 0 ]]; then + set -- "$@" --report-log=tests/reportlog.jsonl +fi + +exec "$VENV_PY" -m pytest "$@" diff --git a/mcp-server/src/meshtastic_mcp/__init__.py b/mcp-server/src/meshtastic_mcp/__init__.py new file mode 100644 index 000000000..bd696afe0 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/__init__.py @@ -0,0 +1,3 @@ +"""Meshtastic MCP server — device discovery, PlatformIO tooling, and device admin.""" + +__version__ = "0.1.0" diff --git a/mcp-server/src/meshtastic_mcp/__main__.py b/mcp-server/src/meshtastic_mcp/__main__.py new file mode 100644 index 000000000..4ed67db38 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/__main__.py @@ -0,0 +1,11 @@ +"""Entry point for `python -m meshtastic_mcp`.""" + +from meshtastic_mcp.server import app + + +def main() -> None: + app.run() + + +if __name__ == "__main__": + main() diff --git a/mcp-server/src/meshtastic_mcp/admin.py b/mcp-server/src/meshtastic_mcp/admin.py new file mode 100644 index 000000000..6da92d860 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/admin.py @@ -0,0 +1,377 @@ +"""Device administration: owner, config, channels, messaging, admin actions. + +All operations use the same `connect()` context manager so port selection, +port-busy detection, and cleanup are handled uniformly. + +Config writes use a dot-path: the first segment names a section (e.g. +`"lora"` in LocalConfig or `"mqtt"` in LocalModuleConfig), remaining segments +walk protobuf fields. Enum fields accept their string names (`"US"` for +`lora.region`) so callers don't need to know the numeric values. +""" + +from __future__ import annotations + +from typing import Any + +from google.protobuf import descriptor as pb_descriptor +from google.protobuf import json_format +from meshtastic.protobuf import localonly_pb2 + +from .connection import connect + + +class AdminError(RuntimeError): + pass + + +LOCAL_CONFIG_SECTIONS = {f.name for f in localonly_pb2.LocalConfig.DESCRIPTOR.fields} +MODULE_CONFIG_SECTIONS = { + f.name for f in localonly_pb2.LocalModuleConfig.DESCRIPTOR.fields +} + + +def _require_confirm(confirm: bool, operation: str) -> None: + if not confirm: + raise AdminError(f"{operation} is destructive and requires confirm=True.") + + +def _message_to_dict(msg: Any) -> dict[str, Any]: + # `including_default_value_fields` was renamed to + # `always_print_fields_with_no_presence` in protobuf 5.26+. Pick whichever + # kwarg the installed version accepts so we work against both. + kwargs: dict[str, Any] = {"preserving_proto_field_name": True} + import inspect + + sig = inspect.signature(json_format.MessageToDict) + if "always_print_fields_with_no_presence" in sig.parameters: + kwargs["always_print_fields_with_no_presence"] = False + elif "including_default_value_fields" in sig.parameters: + kwargs["including_default_value_fields"] = False + return json_format.MessageToDict(msg, **kwargs) + + +# ---------- owner ---------------------------------------------------------- + + +def set_owner( + long_name: str, + short_name: str | None = None, + port: str | None = None, +) -> dict[str, Any]: + if short_name is not None and len(short_name) > 4: + raise AdminError("short_name must be 4 characters or fewer") + with connect(port=port) as iface: + iface.localNode.setOwner(long_name=long_name, short_name=short_name) + return { + "ok": True, + "long_name": long_name, + "short_name": short_name, + } + + +# ---------- config reads --------------------------------------------------- + + +def _section_container(node, section: str) -> tuple[Any, str]: + """Return (container_message, parent_name) for a section name. + + Parent is 'localConfig' or 'moduleConfig' so callers know where to call + writeConfig() after mutating. + """ + if section in LOCAL_CONFIG_SECTIONS: + return getattr(node.localConfig, section), "localConfig" + if section in MODULE_CONFIG_SECTIONS: + return getattr(node.moduleConfig, section), "moduleConfig" + raise AdminError( + f"Unknown config section: {section!r}. " + f"Valid sections: {sorted(LOCAL_CONFIG_SECTIONS | MODULE_CONFIG_SECTIONS)}" + ) + + +def get_config(section: str | None = None, port: str | None = None) -> dict[str, Any]: + """Read one or all config sections. + + `section` may be any name in LocalConfig (device, lora, position, power, + network, display, bluetooth, security) or LocalModuleConfig (mqtt, serial, + telemetry, ...). Omit `section` or pass `"all"` for everything. + """ + with connect(port=port) as iface: + node = iface.localNode + if section in (None, "all"): + lc = _message_to_dict(node.localConfig) + mc = _message_to_dict(node.moduleConfig) + return { + "config": { + "localConfig": lc, + "moduleConfig": mc, + } + } + container, _parent = _section_container(node, section) + return {"config": {section: _message_to_dict(container)}} + + +# ---------- config writes -------------------------------------------------- + + +def _coerce_enum(field: pb_descriptor.FieldDescriptor, value: Any) -> int: + """Accept an enum value as either its int or its string name.""" + enum_type = field.enum_type + if isinstance(value, bool): + raise AdminError(f"{field.name}: expected enum {enum_type.name}, got bool") + if isinstance(value, int): + if enum_type.values_by_number.get(value) is None: + raise AdminError( + f"{field.name}: {value} is not a valid {enum_type.name} value" + ) + return value + if isinstance(value, str): + upper = value.upper() + ev = enum_type.values_by_name.get(upper) + if ev is None: + valid = sorted(enum_type.values_by_name.keys()) + raise AdminError( + f"{field.name}: {value!r} is not a valid {enum_type.name}. " + f"Valid: {valid}" + ) + return ev.number + raise AdminError( + f"{field.name}: expected enum {enum_type.name}, got {type(value).__name__}" + ) + + +def _coerce_scalar(field: pb_descriptor.FieldDescriptor, value: Any) -> Any: + t = field.type + FT = pb_descriptor.FieldDescriptor + if t == FT.TYPE_ENUM: + return _coerce_enum(field, value) + if t == FT.TYPE_BOOL: + if isinstance(value, bool): + return value + if isinstance(value, str): + return value.strip().lower() in ("true", "yes", "1", "on") + if isinstance(value, int): + return bool(value) + if t in ( + FT.TYPE_INT32, + FT.TYPE_INT64, + FT.TYPE_UINT32, + FT.TYPE_UINT64, + FT.TYPE_SINT32, + FT.TYPE_SINT64, + FT.TYPE_FIXED32, + FT.TYPE_FIXED64, + ): + return int(value) + if t in (FT.TYPE_FLOAT, FT.TYPE_DOUBLE): + return float(value) + if t == FT.TYPE_STRING: + return str(value) + if t == FT.TYPE_BYTES: + if isinstance(value, (bytes, bytearray)): + return bytes(value) + return str(value).encode("utf-8") + raise AdminError( + f"{field.name}: unsupported field type {t}. Use raw protobuf for this field." + ) + + +def _walk_to_field( + root_msg: Any, path_segments: list[str] +) -> tuple[Any, pb_descriptor.FieldDescriptor]: + """Walk `root_msg` by field names until the leaf; return (parent_msg, leaf_field_descriptor).""" + msg = root_msg + for i, name in enumerate(path_segments): + desc = msg.DESCRIPTOR + field = desc.fields_by_name.get(name) + if field is None: + trail = ".".join(path_segments[:i] or [""]) + valid = [f.name for f in desc.fields] + raise AdminError(f"No field {name!r} in {trail}. Valid: {valid}") + is_last = i == len(path_segments) - 1 + if is_last: + return msg, field + if field.type != pb_descriptor.FieldDescriptor.TYPE_MESSAGE: + raise AdminError( + f"{'.'.join(path_segments[:i+1])} is a scalar; cannot descend into it" + ) + msg = getattr(msg, name) + # path_segments was empty + raise AdminError("Empty config path") + + +def set_config(path: str, value: Any, port: str | None = None) -> dict[str, Any]: + """Set a single config field by dot-path and write it to the device. + + Examples: + set_config("lora.region", "US") + set_config("lora.modem_preset", "LONG_FAST") + set_config("device.role", "ROUTER") + set_config("mqtt.enabled", True) + set_config("mqtt.address", "mqtt.example.com") + + """ + segments = [s for s in path.split(".") if s] + if not segments: + raise AdminError("path cannot be empty") + section = segments[0] + + with connect(port=port) as iface: + node = iface.localNode + container, parent_name = _section_container(node, section) + + # Treat the section as the root; the rest of the path walks into it. + leaf_parent, field = _walk_to_field(container, segments[1:] or []) + # Use `is_repeated` (modern upb protobuf API) rather than the + # deprecated `label == LABEL_REPEATED` check — the C-extension + # FieldDescriptor in protobuf >= 5.x doesn't expose `.label` at + # all, and `is_repeated` is the supported replacement that works + # across both the pure-python and upb backends. + if field.is_repeated: + raise AdminError( + f"{path!r} is a repeated field; v1 only supports scalar sets. " + "Use the raw meshtastic CLI for now." + ) + old_raw = getattr(leaf_parent, field.name) + coerced = _coerce_scalar(field, value) + try: + setattr(leaf_parent, field.name, coerced) + except (TypeError, ValueError) as exc: + raise AdminError(f"{path}: {exc}") from exc + + node.writeConfig(section) + + # Stringify enums for the response (so the caller can see the change in + # the same vocabulary they used to set it). + if field.type == pb_descriptor.FieldDescriptor.TYPE_ENUM: + try: + old_display = field.enum_type.values_by_number[old_raw].name + new_display = field.enum_type.values_by_number[coerced].name + except Exception: + old_display, new_display = old_raw, coerced + else: + old_display, new_display = old_raw, coerced + + return { + "ok": True, + "path": path, + "section": section, + "parent": parent_name, + "old_value": old_display, + "new_value": new_display, + } + + +# ---------- channels ------------------------------------------------------- + + +def get_channel_url( + include_all: bool = False, port: str | None = None +) -> dict[str, Any]: + with connect(port=port) as iface: + url = iface.localNode.getURL(includeAll=include_all) + return {"url": url} + + +def set_channel_url(url: str, port: str | None = None) -> dict[str, Any]: + with connect(port=port) as iface: + # setURL replaces the channel set from the URL's contents. It does not + # return a count; we infer by counting non-DISABLED channels after. + iface.localNode.setURL(url) + channels = iface.localNode.channels or [] + active = sum(1 for c in channels if getattr(c, "role", 0) != 0) + return {"ok": True, "channels_imported": active} + + +# ---------- messaging ------------------------------------------------------ + + +def send_text( + text: str, + to: str | int | None = None, + channel_index: int = 0, + want_ack: bool = False, + port: str | None = None, +) -> dict[str, Any]: + destination = to if to is not None else "^all" + with connect(port=port) as iface: + packet = iface.sendText( + text, + destinationId=destination, + wantAck=want_ack, + channelIndex=channel_index, + ) + packet_id = getattr(packet, "id", None) + return {"ok": True, "packet_id": packet_id, "destination": destination} + + +# ---------- diagnostics ---------------------------------------------------- + + +def set_debug_log_api(enabled: bool, port: str | None = None) -> dict[str, Any]: + """Toggle `config.security.debug_log_api_enabled` on the local node. + + When enabled, firmware emits log lines as protobuf `LogRecord` messages + over the StreamAPI instead of raw text. meshtastic-python surfaces them + on pubsub topic `meshtastic.log.line`, which flows through the SAME + SerialInterface our tests already hold open — no `pio device monitor` + needed, no port-contention with admin/info calls. + + Firmware gate: `src/SerialConsole.cpp` (`usingProtobufs && + config.security.debug_log_api_enabled`). Setting persists in NVS; it + survives reboot. `factory_reset(full=False)` clears it unless it's + re-applied after reset. + + Previously-documented concurrency hazard (emitLogRecord sharing the + main packet-emission buffers) has been fixed — see `StreamAPI.h` + where the log path now owns dedicated `fromRadioScratchLog` / + `txBufLog` buffers, and `StreamAPI::emitTxBuffer` + + `StreamAPI::emitLogRecord` both serialize their `stream->write` + calls via `streamLock`. Leaving the flag on under traffic is safe. + """ + with connect(port=port) as iface: + sec = iface.localNode.localConfig.security + sec.debug_log_api_enabled = bool(enabled) + iface.localNode.writeConfig("security") + return {"ok": True, "debug_log_api_enabled": bool(enabled)} + + +# ---------- admin actions -------------------------------------------------- + + +def reboot( + port: str | None = None, confirm: bool = False, seconds: int = 10 +) -> dict[str, Any]: + _require_confirm(confirm, "reboot") + with connect(port=port) as iface: + iface.localNode.reboot(secs=seconds) + return {"ok": True, "rebooting_in_s": seconds} + + +def shutdown( + port: str | None = None, confirm: bool = False, seconds: int = 10 +) -> dict[str, Any]: + _require_confirm(confirm, "shutdown") + with connect(port=port) as iface: + iface.localNode.shutdown(secs=seconds) + return {"ok": True, "shutting_down_in_s": seconds} + + +def factory_reset( + port: str | None = None, confirm: bool = False, full: bool = False +) -> dict[str, Any]: + """Tell the node to factory-reset its config. + + Works around a meshtastic-python 2.7.8 bug: `Node.factoryReset(full=True)` + internally does `p.factory_reset_config = True` where the field is + int32. protobuf 5.x rejects bool→int assignment as a TypeError. We build + the AdminMessage directly with int values (1=non-full, 2=full) and call + `_sendAdmin` to sidestep the SDK bug entirely. + """ + _require_confirm(confirm, "factory_reset") + from meshtastic.protobuf import admin_pb2 # type: ignore[import-untyped] + + with connect(port=port) as iface: + msg = admin_pb2.AdminMessage() + msg.factory_reset_config = 2 if full else 1 + iface.localNode._sendAdmin(msg) + return {"ok": True, "full": full} diff --git a/mcp-server/src/meshtastic_mcp/boards.py b/mcp-server/src/meshtastic_mcp/boards.py new file mode 100644 index 000000000..df5024800 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/boards.py @@ -0,0 +1,159 @@ +"""Board / PlatformIO env enumeration. + +Parses `pio project config --json-output` — a nested list of +`[section_name, [[key, value], ...]]` pairs — into a dict keyed by env name, +extracting the `custom_meshtastic_*` metadata the firmware variants expose. + +The parsed config is cached and invalidated when `platformio.ini`'s mtime +changes, so subsequent calls don't pay the 1–2s pio startup cost. +""" + +from __future__ import annotations + +import threading +from typing import Any + +from . import config, pio + +_CACHE_LOCK = threading.Lock() +_CACHE: dict[str, Any] = {"mtime": None, "envs": None} + + +def _parse_bool(value: Any) -> bool: + if isinstance(value, bool): + return value + if isinstance(value, str): + return value.strip().lower() in ("true", "yes", "1", "on") + return bool(value) + + +def _parse_int(value: Any) -> int | None: + try: + return int(value) + except (TypeError, ValueError): + return None + + +def _parse_tags(value: Any) -> list[str]: + if value is None: + return [] + if isinstance(value, list): + return [str(v).strip() for v in value if str(v).strip()] + return [t.strip() for t in str(value).replace(",", " ").split() if t.strip()] + + +def _env_record(env_name: str, items: list[list[Any]]) -> dict[str, Any]: + """Build a normalized dict for one env section.""" + d = dict(items) + return { + "env": env_name, + "architecture": d.get("custom_meshtastic_architecture"), + "hw_model": _parse_int(d.get("custom_meshtastic_hw_model")), + "hw_model_slug": d.get("custom_meshtastic_hw_model_slug"), + "display_name": d.get("custom_meshtastic_display_name"), + "actively_supported": _parse_bool( + d.get("custom_meshtastic_actively_supported") + ), + "support_level": _parse_int(d.get("custom_meshtastic_support_level")), + "board_level": d.get("board_level"), # "pr", "extra", or None + "tags": _parse_tags(d.get("custom_meshtastic_tags")), + "images": _parse_tags(d.get("custom_meshtastic_images")), + "board": d.get("board"), + "upload_speed": _parse_int(d.get("upload_speed")), + "upload_protocol": d.get("upload_protocol"), + "monitor_speed": _parse_int(d.get("monitor_speed")), + "monitor_filters": d.get("monitor_filters") or [], + "_raw": d, # Full dict for get_board + } + + +def _load_all() -> dict[str, dict[str, Any]]: + """Parse `pio project config` into `{env_name: record}`.""" + raw = pio.run_json(["project", "config"], timeout=pio.TIMEOUT_PROJECT_CONFIG) + result: dict[str, dict[str, Any]] = {} + for section_name, items in raw: + if not isinstance(section_name, str) or not section_name.startswith("env:"): + continue + env_name = section_name.split(":", 1)[1] + result[env_name] = _env_record(env_name, items) + return result + + +def _get_cached() -> dict[str, dict[str, Any]]: + root = config.firmware_root() + platformio_ini = root / "platformio.ini" + try: + mtime = platformio_ini.stat().st_mtime + except FileNotFoundError: + mtime = None + + with _CACHE_LOCK: + if _CACHE["envs"] is not None and _CACHE["mtime"] == mtime: + return _CACHE["envs"] + envs = _load_all() + _CACHE["envs"] = envs + _CACHE["mtime"] = mtime + return envs + + +def invalidate_cache() -> None: + with _CACHE_LOCK: + _CACHE["envs"] = None + _CACHE["mtime"] = None + + +def _public_record(rec: dict[str, Any]) -> dict[str, Any]: + """Strip the `_raw` field for list outputs.""" + return {k: v for k, v in rec.items() if not k.startswith("_")} + + +def list_boards( + architecture: str | None = None, + actively_supported_only: bool = False, + query: str | None = None, + board_level: str | None = None, # "release" | "pr" | "extra" +) -> list[dict[str, Any]]: + """Enumerate PlatformIO envs with Meshtastic metadata. + + Filters are cumulative (AND). `board_level="release"` means envs with no + explicit `board_level` set (the default release targets). + """ + envs = _get_cached() + q = query.lower().strip() if query else None + + out = [] + for rec in envs.values(): + if architecture and rec.get("architecture") != architecture: + continue + if actively_supported_only and not rec.get("actively_supported"): + continue + if board_level is not None: + rec_level = rec.get("board_level") + if board_level == "release": + if rec_level not in (None, ""): + continue + elif rec_level != board_level: + continue + if q: + display = (rec.get("display_name") or "").lower() + env_name = rec.get("env", "").lower() + slug = (rec.get("hw_model_slug") or "").lower() + if q not in display and q not in env_name and q not in slug: + continue + out.append(_public_record(rec)) + + out.sort(key=lambda r: (r.get("architecture") or "", r.get("env"))) + return out + + +def get_board(env: str) -> dict[str, Any]: + """Full metadata for one env, including the raw pio config dict.""" + envs = _get_cached() + rec = envs.get(env) + if rec is None: + raise KeyError( + f"Unknown env: {env!r}. Use list_boards() to see available envs." + ) + public = _public_record(rec) + public["raw_config"] = rec["_raw"] + return public diff --git a/mcp-server/src/meshtastic_mcp/cli/__init__.py b/mcp-server/src/meshtastic_mcp/cli/__init__.py new file mode 100644 index 000000000..04729b643 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/__init__.py @@ -0,0 +1,6 @@ +"""Command-line entry points that sit alongside the MCP server. + +Modules here are loaded on-demand by `[project.scripts]` entries in +`pyproject.toml`. They are NOT imported by `meshtastic_mcp.server` or the +admin/info tool surface — the MCP server stays pure stdio JSON-RPC. +""" diff --git a/mcp-server/src/meshtastic_mcp/cli/_flashlog.py b/mcp-server/src/meshtastic_mcp/cli/_flashlog.py new file mode 100644 index 000000000..889183bb3 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/_flashlog.py @@ -0,0 +1,73 @@ +"""Flash progress log tailer for ``meshtastic-mcp-test-tui``. + +``pio.py`` / ``hw_tools.py`` tee subprocess output (``pio run -t upload``, +``esptool erase_flash``, ``nrfutil dfu``, etc.) to ``tests/flash.log`` +line-by-line as it arrives — controlled by the ``MESHTASTIC_MCP_FLASH_LOG`` +env var that ``run-tests.sh`` sets. The TUI tails that file so the operator +sees live flash progress in the pytest pane instead of 3 minutes of silence +during ``test_00_bake``. + +Separate from ``_fwlog.py`` because that one parses JSONL, this one +streams plain text lines. Same daemon-thread + EOF-backoff structure. +""" + +from __future__ import annotations + +import pathlib +import threading +import time +from typing import Callable + + +class FlashLogTailer(threading.Thread): + """Tail a plain-text log file, publish each stripped line via ``post``. + + ``post`` is invoked with a single ``str`` for every new line. Lines are + stripped of trailing newlines; empty lines after stripping are dropped. + + The file may not exist yet when this thread starts — it's truncated by + ``run-tests.sh`` at session start, but if the tailer races the shell, + we tolerate FileNotFoundError for up to ``wait_s`` seconds. + """ + + def __init__( + self, + path: pathlib.Path, + post: Callable[[str], None], + stop: threading.Event, + *, + wait_s: float = 30.0, + ) -> None: + super().__init__(daemon=True, name="flashlog-tail") + self._path = path + self._post = post + self._stop = stop + self._wait_s = wait_s + + def run(self) -> None: + deadline = time.monotonic() + self._wait_s + while not self._path.is_file(): + if self._stop.is_set() or time.monotonic() > deadline: + return + time.sleep(0.1) + try: + fh = self._path.open("r", encoding="utf-8", errors="replace") + except OSError: + return + try: + while not self._stop.is_set(): + line = fh.readline() + if not line: + time.sleep(0.05) + continue + line = line.rstrip("\r\n") + if not line: + continue + try: + self._post(line) + except Exception: + # A post failure (e.g. closed app) is terminal for this + # thread but we still want to close the file handle. + return + finally: + fh.close() diff --git a/mcp-server/src/meshtastic_mcp/cli/_fwlog.py b/mcp-server/src/meshtastic_mcp/cli/_fwlog.py new file mode 100644 index 000000000..7db20f81c --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/_fwlog.py @@ -0,0 +1,96 @@ +"""Firmware log tail worker for ``meshtastic-mcp-test-tui``. + +Complements v1's reportlog-tail worker. ``tests/conftest.py`` owns a +session-scoped autouse fixture (``_firmware_log_stream``) that mirrors +every ``meshtastic.log.line`` pubsub event to ``tests/fwlog.jsonl`` — +one JSON object per line: + + {"ts": 1729100000.123, "port": "/dev/cu.usbmodem1101", "line": "..."} + +The TUI tails that file from a worker thread; each new line becomes a +:class:`FirmwareLogLine` message posted to the App. Same pattern as the +reportlog tail worker — truncate on launch, tolerate missing file for +30 s, back off at EOF. + +Kept in its own module so the (large) ``test_tui.py`` stays focused on +the Textual App shell. +""" + +from __future__ import annotations + +import json +import pathlib +import threading +import time +from typing import Any, Callable + + +class FirmwareLogTailer(threading.Thread): + """Tail ``tests/fwlog.jsonl``, publish parsed records via ``post``. + + ``post`` is the App's ``post_message`` (or any callable that accepts a + single payload arg). We pass parsed dicts rather than constructing + Textual Message objects here — keeps this module free of the + textual dependency so it's unit-testable in a bare venv. + + Parameters + ---------- + path: + Path to ``tests/fwlog.jsonl``. The file may not exist yet at + startup — pytest only creates it once the session fixture runs. + post: + Callable invoked with a dict ``{"ts", "port", "line"}`` for every + new line parsed from the file. + stop: + An event the App sets to signal shutdown. + wait_s: + How long to poll for the file's creation before giving up. Default + 30 s; pytest collection on a cold cache can be slow. + + """ + + def __init__( + self, + path: pathlib.Path, + post: Callable[[dict[str, Any]], None], + stop: threading.Event, + *, + wait_s: float = 30.0, + ) -> None: + super().__init__(daemon=True, name="fwlog-tail") + self._path = path + self._post = post + self._stop = stop + self._wait_s = wait_s + + def run(self) -> None: + deadline = time.monotonic() + self._wait_s + while not self._path.is_file(): + if self._stop.is_set() or time.monotonic() > deadline: + return + time.sleep(0.1) + try: + fh = self._path.open("r", encoding="utf-8") + except OSError: + return + try: + while not self._stop.is_set(): + line = fh.readline() + if not line: + time.sleep(0.05) + continue + line = line.strip() + if not line: + continue + try: + record = json.loads(line) + except json.JSONDecodeError: + continue + # Defensive: require the three fields we rely on. + if not isinstance(record, dict): + continue + if "line" not in record: + continue + self._post(record) + finally: + fh.close() diff --git a/mcp-server/src/meshtastic_mcp/cli/_history.py b/mcp-server/src/meshtastic_mcp/cli/_history.py new file mode 100644 index 000000000..639dcec5f --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/_history.py @@ -0,0 +1,127 @@ +"""Cross-run history for ``meshtastic-mcp-test-tui``. + +Persists one JSON object per pytest run to +``mcp-server/tests/.history/runs.jsonl``. The TUI reads the last N +entries on launch to render a duration sparkline in the header — a +quick read on whether the suite is slowing down over time. + +Schema (keep small; the file can grow for months): + + {"run": 42, "ts": 1729100000.0, "duration_s": 387.2, + "passed": 52, "failed": 0, "skipped": 23, "exit_code": 0, + "seed": "mcp-user-host"} +""" + +from __future__ import annotations + +import json +import pathlib +import time +from dataclasses import asdict, dataclass +from typing import Iterable + +# Sparkline glyphs, low → high. 8 levels is the Unicode convention. +_SPARK_BLOCKS = "▁▂▃▄▅▆▇█" + + +@dataclass +class RunRecord: + run: int + ts: float + duration_s: float + passed: int + failed: int + skipped: int + exit_code: int + seed: str + + +class HistoryStore: + """Append-only JSONL store with bounded read. + + Writes are fsynced after each append (the file is tiny; fsync cost + is negligible and protects against truncation on a crash). + """ + + def __init__(self, path: pathlib.Path, *, keep_last: int = 50) -> None: + self._path = path + self._keep_last = keep_last + + def append(self, record: RunRecord) -> None: + try: + self._path.parent.mkdir(parents=True, exist_ok=True) + with self._path.open("a", encoding="utf-8") as fh: + fh.write(json.dumps(asdict(record)) + "\n") + fh.flush() + except Exception: + # Non-fatal: history is cosmetic. + pass + + def read_recent(self) -> list[RunRecord]: + """Return the last ``keep_last`` records in chronological order.""" + if not self._path.is_file(): + return [] + try: + lines = self._path.read_text(encoding="utf-8").splitlines() + except OSError: + return [] + out: list[RunRecord] = [] + # Parse tail-first so we don't waste work on a huge history. + for line in lines[-self._keep_last :]: + line = line.strip() + if not line: + continue + try: + raw = json.loads(line) + except json.JSONDecodeError: + continue + try: + out.append(RunRecord(**raw)) + except TypeError: + # Schema drift; skip the record rather than crash. + continue + return out + + def record_run( + self, + *, + run: int, + duration_s: float, + passed: int, + failed: int, + skipped: int, + exit_code: int, + seed: str, + ) -> RunRecord: + rec = RunRecord( + run=run, + ts=time.time(), + duration_s=float(duration_s), + passed=int(passed), + failed=int(failed), + skipped=int(skipped), + exit_code=int(exit_code), + seed=seed, + ) + self.append(rec) + return rec + + +def sparkline(values: Iterable[float], *, width: int = 20) -> str: + """Render a Unicode block-character sparkline from the last ``width`` values. + + Returns an empty string for empty input so the header handles + "no history yet" gracefully. + """ + buf = [v for v in values if v >= 0][-width:] + if not buf: + return "" + lo, hi = min(buf), max(buf) + if hi - lo < 1e-9: + return _SPARK_BLOCKS[len(_SPARK_BLOCKS) // 2] * len(buf) + n = len(_SPARK_BLOCKS) - 1 + out = [] + for v in buf: + idx = int(round((v - lo) / (hi - lo) * n)) + out.append(_SPARK_BLOCKS[max(0, min(n, idx))]) + return "".join(out) diff --git a/mcp-server/src/meshtastic_mcp/cli/_reproducer.py b/mcp-server/src/meshtastic_mcp/cli/_reproducer.py new file mode 100644 index 000000000..420da3c76 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/_reproducer.py @@ -0,0 +1,214 @@ +"""Reproducer bundle builder for ``meshtastic-mcp-test-tui``. + +When the operator presses ``x`` on a failed test leaf, we package the +minimum viable failure context into a tarball under +``mcp-server/tests/reproducers/``: + +:: + + repro--.tar.gz + ├── README.md human-readable overview + ├── test_report.json the failing TestReport event from reportlog + ├── fwlog.jsonl firmware log filtered to the failure window + ├── devices.json per-device device_info + lora config snapshot + └── env.json seed, run #, pytest version, platform, hostname + +Separate module so the logic can be unit-tested without Textual. The +TUI glue is thin — one key binding calls :func:`build_reproducer_bundle` +with the focused test's state and shows the path in a modal. +""" + +from __future__ import annotations + +import io +import json +import pathlib +import platform +import re +import socket +import tarfile +import time +from dataclasses import dataclass +from typing import Any, Iterable + + +@dataclass +class ReproContext: + """Everything :func:`build_reproducer_bundle` needs. Shaped to map + cleanly onto the state the TUI already tracks — no extra data + collection required at export time.""" + + nodeid: str + longrepr: str + sections: list[tuple[str, str]] + start_ts: float | None + stop_ts: float | None + seed: str + run_number: int + exit_code: int | None + fwlog_path: pathlib.Path + output_dir: pathlib.Path + extra_device_rows: list[dict[str, Any]] # [{role, port, info, ...}, ...] + + +def _short_nodeid(nodeid: str) -> str: + """Collapse a pytest nodeid into a filename-safe slug (<= 60 chars).""" + # Drop the file path prefix; keep test name + parametrization. + tail = nodeid.split("::", 1)[-1] if "::" in nodeid else nodeid + slug = re.sub(r"[^A-Za-z0-9_.\-]", "_", tail) + return slug[:60].strip("_.-") or "test" + + +def _filtered_fwlog( + fwlog_path: pathlib.Path, + start_ts: float | None, + stop_ts: float | None, + *, + pad_s: float = 5.0, +) -> bytes: + """Return fwlog.jsonl lines whose ``ts`` lies in [start-pad, stop+pad].""" + if not fwlog_path.is_file(): + return b"" + if start_ts is None or stop_ts is None: + # Without a time window, include the whole file — rare; happens + # when a test fails in setup before pytest emitted a start ts. + try: + return fwlog_path.read_bytes() + except OSError: + return b"" + lo, hi = start_ts - pad_s, stop_ts + pad_s + out = io.BytesIO() + try: + with fwlog_path.open("r", encoding="utf-8") as fh: + for line in fh: + stripped = line.strip() + if not stripped: + continue + try: + record = json.loads(stripped) + except json.JSONDecodeError: + continue + ts = record.get("ts") + if not isinstance(ts, (int, float)): + continue + if lo <= ts <= hi: + out.write(line.encode("utf-8")) + except OSError: + return b"" + return out.getvalue() + + +def _readme(ctx: ReproContext) -> str: + t = time.strftime("%Y-%m-%d %H:%M:%S %Z", time.localtime()) + return f"""# Reproducer bundle + +Exported by `meshtastic-mcp-test-tui` on {t}. + +## Failing test + +- **nodeid:** `{ctx.nodeid}` +- **seed:** `{ctx.seed}` +- **run #:** {ctx.run_number} +- **suite exit code (at export time):** {ctx.exit_code if ctx.exit_code is not None else "in progress"} + +## Files in this archive + +| File | Contents | +|---|---| +| `test_report.json` | The pytest-reportlog `TestReport` event for the failing test — includes `longrepr`, captured `sections` (stdout/stderr/log), `duration`, `location`, `keywords`. | +| `fwlog.jsonl` | Firmware log lines (from `meshtastic.log.line` pubsub) filtered to [start−5s, stop+5s] around the test's run window. Each line is `{{ts, port, line}}`. | +| `devices.json` | Per-device snapshot at export time: `device_info` + `lora` config per detected role. | +| `env.json` | Python version, platform, hostname, seed, run number. | + +## How to triage + +1. Open `test_report.json` and read `longrepr` + `sections` — most failures explain themselves there. +2. If the failure is a mesh/telemetry assertion, `fwlog.jsonl` is where the answer usually lives. Grep for `Error=`, `NAK`, `PKI_UNKNOWN_PUBKEY`, `Skip send`, `Guru Meditation`, or the uptime timestamps around the assertion event. +3. Compare `devices.json` against the expected state (e.g. `num_nodes >= 2`, `primary_channel == "McpTest"`, `region == "US"`). If fields disagree with the seed-derived USERPREFS profile, the device probably wasn't baked with this session's profile. + +## Reproducing locally + +```bash +cd mcp-server +MESHTASTIC_MCP_SEED='{ctx.seed}' .venv/bin/pytest '{ctx.nodeid}' --tb=long -v +``` +""" + + +def build_reproducer_bundle(ctx: ReproContext) -> pathlib.Path: + """Build a tarball under ``ctx.output_dir`` and return its path. + + Parent dirs are created as needed. Errors during optional sections + (devices, env) are swallowed — the bundle is still useful without + them; refusing to export because the device poller had a hiccup + would be worse than the export missing a file. + """ + ctx.output_dir.mkdir(parents=True, exist_ok=True) + ts = int(time.time()) + slug = _short_nodeid(ctx.nodeid) + archive_path = ctx.output_dir / f"repro-{ts}-{slug}.tar.gz" + + with tarfile.open(archive_path, "w:gz") as tar: + + def _add(name: str, data: bytes) -> None: + info = tarfile.TarInfo(name=name) + info.size = len(data) + info.mtime = ts + tar.addfile(info, io.BytesIO(data)) + + # README + _add("README.md", _readme(ctx).encode("utf-8")) + + # test_report.json — reconstruct from the fields the TUI stashes. + test_report = { + "nodeid": ctx.nodeid, + "outcome": "failed", + "longrepr": ctx.longrepr, + "sections": [list(s) for s in ctx.sections], + "start": ctx.start_ts, + "stop": ctx.stop_ts, + } + _add( + "test_report.json", + json.dumps(test_report, indent=2, default=str).encode("utf-8"), + ) + + # fwlog.jsonl (filtered) + _add("fwlog.jsonl", _filtered_fwlog(ctx.fwlog_path, ctx.start_ts, ctx.stop_ts)) + + # devices.json + try: + devices_payload = json.dumps( + ctx.extra_device_rows or [], indent=2, default=str + ) + except Exception: + devices_payload = "[]" + _add("devices.json", devices_payload.encode("utf-8")) + + # env.json + try: + from importlib.metadata import version as _pkg_version + + pytest_version = _pkg_version("pytest") + except Exception: + pytest_version = "unknown" + env_payload = { + "seed": ctx.seed, + "run": ctx.run_number, + "exit_code": ctx.exit_code, + "export_ts": ts, + "python": platform.python_version(), + "pytest": pytest_version, + "platform": f"{platform.system()} {platform.release()} {platform.machine()}", + "hostname": socket.gethostname(), + } + _add("env.json", json.dumps(env_payload, indent=2).encode("utf-8")) + + return archive_path + + +def iter_entries(archive_path: pathlib.Path) -> Iterable[str]: + """Yield member names — used by callers that want to confirm the bundle shape.""" + with tarfile.open(archive_path, "r:gz") as tar: + for m in tar.getmembers(): + yield m.name diff --git a/mcp-server/src/meshtastic_mcp/cli/test_tui.py b/mcp-server/src/meshtastic_mcp/cli/test_tui.py new file mode 100644 index 000000000..33201101b --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/test_tui.py @@ -0,0 +1,1782 @@ +"""Textual TUI wrapping `mcp-server/run-tests.sh`. + +Launch: ``meshtastic-mcp-test-tui [pytest-args]`` + +The TUI *wraps* ``run-tests.sh``; it never replaces it. Same script, same +env-var resolution, same ``userPrefs.jsonc`` session fixture. Four data +sources drive live state: + +1. ``tests/reportlog.jsonl`` — written by ``pytest-reportlog``. Tailed in a + worker thread; each JSON line is published as a :class:`ReportLogEvent` + message. This is the authoritative source for tree population + per-test + outcome. +2. The pytest subprocess ``stdout`` + ``stderr`` streams — line-by-line, + published as :class:`PytestLine` messages and rendered verbatim in the + pytest pane. +3. ``tests/fwlog.jsonl`` — firmware log stream. Written by the + ``_firmware_log_stream`` autouse session fixture in ``conftest.py`` + (mirrors every ``meshtastic.log.line`` pubsub event), tailed by the + :class:`FirmwareLogTailer` worker, displayed in a wrap-enabled + RichLog with cycleable port filter. +4. ``devices.list_devices()`` + ``info.device_info(port)`` — polled only at + startup and again after ``RunFinished``. Device polling while pytest + holds a SerialInterface would deadlock on the exclusive port lock; the + existing ``hub_devices`` fixture is session-scoped so there is no safe + "between tests" window. The header reflects this with a "(stale)" + marker while the run is active. + +Key bindings (see :class:`TestTuiApp.BINDINGS`): + ``r`` re-run focused ``f`` filter tree ``d`` failure detail + ``g`` open report.html ``l`` cycle firmware-log port filter + ``x`` export reproducer bundle ``c`` tool-coverage panel + ``q`` / Ctrl-C graceful quit with SIGINT → SIGTERM → SIGKILL escalation + +Shipped today (v1 + v2 slice): test tree + tier counters with progress bars, +pytest tail, live firmware log with port filter, device strip with +"currently running" status column, failure-detail modal, reproducer bundle +export (filters fwlog by test's start/stop timestamps), tool-coverage +modal, cross-run history sparkline in the header, clean SIGINT +propagation. Still open (see the plan file): mesh topology mini-diagram +and airtime / channel-utilization gauges. +""" + +from __future__ import annotations + +import argparse +import json +import os +import pathlib +import signal +import subprocess +import sys +import threading +import time +from dataclasses import dataclass, field +from typing import Any, Iterator + +# --------------------------------------------------------------------------- +# Configuration constants +# --------------------------------------------------------------------------- + +# Tier names that map nodeids like "tests//..." to counter buckets. +# Order here == display order in the tier-counters table. Matches the order +# `pytest_collection_modifyitems` in `conftest.py` uses: +# bake → unit → mesh → telemetry → monitor → fleet → admin → provisioning +# so the counters table reads top-to-bottom in execution order. +# +# "bake" is the synthetic tier for `tests/test_00_bake.py` — the file sits +# at the `tests/` root rather than under a tier subdirectory, so without +# this mapping `_tier_of_nodeid` would return "other" and the bake outcomes +# would be silently dropped from both the tier table and the history +# record (which sums tier counters to compute passed/failed/skipped). +TIERS = ( + "bake", + "unit", + "mesh", + "telemetry", + "monitor", + "fleet", + "admin", + "provisioning", +) + +# Relative paths from the mcp-server root. +_REPORTLOG_RELATIVE = "tests/reportlog.jsonl" +_FWLOG_RELATIVE = "tests/fwlog.jsonl" +# pio / esptool / nrfutil / picotool tee subprocess output here when +# `MESHTASTIC_MCP_FLASH_LOG` is set (see `pio._run_capturing`). run-tests.sh +# sets that env var; the TUI also sets it for direct `_spawn_pytest` calls +# so `r`-key re-runs that skip the wrapper still get tee'd output. +_FLASHLOG_RELATIVE = "tests/flash.log" +_REPORT_HTML_RELATIVE = "tests/report.html" +_TOOL_COVERAGE_RELATIVE = "tests/tool_coverage.json" +_HISTORY_RELATIVE = "tests/.history/runs.jsonl" +_REPRODUCERS_RELATIVE = "tests/reproducers" +_RUN_TESTS_RELATIVE = "run-tests.sh" +_RUN_COUNTER_RELATIVE = "tests/.tui-runs" + +# Graceful-shutdown budgets (seconds) for the pytest subprocess when the +# user hits `q`. Matches what the existing CLI's atexit + userprefs sidecar +# self-heal expects. +_SIGINT_GRACE_S = 5.0 +_SIGTERM_GRACE_S = 5.0 + + +# --------------------------------------------------------------------------- +# Path resolution +# --------------------------------------------------------------------------- + + +def _mcp_server_root() -> pathlib.Path: + """Locate the mcp-server directory (the one containing run-tests.sh).""" + here = pathlib.Path(__file__).resolve() + # Walk up until we find pyproject.toml with a matching project name, or + # default to the three-up ancestor (src/meshtastic_mcp/cli/test_tui.py → + # .../mcp-server). The walk-up protects against unusual checkouts. + for parent in (here.parent, *here.parents): + if (parent / "pyproject.toml").is_file() and ( + parent / "run-tests.sh" + ).is_file(): + return parent + return here.parents[3] + + +# --------------------------------------------------------------------------- +# Data classes +# --------------------------------------------------------------------------- + + +@dataclass +class LeafReport: + """Per-test state drawn from reportlog events. + + Outcomes mirror pytest's: "passed" | "failed" | "skipped" | "running". + """ + + nodeid: str + tier: str + outcome: str = "pending" + duration_s: float = 0.0 + longrepr: str = "" + # Captured stdout / stderr / firmware-log sections from the test's + # `TestReport.sections` — shown in the failure-detail modal. + sections: list[tuple[str, str]] = field(default_factory=list) + # Wall-clock start/stop from the TestReport event. Used by the + # reproducer exporter (`x`) to filter `tests/fwlog.jsonl` down to + # just the lines around the failure window. + start_ts: float | None = None + stop_ts: float | None = None + + +@dataclass +class TierCounters: + tier: str + passed: int = 0 + failed: int = 0 + skipped: int = 0 + running: int = 0 + remaining: int = 0 + + +@dataclass +class DeviceRow: + role: str | None + port: str + vid: str + pid: str + description: str + # Populated from info.device_info when available; empty dict when we + # haven't queried (or when the poller is paused). + info: dict[str, Any] = field(default_factory=dict) + + +@dataclass +class State: + """Shared state owned by the App; written by workers under `lock`. + + UI code reads via Textual Message handlers which run on the UI thread + in the order workers called `post_message` — so reads don't need the + lock themselves. + """ + + lock: threading.Lock = field(default_factory=threading.Lock) + tiers: dict[str, TierCounters] = field( + default_factory=lambda: {t: TierCounters(tier=t) for t in TIERS} + ) + leaves: dict[str, LeafReport] = field(default_factory=dict) + # Ordered list of nodeids in the order they were first seen — lets us + # rebuild the tree deterministically. + nodeid_order: list[str] = field(default_factory=list) + devices: list[DeviceRow] = field(default_factory=list) + run_active: bool = False + exit_code: int | None = None + # nodeid of the currently-running test. Set on `when="setup"` + + # outcome="passed" (body about to execute); cleared on `when="call"` + # (any outcome) or on `when="setup"` + outcome="failed" (no body + # window). Drives the device-table "Status" column so the operator + # can see which test is touching a given device right now. + running_nodeid: str | None = None + # `time.monotonic()` captured when `running_nodeid` was set. Surfaced + # as live-updating elapsed-time ("RUNNING: test_bake_nrf52 (1:23)") so + # an operator staring at a ~3 min `test_00_bake` or a `mesh_formation` + # with a 60 s ceiling has concrete evidence the test isn't stuck. + running_started_at: float | None = None + + +# --------------------------------------------------------------------------- +# Helpers +# --------------------------------------------------------------------------- + + +def _tier_of_nodeid(nodeid: str) -> str: + """Map a pytest nodeid to its tier bucket. Unknown → 'other'. + + `tests/test_00_bake.py::...` is special-cased to the synthetic `bake` + tier — it's a top-level file (no tier subdirectory) so the generic + "second path segment" logic would miss it and route the bake outcomes + into the non-existent `other` bucket. + """ + parts = nodeid.split("/", 2) + if len(parts) >= 2 and parts[0] == "tests": + # Bake file sits at `tests/test_00_bake.py` — dedicated bucket. + if parts[1].startswith("test_00_bake"): + return "bake" + candidate = parts[1] + if candidate in TIERS: + return candidate + return "other" + + +def _file_of_nodeid(nodeid: str) -> str: + """Extract the test file name (e.g. 'test_boards.py') from a nodeid.""" + left = nodeid.split("::", 1)[0] + return left.rsplit("/", 1)[-1] + + +def _testname_of_nodeid(nodeid: str) -> str: + """Extract the 'test_foo[param]' suffix from a nodeid, or the full thing.""" + if "::" in nodeid: + return nodeid.split("::", 1)[1] + return nodeid + + +def _roles_from_nodeid(nodeid: str) -> set[str]: + """Infer which device roles a parametrized test touches. + + Patterns we recognize (from the existing ``conftest.py`` parametrization + in ``pytest_generate_tests``): + + - ``test_foo[nrf52]`` → {"nrf52"} (baked_single) + - ``test_foo[nrf52->esp32s3]`` → {"nrf52", "esp32s3"} (mesh_pair) + + Unparametrized tests (no bracket) return an empty set — the caller + should fall back to "this test involves ALL detected devices" rather + than pretending it touches none. + """ + if "[" not in nodeid or not nodeid.endswith("]"): + return set() + try: + inner = nodeid.rsplit("[", 1)[1][:-1] + except Exception: + return set() + # Split on "->" for directed mesh pairs; otherwise treat as single role. + parts = [p.strip() for p in inner.split("->")] if "->" in inner else [inner.strip()] + return {p for p in parts if p} + + +def _parse_events(path: pathlib.Path) -> Iterator[dict[str, Any]]: + """Yield parsed JSON dicts from a reportlog file, skipping malformed lines. + + Used for smoke-testing the parser against a finished file; the live + worker has its own tail loop. + """ + if not path.is_file(): + return + with path.open("r", encoding="utf-8") as fh: + for line in fh: + line = line.strip() + if not line: + continue + try: + yield json.loads(line) + except json.JSONDecodeError: + continue + + +def _load_run_number(counter_path: pathlib.Path) -> int: + """Bump + persist a monotonic run counter used in the TUI header.""" + try: + n = int(counter_path.read_text().strip()) + except Exception: + n = 0 + n += 1 + try: + counter_path.parent.mkdir(parents=True, exist_ok=True) + counter_path.write_text(str(n)) + except Exception: + # Non-fatal: the counter is cosmetic. + pass + return n + + +def _resolve_seed() -> str: + """Mirror the default-seed resolution from run-tests.sh. + + Operator can override via MESHTASTIC_MCP_SEED. Matches the + per-user/per-host default so repeated invocations land on the same PSK + (makes --assume-baked valid across invocations). + """ + if explicit := os.environ.get("MESHTASTIC_MCP_SEED"): + return explicit + try: + who = os.environ.get("USER") or os.environ.get("LOGNAME") or "anon" + except Exception: + who = "anon" + try: + import socket + + host = socket.gethostname().split(".", 1)[0] + except Exception: + host = "host" + return f"mcp-{who}-{host}" + + +def _format_duration(seconds: float) -> str: + if seconds < 60: + return f"{seconds:5.1f}s" + m, s = divmod(int(seconds), 60) + return f"{m:d}:{s:02d}" + + +# --------------------------------------------------------------------------- +# Textual imports (lazy — only when main() runs, so `_parse_events` can be +# imported by smoke tests without requiring textual installed in every env) +# --------------------------------------------------------------------------- + + +def _import_textual() -> Any: + """Return a namespace carrying every Textual class we use. + + Deferred import keeps `_parse_events` + `_tier_of_nodeid` importable + from tests / smoke scripts without pulling in the UI stack. + """ + import textual + from textual.app import App, ComposeResult + from textual.binding import Binding + from textual.containers import Horizontal, Vertical + from textual.message import Message + from textual.screen import ModalScreen + from textual.widgets import DataTable, Footer, Input, RichLog, Static, Tree + + ns = argparse.Namespace() + ns.App = App + ns.Binding = Binding + ns.ComposeResult = ComposeResult + ns.DataTable = DataTable + ns.Footer = Footer + ns.Horizontal = Horizontal + ns.Input = Input + ns.Message = Message + ns.ModalScreen = ModalScreen + ns.RichLog = RichLog + ns.Static = Static + ns.Tree = Tree + ns.Vertical = Vertical + ns.textual = textual + return ns + + +# --------------------------------------------------------------------------- +# main() — the important scaffolding lives here so that when we bail out +# before entering the Textual event loop (missing terminal, --help, etc.) +# nothing has grabbed the screen yet. +# --------------------------------------------------------------------------- + + +def main(argv: list[str] | None = None) -> int: + """Entry point for `meshtastic-mcp-test-tui`.""" + argv = list(argv if argv is not None else sys.argv[1:]) + + parser = argparse.ArgumentParser( + prog="meshtastic-mcp-test-tui", + description=( + "Live Textual TUI wrapping mcp-server/run-tests.sh. " + "Passes any unrecognized arguments through to pytest." + ), + allow_abbrev=False, + ) + parser.add_argument( + "--no-tui", + action="store_true", + help=( + "Skip the TUI and exec run-tests.sh directly. Useful as a health " + "check that the wrapper argv+env resolution is working." + ), + ) + args, pytest_args = parser.parse_known_args(argv) + + root = _mcp_server_root() + run_tests = root / _RUN_TESTS_RELATIVE + reportlog = root / _REPORTLOG_RELATIVE + fwlog = root / _FWLOG_RELATIVE + flashlog = root / _FLASHLOG_RELATIVE + counter = root / _RUN_COUNTER_RELATIVE + + if not run_tests.is_file(): + print( + f"error: could not locate {_RUN_TESTS_RELATIVE} relative to " + f"{root}. Is this the mcp-server checkout?", + file=sys.stderr, + ) + return 2 + + # Always clear stale log files before launching pytest. The TUI's tail + # workers race pytest file-creation; starting from a known-empty state + # avoids mid-line-decode confusion from the prior run. The fwlog session + # fixture also truncates on its end, and run-tests.sh truncates the + # flashlog — triple-truncate is deliberate (whichever side creates the + # file first, it starts empty). + for p in (reportlog, fwlog, flashlog): + try: + p.unlink(missing_ok=True) + except Exception: + pass + + # Compute + persist the run counter for the header (cosmetic). + run_number = _load_run_number(counter) + seed = _resolve_seed() + # Export the seed so the subprocess inherits the SAME value the TUI + # displays. run-tests.sh computes its own fallback if unset, and we'd + # end up with a header / wrapper-header mismatch if we let that happen. + os.environ.setdefault("MESHTASTIC_MCP_SEED", seed) + # Turn on subprocess-output tee'ing so `pio._run_capturing` writes each + # line of pio / esptool / nrfutil / picotool output to `tests/flash.log` + # as it arrives. The TUI tails that file and routes each line to the + # pytest pane so the operator sees live flash progress during long + # `pio run -t upload` / `esptool erase_flash` operations. run-tests.sh + # also sets this when invoked directly — `setdefault` so the wrapper's + # value wins when present. + os.environ.setdefault("MESHTASTIC_MCP_FLASH_LOG", str(flashlog)) + + # --no-tui: exec run-tests.sh directly. Useful for diagnosing wrapper + # env / argv handling without getting into Textual's alternate screen. + if args.no_tui: + cmd = [str(run_tests), *pytest_args] + os.execv(str(run_tests), cmd) # noqa: S606 — intentional + + # Textual UI import is deferred so `--help` and `--no-tui` do not pay + # the ~40 MB startup cost. + try: + tx = _import_textual() + except ImportError as exc: + print( + f"error: textual is not installed ({exc}). Install with: " + f"pip install -e '.[test]'", + file=sys.stderr, + ) + return 2 + + # Narrow-terminal warning (see plan §8 risk 2). Textual itself degrades, + # but a heads-up helps a first-time user. + term = os.environ.get("TERM", "") + if term in ("", "dumb", "screen") and not os.environ.get("TEXTUAL_NO_TERM_HINT"): + print( + f"[hint] TERM={term!r} may render poorly. Try " + f"`TERM=xterm-256color meshtastic-mcp-test-tui ...` if the layout " + f"looks broken.", + file=sys.stderr, + ) + + app = _build_app( + tx=tx, + root=root, + run_tests=run_tests, + reportlog=reportlog, + fwlog=fwlog, + flashlog=flashlog, + seed=seed, + run_number=run_number, + pytest_args=pytest_args, + ) + + # App.run() returns the subprocess exit code via `app.exit(returncode)`. + return_value = app.run() + if isinstance(return_value, int): + return return_value + return 0 + + +# --------------------------------------------------------------------------- +# Everything below is only reachable once Textual is importable. `tx` is +# the namespace returned by `_import_textual()` so we don't scatter `from +# textual import ...` across the file. +# --------------------------------------------------------------------------- + + +def _build_app( + *, + tx: Any, + root: pathlib.Path, + run_tests: pathlib.Path, + reportlog: pathlib.Path, + fwlog: pathlib.Path, + flashlog: pathlib.Path, + seed: str, + run_number: int, + pytest_args: list[str], +) -> Any: + """Assemble TestTuiApp with its Textual-dependent inner classes. + + Keeping the class definitions inside a factory means `main()` can + short-circuit (--no-tui, terminal-check, argparse error) before we + force Textual's import cost. + """ + + # Helper modules — lazy-imported here so the top-of-file import cost + # only kicks in when main() has decided to run the TUI. + from . import _flashlog as _flashlog_mod + from . import _fwlog as _fwlog_mod + from . import _history as _history_mod + from . import _reproducer as _reproducer_mod + + # ---------------- Messages ---------------- + + class ReportLogEvent(tx.Message): + def __init__(self, event: dict[str, Any]) -> None: + self.event = event + super().__init__() + + class PytestLine(tx.Message): + def __init__(self, source: str, line: str) -> None: + self.source = source # "stdout" | "stderr" + self.line = line + super().__init__() + + class FirmwareLogLine(tx.Message): + def __init__(self, record: dict[str, Any]) -> None: + # {"ts": float, "port": str | None, "line": str} + self.record = record + super().__init__() + + class FlashLogLine(tx.Message): + """Plain-text line from `tests/flash.log` — pio / esptool / nrfutil / + picotool output tee'd by `pio._run_capturing`. Routed to the pytest + pane so the operator sees live flash progress during `test_00_bake` + instead of 3 minutes of pytest-captured silence.""" + + def __init__(self, line: str) -> None: + self.line = line + super().__init__() + + class DeviceSnapshot(tx.Message): + def __init__(self, rows: list[DeviceRow]) -> None: + self.rows = rows + super().__init__() + + class RunFinished(tx.Message): + def __init__(self, returncode: int) -> None: + self.returncode = returncode + super().__init__() + + # ---------------- Workers ---------------- + + class ReportlogWorker(threading.Thread): + """Tail `reportlog.jsonl`, publish each event.""" + + def __init__(self, app: Any, path: pathlib.Path, stop: threading.Event) -> None: + super().__init__(daemon=True, name="reportlog-tail") + self._app = app + self._path = path + self._stop = stop + + def run(self) -> None: + # Wait up to 30 s for pytest to create the file (first call on + # a cold cache can be slow). + wait_deadline = time.monotonic() + 30.0 + while not self._path.is_file(): + if self._stop.is_set() or time.monotonic() > wait_deadline: + return + time.sleep(0.1) + try: + fh = self._path.open("r", encoding="utf-8") + except OSError: + return + try: + while not self._stop.is_set(): + line = fh.readline() + if not line: + time.sleep(0.05) + continue + line = line.strip() + if not line: + continue + try: + event = json.loads(line) + except json.JSONDecodeError: + continue + self._app.post_message(ReportLogEvent(event)) + finally: + fh.close() + + class SubprocessReaderWorker(threading.Thread): + """Read one stream line-by-line and publish PytestLine messages.""" + + def __init__( + self, + app: Any, + stream: Any, + source: str, + stop: threading.Event, + ) -> None: + super().__init__(daemon=True, name=f"subprocess-{source}") + self._app = app + self._stream = stream + self._source = source + self._stop = stop + + def run(self) -> None: + try: + for line in iter(self._stream.readline, ""): + if self._stop.is_set(): + break + self._app.post_message( + PytestLine(source=self._source, line=line.rstrip("\n")) + ) + except Exception: + # stream closed / subprocess died; not fatal. + pass + + class DevicePollerWorker(threading.Thread): + """Poll list_devices() + device_info() at startup and after RunFinished. + + Deliberately NOT polling during the run — `hub_devices` is a + session-scoped fixture holding SerialInterfaces across the whole + session, and device_info() would deadlock on the exclusive port + lock. Header shows "(stale)" during the gap. + """ + + def __init__(self, app: Any, state: State, stop: threading.Event) -> None: + super().__init__(daemon=True, name="device-poller") + self._app = app + self._state = state + self._stop = stop + self._trigger = threading.Event() + + def trigger(self) -> None: + self._trigger.set() + + def run(self) -> None: + # Perform one poll at startup; then wait for explicit triggers. + self._poll_once() + while not self._stop.is_set(): + if self._trigger.wait(timeout=0.5): + self._trigger.clear() + if self._stop.is_set(): + break + with self._state.lock: + active = self._state.run_active + if active: + continue + self._poll_once() + + def _poll_once(self) -> None: + try: + from meshtastic_mcp import devices as devices_mod + from meshtastic_mcp import info as info_mod + except Exception as exc: # pragma: no cover + self._app.post_message( + PytestLine( + source="stderr", line=f"[tui] device import failed: {exc!r}" + ) + ) + return + rows: list[DeviceRow] = [] + try: + raw = devices_mod.list_devices(include_unknown=True) + except Exception as exc: + self._app.post_message( + PytestLine( + source="stderr", line=f"[tui] list_devices failed: {exc!r}" + ) + ) + return + for d in raw: + vid_raw = d.get("vid") or "" + try: + vid_i = ( + int(vid_raw, 16) + if isinstance(vid_raw, str) and vid_raw.startswith("0x") + else int(vid_raw) + ) + except (TypeError, ValueError): + vid_i = 0 + role = None + if vid_i == 0x239A: + role = "nrf52" + elif vid_i in (0x303A, 0x10C4): + role = "esp32s3" + if not role and not d.get("likely_meshtastic"): + continue + row = DeviceRow( + role=role, + port=d.get("port", ""), + vid=str(vid_raw), + pid=str(d.get("pid") or ""), + description=d.get("description", "") or "", + ) + if role: + try: + row.info = info_mod.device_info(port=row.port, timeout_s=6.0) + except Exception as exc: + row.info = {"error": repr(exc)} + rows.append(row) + self._app.post_message(DeviceSnapshot(rows=rows)) + + # ---------------- Modals ---------------- + + class FailureDetailScreen(tx.ModalScreen): + """Show a failed test's longrepr + captured sections.""" + + BINDINGS = [tx.Binding("escape,q", "dismiss", "close")] + + def __init__(self, leaf: LeafReport, report_html: pathlib.Path) -> None: + self._leaf = leaf + self._report_html = report_html + super().__init__() + + def compose(self) -> Any: + yield tx.Static( + f"[bold]{self._leaf.nodeid}[/bold] " + f"outcome=[red]{self._leaf.outcome}[/red] " + f"duration={_format_duration(self._leaf.duration_s)}", + id="failure-detail-header", + ) + log = tx.RichLog( + highlight=False, markup=False, wrap=False, id="failure-detail-log" + ) + yield log + yield tx.Static( + f"[dim]Full HTML report: {self._report_html}[/dim] [esc] close", + id="failure-detail-footer", + ) + + def on_mount(self) -> None: + log = self.query_one("#failure-detail-log", tx.RichLog) + if self._leaf.longrepr: + log.write(self._leaf.longrepr) + log.write("") + for section_name, section_text in self._leaf.sections: + log.write(f"--- {section_name} ---") + log.write(section_text) + log.write("") + if not self._leaf.longrepr and not self._leaf.sections: + log.write("(no longrepr or captured sections in reportlog event)") + + def action_dismiss(self, _result: Any = None) -> None: + self.dismiss() + + class FilterInputScreen(tx.ModalScreen[str]): + """Prompt the user for a tree filter substring (empty clears).""" + + BINDINGS = [tx.Binding("escape", "cancel", "cancel")] + + def compose(self) -> Any: + yield tx.Static("filter test tree (substring, empty = clear):") + yield tx.Input(placeholder="nodeid substring", id="filter-input") + + def on_input_submitted(self, event: Any) -> None: + self.dismiss(event.value.strip()) + + def action_cancel(self) -> None: + self.dismiss(None) + + class CoverageModal(tx.ModalScreen): + """Read `tests/tool_coverage.json` (written by `tests/tool_coverage.py` + at `pytest_sessionfinish`) and render a two-column summary of which + MCP tools got exercised by the run. `(no coverage data yet)` while + the run is in flight.""" + + BINDINGS = [tx.Binding("escape,q,c", "dismiss", "close")] + + def __init__(self, coverage_path: pathlib.Path) -> None: + self._path = coverage_path + super().__init__() + + def compose(self) -> Any: + yield tx.Static("[bold]MCP tool coverage[/bold]", id="coverage-header") + yield tx.RichLog( + highlight=False, markup=True, wrap=False, id="coverage-log" + ) + yield tx.Static( + f"[dim]{self._path}[/dim] [esc] close", + id="coverage-footer", + ) + + def on_mount(self) -> None: + log = self.query_one("#coverage-log", tx.RichLog) + if not self._path.is_file(): + log.write("(no coverage data — tool_coverage.json not written yet)") + log.write("") + log.write("Coverage is emitted at pytest_sessionfinish; this") + log.write("file appears after the suite completes.") + return + try: + data = json.loads(self._path.read_text(encoding="utf-8")) + except Exception as exc: + log.write(f"[red]failed to read {self._path}:[/red] {exc!r}") + return + calls = data.get("calls") or {} + if not calls: + log.write("(tool_coverage.json present but no calls recorded)") + return + exercised = sorted( + ((n, c) for n, c in calls.items() if c > 0), key=lambda x: -x[1] + ) + unexercised = sorted(n for n, c in calls.items() if c == 0) + log.write(f"[b]{len(exercised)} / {len(calls)} MCP tools exercised[/b]") + log.write("") + log.write("[green]exercised[/green] (count):") + for name, count in exercised: + log.write(f" {count:>4} {name}") + if unexercised: + log.write("") + log.write("[dim]not exercised:[/dim]") + for name in unexercised: + log.write(f" {name}") + + def action_dismiss(self, _result: Any = None) -> None: + self.dismiss() + + class ReproducerResultModal(tx.ModalScreen): + """Show the exported reproducer tarball path with a short instruction.""" + + BINDINGS = [tx.Binding("escape,q,enter", "dismiss", "close")] + + def __init__( + self, archive_path: pathlib.Path, error: str | None = None + ) -> None: + self._archive = archive_path + self._error = error + super().__init__() + + def compose(self) -> Any: + if self._error: + yield tx.Static(f"[red]Reproducer export failed:[/red] {self._error}") + else: + yield tx.Static("[bold green]Reproducer bundle written[/bold green]") + yield tx.Static(f"[cyan]{self._archive}[/cyan]") + yield tx.Static("") + yield tx.Static( + "Contains: README.md, test_report.json, fwlog.jsonl (time-filtered)," + ) + yield tx.Static( + "devices.json, env.json. Attach to an issue / paste the path in chat." + ) + yield tx.Static("") + yield tx.Static("[dim][esc] close[/dim]") + + def action_dismiss(self, _result: Any = None) -> None: + self.dismiss() + + # ---------------- App ---------------- + + class TestTuiApp(tx.App): + CSS = """ + Screen { layout: vertical; } + #header-bar { height: 2; padding: 0 1; background: $panel; } + #tier-table { height: auto; max-height: 11; } + #body { height: 1fr; } + #tree-pane { width: 50%; border-right: solid $primary-background; } + #right-pane { width: 50%; layout: vertical; } + #pytest-pane { height: 50%; border-bottom: solid $primary-background; } + #fwlog-header { height: 1; padding: 0 1; background: $panel; } + #fwlog-pane { height: 1fr; } + Tree { height: 100%; } + RichLog { height: 100%; } + #device-table { height: auto; max-height: 6; } + """ + + TITLE = "mcp-server test runner" + + BINDINGS = [ + tx.Binding("r", "rerun_focused", "re-run focused"), + tx.Binding("f", "filter_tree", "filter"), + tx.Binding("d", "failure_detail", "failure detail"), + tx.Binding("g", "open_html_report", "open report.html"), + tx.Binding("x", "export_reproducer", "export reproducer"), + tx.Binding("c", "coverage_panel", "coverage"), + tx.Binding("l", "cycle_fwlog_filter", "fw log filter"), + tx.Binding("q,ctrl+c", "quit_app", "quit"), + ] + + def __init__(self) -> None: + super().__init__() + self._state = State() + self._root = root + self._run_tests = run_tests + self._reportlog = reportlog + self._fwlog = fwlog + self._flashlog = flashlog + self._report_html = root / _REPORT_HTML_RELATIVE + self._tool_coverage = root / _TOOL_COVERAGE_RELATIVE + self._repro_dir = root / _REPRODUCERS_RELATIVE + self._seed = seed + self._run_number = run_number + self._pytest_args = pytest_args + self._start_time = time.monotonic() + self._proc: subprocess.Popen[str] | None = None + self._stop = threading.Event() + self._reportlog_worker: ReportlogWorker | None = None + self._stdout_worker: SubprocessReaderWorker | None = None + self._stderr_worker: SubprocessReaderWorker | None = None + self._device_worker: DevicePollerWorker | None = None + self._fwlog_worker: _fwlog_mod.FirmwareLogTailer | None = None + self._flashlog_worker: _flashlog_mod.FlashLogTailer | None = None + self._tree_filter: str = "" + self._sigint_count = 0 + # Firmware-log port filter: None = all, else exact port match. + self._fwlog_filter: str | None = None + # Ordered set of distinct ports we've seen firmware log lines + # from — the `l` key cycles through these. + self._fwlog_ports: list[str] = [] + # Cross-run history. + self._history_store = _history_mod.HistoryStore( + root / _HISTORY_RELATIVE, keep_last=40 + ) + self._history_cache = self._history_store.read_recent() + + # -------- composition / mount -------- + + def compose(self) -> Any: + yield tx.Static(self._header_text(), id="header-bar") + tier_table = tx.DataTable(id="tier-table", show_cursor=False) + yield tier_table + with tx.Horizontal(id="body"): + with tx.Vertical(id="tree-pane"): + yield tx.Tree("tests", id="test-tree") + with tx.Vertical(id="right-pane"): + with tx.Vertical(id="pytest-pane"): + yield tx.RichLog( + id="pytest-log", + highlight=False, + markup=False, + wrap=False, + max_lines=5000, + ) + yield tx.Static(self._fwlog_header_text(), id="fwlog-header") + with tx.Vertical(id="fwlog-pane"): + yield tx.RichLog( + id="fwlog-log", + highlight=False, + markup=False, + # `wrap=True` so long firmware log lines (some + # hit ~200 chars — full packet hex dumps plus + # source tags) don't get truncated at the + # right edge. The right pane is ~50% of the + # terminal so even a wide terminal has a + # ~90-char cap; plain truncation dropped the + # uptime counter or packet id off the end. + wrap=True, + max_lines=5000, + ) + yield tx.DataTable(id="device-table", show_cursor=False) + yield tx.Footer() + + def _fwlog_header_text(self) -> str: + filt = self._fwlog_filter or "(all ports)" + return f"firmware log filter: [b]{filt}[/b] [l] cycle" + + def on_mount(self) -> None: + # Tier-counters table. `add_column` (singular) lets us pick + # the key explicitly — `add_columns` (plural) in textual 8.x + # returns auto-generated keys that are tedious to track + # separately, and update_cell(column_key=

)` — region, preset, channel_num, tx_power, hop_limit. - Optionally, if the device seems unhappy (fails to connect, `num_nodes==1` when ≥2 are plugged in, missing firmware*version), open a short firmware log window: `mcp__meshtastic__serial_open(port=

, env=)`, wait 3s, `serial_read(session_id=, max_lines=100)`, `serial_close(session_id=)`. The env should be inferred from the VID map in `mcp-server/run-tests.sh` (nrf52 → rak4631, esp32s3 → heltec-v3) unless `MESHTASTIC_MCP_ENV*` is set. -4. **Render per-device report** as: +4. **Hub health** (call once, not per-device): `mcp__meshtastic__uhubctl_list()` — enumerates every USB hub the host can see. Note which hubs advertise `ppps=true` and which hub hosts each Meshtastic device (cross-reference by VID). Flag it in the report if: + - No hub advertises PPPS → `tests/recovery/` can't run on this setup; hard-recovery via `uhubctl_cycle` isn't available. + - A Meshtastic device is on a non-PPPS hub → note it; operator may want to move the device to a PPPS hub to unlock auto-recovery. + - `uhubctl_list` raises `ConfigError: uhubctl not found` → just say `uhubctl not installed` in the report; don't treat as a fault. + +5. **Render per-device report** as: ```text [nrf52 @ /dev/cu.usbmodem1101] fw=2.7.23.bce2825, hw=RAK4631 @@ -33,20 +38,22 @@ Call the meshtastic MCP tool bundle and format a structured health report for on tx_power : 30 dBm, hop_limit=3 peers : 1 (esp32s3 0x433c2428, pubkey ✓, SNR 6.0 / RSSI -24 dBm) primary ch : McpTest + hub : 1-1.3 port 2 (PPPS, uhubctl-controllable) firmware : no panics in last 3s; NodeInfoModule emitted 2 broadcasts ``` - Keep it scannable. If a field is missing or abnormal (no pubkey for a known peer, region=UNSET, num_nodes inconsistent with the hub), flag it inline with a short `⚠︎ `. + Keep it scannable. If a field is missing or abnormal (no pubkey for a known peer, region=UNSET, num_nodes inconsistent with the hub, device on non-PPPS hub), flag it inline with a short `⚠︎ `. -5. **Cross-device correlation** (only when >1 device is inspected): +6. **Cross-device correlation** (only when >1 device is inspected): - Do both sides see each other in `nodesByNum`? If one does and the other doesn't, that's asymmetric NodeInfo — flag it. - Do the LoRa configs match? (region, channel_num, modem_preset should all agree; mismatch = no mesh) - Do the primary channel NAMES match? Mismatch = different PSK = no decode. -6. **Suggest next actions only for specific, recognisable failure modes**: +7. **Suggest next actions only for specific, recognisable failure modes**: - Stale PKI pubkey one-way → "run `/test tests/mesh/test_direct_with_ack.py` — the retry + nodeinfo-ping heals this in the test path." - Region mismatch → "re-bake one side via `./mcp-server/run-tests.sh --force-bake`." - - Device unreachable → point at touch_1200bps + the CP2102-wedged-driver note in run-tests.sh. + - Device unreachable, reachable via DFU → `touch_1200bps(port=...)` + `pio_flash`. If not even DFU responds AND the device is on a PPPS hub, escalate to `uhubctl_cycle(role=..., confirm=True)`. + - CP2102-wedged-driver on macOS → see the note in `run-tests.sh`. ## What NOT to do diff --git a/.claude/commands/repro.md b/.claude/commands/repro.md index 52dcf222b..c5f466ce6 100644 --- a/.claude/commands/repro.md +++ b/.claude/commands/repro.md @@ -44,7 +44,8 @@ Re-run a single pytest node ID N times in isolation, track pass rate, and surfac - **LoRa airtime collision** → pass rate improves with fewer concurrent transmitters; propose a `time.sleep` gap or retry bump in the test body. - **PKI key staleness** → fails on first attempt, passes after self-heal; existing retry loop in `test_direct_with_ack.py` handles this. - **NodeInfo cooldown** → `Skip send NodeInfo since we sent it <600s ago` in fail-only logs; needs `broadcast_nodeinfo_ping()` warmup. - - **Hardware-specific** (one direction fails, other passes; one device's firmware is older; driver wedged) → specific recovery pointer. + - **Hardware-specific** (one direction fails, other passes; one device's firmware is older; driver wedged) → specific recovery pointer. For a device that's wedged past `touch_1200bps`, the next escalation is `uhubctl_cycle(role=..., confirm=True)` to hard-power-cycle its hub port (requires `uhubctl` installed). + - **Device went dark mid-run** → fails from some attempt onward, never recovers, firmware log stops arriving. Almost always hardware: a Guru crash + frozen CDC. Hard-power-cycle via `uhubctl_cycle(role=..., confirm=True)` before the next iteration; if that also fails, escalate to replug. - **Genuinely unknown** → say so; don't invent a root cause. 7. **Report back** with: diff --git a/.claude/commands/test.md b/.claude/commands/test.md index 986ee1f31..46a753749 100644 --- a/.claude/commands/test.md +++ b/.claude/commands/test.md @@ -19,16 +19,21 @@ Run `mcp-server/run-tests.sh` and make sense of the output so the operator doesn 2. **Read the pre-flight header.** First ~6 lines print the detected hub (role → port → env). If that line reads `detected hub : (none)`, the wrapper will narrow to `tests/unit` only — say so explicitly in your summary so the operator knows hardware tiers were skipped. -3. **On pass**: one-line summary of the form `N passed, M skipped in `. Don't enumerate the 52 test names — the user can read those. Do mention if any test was SKIPPED for a NON-placeholder reason (e.g. "role not present on hub" is worth flagging). +3. **On pass**: one-line summary of the form `N passed, M skipped in `. Don't enumerate the test names — the user can read those. Do mention any SKIPPED tests and name the cause: + - `"role not present on hub"` → device unplugged; operator knows to reconnect. + - `"firmware not baked with USERPREFS_UI_TEST_LOG"` → tests/ui skipped because the macro isn't in firmware yet; suggest `--force-bake`. + - `"uhubctl not installed"` → tests/recovery + peer-offline skipped; suggest `brew install uhubctl` / `apt install uhubctl`. + - `"no PPPS-capable hubs detected"` → tests/recovery skipped because the hub doesn't support per-port power; the tier will never run on that setup. + - `"opencv-python-headless is not installed"` → tests/ui auto-deselected by run-tests.sh; suggest `pip install -e 'mcp-server/.[ui]'`. -4. **On failure**: for every FAILED test, open `mcp-server/tests/report.html` and extract the `Meshtastic debug` section for that test. pytest-html embeds the firmware log stream + device state dump there; the 200-line firmware log tail is usually enough to explain the failure. Summarise: which test, one-line assertion message, the firmware log lines that matter (things like `PKI_UNKNOWN_PUBKEY`, `Skip send NodeInfo`, `Error=`, `Guru Meditation`, `assertion failed`). +4. **On failure**: for every FAILED test, open `mcp-server/tests/report.html` and extract the `Meshtastic debug` section for that test. pytest-html embeds the firmware log stream + device state dump there; the 200-line firmware log tail is usually enough to explain the failure. Summarise: which test, one-line assertion message, the firmware log lines that matter (things like `PKI_UNKNOWN_PUBKEY`, `Skip send NodeInfo`, `Error=`, `Guru Meditation`, `assertion failed`). For UI-tier failures also glance at `mcp-server/tests/ui_captures///transcript.md` — it records each step's frame + OCR. 5. **Classify the failure** as one of: - **Transient/flake**: LoRa collision, timing-sensitive assertion, first-attempt NAK + successful retry pattern. Propose `/repro ` to confirm. - - **Environmental**: device unreachable, port busy, CP2102 driver wedged. Suggest the specific recovery (replug USB, `touch_1200bps`, check `git status userPrefs.jsonc`). + - **Environmental**: device unreachable, port busy, CP2102 driver wedged. Suggest the specific recovery in escalation order: (a) replug USB, (b) `touch_1200bps(port=...)` + `pio_flash` for nRF52 DFU, (c) `uhubctl_cycle(role="nrf52", confirm=True)` when a device is fully wedged past DFU (needs `uhubctl` installed — `baked_single`'s auto-recovery hook does this once automatically). Also check `git status userPrefs.jsonc`. - **Regression**: same assertion fails repeatedly, firmware log shows a new/unusual error. Surface the diff between expected and observed, identify the module likely responsible. -6. **Never run destructive recovery automatically.** If a failure looks like it needs a reflash, factory*reset, or USB replug, \_describe what to do* — don't execute. The operator decides. +6. **Never run destructive recovery automatically.** If a failure looks like it needs a reflash, factory*reset, `uhubctl_cycle`, or USB replug, \_describe what to do* — don't execute. The operator decides. ## Arguments handling diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d12244229..7c71a5014 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -474,7 +474,7 @@ The repo registers the server via `.mcp.json` at the repo root — Claude Code p **One MCP call per port at a time.** `SerialInterface` holds an exclusive OS-level lock on the serial port for its lifetime. If a `serial_*` session is open on `/dev/cu.usbmodem101`, calling `device_info` on the same port will fail fast pointing at the active session. Sequence calls: open → read/mutate → close, then next device. Never parallelize tool calls on the same port. -### MCP tool surface (~32 tools) +### MCP tool surface (43 tools) Grouped by purpose. Full argument shapes in `mcp-server/README.md`; a few high-value signatures are called out here. @@ -482,11 +482,13 @@ Grouped by purpose. Full argument shapes in `mcp-server/README.md`; a few high-v - **Build & flash**: `build`, `clean`, `pio_flash`, `erase_and_flash` (ESP32 only), `update_flash` (ESP32 OTA), `touch_1200bps` - **Serial sessions** (long-running, 10k-line ring buffer): `serial_open`, `serial_read`, `serial_list`, `serial_close` - **Device reads**: `device_info`, `list_nodes` -- **Device writes** (all require `confirm=True`): `set_owner`, `get_config`, `set_config`, `get_channel_url`, `set_channel_url`, `send_text`, `reboot`, `shutdown`, `factory_reset`, `set_debug_log_api` +- **Device writes**: `set_owner`, `get_config`, `set_config`, `get_channel_url`, `set_channel_url`, `send_text`, `send_input_event` (inject a button/key press via the firmware's InputBroker), `set_debug_log_api`; destructive/power-state writes require `confirm=True`: `reboot`, `shutdown`, `factory_reset` - **userPrefs admin** (build-time constants, not runtime config): `userprefs_get`, `userprefs_set`, `userprefs_reset`, `userprefs_manifest`, `userprefs_testing_profile` - **Vendor escape hatches**: `esptool_chip_info`, `esptool_erase_flash`, `esptool_raw`, `nrfutil_dfu`, `nrfutil_raw`, `picotool_info`, `picotool_load`, `picotool_raw` +- **USB power control** (via `uhubctl`, per-port PPPS toggle): `uhubctl_list` (read-only), `uhubctl_power(action='on'|'off', confirm=True)`, `uhubctl_cycle(delay_s, confirm=True)`. Target by raw `(location, port)` or by `role` (`"nrf52"`, `"esp32s3"`); role lookup checks `MESHTASTIC_UHUBCTL_LOCATION_` + `_PORT_` env vars first, falls back to VID auto-detection. +- **Observability** (UI tier + operator ad-hoc): `capture_screen(role, ocr=True)` — grabs a USB-webcam frame of the device OLED and optionally OCRs it. Requires `mcp-server[ui]` extras (`opencv-python-headless`, `easyocr`) and `MESHTASTIC_UI_CAMERA_DEVICE_` env var; falls through to a 1×1 black PNG `NullBackend` when unconfigured. -`confirm=True` is a tool-level gate on top of whatever permission prompt your MCP host shows. **Don't bypass it** by asking the host to auto-approve — it exists specifically because MCP hosts sometimes remember "always allow this tool" and that's dangerous for `factory_reset` and `erase_and_flash`. +`confirm=True` is a tool-level gate on top of whatever permission prompt your MCP host shows. **Don't bypass it** by asking the host to auto-approve — it exists specifically because MCP hosts sometimes remember "always allow this tool" and that's dangerous for `factory_reset`, `erase_and_flash`, `uhubctl_power(action='off')`, and `uhubctl_cycle`. ### Hardware test suite (`mcp-server/run-tests.sh`) @@ -494,14 +496,16 @@ The wrapper auto-detects connected devices (VID → role map: `0x239A` → `nrf5 Suite tiers (collected + run in this order via `pytest_collection_modifyitems`): -1. `tests/unit/` — pure Python (boards parse, pio wrapper, userPrefs parse, testing profile). No hardware. +1. `tests/unit/` — pure Python (boards parse, pio wrapper, userPrefs parse, testing profile, uhubctl parser). No hardware. 2. `tests/test_00_bake.py` — flashes each detected device with current `userPrefs.jsonc` merged with the session's test profile. Has its own skip-if-already-baked check comparing region + primary channel to the session profile; skips cheaply on warm devices. -3. `tests/mesh/` — multi-device mesh: bidirectional send, broadcast delivery, direct-with-ACK, mesh formation within 60s. Parametrized `[nrf52->esp32s3]` and `[esp32s3->nrf52]`. +3. `tests/mesh/` — multi-device mesh: bidirectional send, broadcast delivery, direct-with-ACK, mesh formation within 60s. Parametrized `[nrf52->esp32s3]` and `[esp32s3->nrf52]`. Includes `test_peer_offline_recovery` which uses uhubctl to physically power off one peer mid-conversation (requires uhubctl; skips without). 4. `tests/telemetry/` — `DEVICE_METRICS_APP` broadcast timing. 5. `tests/monitor/` — boot-log panic check. -6. `tests/fleet/` — PSK seed session isolation. -7. `tests/admin/` — channel URL roundtrip, owner persistence across reboot. -8. `tests/provisioning/` — region + modem + slot bake, admin key presence, `UNSET` region blocks TX, userPrefs survive factory reset. +6. `tests/recovery/` — `uhubctl` power-cycle round-trip + NVS persistence across hard reset. Requires `uhubctl` installed and a PPPS-capable hub; entire tier auto-skips otherwise. +7. `tests/ui/` — input-broker-driven screen navigation with camera + OCR evidence. +8. `tests/fleet/` — PSK seed session isolation. +9. `tests/admin/` — channel URL roundtrip, owner persistence across reboot. +10. `tests/provisioning/` — region + modem + slot bake, admin key presence, `UNSET` region blocks TX, userPrefs survive factory reset. Invocation patterns: @@ -586,15 +590,19 @@ If you're modifying `StreamAPI`, `PhoneAPI`, `NodeInfoModule`, or `userPrefs` fl ### Recovery playbooks -| Symptom | First check | Fix | -| ---------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `userPrefs.jsonc` dirty after test run | `git status --porcelain userPrefs.jsonc` | If non-empty, re-run `./mcp-server/run-tests.sh` once — the pre-flight self-heal restores from sidecar. If still dirty, `git checkout userPrefs.jsonc`. | -| Port busy / wedged CP2102 on macOS | `lsof /dev/cu.usbserial-0001` | Kill the holder. USB replug if the kernel still reports busy. Often a stale `pio device monitor` or zombie `meshtastic_mcp` process. | -| nRF52 appears unresponsive | `list_devices` shows VID `0x239A` but `device_info` times out | `touch_1200bps(port=...)` drops it into the DFU bootloader → `pio_flash` re-installs. | -| Multiple MCP server processes | `ps aux \| grep meshtastic_mcp` shows >1 | Kill all but the one your MCP host spawned. Zombies hold ports and break tests. | -| Mesh formation fails, one side sees peer but other doesn't | `/diagnose` (or `list_nodes` on both sides) | Asymmetric NodeInfo. `test_direct_with_ack` has a heal path; `/repro` it a few times. If persistent, both devices' clocks may be out of sync with their NodeInfo cooldown. | -| "role not present on hub" in skip reasons | `list_devices` | Expected if a device is unplugged. Reconnect before re-running the tier. | -| Tests fail only on first attempt then pass on rerun | — | State leak from a prior session. Run with `--force-bake` to reset to a known state. | +| Symptom | First check | Fix | +| --------------------------------------------------------------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `userPrefs.jsonc` dirty after test run | `git status --porcelain userPrefs.jsonc` | If non-empty, re-run `./mcp-server/run-tests.sh` once — the pre-flight self-heal restores from sidecar. If still dirty, `git checkout userPrefs.jsonc`. | +| Port busy / wedged CP2102 on macOS | `lsof /dev/cu.usbserial-0001` | Kill the holder. USB replug if the kernel still reports busy. Often a stale `pio device monitor` or zombie `meshtastic_mcp` process. | +| nRF52 appears unresponsive | `list_devices` shows VID `0x239A` but `device_info` times out | `touch_1200bps(port=...)` drops it into the DFU bootloader → `pio_flash` re-installs. | +| Device fully wedged (Guru Meditation, frozen CDC, no DFU) | `list_devices` shows the VID but every admin call times out | `uhubctl_cycle(role="nrf52", confirm=True)` hard-power-cycles the port via USB hub PPPS. `baked_single`'s auto-recovery hook does this once automatically if uhubctl is installed. Falls back to physical replug if no PPPS hub. | +| Multiple MCP server processes | `ps aux \| grep meshtastic_mcp` shows >1 | Kill all but the one your MCP host spawned. Zombies hold ports and break tests. | +| Mesh formation fails, one side sees peer but other doesn't | `/diagnose` (or `list_nodes` on both sides) | Asymmetric NodeInfo. `test_direct_with_ack` has a heal path; `/repro` it a few times. If persistent, both devices' clocks may be out of sync with their NodeInfo cooldown. | +| "role not present on hub" in skip reasons | `list_devices` | Expected if a device is unplugged. Reconnect before re-running the tier. | +| Entire `tests/recovery/` tier skipped | `command -v uhubctl` | Expected if `uhubctl` isn't on PATH. Install via `brew install uhubctl` (macOS) or `apt install uhubctl` (Debian/Ubuntu). Also skips if no hub advertises PPPS. | +| Entire `tests/ui/` tier skipped ("firmware not baked with USERPREFS_UI_TEST_LOG") | reportlog.jsonl for the skip reason | Re-run with `--force-bake` so the UI-log macro gets compiled into the fresh firmware. First run after the Round-3 landing always re-bakes. | +| `tests/ui/` runs but captures are all 1×1 black PNGs | `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3` | Env var not set → `NullBackend`. Point a USB webcam at the heltec-v3 OLED and set the device index; `.venv/bin/python -c "import cv2; [print(i, cv2.VideoCapture(i).read()[0]) for i in range(5)]"` discovers it. | +| Tests fail only on first attempt then pass on rerun | — | State leak from a prior session. Run with `--force-bake` to reset to a known state. | ### Never do these without asking diff --git a/.github/prompts/mcp-diagnose.prompt.md b/.github/prompts/mcp-diagnose.prompt.md index c86826030..1049858f8 100644 --- a/.github/prompts/mcp-diagnose.prompt.md +++ b/.github/prompts/mcp-diagnose.prompt.md @@ -26,7 +26,12 @@ This prompt assumes the meshtastic MCP server is registered with your VS Code Co - `get_config(section="lora", port=

)` → region, preset, channel_num, tx_power, hop_limit - If anything looks off (can't connect, `num_nodes` wrong, missing `firmware_version`), open a short firmware-log window: `serial_open(port=

, env=)`, wait 3 seconds, `serial_read(session_id, max_lines=100)`, `serial_close(session_id)`. Infer env from VID (0x239a → `rak4631`, 0x303a/0x10c4 → `heltec-v3`) unless an `MESHTASTIC_MCP_ENV_` env var overrides it. -4. **Render per-device report** as a compact block: +4. **Hub health** (call once, not per-device): `uhubctl_list()` — enumerates every USB hub the host sees. Cross-reference each Meshtastic device's VID to find which hub + port it's on. Flag in the report if: + - No hub advertises `ppps=true` → `tests/recovery/` can't run; hard-recovery via `uhubctl_cycle` isn't available. + - A Meshtastic device is on a non-PPPS hub → note it; moving to a PPPS hub unlocks auto-recovery. + - `uhubctl_list` raises `ConfigError: uhubctl not found` → report as "uhubctl not installed"; don't treat as a device fault. + +5. **Render per-device report** as a compact block: ```text [nrf52 @ /dev/cu.usbmodem1101] fw=2.7.23.bce2825, hw=RAK4631 @@ -35,20 +40,22 @@ This prompt assumes the meshtastic MCP server is registered with your VS Code Co tx_power : 30 dBm, hop_limit=3 peers : 1 (esp32s3 0x433c2428, pubkey ✓, SNR 6.0 / RSSI -24 dBm) primary ch : McpTest + hub : 1-1.3 port 2 (PPPS, uhubctl-controllable) firmware : no panics in last 3s ``` - Flag abnormalities inline with `⚠︎ ` — missing pubkey on a known peer, region UNSET, mismatched channel name, etc. + Flag abnormalities inline with `⚠︎ ` — missing pubkey on a known peer, region UNSET, mismatched channel name, device on non-PPPS hub, etc. -5. **Cross-device correlation** (when >1 device selected): +6. **Cross-device correlation** (when >1 device selected): - Do both see each other in `nodesByNum`? - Do `region`, `channel_num`, `modem_preset` match across devices? - Do the primary channel names match? (Different name → different PSK → no decode.) -6. **Suggest next steps only for recognizable failure modes**, never speculatively: +7. **Suggest next steps only for recognizable failure modes**, never speculatively: - Stale PKI one-way → "`/mcp-test tests/mesh/test_direct_with_ack.py` — the test's retry+nodeinfo-ping heals this." - Region mismatch → "re-bake one side via `./mcp-server/run-tests.sh --force-bake`." - - Device unreachable → refer operator to the touch_1200bps + CP2102-wedged-driver notes in `run-tests.sh`. + - Device unreachable, DFU reachable → `touch_1200bps(port=...)` + `pio_flash`. If not even DFU responds and the device is on a PPPS hub, escalate to `uhubctl_cycle(role=..., confirm=True)`. + - CP2102-wedged-driver on macOS → see `run-tests.sh` notes. ## Hard constraints diff --git a/.github/prompts/mcp-repro.prompt.md b/.github/prompts/mcp-repro.prompt.md index be2963c33..3a7c5c3de 100644 --- a/.github/prompts/mcp-repro.prompt.md +++ b/.github/prompts/mcp-repro.prompt.md @@ -46,7 +46,8 @@ Equivalent of `.claude/commands/repro.md`. Use when the operator says "that one - **LoRa airtime collision** — pass rate improves with fewer concurrent transmitters. Suggest a `time.sleep` gap or retry bump in the test body. - **PKI key staleness** — first attempt fails, subsequent ones pass; existing retry-loop pattern in `test_direct_with_ack.py` is the fix. - **NodeInfo cooldown** — `Skip send NodeInfo since we sent it <600s ago` in fail-only logs; needs a `broadcast_nodeinfo_ping()` warmup. - - **Hardware-specific** — one direction consistently fails, firmware versions differ, CP2102 driver wedged, etc. + - **Hardware-specific** — one direction consistently fails, firmware versions differ, CP2102 driver wedged, etc. For a device wedged past `touch_1200bps`, recommend `uhubctl_cycle(role=..., confirm=True)` to hard-power-cycle its hub port (requires `uhubctl` installed). + - **Device went dark mid-run** — fails from some iteration onward and never recovers; firmware log stops arriving. Almost always a Guru crash with frozen CDC. Recommend `uhubctl_cycle` before the next iteration; escalate to replug if that also fails. - **Unknown** — say so. Don't invent a root cause. 7. **Report back** with: diff --git a/.github/prompts/mcp-test.prompt.md b/.github/prompts/mcp-test.prompt.md index 092ad3d85..148569e83 100644 --- a/.github/prompts/mcp-test.prompt.md +++ b/.github/prompts/mcp-test.prompt.md @@ -21,19 +21,25 @@ Equivalent of the Claude Code `/test` slash command in `.claude/commands/test.md 2. **Read the pre-flight header** (first few lines of wrapper output). The `detected hub :` line lists role → port → env mappings. If it reads `(none)`, the wrapper narrowed to `tests/unit` only — call that out explicitly so the operator knows hardware tiers were skipped. -3. **On pass**: one-line summary like `N passed, M skipped in `. Don't enumerate test names. DO mention any non-placeholder SKIPs (things like "role not present on hub") because they indicate missing hardware or setup issues. +3. **On pass**: one-line summary like `N passed, M skipped in `. Don't enumerate test names. DO mention any non-placeholder SKIPs and name the cause: + - `"role not present on hub"` → device unplugged; operator should reconnect. + - `"firmware not baked with USERPREFS_UI_TEST_LOG"` → tests/ui skipped; the UI-log compile macro isn't in the baked firmware. Suggest `--force-bake`. + - `"uhubctl not installed"` → tests/recovery + `test_peer_offline_recovery` skipped. Suggest `brew install uhubctl` / `apt install uhubctl`. + - `"no PPPS-capable hubs detected"` → tests/recovery skipped because the attached hub doesn't support per-port power switching; won't run on that setup. + - `"opencv-python-headless is not installed"` → tests/ui auto-deselected by `run-tests.sh`. Suggest `pip install -e 'mcp-server/.[ui]'`. 4. **On failure**: open `mcp-server/tests/report.html` (pytest-html output, self-contained) and extract the `Meshtastic debug` section for each failed test. That section includes a firmware log stream (last 200 lines) and device state dump. For each failure, summarise: - test name - one-line assertion message - the specific firmware log lines that explain why (look for `PKI_UNKNOWN_PUBKEY`, `Skip send NodeInfo`, `Error=`, `Guru Meditation`, `assertion failed`, `No suitable channel`) + - for UI-tier failures also check `mcp-server/tests/ui_captures///transcript.md` (per-step frame + OCR) 5. **Classify each failure** as one of: - **Transient flake** — LoRa collision, first-attempt NAK with self-heal pattern, timing-sensitive assertion. Suggest `/mcp-repro ` to confirm. - - **Environmental** — device unreachable, port busy, CP2102 driver wedged on macOS. Suggest specific recovery (USB replug, `touch_1200bps`, `git status userPrefs.jsonc`). + - **Environmental** — device unreachable, port busy, CP2102 driver wedged on macOS. Suggest recovery in escalation order: (a) replug USB, (b) `touch_1200bps` + `pio_flash` for nRF52 DFU, (c) `uhubctl_cycle(role=..., confirm=True)` for a device wedged past DFU (needs `uhubctl` installed; `baked_single` does this once automatically when available). Also check `git status userPrefs.jsonc`. - **Regression** — same assertion fails repeatedly on re-runs, firmware log shows novel errors. Identify the firmware module likely responsible. -6. **Do NOT run destructive recovery automatically**. If a failure looks like it needs a reflash, factory*reset, or replug — \_describe the steps* and let the operator decide. Never burn airtime or flash cycles without approval. +6. **Do NOT run destructive recovery automatically**. If a failure looks like it needs a reflash, factory*reset, `uhubctl_cycle`, or replug — \_describe the steps* and let the operator decide. Never burn airtime or flash cycles without approval. ## Arguments convention diff --git a/AGENTS.md b/AGENTS.md index cd043c087..b3fa1970c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -89,25 +89,42 @@ Sequence these; don't parallelize on the same port. ## Where to look -| Path | What's there | -| --------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `src/` | Firmware C++ source (`mesh/`, `modules/`, `platform/`, `graphics/`, `gps/`, `motion/`, `mqtt/`, …) | -| `src/mesh/` | Core: NodeDB, Router, Channels, CryptoEngine, radio interfaces, StreamAPI, PhoneAPI | -| `src/modules/` | Feature modules; `Telemetry/Sensor/` has 50+ I2C sensor drivers | -| `variants/` | 200+ hardware variant definitions (`variant.h` + `platformio.ini` per board) | -| `protobufs/` | `.proto` definitions; regenerate with `bin/regen-protos.sh` | -| `test/` | Firmware unit tests (12 suites; `pio test -e native`) | -| `mcp-server/` | Python MCP server + pytest hardware integration tests | -| `mcp-server/tests/` | Tiered pytest suite: `unit/`, `mesh/`, `telemetry/`, `monitor/`, `fleet/`, `admin/`, `provisioning/` | -| `.claude/commands/` | Claude Code slash command bodies | -| `.github/prompts/` | Copilot prompt bodies (mirrors of the Claude Code ones) | -| `.github/copilot-instructions.md` | **Primary agent instructions — read this** | -| `.github/workflows/` | CI pipelines | -| `.mcp.json` | MCP server registration for Claude Code | +| Path | What's there | +| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | +| `src/` | Firmware C++ source (`mesh/`, `modules/`, `platform/`, `graphics/`, `gps/`, `motion/`, `mqtt/`, …) | +| `src/mesh/` | Core: NodeDB, Router, Channels, CryptoEngine, radio interfaces, StreamAPI, PhoneAPI | +| `src/modules/` | Feature modules; `Telemetry/Sensor/` has 50+ I2C sensor drivers | +| `variants/` | 200+ hardware variant definitions (`variant.h` + `platformio.ini` per board) | +| `protobufs/` | `.proto` definitions; regenerate with `bin/regen-protos.sh` | +| `test/` | Firmware unit tests (12 suites; `pio test -e native`) | +| `mcp-server/` | Python MCP server + pytest hardware integration tests | +| `mcp-server/tests/` | Tiered pytest suite: `unit/`, `mesh/`, `telemetry/`, `monitor/`, `recovery/`, `ui/`, `fleet/`, `admin/`, `provisioning/` | +| `.claude/commands/` | Claude Code slash command bodies | +| `.github/prompts/` | Copilot prompt bodies (mirrors of the Claude Code ones) | +| `.github/copilot-instructions.md` | **Primary agent instructions — read this** | +| `.github/workflows/` | CI pipelines | +| `.mcp.json` | MCP server registration for Claude Code | ## Recovery one-liners - **`userPrefs.jsonc` dirty after a test run?** Re-run `./mcp-server/run-tests.sh` once (pre-flight self-heals from the sidecar). If still dirty: `git checkout userPrefs.jsonc`. - **nRF52 not responding?** `mcp__meshtastic__touch_1200bps(port=...)` drops it into the DFU bootloader, then `pio_flash` re-installs. +- **Device fully wedged (no DFU)?** `mcp__meshtastic__uhubctl_cycle(role="nrf52", confirm=True)` hard-power-cycles it via USB hub PPPS. Needs `uhubctl` installed (`brew install uhubctl` / `apt install uhubctl`); on Linux without udev rules, permission errors fail fast, so use `sudo uhubctl` yourself or configure udev access. - **Port busy?** `lsof ` to find the holder. Usually a stale `pio device monitor` or zombie `meshtastic_mcp` process. Kill it. - **Multiple MCP servers running?** `ps aux | grep meshtastic_mcp` — zombies hold ports. Kill all but the one your host spawned. + +## Environment variables (test harness) + +| Var | Purpose | +| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | +| `MESHTASTIC_MCP_ENV_` | Override PlatformIO env for a role (e.g. `MESHTASTIC_MCP_ENV_NRF52=rak4631-dap`). Default map: `nrf52→rak4631`, `esp32s3→heltec-v3`. | +| `MESHTASTIC_MCP_SEED` | PSK seed for the session test profile. Defaults to `mcp--`. | +| `MESHTASTIC_MCP_FLASH_LOG` | File path to tee pio/esptool/nrfutil/picotool output. `run-tests.sh` sets this to `tests/flash.log` so the TUI can stream live flash progress. | +| `MESHTASTIC_UHUBCTL_BIN` | Absolute path to `uhubctl` binary. Default: PATH lookup. | +| `MESHTASTIC_UHUBCTL_LOCATION_` | Pin a role to a specific uhubctl hub location (e.g. `1-1.3`). Wins over VID auto-detection — use when multiple devices share a VID. | +| `MESHTASTIC_UHUBCTL_PORT_` | Pin a role to a specific hub port number. Required alongside `LOCATION_`. | +| `MESHTASTIC_UI_CAMERA_BACKEND` | Camera backend for UI tier + `capture_screen` tool: `opencv` / `ffmpeg` / `null` / `auto` (default). | +| `MESHTASTIC_UI_CAMERA_DEVICE` | Generic camera device (index or path). Used by the UI tier when no per-role var is set. | +| `MESHTASTIC_UI_CAMERA_DEVICE_` | Per-role camera pinning (e.g. `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=0` for the OLED-bearing heltec-v3). | +| `MESHTASTIC_UI_OCR_BACKEND` | OCR engine selection: `easyocr` / `pytesseract` / `null` / `auto` (default). | +| `MESHTASTIC_UI_TUI_CAMERA` | Set to `1` to mount the live camera-feed panel in `meshtastic-mcp-test-tui`. | diff --git a/mcp-server/.gitignore b/mcp-server/.gitignore index f5180bc71..4cc892b2a 100644 --- a/mcp-server/.gitignore +++ b/mcp-server/.gitignore @@ -24,3 +24,6 @@ tests/.tui-runs tests/.history/ # Reproducer bundles (TUI `x` export on failed tests). tests/reproducers/ +# UI-tier camera captures + per-test transcripts. Regenerated every run; +# left on disk for human review between runs. +tests/ui_captures/ diff --git a/mcp-server/README.md b/mcp-server/README.md index 7d5fc551a..7a36a6fac 100644 --- a/mcp-server/README.md +++ b/mcp-server/README.md @@ -61,7 +61,7 @@ Replace `` with the absolute path, e.g. `/Users/you/GitHub/firmwa Same `mcpServers` block, but in `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows). -## Tools (38) +## Tools (43) ### Discovery & metadata @@ -130,6 +130,34 @@ _The tool tables below document 38 currently registered MCP server tools._ | `picotool_load` | Load a UF2 | | `picotool_raw` | Pass-through | +### USB power control (uhubctl) + +| Tool | What it does | +| --------------- | ----------------------------------------------------------- | +| `uhubctl_list` | Enumerate USB hubs + attached-device VID/PID (read-only) | +| `uhubctl_power` | Drive a hub port `on` or `off`; `off` requires confirm=True | +| `uhubctl_cycle` | Off → wait `delay_s` → on; confirm=True required | + +Target a port by explicit `(location, port)` (raw uhubctl syntax like +`location="1-1.3", port=2`) or by `role` (`"nrf52"`, `"esp32s3"`). Role +lookup checks `MESHTASTIC_UHUBCTL_LOCATION_` + +`MESHTASTIC_UHUBCTL_PORT_` env vars first, then auto-detects via VID +against `uhubctl`'s output. + +Requires [`uhubctl`](https://github.com/mvp/uhubctl) on PATH: + +```bash +brew install uhubctl # macOS +apt install uhubctl # Debian/Ubuntu +``` + +Modern macOS + PPPS-capable hubs generally work without root. On Linux +without udev rules, or on old macOS with driver quirks, you may need +`sudo`. If uhubctl returns a permission error the MCP tool raises a +clear `UhubctlError` pointing at the +[udev-rules / sudo fallback](https://github.com/mvp/uhubctl#linux-usb-permissions) +rather than auto-`sudo`'ing mid-run. + ## Safety - **All destructive flash/admin tools require `confirm=True`** as a tool-level gate, on top of any permission prompt from Claude. @@ -182,10 +210,22 @@ in the pre-flight header. - **`unit`** — pure Python, no hardware. boards / PIO wrapper / userPrefs-parse / testing-profile fixtures. - **`mesh`** — 2-device mesh: formation, broadcast delivery, direct+ACK, - traceroute, bidirectional. Parametrized over both directions. + traceroute, bidirectional. Parametrized over both directions. Includes + `test_peer_offline_recovery` which uses uhubctl to power-cycle one peer + mid-conversation and verifies the mesh recovers (skips without uhubctl). - **`telemetry`** — periodic telemetry broadcast + on-demand request/reply (`TELEMETRY_APP` with `wantResponse=True`). - **`monitor`** — boot log has no panic markers within 60 s of reboot. +- **`recovery`** — `uhubctl` power-cycle round-trip: verifies the hub port + can be toggled off/on, the device re-enumerates with the same + `my_node_num`, and NVS-resident config (region, channel, modem preset) + survives a hard reset. Requires `uhubctl` on PATH; skips cleanly otherwise. +- **`ui`** — input-broker-driven screen navigation (`AdminMessage.send_input_event` + injection → `Screen::handleInputEvent` → frame transition). Parametrized + on the screen-bearing role (heltec-v3 OLED). Captures images via USB + webcam + OCRs them for HTML-report evidence. Requires `pip install -e '.[ui]'` + and `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=`; tier is auto-deselected + if `cv2` isn't importable. - **`fleet`** — PSK-seed isolation: two labs with different seeds never overlap. - **`admin`** — owner persistence across reboot, channel URL round-trip, @@ -193,6 +233,42 @@ in the pre-flight header. - **`provisioning`** — region/channel baking, userPrefs survive `factory_reset(full=False)`. +#### UI tier setup + +The `tests/ui/` tier drives the on-device OLED via the firmware's existing +`AdminMessage.send_input_event` RPC (no firmware changes required) and +verifies transitions via a macro-gated log line + camera + OCR. Summary: + +1. Install extras: `pip install -e 'mcp-server/.[ui]'` — pulls in + `opencv-python-headless`, `numpy`, `easyocr`, `Pillow`. First easyocr + run downloads ~100 MB of models to `~/.EasyOCR/`; an autouse session + fixture pre-warms the reader so per-test OCR is <100 ms after that. +2. Point a USB webcam at the heltec-v3 OLED. Discover its index: + ```bash + .venv/bin/python -c "import cv2; [print(i, cv2.VideoCapture(i).read()[0]) for i in range(5)]" + ``` +3. Export the per-role device env var: + ```bash + export MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=0 + ``` +4. Run: + ```bash + ./run-tests.sh tests/ui -v + ``` + Captures land under `tests/ui_captures///`, one + PNG + `.ocr.txt` per `frame_capture()` call, with a per-test + `transcript.md` stepping through event → frame → OCR. The HTML report + embeds the full image strip inline (pass or fail). + +On macOS, `cv2.VideoCapture(0)` triggers the TCC Camera permission prompt +on first use. Pre-grant Terminal (or your IDE's terminal) before running. +The `OpenCVBackend` fails fast on 10 consecutive black frames so a silent +permission denial surfaces as a clear error, not an empty PNG strip. + +No camera? Set `MESHTASTIC_UI_CAMERA_BACKEND=null` (or leave the device var +unset). Tests still exercise the event-injection path and log assertions; +captures just become 1×1 black PNGs. + ### Artifacts (regenerated every run, under `tests/`) - `report.html` — self-contained pytest-html report. Each test gets a @@ -217,6 +293,14 @@ Key bindings: `r` re-run focused, `f` filter, `d` failure detail, `g` open `report.html`, `x` export reproducer bundle, `l` cycle fw-log filter, `q` quit (SIGINT → SIGTERM → SIGKILL escalation). +Set `MESHTASTIC_UI_TUI_CAMERA=1` to mount a bottom-of-screen **UI camera** +panel. Left side: the latest capture PNG rendered as Unicode half-blocks +(via `rich-pixels`, works in any terminal — no kitty/sixel required). +Right side: live transcript tail ("step 3 — frame 4/8 name=nodelist_nodes +— OCR: Nodes 2/2") so you can see every event-injection and its result +as each UI test runs. Requires the `[ui]` extras for image rendering; the +transcript alone works without them. + ### Slash commands Three AI-assisted workflows are wired up for Claude Code operators diff --git a/mcp-server/pyproject.toml b/mcp-server/pyproject.toml index d73bf795f..3241c843f 100644 --- a/mcp-server/pyproject.toml +++ b/mcp-server/pyproject.toml @@ -23,6 +23,21 @@ test = [ # consumers; revisit if install cost pushes back. "textual>=0.50", ] +# UI test tier + `capture_screen` MCP tool. Optional because the ML OCR +# model alone is ~100 MB and camera hardware is user-supplied. +# pip install -e '.[ui]' — full (OpenCV + easyocr) +# pip install -e '.[ui-min]' — image capture only, no OCR +ui = [ + "opencv-python-headless>=4.9", + "numpy>=1.26", + "easyocr>=1.7", + "Pillow>=10.0", + # Renders the latest camera capture as Unicode half-blocks in the TUI + # (MESHTASTIC_UI_TUI_CAMERA=1). Terminal-agnostic — no kitty / sixel + # dependency. Pure Python, tiny. + "rich-pixels>=3.0", +] +ui-min = ["opencv-python-headless>=4.9", "numpy>=1.26"] [project.scripts] meshtastic-mcp = "meshtastic_mcp.__main__:main" diff --git a/mcp-server/run-tests.sh b/mcp-server/run-tests.sh index 292e6e3a2..c84a8f751 100755 --- a/mcp-server/run-tests.sh +++ b/mcp-server/run-tests.sh @@ -217,6 +217,40 @@ if [[ $# -eq 0 ]]; then -v --tb=short fi +# UI tier requires opencv-python-headless (and ideally easyocr). If it's +# not installed, auto-deselect tests/ui so operators without the [ui] +# extra still get a green run. Printed in yellow; silent when cv2 is +# present. +_cv2_ok=0 +if "$VENV_PY" -c "import cv2" >/dev/null 2>&1; then + _cv2_ok=1 +fi +_running_ui=0 +for _arg in "$@"; do + case "$_arg" in + *tests/ui* | tests/) _running_ui=1 ;; + *) ;; + esac +done +if [[ $_running_ui -eq 1 && $_cv2_ok -eq 0 ]]; then + printf '\033[33m[pre-flight] tests/ui tier detected, but opencv-python-headless is not installed — deselecting.\033[0m\n' + printf ' install with: .venv/bin/pip install -e "mcp-server/.[ui]"\n' + echo + set -- "$@" --ignore=tests/ui +fi + +# Recovery tier needs `uhubctl` on PATH — it power-cycles devices via USB +# hub PPPS. The tier's conftest already skips cleanly, so this is just a +# friendly heads-up before the skip happens. `baked_single`'s auto- +# recovery hook also benefits from having uhubctl available across the +# whole suite. +if ! command -v uhubctl >/dev/null 2>&1; then + printf "\033[33m[pre-flight] uhubctl not found on PATH — recovery tier will skip, and\n" + printf " wedged-device auto-recovery is disabled.\033[0m\n" + printf " install with: brew install uhubctl (macOS) or apt install uhubctl (Debian/Ubuntu).\n" + echo +fi + # Always emit `tests/reportlog.jsonl` (unless the operator explicitly passed # their own `--report-log=...`). Consumers — notably the # `meshtastic-mcp-test-tui` TUI — tail the reportlog for live per-test state. diff --git a/mcp-server/src/meshtastic_mcp/admin.py b/mcp-server/src/meshtastic_mcp/admin.py index 6da92d860..33f3865dd 100644 --- a/mcp-server/src/meshtastic_mcp/admin.py +++ b/mcp-server/src/meshtastic_mcp/admin.py @@ -356,6 +356,46 @@ def shutdown( return {"ok": True, "shutting_down_in_s": seconds} +def send_input_event( + event_code: int | str, + kb_char: int = 0, + touch_x: int = 0, + touch_y: int = 0, + port: str | None = None, +) -> dict[str, Any]: + """Inject an InputBroker event (button press / key / gesture) into the UI. + + Wraps `AdminMessage.send_input_event` (handled in firmware at + src/modules/AdminModule.cpp::handleSendInputEvent). Local-only — no PKI + warmup needed since the admin message is addressed to `my_node_num`. + + `event_code` accepts an int, a case-insensitive name + (`"RIGHT"` / `"input_broker_right"`), or an `InputEventCode`. The + firmware-side enum lives in src/input/InputBroker.h and is mirrored in + `meshtastic_mcp.input_events`. + """ + from meshtastic.protobuf import admin_pb2 # type: ignore[import-untyped] + + from .input_events import coerce_event_code + + code = coerce_event_code(event_code) + if not 0 <= kb_char <= 255: + raise ValueError(f"kb_char out of u8 range: {kb_char}") + if not 0 <= touch_x <= 65535: + raise ValueError(f"touch_x out of u16 range: {touch_x}") + if not 0 <= touch_y <= 65535: + raise ValueError(f"touch_y out of u16 range: {touch_y}") + + with connect(port=port) as iface: + msg = admin_pb2.AdminMessage() + msg.send_input_event.event_code = code + msg.send_input_event.kb_char = kb_char + msg.send_input_event.touch_x = touch_x + msg.send_input_event.touch_y = touch_y + iface.localNode._sendAdmin(msg) + return {"ok": True, "event_code": code, "kb_char": kb_char} + + def factory_reset( port: str | None = None, confirm: bool = False, full: bool = False ) -> dict[str, Any]: diff --git a/mcp-server/src/meshtastic_mcp/camera.py b/mcp-server/src/meshtastic_mcp/camera.py new file mode 100644 index 000000000..5f1e5ede3 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/camera.py @@ -0,0 +1,286 @@ +"""Cross-platform USB-webcam capture for UI tests + the `capture_screen` tool. + +Backends: +- `opencv` — cv2.VideoCapture (AVFoundation on macOS, V4L2 on Linux). +- `ffmpeg` — subprocess shelling out to the system `ffmpeg` binary. Slower + per frame, but zero Python deps beyond stdlib. +- `null` — no-op stub returning a 1×1 black PNG. Used when no camera is + configured; keeps code paths alive without forcing every operator to + hook up hardware. + +Environment variables (read at `get_camera()` call time): +- `MESHTASTIC_UI_CAMERA_BACKEND` — one of `opencv` / `ffmpeg` / `null` / + `auto` (default). `auto` picks opencv if `cv2` imports, else ffmpeg if + `ffmpeg --version` resolves, else null. +- `MESHTASTIC_UI_CAMERA_DEVICE` — generic default (index or path). +- `MESHTASTIC_UI_CAMERA_DEVICE_` — per-role override, e.g. + `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=0` for the OLED-bearing heltec-v3. + Role suffix is uppercased before lookup. + +Dependencies land in the optional `[ui]` extra; imports are lazy so clients +without `opencv-python-headless` installed can still import this module. +""" + +from __future__ import annotations + +import io +import os +import shutil +import subprocess +import sys +import time +import warnings +from pathlib import Path +from typing import Protocol + + +class CameraError(RuntimeError): + """Raised when a camera backend fails to initialize or capture.""" + + +class CameraBackend(Protocol): + name: str + + def capture(self) -> bytes: + """Return one PNG-encoded frame.""" + ... + + def close(self) -> None: ... + + +# ---------- OpenCV backend ------------------------------------------------- + + +class OpenCVBackend: + name = "opencv" + + def __init__(self, device: int | str, warmup_frames: int = 5) -> None: + try: + import cv2 # type: ignore[import-untyped] # noqa: PLC0415 + except ImportError as exc: + raise CameraError( + "opencv backend requested but `cv2` is not installed. " + "Install the mcp-server [ui] extra: pip install -e '.[ui]'" + ) from exc + + self._cv2 = cv2 + device_arg: int | str + if isinstance(device, str) and device.isdigit(): + device_arg = int(device) + else: + device_arg = device + self._cap = cv2.VideoCapture(device_arg) + if not self._cap.isOpened(): + raise CameraError( + f"cv2.VideoCapture({device_arg!r}) failed to open. " + "On macOS check TCC Camera permission; on Linux check /dev/video* and v4l2 access." + ) + + # Drop the first few frames — auto-exposure + white-balance settle. + for _ in range(warmup_frames): + self._cap.read() + # Detect a stuck black-frame camera early rather than silently + # producing all-black captures. + ok, frame = self._cap.read() + if not ok or frame is None: + self._cap.release() + raise CameraError(f"camera {device_arg!r} opened but returned no frames") + + def capture(self) -> bytes: + cv2 = self._cv2 + ok, frame = self._cap.read() + if not ok or frame is None: + raise CameraError("cv2.VideoCapture.read() returned no frame") + success, buf = cv2.imencode(".png", frame) + if not success: + raise CameraError("cv2.imencode('.png', ...) failed") + return bytes(buf) + + def close(self) -> None: + try: + self._cap.release() + except Exception: # noqa: BLE001 + pass + + +# ---------- ffmpeg subprocess backend -------------------------------------- + + +class FfmpegBackend: + name = "ffmpeg" + + def __init__(self, device: int | str) -> None: + if shutil.which("ffmpeg") is None: + raise CameraError("ffmpeg backend requested but `ffmpeg` is not on PATH") + + self._device = str(device) + # Platform-specific -f flag: + # macOS → avfoundation (index like "0") + # Linux → v4l2 (device like "/dev/video0" or "0") + if sys.platform == "darwin": + self._input_format = "avfoundation" + self._input_spec = self._device # bare index for avfoundation + else: + self._input_format = "v4l2" + self._input_spec = ( + self._device + if self._device.startswith("/dev/") + else f"/dev/video{self._device}" + ) + + def capture(self) -> bytes: + cmd = [ + "ffmpeg", + "-hide_banner", + "-loglevel", + "error", + "-f", + self._input_format, + "-i", + self._input_spec, + "-frames:v", + "1", + "-f", + "image2pipe", + "-vcodec", + "png", + "-", + ] + try: + out = subprocess.run( + cmd, capture_output=True, check=True, timeout=15 # noqa: S603 + ) + except subprocess.CalledProcessError as exc: + raise CameraError( + f"ffmpeg capture failed (rc={exc.returncode}): {exc.stderr.decode(errors='replace')[:200]}" + ) from exc + except subprocess.TimeoutExpired as exc: + raise CameraError("ffmpeg capture timed out after 15s") from exc + return out.stdout + + def close(self) -> None: + pass # stateless — each capture spawns a new process + + +# ---------- Null backend --------------------------------------------------- + + +# A tiny valid 1×1 transparent PNG so callers always get a decodable image. +_BLACK_1X1_PNG = bytes.fromhex( + "89504e470d0a1a0a0000000d49484452000000010000000108060000001f15c489" + "0000000d49444154789c6300010000000500010d0a2db40000000049454e44ae426082" +) + + +class NullBackend: + name = "null" + + def capture(self) -> bytes: + return _BLACK_1X1_PNG + + def close(self) -> None: + pass + + +# ---------- Factory -------------------------------------------------------- + + +def _resolve_device(role: str | None) -> str | None: + if role: + specific = os.environ.get(f"MESHTASTIC_UI_CAMERA_DEVICE_{role.upper()}") + if specific: + return specific + return os.environ.get("MESHTASTIC_UI_CAMERA_DEVICE") + + +def get_camera(role: str | None = None) -> CameraBackend: + """Return a CameraBackend for the given device role (e.g. `"esp32s3"`). + + Falls back to `NullBackend` if no camera is configured or the selected + backend fails to init — tests should treat captures as best-effort + evidence, not a blocker. + """ + backend = os.environ.get("MESHTASTIC_UI_CAMERA_BACKEND", "auto").lower() + device = _resolve_device(role) + + if backend in ("null", "none") or device is None: + return NullBackend() + + if backend == "auto": + # Prefer opencv if importable; fall back to ffmpeg; else null. + try: + import cv2 # type: ignore[import-untyped] # noqa: F401,PLC0415 + + backend = "opencv" + except ImportError: + backend = "ffmpeg" if shutil.which("ffmpeg") else "null" + + if backend == "opencv": + try: + return OpenCVBackend(device) + except CameraError as exc: + warnings.warn( + f"camera backend {backend!r} failed to initialize for device " + f"{device!r}: {exc}; falling back to null backend", + RuntimeWarning, + stacklevel=2, + ) + return NullBackend() + if backend == "ffmpeg": + try: + return FfmpegBackend(device) + except CameraError as exc: + warnings.warn( + f"camera backend {backend!r} failed to initialize for device " + f"{device!r}: {exc}; falling back to null backend", + RuntimeWarning, + stacklevel=2, + ) + return NullBackend() + if backend == "null": + return NullBackend() + + raise CameraError(f"unknown MESHTASTIC_UI_CAMERA_BACKEND: {backend!r}") + + +def save_capture(png_bytes: bytes, path: Path) -> None: + path.parent.mkdir(parents=True, exist_ok=True) + path.write_bytes(png_bytes) + + +def capture_to_file(role: str | None, path: Path) -> dict[str, object]: + """One-shot: open camera, capture, write PNG, close. Returns metadata.""" + started = time.monotonic() + cam = get_camera(role) + try: + data = cam.capture() + finally: + cam.close() + save_capture(data, path) + return { + "backend": cam.name, + "path": str(path), + "bytes": len(data), + "elapsed_s": round(time.monotonic() - started, 3), + } + + +def _is_png(data: bytes) -> bool: + return data.startswith(b"\x89PNG\r\n\x1a\n") + + +# Exposed so callers can sanity-check a capture without a full PIL import. +__all__ = [ + "CameraBackend", + "CameraError", + "FfmpegBackend", + "NullBackend", + "OpenCVBackend", + "capture_to_file", + "get_camera", + "save_capture", +] + +# Keep `io` import used (pyflakes is picky) via a small guard used at import +# time to normalize stdin/stdout if a subclass ever needs it. +_ = io.BytesIO # noqa: SLF001 diff --git a/mcp-server/src/meshtastic_mcp/cli/_uicap.py b/mcp-server/src/meshtastic_mcp/cli/_uicap.py new file mode 100644 index 000000000..448459954 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/cli/_uicap.py @@ -0,0 +1,83 @@ +"""UI-capture transcript tailer for ``meshtastic-mcp-test-tui``. + +Watches ``tests/ui_captures//`` for new transcript lines +(one per ``frame_capture()`` call from the UI tier) and posts them to +the TUI. Enabled by ``MESHTASTIC_UI_TUI_CAMERA=1``. + +Design mirrors ``_flashlog.py``: +- Daemon thread, cooperative stop via ``threading.Event``. +- Tolerates the captures directory not existing yet (UI tier hasn't run). +- Per-file seek state so we only forward genuinely-new lines. +""" + +from __future__ import annotations + +import pathlib +import threading +import time +from typing import Callable + + +class UiCaptureTailer(threading.Thread): + """Recursively watch a captures root for new `transcript.md` lines. + + Invokes ``post(test_id, line)`` for each new line, where ``test_id`` + is derived from the path — the sanitized nodeid directory name. + """ + + def __init__( + self, + root: pathlib.Path, + post: Callable[[str, str], None], + stop: threading.Event, + *, + poll_interval: float = 0.5, + ) -> None: + super().__init__(daemon=True, name="uicap-tail") + self._root = root + self._post = post + self._stop = stop + self._poll_interval = poll_interval + # path → byte offset we've already read through + self._offsets: dict[pathlib.Path, int] = {} + + def run(self) -> None: + while not self._stop.is_set(): + try: + self._scan_once() + except Exception: + # Best-effort tailer — never bring down the TUI because a + # directory vanished mid-scan. + pass + time.sleep(self._poll_interval) + + def _scan_once(self) -> None: + if not self._root.is_dir(): + return + for transcript in self._root.rglob("transcript.md"): + test_id = transcript.parent.name + offset = self._offsets.get(transcript, 0) + try: + size = transcript.stat().st_size + except OSError: + continue + if size < offset: + # File truncated / rewritten — reset and re-emit. + offset = 0 + if size == offset: + continue + try: + with transcript.open("rb") as fh: + fh.seek(offset) + chunk = fh.read(size - offset).decode("utf-8", errors="replace") + except OSError: + continue + for line in chunk.splitlines(): + line = line.rstrip() + if not line or line.startswith("#"): + continue + try: + self._post(test_id, line) + except Exception: + return + self._offsets[transcript] = size diff --git a/mcp-server/src/meshtastic_mcp/cli/test_tui.py b/mcp-server/src/meshtastic_mcp/cli/test_tui.py index 33201101b..7f3a2da36 100644 --- a/mcp-server/src/meshtastic_mcp/cli/test_tui.py +++ b/mcp-server/src/meshtastic_mcp/cli/test_tui.py @@ -518,6 +518,7 @@ def _build_app( from . import _fwlog as _fwlog_mod from . import _history as _history_mod from . import _reproducer as _reproducer_mod + from . import _uicap as _uicap_mod # ---------------- Messages ---------------- @@ -548,6 +549,16 @@ def _build_app( self.line = line super().__init__() + class UiCaptureLine(tx.Message): + """Live line from the UI-tier camera transcript — one per + `frame_capture()` call. Posted only when the camera panel is + enabled via `MESHTASTIC_UI_TUI_CAMERA=1`.""" + + def __init__(self, test_id: str, line: str) -> None: + self.test_id = test_id + self.line = line + super().__init__() + class DeviceSnapshot(tx.Message): def __init__(self, rows: list[DeviceRow]) -> None: self.rows = rows @@ -871,6 +882,10 @@ def _build_app( #pytest-pane { height: 50%; border-bottom: solid $primary-background; } #fwlog-header { height: 1; padding: 0 1; background: $panel; } #fwlog-pane { height: 1fr; } + #uicap-header { height: 1; padding: 0 1; background: $boost; } + #uicap-pane { height: 14; border-top: solid $primary-background; } + #uicap-image { width: 36; border-right: solid $primary-background; padding: 0 1; } + #uicap-log { width: 1fr; height: 14; } Tree { height: 100%; } RichLog { height: 100%; } #device-table { height: auto; max-height: 6; } @@ -912,6 +927,11 @@ def _build_app( self._device_worker: DevicePollerWorker | None = None self._fwlog_worker: _fwlog_mod.FirmwareLogTailer | None = None self._flashlog_worker: _flashlog_mod.FlashLogTailer | None = None + self._uicap_worker: _uicap_mod.UiCaptureTailer | None = None + # Env-gated; only mounts the UI-capture panel when operator asks for it. + self._ui_camera_enabled = bool( + int(os.environ.get("MESHTASTIC_UI_TUI_CAMERA", "0") or "0") + ) self._tree_filter: str = "" self._sigint_count = 0 # Firmware-log port filter: None = all, else exact port match. @@ -959,6 +979,22 @@ def _build_app( wrap=True, max_lines=5000, ) + if self._ui_camera_enabled: + yield tx.Static( + "UI camera — latest capture + transcript (MESHTASTIC_UI_TUI_CAMERA=1)", + id="uicap-header", + ) + with tx.Horizontal(id="uicap-pane"): + yield tx.Static( + "(waiting…)", id="uicap-image", markup=False + ) + yield tx.RichLog( + id="uicap-log", + highlight=False, + markup=False, + wrap=True, + max_lines=500, + ) yield tx.DataTable(id="device-table", show_cursor=False) yield tx.Footer() @@ -1023,6 +1059,21 @@ def _build_app( stop=self._stop, ) self._flashlog_worker.start() + # UI-capture transcript tailer — only runs when the camera panel + # is enabled. Watches tests/ui_captures/**/transcript.md for new + # lines as UI tests execute. + if self._ui_camera_enabled: + captures_root = self._root / "mcp-server" / "tests" / "ui_captures" + # When the TUI is launched from inside mcp-server (the usual + # case), `self._root` is already mcp-server/, so adjust: + if not captures_root.parent.name == "mcp-server": + captures_root = self._root / "tests" / "ui_captures" + self._uicap_worker = _uicap_mod.UiCaptureTailer( + root=captures_root, + post=lambda tid, line: self.post_message(UiCaptureLine(tid, line)), + stop=self._stop, + ) + self._uicap_worker.start() self._spawn_pytest(self._pytest_args) # Header tick (seed / runtime / sparkline re-renders at 1 Hz). # Also refreshes the device-status column so the per-test elapsed @@ -1217,6 +1268,84 @@ def _build_app( log = self.query_one("#pytest-log", tx.RichLog) log.write(f"[flash] {message.line}") + def on_ui_capture_line(self, message: Any) -> None: + """Route a UI-capture transcript line into the camera panel. + + Each line is already formatted by frame_capture — e.g. + `1. **initial** — frame 2/8 name=home — OCR: ...`. We write + the text into the RichLog AND try to render the corresponding + PNG on the left side (requires rich-pixels, Pillow). + """ + if not self._ui_camera_enabled: + return + try: + log_panel = self.query_one("#uicap-log", tx.RichLog) + except Exception: + return + log_panel.write(f"[{message.test_id}] {message.line}") + self._render_latest_ui_capture(message.test_id, message.line) + + def _render_latest_ui_capture(self, test_id: str, line: str) -> None: + """Find the PNG that corresponds to `line` and render it on the + left of the uicap pane. Soft-fails if rich-pixels isn't + installed or the PNG isn't found — operator still has the text + transcript on the right. + """ + try: + from PIL import Image # type: ignore[import-untyped] + from rich_pixels import Pixels # type: ignore[import-untyped] + except ImportError: + return + + # Transcript lines look like `1. **label** — ...`. Pull the leading + # integer to locate the capture file. + import re as _re + + m = _re.match(r"\s*(\d+)\.\s", line) + if not m: + return + step = int(m.group(1)) + + # Captures directory is sibling of tests/ — mirror the path the + # tailer watches. Search both likely layouts (in-mcp-server vs. + # firmware-root invocation). + candidates = [ + self._root / "tests" / "ui_captures", + self._root / "mcp-server" / "tests" / "ui_captures", + ] + captures_root = next((p for p in candidates if p.is_dir()), None) + if captures_root is None: + return + + # Drill into // — test_id is the + # sanitized nodeid the tailer already passed through. + matches = list(captures_root.rglob(f"{test_id}/{step:03d}-*.png")) + if not matches: + return + png_path = matches[-1] + + try: + img = Image.open(png_path).convert("RGB") + # Resize to fit ~32 cells wide × ~12 rows tall (half-block + # renderer gives 2× vertical resolution, so 32×24 px input + # lands at ~32×12 cells). Keep aspect ratio. + target_w = 60 + w, h = img.size + target_h = max(1, int(h * (target_w / max(1, w)))) + # Clamp: the image panel is 14 rows; half-blocks give 2 rows + # per vertical cell, so cap pixel height at ~26. + target_h = min(target_h, 26) + img = img.resize((target_w, target_h)) + pixels = Pixels.from_image(img) + except Exception: + return + + try: + image_widget = self.query_one("#uicap-image", tx.Static) + image_widget.update(pixels) + except Exception: + pass + def on_firmware_log_line(self, message: Any) -> None: rec = message.record port = rec.get("port") diff --git a/mcp-server/src/meshtastic_mcp/config.py b/mcp-server/src/meshtastic_mcp/config.py index 7ece10032..d3006a73e 100644 --- a/mcp-server/src/meshtastic_mcp/config.py +++ b/mcp-server/src/meshtastic_mcp/config.py @@ -135,3 +135,14 @@ def picotool_bin() -> Path: ("picotool",), "Install via `brew install picotool` or build from https://github.com/raspberrypi/picotool.", ) + + +def uhubctl_bin() -> Path: + return _hw_tool( + "MESHTASTIC_UHUBCTL_BIN", + ("uhubctl",), + "Install via `brew install uhubctl` (macOS) or `apt install uhubctl` " + "(Debian/Ubuntu). On Linux without the udev rules, or on older macOS " + "with certain hubs, you may need to run via `sudo`: " + "https://github.com/mvp/uhubctl#linux-usb-permissions", + ) diff --git a/mcp-server/src/meshtastic_mcp/input_events.py b/mcp-server/src/meshtastic_mcp/input_events.py new file mode 100644 index 000000000..f6b287ba3 --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/input_events.py @@ -0,0 +1,67 @@ +"""Python mirror of firmware `enum input_broker_event` (src/input/InputBroker.h). + +Used by `admin.send_input_event` + `tests/ui/` so callers can say +`InputEventCode.RIGHT` instead of hard-coding 20. Values MUST stay in sync +with the firmware enum — unit test `tests/unit/test_input_event_codes.py` +pins the mapping. +""" + +from __future__ import annotations + +from enum import IntEnum + + +class InputEventCode(IntEnum): + """Button / key / gesture events dispatched by the firmware InputBroker.""" + + NONE = 0 + SELECT = 10 + SELECT_LONG = 11 + UP_LONG = 12 + DOWN_LONG = 13 + UP = 17 + DOWN = 18 + LEFT = 19 + RIGHT = 20 + CANCEL = 24 + BACK = 27 + # Auto-incremented values in the C enum (27 + 1, +2, +3): + USER_PRESS = 28 + ALT_PRESS = 29 + ALT_LONG = 30 + SHUTDOWN = 0x9B + GPS_TOGGLE = 0x9E + SEND_PING = 0xAF + FN_F1 = 0xF1 + FN_F2 = 0xF2 + FN_F3 = 0xF3 + FN_F4 = 0xF4 + FN_F5 = 0xF5 + MATRIXKEY = 0xFE + ANYKEY = 0xFF + + +def coerce_event_code(value: int | str | InputEventCode) -> int: + """Accept an int, a case-insensitive name, or an `InputEventCode` and return + the u8 wire value. Raises ValueError on unknown names / out-of-range ints. + """ + if isinstance(value, InputEventCode): + return int(value) + if isinstance(value, int): + if not 0 <= value <= 255: + raise ValueError(f"event_code out of u8 range: {value}") + return value + if isinstance(value, str): + key = value.upper().replace("-", "_") + if key.startswith("INPUT_BROKER_"): + key = key[len("INPUT_BROKER_") :] + try: + return int(InputEventCode[key]) + except KeyError as exc: + known = ", ".join(m.name for m in InputEventCode) + raise ValueError( + f"unknown event code name {value!r}; known: {known}" + ) from exc + raise TypeError( + f"event_code must be int|str|InputEventCode, got {type(value).__name__}" + ) diff --git a/mcp-server/src/meshtastic_mcp/ocr.py b/mcp-server/src/meshtastic_mcp/ocr.py new file mode 100644 index 000000000..f40bc3cbd --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/ocr.py @@ -0,0 +1,147 @@ +"""OCR wrapper for UI tests + the `capture_screen` tool. + +Auto-selects a reader in priority order: + 1. `easyocr` (deep-learning, high quality on OLED screens — but ~100 MB + model download on first use). + 2. `pytesseract` (requires system `tesseract` binary on PATH). + 3. `null` — returns `""` with a warning. Tests fall back to log + image + evidence when OCR is unavailable. + +Override via `MESHTASTIC_UI_OCR_BACKEND=easyocr|pytesseract|null|auto` +(default `auto`). + +`ocr_text(png_bytes) -> str` is the only public entry point. The reader is +constructed lazily on first call and cached, so the easyocr cold-start cost +only hits once per process. +""" + +from __future__ import annotations + +import functools +import logging +import os +import shutil +import sys +from typing import Callable + +log = logging.getLogger(__name__) + + +def _backend_choice() -> str: + return os.environ.get("MESHTASTIC_UI_OCR_BACKEND", "auto").lower() + + +@functools.lru_cache(maxsize=1) +def _reader() -> tuple[str, Callable[[bytes], str]]: + """Return `(backend_name, callable)` for whichever OCR is available.""" + choice = _backend_choice() + + def _easyocr() -> tuple[str, Callable[[bytes], str]]: + import easyocr # type: ignore[import-untyped] # noqa: PLC0415 + import numpy as np # type: ignore[import-untyped] # noqa: PLC0415 + + reader = easyocr.Reader(["en"], gpu=False, verbose=False) + + def _run(png: bytes) -> str: + try: + import cv2 # type: ignore[import-untyped] # noqa: PLC0415 + + arr = np.frombuffer(png, dtype=np.uint8) + img = cv2.imdecode(arr, cv2.IMREAD_COLOR) + except ImportError: + # Fall back to PIL if cv2 isn't around. + from io import BytesIO # noqa: PLC0415 + + from PIL import Image # type: ignore[import-untyped] # noqa: PLC0415 + + img = np.array(Image.open(BytesIO(png)).convert("RGB")) + try: + results = reader.readtext(img, detail=0, paragraph=True) + except Exception as exc: # noqa: BLE001 + log.warning("easyocr failed: %s", exc) + return "" + return "\n".join(str(r) for r in results) + + return "easyocr", _run + + def _pytesseract() -> tuple[str, Callable[[bytes], str]]: + from io import BytesIO # noqa: PLC0415 + + import pytesseract # type: ignore[import-untyped] # noqa: PLC0415 + from PIL import Image # type: ignore[import-untyped] # noqa: PLC0415 + + if shutil.which("tesseract") is None: + raise ImportError("`tesseract` binary not on PATH") + + def _run(png: bytes) -> str: + try: + return str(pytesseract.image_to_string(Image.open(BytesIO(png)))) + except Exception as exc: # noqa: BLE001 + log.warning("pytesseract failed: %s", exc) + return "" + + return "pytesseract", _run + + def _null() -> tuple[str, Callable[[bytes], str]]: + log.warning( + "OCR backend is null; install easyocr or tesseract for text extraction" + ) + return "null", lambda _png: "" + + if choice == "easyocr": + return _easyocr() + if choice == "pytesseract": + return _pytesseract() + if choice == "null": + return _null() + if choice != "auto": + print( + f"[ocr] unknown MESHTASTIC_UI_OCR_BACKEND={choice!r}; falling back to auto", + file=sys.stderr, + ) + + # auto mode + try: + return _easyocr() + except ImportError: + pass + try: + return _pytesseract() + except ImportError: + pass + return _null() + + +def ocr_text(png_bytes: bytes) -> str: + """Run OCR on a PNG-encoded image and return the decoded text (possibly empty).""" + if not png_bytes: + return "" + _, run = _reader() + return run(png_bytes) + + +def backend_name() -> str: + """Return the currently-selected backend name, initializing if necessary.""" + name, _ = _reader() + return name + + +def warm() -> None: + """Run one dummy inference so the easyocr cold-start cost is paid upfront. + + Pytest session fixture calls this once so the first real capture doesn't + eat the model-load latency. + """ + # A 64×32 white PNG — decodes clean, no text to extract. + white_png = bytes.fromhex( + "89504e470d0a1a0a0000000d49484452000000400000002008060000007ccac28e" + "0000001c49444154785eedc1010d000000c2a0f74f6d0d370000000000000080" + "0b010000ffff030000000000000049454e44ae426082" + ) + try: + ocr_text(white_png) + except Exception as exc: # noqa: BLE001 + log.warning("ocr.warm() failed: %s", exc) + + +__all__ = ["backend_name", "ocr_text", "warm"] diff --git a/mcp-server/src/meshtastic_mcp/server.py b/mcp-server/src/meshtastic_mcp/server.py index 7cb8db65e..83aa80c45 100644 --- a/mcp-server/src/meshtastic_mcp/server.py +++ b/mcp-server/src/meshtastic_mcp/server.py @@ -1,4 +1,4 @@ -"""FastMCP server wiring — 38 tools across 7 categories. +"""FastMCP server wiring — 43 tools across 9 categories (adds uhubctl power control). Each tool handler is a thin delegation to a named module (pio.py, admin.py, etc.). Business logic does not live here. @@ -513,6 +513,152 @@ def factory_reset( return admin.factory_reset(port=port, confirm=confirm, full=full) +@app.tool() +def send_input_event( + event_code: int | str, + kb_char: int = 0, + touch_x: int = 0, + touch_y: int = 0, + port: str | None = None, +) -> dict[str, Any]: + """Inject an InputBroker event (button / key / gesture) into the device UI. + + Drives the same code path as a physical button press. Accepts a numeric + event code (0..255) or a name like `"RIGHT"`, `"SELECT"`, `"FN_F1"`. + + Common codes: SELECT=10, UP=17, DOWN=18, LEFT=19, RIGHT=20, CANCEL=24, + BACK=27, FN_F1..F5=241..245. + """ + return admin.send_input_event( + event_code=event_code, + kb_char=kb_char, + touch_x=touch_x, + touch_y=touch_y, + port=port, + ) + + +@app.tool() +def capture_screen(role: str | None = None, ocr: bool = True) -> dict[str, Any]: + """Grab a frame from the USB webcam pointed at the device screen. + + Returns PNG bytes (base64), optional OCR text, and backend metadata. + Requires the `[ui]` extras (opencv-python-headless) and a camera + configured via `MESHTASTIC_UI_CAMERA_DEVICE[_]`. Falls back to a + 1×1 black PNG from the null backend when no camera is configured. + """ + import base64 + + from . import camera as camera_mod + + cam = camera_mod.get_camera(role) + try: + png = cam.capture() + finally: + cam.close() + + result: dict[str, Any] = { + "backend": cam.name, + "bytes": len(png), + "image_base64": base64.b64encode(png).decode("ascii"), + } + if ocr: + from . import ocr as ocr_mod + + result["ocr_backend"] = ocr_mod.backend_name() + result["ocr_text"] = ocr_mod.ocr_text(png) + return result + + +# ---------- USB power control (uhubctl) ----------------------------------- + + +@app.tool() +def uhubctl_list() -> list[dict[str, Any]]: + """List every USB hub + per-port device attachment as seen by `uhubctl`. + + Read-only — no confirm required. Each hub entry includes its location + (`1-1.3`), descriptor, whether it supports Per-Port Power Switching, + and a list of populated ports with VID:PID of attached devices. + Useful for pre-flight checks before a destructive power-cycle call. + """ + from . import uhubctl as uhubctl_mod + + return uhubctl_mod.list_hubs() + + +@app.tool() +def uhubctl_power( + action: str, + location: str | None = None, + port: int | None = None, + role: str | None = None, + confirm: bool = False, +) -> dict[str, Any]: + """Power a USB hub port on or off via `uhubctl -a on|off`. + + Target the port by either (`location`, `port`) — raw uhubctl syntax, + e.g. `location="1-1.3", port=2` — OR by `role` ("nrf52", "esp32s3"). + Role lookup honors `MESHTASTIC_UHUBCTL_LOCATION_` + + `_PORT_` env vars first, falls back to VID auto-detection. + + `action="off"` requires `confirm=True` (destructive — the attached + device will immediately disappear from the OS). + """ + from . import uhubctl as uhubctl_mod + + action_lower = action.lower() + if action_lower not in {"on", "off"}: + raise ValueError(f"action must be 'on' or 'off', got {action!r}") + if action_lower == "off" and not confirm: + raise uhubctl_mod.UhubctlError( + "uhubctl_power action='off' requires confirm=True" + ) + loc, p = _resolve_uhubctl_target(location, port, role) + if action_lower == "on": + return uhubctl_mod.power_on(loc, p) + return uhubctl_mod.power_off(loc, p) + + +@app.tool() +def uhubctl_cycle( + location: str | None = None, + port: int | None = None, + role: str | None = None, + delay_s: int = 2, + confirm: bool = False, +) -> dict[str, Any]: + """Power a USB hub port off, wait `delay_s` seconds, then on. + + The typical hard-reset sequence — shorter than off+on as two RPCs + because uhubctl handles the timing in-process. Target by (location, + port) or by role (see `uhubctl_power`). Requires `confirm=True`. + """ + from . import uhubctl as uhubctl_mod + + if not confirm: + raise uhubctl_mod.UhubctlError("uhubctl_cycle requires confirm=True") + if delay_s < 0 or delay_s > 60: + raise ValueError(f"delay_s must be 0..60, got {delay_s}") + loc, p = _resolve_uhubctl_target(location, port, role) + return uhubctl_mod.cycle(loc, p, delay_s=delay_s) + + +def _resolve_uhubctl_target( + location: str | None, port: int | None, role: str | None +) -> tuple[str, int]: + """Shared arg-resolution for uhubctl_power + uhubctl_cycle.""" + from . import uhubctl as uhubctl_mod + + if role is not None: + if location is not None or port is not None: + raise ValueError("pass either `role` OR (`location` + `port`), not both") + return uhubctl_mod.resolve_target(role) + if location is None or port is None: + raise ValueError("must pass `role` or both `location` and `port`") + return (location, int(port)) + + # ---------- Direct hardware tools ----------------------------------------- diff --git a/mcp-server/src/meshtastic_mcp/uhubctl.py b/mcp-server/src/meshtastic_mcp/uhubctl.py new file mode 100644 index 000000000..e0306386b --- /dev/null +++ b/mcp-server/src/meshtastic_mcp/uhubctl.py @@ -0,0 +1,321 @@ +"""USB hub power control via `uhubctl` — hard-recovery for wedged devices + +deliberate offline-peer simulation for mesh tests. + +Why: when a Meshtastic device's serial port wedges (stuck in a boot loop, +frozen USB CDC, crashed firmware that didn't reboot), the only recovery is +a physical unplug. uhubctl toggles VBUS per-port on any hub with Per-Port +Power Switching (PPPS) support — which is most externally-powered hubs +from the last ~5 years — so the harness can power-cycle a device +programmatically. + +Architecture: +- `list_hubs()` parses `uhubctl` default output into structured records. +- `find_port_for_vid(vid)` walks the hubs to find which location+port + hosts a given USB VID. +- `resolve_target(role)` is the public entry for callers that know a role + (`nrf52`, `esp32s3`) but not a hub location: env-var pins win, VID + auto-detect falls back. +- `power_on`, `power_off`, `cycle` wrap the corresponding `uhubctl -a` + invocations, routed through `hw_tools._run` so they share tee-to-flash- + log + timeout handling with esptool / nrfutil / picotool. + +Sudo policy: **fail fast**. Modern macOS + most PPPS-capable hubs work +without root, but Linux without udev rules (or old macOS with specific +driver quirks) still needs it. We run uhubctl non-root; if stderr +matches the classic permission pattern we raise `UhubctlError` with an +install hint pointing at the uhubctl docs. Auto-wrapping with `sudo` +would prompt in the middle of test runs — bad for CI. +""" + +from __future__ import annotations + +import os +import re +from typing import Any, Sequence + +from . import config, hw_tools + +# ---------- Parser --------------------------------------------------------- + +# Hub descriptor line: +# Current status for hub 1-1.3 [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports, ppps] +_HUB_RE = re.compile( + r"^Current status for hub (?P\S+)\s+\[(?P.+)\]\s*$" +) + +# Port line: +# " Port 2: 0103 power enable connect [239a:8029 RAKwireless ...]" +# The bracketed section is absent for empty ports. +_PORT_RE = re.compile( + r"^\s+Port\s+(?P\d+):\s+(?P\S+)\s+(?P.*?)" + r"(?:\s+\[(?P[0-9a-fA-F]{4}):(?P[0-9a-fA-F]{4})(?:\s+(?P.+))?\])?\s*$" +) + + +class UhubctlError(RuntimeError): + """Raised on uhubctl-specific failures: parse errors, permission denied, + hub-not-found, or PPPS not supported.""" + + +# ---------- Role → VID map ------------------------------------------------- + +# Mirrors the default hub_profile in `mcp-server/tests/conftest.py:335`. +# Note: esp32s3 and esp32s3_alt share a logical role — we search both. +ROLE_VIDS: dict[str, tuple[int, ...]] = { + "nrf52": (0x239A,), + "esp32s3": (0x303A, 0x10C4), +} + + +def _normalize_role(role: str) -> str: + """Collapse `esp32s3_alt` → `esp32s3` to match the tier conventions.""" + return role.split("_alt", 1)[0].lower() + + +# ---------- Core subprocess runner ----------------------------------------- + + +# If uhubctl hits a permission problem — most commonly Linux without the +# udev rules, or a macOS variant where the kernel holds the hub driver — +# it prints something like "Permission denied. Try running as root". +# Linux error text varies; we match a broad substring rather than exact. +_PERM_ERROR_PATTERNS = ( + "permission denied", + "operation not permitted", + "try running as root", + "need root", + "requires root", +) + + +def _run_uhubctl(args: Sequence[str], *, timeout: float = 30.0) -> dict[str, Any]: + """Invoke uhubctl with the given args. Returns `hw_tools._run`'s dict. + + Translates permission-denied failures into a `UhubctlError` with the + install hint, so callers don't have to match stderr themselves. Other + non-zero exits are returned as-is for the caller to interpret. + """ + binary = config.uhubctl_bin() + result = hw_tools._run(binary, args, timeout=timeout) # noqa: SLF001 + if result["exit_code"] != 0: + combined = (result.get("stderr") or "") + "\n" + (result.get("stdout") or "") + lower = combined.lower() + if any(pat in lower for pat in _PERM_ERROR_PATTERNS): + raise UhubctlError( + "uhubctl exited with a permission error. Install the udev " + "rules on Linux, or try `sudo` as a fallback: " + "https://github.com/mvp/uhubctl#linux-usb-permissions\n" + f"stderr: {result.get('stderr_tail')!r}" + ) + return result + + +# ---------- List / parse --------------------------------------------------- + + +def parse_list_output(output: str) -> list[dict[str, Any]]: + """Parse the default `uhubctl` stdout into structured hubs. + + Each hub: { + "location": "1-1.3", + "descriptor": "2109:2817 VIA Labs ...", + "vid": 0x2109, + "pid": 0x2817, + "ppps": bool, + "ports": [{"port": int, "status": str, "flags": str, + "device_vid": int | None, "device_pid": int | None, + "device_desc": str | None}, ...], + } + """ + hubs: list[dict[str, Any]] = [] + current: dict[str, Any] | None = None + + for line in output.splitlines(): + hm = _HUB_RE.match(line) + if hm: + descriptor = hm.group("descriptor") + hub_vid, hub_pid = None, None + vid_match = re.match(r"([0-9a-fA-F]{4}):([0-9a-fA-F]{4})", descriptor) + if vid_match: + hub_vid = int(vid_match.group(1), 16) + hub_pid = int(vid_match.group(2), 16) + current = { + "location": hm.group("location"), + "descriptor": descriptor, + "vid": hub_vid, + "pid": hub_pid, + "ppps": ", ppps" in descriptor or descriptor.endswith("ppps"), + "ports": [], + } + hubs.append(current) + continue + + pm = _PORT_RE.match(line) + if pm and current is not None: + device_vid = pm.group("device_vid") + device_pid = pm.group("device_pid") + current["ports"].append( + { + "port": int(pm.group("port")), + "status": pm.group("status"), + "flags": (pm.group("flags") or "").strip(), + "device_vid": int(device_vid, 16) if device_vid else None, + "device_pid": int(device_pid, 16) if device_pid else None, + "device_desc": (pm.group("device_desc") or "").strip() or None, + } + ) + return hubs + + +def list_hubs() -> list[dict[str, Any]]: + """Enumerate every hub uhubctl can see, with per-port device attachments. + + Pure read — no power state changes. Useful as a pre-flight check before + a destructive `power_off` call. + """ + result = _run_uhubctl([], timeout=15.0) + if result["exit_code"] != 0: + raise UhubctlError( + f"uhubctl list failed (exit {result['exit_code']}): {result.get('stderr_tail')!r}" + ) + return parse_list_output(result["stdout"]) + + +# ---------- Lookup / resolution ------------------------------------------- + + +def find_port_for_vid( + vid: int, pid: int | None = None, *, only_ppps: bool = True +) -> list[tuple[str, int]]: + """Return ALL (location, port) matches for a device VID (optionally +PID). + + `only_ppps=True` filters out hubs that don't advertise PPPS — we can't + control them anyway. Callers that want to diagnose a missing device can + pass `only_ppps=False` to see if the device is on a non-controllable + hub (and raise a clearer error). + """ + hubs = list_hubs() + matches: list[tuple[str, int]] = [] + for hub in hubs: + if only_ppps and not hub["ppps"]: + continue + for port in hub["ports"]: + if port["device_vid"] != vid: + continue + if pid is not None and port["device_pid"] != pid: + continue + matches.append((hub["location"], port["port"])) + return matches + + +def resolve_target(role: str) -> tuple[str, int]: + """Resolve a Meshtastic role to (hub_location, port_number). + + Priority: + 1. Env vars `MESHTASTIC_UHUBCTL_LOCATION_` + `_PORT_` + (e.g. `MESHTASTIC_UHUBCTL_LOCATION_NRF52=1-1.3`, `_PORT_NRF52=2`). + 2. VID auto-detect against `ROLE_VIDS[role]`, taking the first PPPS + match. + + Raises `UhubctlError` on ambiguity (multiple matches) or no-match. The + env-var path exists specifically to disambiguate when two devices share + a VID. + """ + role = _normalize_role(role) + env_key_loc = f"MESHTASTIC_UHUBCTL_LOCATION_{role.upper()}" + env_key_port = f"MESHTASTIC_UHUBCTL_PORT_{role.upper()}" + loc = os.environ.get(env_key_loc) + port_str = os.environ.get(env_key_port) + if loc and port_str: + try: + return (loc, int(port_str)) + except ValueError as exc: + raise UhubctlError( + f"{env_key_port}={port_str!r} is not a valid integer" + ) from exc + + if role not in ROLE_VIDS: + raise UhubctlError( + f"unknown role {role!r}; known roles: {sorted(ROLE_VIDS)}. " + f"Set {env_key_loc} + {env_key_port} to pin manually." + ) + + matches: list[tuple[str, int]] = [] + for vid in ROLE_VIDS[role]: + matches.extend(find_port_for_vid(vid)) + + if not matches: + vids = ", ".join(f"0x{v:04x}" for v in ROLE_VIDS[role]) + raise UhubctlError( + f"no controllable hub hosts a device with VID in {{{vids}}} " + f"for role={role!r}. Check the device is plugged into a " + f"PPPS-capable hub, or pin manually via {env_key_loc} + {env_key_port}." + ) + if len(matches) > 1: + shown = ", ".join(f"{loc}:port{p}" for loc, p in matches) + raise UhubctlError( + f"ambiguous: multiple devices match role={role!r} ({shown}). " + f"Pin the target via {env_key_loc} + {env_key_port}." + ) + return matches[0] + + +# ---------- Power actions -------------------------------------------------- + + +def _action( + action: str, + location: str, + port: int, + *, + delay_s: int | None = None, + timeout: float = 30.0, +) -> dict[str, Any]: + args: list[str] = ["-a", action, "-l", location, "-p", str(port)] + if delay_s is not None: + args.extend(["-d", str(delay_s)]) + # Suppress verbose "before" printout so our parser doesn't have to skip it. + args.append("-N") + result = _run_uhubctl(args, timeout=timeout) + if result["exit_code"] != 0: + raise UhubctlError( + f"uhubctl -a {action} -l {location} -p {port} failed " + f"(exit {result['exit_code']}): {result.get('stderr_tail')!r}" + ) + return { + "action": action, + "location": location, + "port": port, + "delay_s": delay_s, + "duration_s": result["duration_s"], + } + + +def power_on(location: str, port: int) -> dict[str, Any]: + """Drive the port VBUS high. Device re-enumerates in 1-3 s on healthy hubs.""" + return _action("on", location, port) + + +def power_off(location: str, port: int) -> dict[str, Any]: + """Drive the port VBUS low. Device disappears from `list_devices` immediately.""" + return _action("off", location, port) + + +def cycle(location: str, port: int, delay_s: int = 2) -> dict[str, Any]: + """Off → wait `delay_s` → on. The common hard-reset pattern.""" + # uhubctl's own `-a cycle` handles the delay internally; we use a + # slightly longer timeout to accommodate delay_s + enumeration. + return _action("cycle", location, port, delay_s=delay_s, timeout=30.0 + delay_s * 2) + + +__all__ = [ + "ROLE_VIDS", + "UhubctlError", + "cycle", + "find_port_for_vid", + "list_hubs", + "parse_list_output", + "power_off", + "power_on", + "resolve_target", +] diff --git a/mcp-server/src/meshtastic_mcp/userprefs.py b/mcp-server/src/meshtastic_mcp/userprefs.py index 59d7165f9..d5f8bab69 100644 --- a/mcp-server/src/meshtastic_mcp/userprefs.py +++ b/mcp-server/src/meshtastic_mcp/userprefs.py @@ -393,6 +393,7 @@ def build_testing_profile( long_name: str | None = None, disable_mqtt: bool = True, disable_position: bool = False, + enable_ui_log: bool = False, ) -> dict[str, Any]: """Build a USERPREFS dict for an isolated test-mesh device. @@ -423,6 +424,10 @@ def build_testing_profile( traffic never leaks to a public broker. disable_position: if True, disables GPS + position broadcasts — useful when test devices sit on a bench without antennas. + enable_ui_log: if True, stamps `USERPREFS_UI_TEST_LOG=true` so the + firmware emits one `Screen: frame N/M name=... reason=...` log + line per frame transition. Test-only; off by default because the + log is chatty (multiple times per second during UI interaction). """ if region not in KNOWN_REGIONS: @@ -475,6 +480,9 @@ def build_testing_profile( prefs["USERPREFS_CONFIG_OWNER_LONG_NAME"] = long_name if short_name is not None: prefs["USERPREFS_CONFIG_OWNER_SHORT_NAME"] = short_name + if enable_ui_log: + # Consumed by `#ifdef USERPREFS_UI_TEST_LOG` in src/graphics/Screen.cpp. + prefs["USERPREFS_UI_TEST_LOG"] = True return prefs diff --git a/mcp-server/tests/_power.py b/mcp-server/tests/_power.py new file mode 100644 index 000000000..0542bbed3 --- /dev/null +++ b/mcp-server/tests/_power.py @@ -0,0 +1,112 @@ +"""USB hub power control for tests — thin composition of the `uhubctl` +module + `_port_discovery.resolve_port_by_role`. + +Why separate from the production module: +- `meshtastic_mcp.uhubctl.cycle` returns as soon as uhubctl exits (VBUS is + back on, but the device hasn't finished enumerating as a CDC port yet). +- Tests that want to immediately issue a `connect(port=...)` need the NEW + `/dev/cu.*` path, which can differ from the pre-cycle path on nRF52 + boards (CDC re-enumeration assigns a fresh `cu.usbmodemNNNN`). +- `resolve_port_by_role` already handles that wait + path-resolution for + the `factory_reset` flow. Composing the two gives a one-call helper. + +Also exposes `is_uhubctl_available()` so fixtures can skip cleanly when +uhubctl isn't installed — we never want "no uhubctl" to look like a test +failure. +""" + +from __future__ import annotations + +import time +from typing import Any + +from meshtastic_mcp import config as config_mod +from meshtastic_mcp import uhubctl as uhubctl_mod + +from ._port_discovery import resolve_port_by_role + + +def is_uhubctl_available() -> bool: + """Return True iff `config.uhubctl_bin()` resolves AND the binary is callable. + + Soft-fails silently — fixtures use this to `pytest.skip` with an + actionable message when the operator hasn't installed uhubctl. + """ + try: + config_mod.uhubctl_bin() + except Exception: # noqa: BLE001 + return False + # Do NOT actually invoke uhubctl here — on macOS a non-sudo run would + # fail, which is a config issue, not a tool-missing issue. That gets + # surfaced to the user when they actually run a recovery action. + return True + + +def power_on(role: str) -> dict[str, Any]: + """Power on the hub port hosting `role`. Does NOT wait for re-enumeration. + Use `power_cycle` or follow with `resolve_port_by_role` to block on readiness. + """ + loc, port = uhubctl_mod.resolve_target(role) + return uhubctl_mod.power_on(loc, port) + + +def power_off(role: str) -> dict[str, Any]: + """Power off the hub port hosting `role`. The device disappears from + `list_devices` immediately. + """ + loc, port = uhubctl_mod.resolve_target(role) + return uhubctl_mod.power_off(loc, port) + + +def power_cycle( + role: str, + *, + delay_s: int = 2, + rediscover_timeout_s: float = 30.0, +) -> str: + """Cycle the port hosting `role`, wait for re-enumeration, return the + new port path. + + On nRF52 the post-cycle path typically matches the pre-cycle path, but + macOS may assign a different `/dev/cu.usbmodemNNNN` if the previous + CDC endpoint hasn't been fully released. `resolve_port_by_role` + handles that transparently. + """ + loc, port = uhubctl_mod.resolve_target(role) + uhubctl_mod.cycle(loc, port, delay_s=delay_s) + # After uhubctl exits, VBUS is on but the device may still be in + # bootloader init. Give it ~500 ms head-start before polling so we + # don't spam list_devices pointlessly. + time.sleep(0.5) + return resolve_port_by_role(role, timeout_s=rediscover_timeout_s) + + +def wait_for_absence(role: str, *, timeout_s: float = 10.0) -> None: + """Block until a device matching `role` is NOT in `list_devices`. + + Used by the recovery tier to assert power_off actually took effect. + Raises TimeoutError on failure. + """ + from meshtastic_mcp import devices as devices_mod + + from ._port_discovery import _ROLE_VIDS, _coerce_vid # type: ignore[attr-defined] + + if role not in _ROLE_VIDS: + raise ValueError(f"unknown role {role!r}") + wanted = _ROLE_VIDS[role] + deadline = time.monotonic() + timeout_s + while time.monotonic() < deadline: + found = devices_mod.list_devices(include_unknown=True) + if not any(_coerce_vid(d.get("vid")) in wanted for d in found): + return + time.sleep(0.3) + raise TimeoutError(f"role {role!r} still visible after {timeout_s}s of power_off") + + +__all__ = [ + "is_uhubctl_available", + "power_cycle", + "power_off", + "power_on", + "wait_for_absence", +] diff --git a/mcp-server/tests/conftest.py b/mcp-server/tests/conftest.py index 3d033b9b8..d4607b239 100644 --- a/mcp-server/tests/conftest.py +++ b/mcp-server/tests/conftest.py @@ -123,15 +123,24 @@ def pytest_collection_modifyitems( return (2, item.nodeid) if "/monitor/" in path or "tests/monitor" in path: return (3, item.nodeid) - if "/fleet/" in path or "tests/fleet" in path: + # Recovery tier: explicitly cycles device power via uhubctl. Slots + # between monitor (read-only) and ui (state-preserving) so any tier + # after it starts from a known re-enumerated + re-verified state. + if "/recovery/" in path or "tests/recovery" in path: return (4, item.nodeid) + # UI tier slots here — read-only w.r.t. mesh state, only mutates + # the on-screen UI (BACK×5 guard restores home before each test). + if "/ui/" in path or "tests/ui" in path: + return (5, item.nodeid) + if "/fleet/" in path or "tests/fleet" in path: + return (6, item.nodeid) # State-mutating tiers run last. if "/admin/" in path or "tests/admin" in path: - return (5, item.nodeid) + return (7, item.nodeid) if "/provisioning/" in path or "tests/provisioning" in path: - return (6, item.nodeid) + return (8, item.nodeid) # Top-level + anything else falls between. - return (7, item.nodeid) + return (9, item.nodeid) items.sort(key=sort_key) @@ -156,13 +165,20 @@ def session_seed(request: pytest.FixtureRequest) -> str: @pytest.fixture(scope="session") def test_profile(session_seed: str) -> dict[str, Any]: - """The canonical isolated-mesh test profile for this session.""" + """The canonical isolated-mesh test profile for this session. + + `enable_ui_log=True` stamps `USERPREFS_UI_TEST_LOG` so the firmware + emits `Screen: frame N/M name=... reason=...` log lines per UI + transition — consumed by the `tests/ui/` tier. Harmless on boards + without a screen (the `#ifdef` sits behind `HAS_SCREEN`). + """ return userprefs.build_testing_profile( psk_seed=session_seed, channel_name="McpTest", channel_num=88, region="US", modem_preset="LONG_FAST", + enable_ui_log=True, ) @@ -654,6 +670,7 @@ def pytest_generate_tests(metafunc: pytest.Metafunc) -> None: def baked_single( baked_mesh: dict[str, Any], baked_single_role: str, + hub_devices: dict[str, str], ) -> dict[str, Any]: """Function-scoped: a single verified baked device. @@ -662,10 +679,75 @@ def baked_single( (e.g. `test_owner_survives_reboot[nrf52]` + `test_owner_survives_reboot[esp32s3]`). Tests never hardcode a role and never skip a device that happens to be connected. + + Auto-recovery: if the baked device fails a pre-test `device_info` probe + AND uhubctl is available, power-cycle the port once and retry. Without + uhubctl, surface the wedge as a clear skip. This catches "device got + stuck between tests" without masking persistent regressions (a second + wedge after cycling still skips). """ if baked_single_role not in baked_mesh: pytest.skip(f"role {baked_single_role!r} not present on the hub") - return {"role": baked_single_role, **baked_mesh[baked_single_role]} + + entry = baked_mesh[baked_single_role] + port = entry.get("port") + if port: + try: + _run_with_timeout(lambda: info.device_info(port=port, timeout_s=3.0), 5.0) + except Exception: + # Device didn't respond. Try a power-cycle recovery if uhubctl + # is installed; otherwise surface a skip that names the root + # cause clearly. + from tests import _power + + if not _power.is_uhubctl_available(): + pytest.skip( + f"device {baked_single_role!r} unresponsive on {port}; " + "install uhubctl (`brew install uhubctl` / `apt install " + "uhubctl`) for auto power-cycle recovery" + ) + try: + new_port = _power.power_cycle(baked_single_role, delay_s=2) + except Exception as exc: # noqa: BLE001 + pytest.skip( + f"device {baked_single_role!r} wedged and power-cycle " + f"failed: {exc}" + ) + # Mutate both the session-scoped `hub_devices` map AND the + # baked_mesh entry so downstream fixtures see the recovered port. + hub_devices[baked_single_role] = new_port + baked_mesh[baked_single_role]["port"] = new_port + entry = baked_mesh[baked_single_role] + return {"role": baked_single_role, **entry} + + +@pytest.fixture +def power_cycle( + hub_devices: dict[str, str], +) -> Callable[..., str]: + """Return a callable `(role, delay_s=2) -> new_port` that hard-resets the + hub port hosting `role`. Skips the test cleanly when uhubctl isn't + installed — never want "no uhubctl" to look like a test failure. + + The callable mutates `hub_devices[role]` in place so subsequent fixture + lookups pick up the post-cycle port (mirrors the pattern in + provisioning/test_userprefs_survive_factory_reset.py). + """ + from tests import _power + + if not _power.is_uhubctl_available(): + pytest.skip( + "uhubctl not installed; this test needs it for power control. " + "Install via `brew install uhubctl` (macOS) or `apt install " + "uhubctl` (Debian/Ubuntu)." + ) + + def _cycle(role: str, delay_s: int = 2) -> str: + new_port = _power.power_cycle(role, delay_s=delay_s) + hub_devices[role] = new_port + return new_port + + return _cycle _DEFAULT_ROLE_ENVS = { @@ -960,6 +1042,45 @@ def _run_with_timeout(fn: Callable[[], Any], timeout: float) -> Any: raise TimeoutError(f"operation did not complete within {timeout}s") from exc +def _attach_ui_captures(item: pytest.Item, report: Any) -> None: + """Embed per-step UI captures (PNG + OCR) into the pytest-html extras. + + Runs for every UI-tier test on BOTH pass and fail so the HTML report + always shows the image strip + OCR transcript. Silently no-ops if + pytest-html isn't installed or the test didn't use `frame_capture`. + """ + captures = getattr(item, "_ui_captures", None) + if not captures: + return + try: + from pytest_html import extras as html_extras # type: ignore[import-untyped] + except ImportError: + return + + existing = getattr(report, "extras", None) or [] + extras_list = list(existing) + for cap in captures: + png_path = cap.get("png_path") + label = f"{cap.get('step', '?')}: {cap.get('label', '')}" + frame = cap.get("frame") or {} + frame_str = ( + f" — frame {frame.get('idx')} {frame.get('name')!r}" if frame else "" + ) + if png_path: + try: + with open(png_path, "rb") as fh: + import base64 + + b64 = base64.b64encode(fh.read()).decode("ascii") + extras_list.append(html_extras.png(b64, name=f"{label}{frame_str}")) + except OSError: + pass + ocr = (cap.get("ocr_text") or "").strip() + if ocr: + extras_list.append(html_extras.text(ocr, name=f"OCR: {label}{frame_str}")) + report.extras = extras_list # type: ignore[attr-defined] + + @pytest.hookimpl(hookwrapper=True) def pytest_runtest_makereport(item: pytest.Item, call: pytest.CallInfo[Any]) -> Any: """On test failure, attach serial capture + device state as report artifacts. @@ -967,10 +1088,20 @@ def pytest_runtest_makereport(item: pytest.Item, call: pytest.CallInfo[Any]) -> Hard-bounded by `_run_with_timeout` — if the device is unreachable (stuck port, unbaked firmware, dead board), the dump is skipped rather than hanging the session. + + For UI-tier tests, also embeds per-step camera captures + OCR on every + test (pass or fail) so the HTML report shows visual evidence of what + the device did. """ outcome = yield report = outcome.get_result() + # Attach UI captures on any outcome (pass + fail) — these are the whole + # point of the UI tier. Do this before the failure-only branch below so + # passing tests still get their image strip. + if report.when == "call": + _attach_ui_captures(item, report) + if report.when != "call" or report.outcome != "failed": return diff --git a/mcp-server/tests/mesh/test_peer_offline_recovery.py b/mcp-server/tests/mesh/test_peer_offline_recovery.py new file mode 100644 index 000000000..b8d0f7a63 --- /dev/null +++ b/mcp-server/tests/mesh/test_peer_offline_recovery.py @@ -0,0 +1,155 @@ +"""Isolation test for peer-offline-then-back mid-conversation. + +Verifies the mesh stack's behavior when a peer is physically powered +off mid-send via uhubctl, then powered back on. + +Flow (parametrized over every directed mesh_pair): + 1. Bilateral PKI warmup (same pattern as test_direct_with_ack). + 2. TX sends a broadcast text "msg-1" — RX confirms receipt via pubsub. + 3. Power OFF RX via uhubctl. The RX device disappears from the OS. + 4. TX sends a directed text "msg-2" with wantAck=True. Firmware retries + internally for ~30s before giving up. Assertion: the packet object + was accepted by the TX stack (non-None) — we don't assert an ACK + since there's no peer to send one. + 5. Power ON RX. Wait for re-enumeration + boot. + 6. Bilateral PKI re-nudge — RX's in-RAM PKI cache was wiped on reboot, + so the first directed send may err=35 without a fresh NodeInfo ping. + 7. TX sends a directed "msg-3" — RX receives it via pubsub, confirming + the mesh recovered. + +Skips cleanly if uhubctl isn't installed (via the `power_cycle` fixture's +auto-skip). Skips for pair directions where RX isn't power-controllable +(e.g. a USB-IF hub that doesn't support PPPS for its port). +""" + +from __future__ import annotations + +import time +from typing import Any + +import pytest +from meshtastic_mcp.connection import connect +from tests import _power +from tests._port_discovery import resolve_port_by_role + +from ._receive import ReceiveCollector, nudge_nodeinfo + + +@pytest.mark.timeout(360) +def test_peer_offline_then_recovers( + mesh_pair: dict[str, Any], + power_cycle, # noqa: ARG001 — forces uhubctl-availability skip + hub_devices: dict[str, str], +) -> None: + tx_port = mesh_pair["tx"]["port"] + rx_node_num = mesh_pair["rx"]["my_node_num"] + tx_role = mesh_pair["tx_role"] + rx_role = mesh_pair["rx_role"] + + unique_pre = f"peer-offline-pre-{tx_role}-to-{rx_role}-{int(time.time())}" + unique_post = f"peer-offline-post-{tx_role}-to-{rx_role}-{int(time.time())}" + + # Step 1 + 2: warm up + confirm baseline delivery works before the test. + with ReceiveCollector( + mesh_pair["rx"]["port"], topic="meshtastic.receive.text" + ) as rx: + rx.broadcast_nodeinfo_ping() + with connect(port=tx_port) as tx_iface: + nudge_nodeinfo(tx_iface) + # Wait for bilateral PKI (RX pubkey in TX's nodesByNum). + deadline = time.monotonic() + 45.0 + last_nudge = time.monotonic() + while time.monotonic() < deadline: + rec = (tx_iface.nodesByNum or {}).get(rx_node_num, {}) + if rec.get("user", {}).get("publicKey"): + break + if time.monotonic() - last_nudge > 15.0: + rx.broadcast_nodeinfo_ping() + nudge_nodeinfo(tx_iface) + last_nudge = time.monotonic() + time.sleep(1.0) + else: + pytest.skip( + f"bilateral PKI never completed ({tx_role}→{rx_role}); " + "can't run the offline test without a warm baseline" + ) + + tx_iface.sendText(unique_pre, destinationId=rx_node_num, wantAck=True) + got = rx.wait_for( + lambda pkt: pkt.get("decoded", {}).get("text") == unique_pre, + timeout=30, + ) + assert got is not None, ( + f"baseline directed send ({tx_role}→{rx_role}) didn't land — " + "skipping offline test to avoid false positive" + ) + + # Step 3: power off RX. uhubctl skips the test with a clear message if + # the RX role isn't on a controllable hub. + try: + _power.power_off(rx_role) + except Exception as exc: # noqa: BLE001 + pytest.skip(f"can't power-control {rx_role!r}: {exc}") + + try: + _power.wait_for_absence(rx_role, timeout_s=10.0) + except TimeoutError: + _power.power_on(rx_role) # restore hub state before failing + resolve_port_by_role(rx_role, timeout_s=30.0) + pytest.fail(f"{rx_role!r} didn't disappear after power_off") + + # Step 4: send to a peer that isn't there. Firmware will retry + # internally. We don't wait for an ACK (there won't be one); we just + # confirm TX's stack accepts the packet without crashing. + try: + with connect(port=tx_port) as tx_iface: + packet = tx_iface.sendText( + f"while-offline-{rx_role}", + destinationId=rx_node_num, + wantAck=True, + ) + assert packet is not None + # Give firmware a moment to do a retry or two while RX is down. + time.sleep(5.0) + except Exception as exc: # noqa: BLE001 — TX should survive the peer being gone + # Restore RX before reraising so the bench state is sane. + _power.power_on(rx_role) + resolve_port_by_role(rx_role, timeout_s=30.0) + raise AssertionError(f"TX crashed when sending to offline peer: {exc}") from exc + + # Step 5: power RX back on + rediscover. + _power.power_on(rx_role) + time.sleep(0.5) + new_rx_port = resolve_port_by_role(rx_role, timeout_s=30.0) + hub_devices[rx_role] = new_rx_port + + # Step 6 + 7: bilateral re-warmup + directed send that should now work. + with ReceiveCollector(new_rx_port, topic="meshtastic.receive.text") as rx: + # RX rebooted → its PKI cache is gone. Re-warm. + rx.broadcast_nodeinfo_ping() + with connect(port=tx_port) as tx_iface: + nudge_nodeinfo(tx_iface) + time.sleep(3.0) + + got = None + for _attempt in range(3): + packet = tx_iface.sendText( + unique_post, + destinationId=rx_node_num, + wantAck=True, + ) + assert packet is not None + got = rx.wait_for( + lambda pkt: pkt.get("decoded", {}).get("text") == unique_post, + timeout=30, + ) + if got is not None: + break + rx.broadcast_nodeinfo_ping() + nudge_nodeinfo(tx_iface) + time.sleep(5.0) + + assert got is not None, ( + f"post-recovery directed send {unique_post!r} ({tx_role}→{rx_role}) " + "never landed — recovery path may be broken" + ) diff --git a/mcp-server/tests/recovery/__init__.py b/mcp-server/tests/recovery/__init__.py new file mode 100644 index 000000000..cf8f3919e --- /dev/null +++ b/mcp-server/tests/recovery/__init__.py @@ -0,0 +1,6 @@ +"""Recovery tier — exercises `uhubctl` power control end-to-end. + +Requires `uhubctl` installed AND at least one connected device on a +PPPS-capable hub. The whole tier skips cleanly via +`tests/recovery/conftest.py::_recovery_tier_guard` when either is missing. +""" diff --git a/mcp-server/tests/recovery/conftest.py b/mcp-server/tests/recovery/conftest.py new file mode 100644 index 000000000..21116d07a --- /dev/null +++ b/mcp-server/tests/recovery/conftest.py @@ -0,0 +1,44 @@ +"""Recovery-tier gating + shared helpers. + +Session-scoped guard skips the whole tier when uhubctl isn't installed. +Tests under this directory assume uhubctl is callable AND that at least +one hub role is detected on a PPPS-capable port. +""" + +from __future__ import annotations + +import pytest + + +@pytest.fixture(scope="session", autouse=True) +def _recovery_tier_guard() -> None: + """Skip the tier when uhubctl is unavailable OR no device is on a + PPPS-capable hub. Prints the specific reason so operators know what + to fix.""" + from tests import _power + + if not _power.is_uhubctl_available(): + pytest.skip( + "uhubctl not installed; recovery tier needs it. " + "Install via `brew install uhubctl` or `apt install uhubctl`.", + allow_module_level=True, + ) + + # Probe: can we even list hubs? (A macOS user without sudo gets a + # permission error here — we'd rather find out once at tier-start than + # 6 tests later.) + from meshtastic_mcp import uhubctl + + try: + hubs = uhubctl.list_hubs() + except uhubctl.UhubctlError as exc: + pytest.skip( + f"uhubctl list failed: {exc}. Try the udev rules or `sudo` as a fallback.", + allow_module_level=True, + ) + + if not any(h["ppps"] for h in hubs): + pytest.skip( + "no PPPS-capable hubs detected — recovery tier has nothing to exercise.", + allow_module_level=True, + ) diff --git a/mcp-server/tests/recovery/test_list_hubs.py b/mcp-server/tests/recovery/test_list_hubs.py new file mode 100644 index 000000000..0a09a672a --- /dev/null +++ b/mcp-server/tests/recovery/test_list_hubs.py @@ -0,0 +1,43 @@ +"""Smoke test: `uhubctl_list` returns a well-formed structure. + +No destructive action. Runs first in the tier as a sanity check that the +tier's dependencies (uhubctl binary + permissions) are actually satisfied. +""" + +from __future__ import annotations + +import pytest +from meshtastic_mcp import uhubctl + + +@pytest.mark.timeout(30) +def test_list_hubs_returns_at_least_one_ppps_hub() -> None: + hubs = uhubctl.list_hubs() + assert hubs, "uhubctl found no hubs at all — is a USB hub connected?" + assert any(h["ppps"] for h in hubs), ( + "no PPPS-capable hubs detected; power control won't work. " + "Check that the hub supports Per-Port Power Switching." + ) + + +@pytest.mark.timeout(30) +def test_list_hubs_structure(hub_devices: dict[str, str]) -> None: + hubs = uhubctl.list_hubs() + for hub in hubs: + assert "location" in hub and hub["location"] + assert "ports" in hub and isinstance(hub["ports"], list) + for port in hub["ports"]: + assert "port" in port and isinstance(port["port"], int) + assert "status" in port + + # At least one of the detected Meshtastic roles should show up in some + # port's device_vid — otherwise the recovery tier can't drive them. + seen_vids = { + p["device_vid"] for h in hubs for p in h["ports"] if p["device_vid"] is not None + } + expected_any = {0x239A, 0x303A, 0x10C4} & seen_vids + assert expected_any or not hub_devices, ( + f"hub_devices detected roles {list(hub_devices)} but uhubctl sees " + f"VIDs {sorted(hex(v) for v in seen_vids)} — the devices may be on " + "a hub that uhubctl can't see (e.g. built-in laptop ports)." + ) diff --git a/mcp-server/tests/recovery/test_power_cycle_preserves_userprefs.py b/mcp-server/tests/recovery/test_power_cycle_preserves_userprefs.py new file mode 100644 index 000000000..9558a7fb4 --- /dev/null +++ b/mcp-server/tests/recovery/test_power_cycle_preserves_userprefs.py @@ -0,0 +1,60 @@ +"""Hard reset via uhubctl must NOT wipe NVS. Verify the test profile's +region + channel survive a power-cycle. + +Guards against a regression where a firmware change treats unexpected +power loss as a factory-reset trigger (e.g. bad EEPROM wear-leveling, +erase-on-boot-for-safety). Such a regression would be catastrophic for +field deployments. +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp import admin, info +from tests import _power +from tests._port_discovery import resolve_port_by_role + + +@pytest.mark.timeout(180) +def test_lora_config_survives_power_cycle( + baked_single: dict[str, object], + test_profile: dict[str, object], +) -> None: + role = baked_single["role"] + pre_port = baked_single["port"] + + pre_config = admin.get_config(section="lora", port=pre_port)["config"]["lora"] + pre_region = pre_config.get("region") + pre_preset = pre_config.get("modem_preset") + assert pre_region, f"lora.region not set pre-cycle on {role}" + + # Hard power-cycle. + _power.power_cycle(role, delay_s=2) + time.sleep(0.5) + new_port = resolve_port_by_role(role, timeout_s=30.0) + # Let the firmware complete boot before admin reads. + time.sleep(2.0) + # Quick readiness probe. + probe = info.device_info(port=new_port, timeout_s=10.0) + assert ( + probe.get("my_node_num") is not None + ), f"device {role!r} didn't respond after power-cycle" + + post_config = admin.get_config(section="lora", port=new_port)["config"]["lora"] + post_region = post_config.get("region") + post_preset = post_config.get("modem_preset") + + assert post_region == pre_region, ( + f"lora.region wiped by power-cycle on {role}: " + f"pre={pre_region!r} post={post_region!r}" + ) + assert post_preset == pre_preset, ( + f"lora.modem_preset wiped by power-cycle on {role}: " + f"pre={pre_preset!r} post={post_preset!r}" + ) + + # Channel-0 name should also match the test profile. + pri_ch = admin.get_channel_url(port=new_port) + assert pri_ch.get("url"), f"channel URL empty after power-cycle on {role}" diff --git a/mcp-server/tests/recovery/test_power_cycle_roundtrip.py b/mcp-server/tests/recovery/test_power_cycle_roundtrip.py new file mode 100644 index 000000000..37bc7c8d2 --- /dev/null +++ b/mcp-server/tests/recovery/test_power_cycle_roundtrip.py @@ -0,0 +1,61 @@ +"""Full power-cycle round-trip: off → verify gone → on → verify identity +preserved. + +Parametrized over every connected role. Validates both the uhubctl +plumbing AND that the device survives a hard reset with the same +`my_node_num` (no firmware-level identity regeneration). +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp import info +from tests import _power +from tests._port_discovery import resolve_port_by_role + + +@pytest.mark.timeout(180) +def test_power_cycle_preserves_node_identity( + baked_single: dict[str, object], +) -> None: + role = baked_single["role"] + pre_port = baked_single["port"] + pre_node_num = baked_single["my_node_num"] + pre_fw = baked_single.get("firmware_version") + + # Record pre-cycle state. + pre_info = info.device_info(port=pre_port, timeout_s=5.0) + assert pre_info.get("my_node_num") == pre_node_num + + # Power off; confirm the device actually disappears from list_devices. + _power.power_off(role) + try: + _power.wait_for_absence(role, timeout_s=10.0) + except TimeoutError: + # If it didn't disappear, power it back on so we don't leave the + # hub in a weird state for the next test. + _power.power_on(role) + resolve_port_by_role(role, timeout_s=30.0) + pytest.fail(f"device {role!r} stayed visible after power_off") + + # Power back on + re-discover port. + _power.power_on(role) + time.sleep(0.5) # head-start before polling + new_port = resolve_port_by_role(role, timeout_s=30.0) + + # Give the firmware a moment to finish boot before we hit it with admin. + time.sleep(2.0) + + post_info = info.device_info(port=new_port, timeout_s=10.0) + assert post_info.get("my_node_num") == pre_node_num, ( + f"my_node_num changed across power-cycle: pre={pre_node_num:#x} " + f"post={post_info.get('my_node_num'):#x}" + ) + # Firmware version must match (same bake, not a re-flash). + if pre_fw: + assert post_info.get("firmware_version") == pre_fw, ( + f"firmware changed across cycle: pre={pre_fw} " + f"post={post_info.get('firmware_version')}" + ) diff --git a/mcp-server/tests/tool_coverage.py b/mcp-server/tests/tool_coverage.py index b91bd4039..edf974e03 100644 --- a/mcp-server/tests/tool_coverage.py +++ b/mcp-server/tests/tool_coverage.py @@ -73,6 +73,13 @@ _TOOL_MAP: dict[str, tuple[str, str]] = { "reboot": ("meshtastic_mcp.admin", "reboot"), "shutdown": ("meshtastic_mcp.admin", "shutdown"), "factory_reset": ("meshtastic_mcp.admin", "factory_reset"), + "send_input_event": ("meshtastic_mcp.admin", "send_input_event"), + # `capture_screen` in server.py calls camera.get_camera — instrument that. + "capture_screen": ("meshtastic_mcp.camera", "get_camera"), + # USB power control via uhubctl. + "uhubctl_list": ("meshtastic_mcp.uhubctl", "list_hubs"), + "uhubctl_power": ("meshtastic_mcp.uhubctl", "power_on"), + "uhubctl_cycle": ("meshtastic_mcp.uhubctl", "cycle"), # USERPREFS "userprefs_manifest": ("meshtastic_mcp.userprefs", "build_manifest"), "userprefs_get": ("meshtastic_mcp.userprefs", "read_state"), diff --git a/mcp-server/tests/ui/__init__.py b/mcp-server/tests/ui/__init__.py new file mode 100644 index 000000000..006fc3c8e --- /dev/null +++ b/mcp-server/tests/ui/__init__.py @@ -0,0 +1,7 @@ +"""UI tier — input-broker-driven screen navigation tests. + +Only runs when a screen-bearing role (esp32s3/heltec-v3) is present on the +hub AND the firmware was baked with `enable_ui_log=True` (so the +`Screen: frame N/M name=... reason=...` log lines are emitted). The +`tests/ui/conftest.py` fixture forces that bake stamp. +""" diff --git a/mcp-server/tests/ui/_screen_log.py b/mcp-server/tests/ui/_screen_log.py new file mode 100644 index 000000000..97954db48 --- /dev/null +++ b/mcp-server/tests/ui/_screen_log.py @@ -0,0 +1,176 @@ +"""Parse `Screen: frame N/M name=X reason=Y` log lines from `_debug_log_buffer`. + +The firmware emits one line per frame transition when +`USERPREFS_UI_TEST_LOG` is defined (see src/graphics/Screen.cpp). Tests use +these helpers to assert which frame is shown / to wait for a transition to +settle before taking a camera capture. +""" + +from __future__ import annotations + +import re +import time +from dataclasses import dataclass +from typing import Iterable, Iterator + +FRAME_RE = re.compile( + r"Screen: frame (?P\d+)/(?P\d+) name=(?P\S+) reason=(?P\S+)" +) + + +@dataclass(frozen=True) +class FrameEvent: + idx: int + count: int + name: str + reason: str + raw: str + + @classmethod + def parse(cls, line: str) -> "FrameEvent | None": + m = FRAME_RE.search(line) + if not m: + return None + return cls( + idx=int(m["idx"]), + count=int(m["count"]), + name=m["name"], + reason=m["reason"], + raw=line, + ) + + +def iter_frame_events(lines: Iterable[str]) -> Iterator[FrameEvent]: + for line in lines: + evt = FrameEvent.parse(line) + if evt is not None: + yield evt + + +def get_current_frame(lines: list[str]) -> FrameEvent | None: + """Return the most recent FrameEvent in `lines`, or None if none found.""" + for line in reversed(lines): + evt = FrameEvent.parse(line) + if evt is not None: + return evt + return None + + +def wait_for_frame( + lines: list[str], + expected_name: str, + *, + timeout_s: float = 5.0, + poll_interval_s: float = 0.1, + reason: str | None = None, +) -> FrameEvent: + """Poll `lines` (the `_debug_log_buffer`) until a FrameEvent with + `name=expected_name` appears after the call started. Raises TimeoutError + with context if it doesn't arrive in `timeout_s`. + + `reason` optionally filters to events matching a specific cause + (e.g. `"fn_f1"`, `"next"`, `"rebuild"`). + """ + start_idx = len(lines) + deadline = time.monotonic() + timeout_s + last: FrameEvent | None = None + while time.monotonic() < deadline: + # Scan only lines appended since we started waiting. + for line in lines[start_idx:]: + evt = FrameEvent.parse(line) + if evt is None: + continue + last = evt + if evt.name == expected_name and (reason is None or evt.reason == reason): + return evt + time.sleep(poll_interval_s) + + seen = [e.name for e in iter_frame_events(lines[start_idx:])] + raise TimeoutError( + f"frame name={expected_name!r} reason={reason!r} not seen in {timeout_s}s; " + f"saw {len(seen)} transition(s): {seen!r}; last={last!r}" + ) + + +def wait_for_any_frame( + lines: list[str], + *, + timeout_s: float = 5.0, + poll_interval_s: float = 0.1, +) -> FrameEvent: + """Wait for ANY frame transition to appear after call-start. Useful for + `no-op` tests that want to confirm a transition did NOT happen (via + TimeoutError) vs. one that did. + """ + start_idx = len(lines) + deadline = time.monotonic() + timeout_s + while time.monotonic() < deadline: + for line in lines[start_idx:]: + evt = FrameEvent.parse(line) + if evt is not None: + return evt + time.sleep(poll_interval_s) + raise TimeoutError(f"no frame transition in {timeout_s}s") + + +def wait_for_reason( + lines: list[str], + reason: str, + *, + timeout_s: float = 5.0, + poll_interval_s: float = 0.1, +) -> FrameEvent: + """Wait for a frame event with `reason=` after call-start. + + Matches only on `reason` — useful when the caller knows *why* a + transition should happen (e.g. `fn_f1`, `rebuild`) but not which named + frame the firmware will land on for this particular board. + """ + start_idx = len(lines) + deadline = time.monotonic() + timeout_s + last: FrameEvent | None = None + while time.monotonic() < deadline: + for line in lines[start_idx:]: + evt = FrameEvent.parse(line) + if evt is None: + continue + last = evt + if evt.reason == reason: + return evt + time.sleep(poll_interval_s) + raise TimeoutError( + f"no frame with reason={reason!r} in {timeout_s}s; last={last!r}" + ) + + +def assert_no_frame_change( + lines: list[str], + *, + wait_s: float = 2.0, +) -> None: + """Assert that NO new FrameEvent lines arrive within `wait_s`. + + Used by idempotency / no-op tests (e.g. BACK on home frame). + """ + start_idx = len(lines) + time.sleep(wait_s) + new = [ + e for e in (FrameEvent.parse(ln) for ln in lines[start_idx:]) if e is not None + ] + if new: + raise AssertionError( + f"expected no frame change in {wait_s}s, but saw {len(new)} event(s): " + f"{[(e.reason, e.name) for e in new]!r}" + ) + + +__all__ = [ + "FRAME_RE", + "FrameEvent", + "assert_no_frame_change", + "get_current_frame", + "iter_frame_events", + "wait_for_any_frame", + "wait_for_frame", + "wait_for_reason", +] diff --git a/mcp-server/tests/ui/conftest.py b/mcp-server/tests/ui/conftest.py new file mode 100644 index 000000000..aedfdbc8f --- /dev/null +++ b/mcp-server/tests/ui/conftest.py @@ -0,0 +1,381 @@ +"""UI-tier fixtures: camera lifecycle, OCR warmup, per-test frame capture, +and a `ui_home_state` autouse guard that resets to the home frame before +every test (prevents state bleed if a prior test exited inside a menu). + +The camera + OCR modules live in `meshtastic_mcp/{camera,ocr}.py` (production +code, so the `capture_screen` MCP tool can share them). These fixtures wire +them into pytest + write per-test captures to `tests/ui_captures/…`. +""" + +from __future__ import annotations + +import re +import shutil +import time +from pathlib import Path +from typing import Any, Iterator + +import pytest +from meshtastic_mcp import admin as admin_mod +from meshtastic_mcp import camera as camera_mod +from meshtastic_mcp import ocr as ocr_mod +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import FrameEvent, get_current_frame, wait_for_frame + +# Roles that carry a screen the UI tier can drive. Only esp32s3 (heltec-v3 +# SSD1306) qualifies today — nrf52 (rak4631) has no display. +UI_CAPABLE_ROLES = ("esp32s3",) + +# Where per-test captures land. One subdirectory per session seed, then per +# sanitized test nodeid — identical pattern to other pytest artifacts. +CAPTURES_ROOT = Path(__file__).resolve().parent.parent / "ui_captures" + + +def _sanitize_nodeid(nodeid: str) -> str: + return re.sub(r"[^a-zA-Z0-9_.-]+", "_", nodeid) + + +# ---------- Role gating ---------------------------------------------------- + + +@pytest.fixture +def ui_capable_role(request: pytest.FixtureRequest, hub_devices: dict[str, Any]) -> str: + """Resolve the single role the UI tier drives. + + Today that's `esp32s3`. Skips if the hub doesn't have one. A future + multi-screen hub could pick a role per parametrization. + """ + for role in UI_CAPABLE_ROLES: + if role in hub_devices: + return role + pytest.skip( + f"no UI-capable role on hub; need one of {UI_CAPABLE_ROLES} in {sorted(hub_devices)}" + ) + + +@pytest.fixture +def ui_port(ui_capable_role: str, hub_devices: dict[str, Any]) -> str: + port = ( + hub_devices[ui_capable_role].get("port") + if isinstance(hub_devices[ui_capable_role], dict) + else hub_devices[ui_capable_role] + ) + if not port: + pytest.skip(f"{ui_capable_role!r} has no usable port") + return port + + +# ---------- Camera + OCR session fixtures --------------------------------- + + +@pytest.fixture(scope="session") +def camera(ui_capable_role_session: str | None) -> Iterator[camera_mod.CameraBackend]: + """Session-scoped camera backend. Closed at teardown. + + Backend + device selected by env vars (see `meshtastic_mcp.camera`). + Falls through to `NullBackend` when no camera is configured, so the + tests run end-to-end on machines without hardware; they just won't + have useful images. + """ + role = ui_capable_role_session or "esp32s3" + cam = camera_mod.get_camera(role) + try: + yield cam + finally: + cam.close() + + +@pytest.fixture(scope="session") +def ui_capable_role_session(hub_devices: dict[str, Any]) -> str | None: + """Session-scoped lookup mirroring `ui_capable_role` but non-skipping. + + Used by the `camera` session fixture so it doesn't depend on a + test-scoped skip. + """ + for role in UI_CAPABLE_ROLES: + if role in hub_devices: + return role + return None + + +@pytest.fixture(scope="session", autouse=True) +def _ocr_warm() -> None: + """Pay easyocr's ~100 MB / cold-start cost ONCE per session. + + Subsequent `ocr_text()` calls hit the cached reader and return quickly. + Swallows errors — if OCR isn't installed, warm is a no-op. + """ + try: + ocr_mod.warm() + except Exception: # noqa: BLE001 — belt: never block the suite on OCR init + pass + + +@pytest.fixture(scope="session") +def _ui_screen_kept_on( + ui_capable_role_session: str | None, hub_devices: dict[str, Any] +) -> Iterator[None]: + """Keep the OLED on throughout the UI tier so input events aren't dropped. + + Why: `InputBroker::handleInputEvent` (src/input/InputBroker.cpp:118-122) + silently DROPS any event that arrives while the screen is off — it just + wakes the screen and returns. Every first event in each test would + disappear. We set `display.screen_on_secs = 86400` at session start + (effectively "always on" for the test window) and restore the prior + value at teardown. + """ + if ui_capable_role_session is None: + yield + return + + hub_entry = hub_devices[ui_capable_role_session] + port = hub_entry.get("port") if isinstance(hub_entry, dict) else hub_entry + if not port: + yield + return + + original: int | None = None + try: + current = admin_mod.get_config(section="display", port=port) + original = int( + current.get("config", {}).get("display", {}).get("screen_on_secs") or 0 + ) + except Exception: # noqa: BLE001 + pass + + try: + admin_mod.set_config("display.screen_on_secs", 86400, port=port) + # Send one wake event so the screen is actually ON going into the + # first test. The event itself gets dropped (screenWasOff), but the + # wake side-effect sticks. + try: + admin_mod.send_input_event(event_code=int(InputEventCode.FN_F1), port=port) + except Exception: # noqa: BLE001 + pass + time.sleep(1.5) # Let the screen finish its wake transition. + except ( + Exception + ): # noqa: BLE001 — best-effort; ui_home_state surfaces the real error + pass + + try: + yield + finally: + if original is not None: + try: + admin_mod.set_config("display.screen_on_secs", original, port=port) + except Exception: # noqa: BLE001 + pass + + +# ---------- Per-test capture + transcript ---------------------------------- + + +class FrameCapture: + """Per-test capture recorder. Created once per test via the + `frame_capture` fixture; call with a label to snapshot the screen. + """ + + def __init__( + self, + cam: camera_mod.CameraBackend, + dir_path: Path, + lines: list[str], + nodeid: str, + ) -> None: + self._cam = cam + self._dir = dir_path + self._lines = lines + self._nodeid = nodeid + self._step = 0 + self.captures: list[dict[str, Any]] = [] + self._transcript_path = dir_path / "transcript.md" + self._dir.mkdir(parents=True, exist_ok=True) + self._transcript_path.write_text( + f"# {nodeid} — {time.strftime('%Y-%m-%dT%H:%M:%SZ', time.gmtime())}\n\n", + encoding="utf-8", + ) + + def __call__(self, label: str) -> dict[str, Any]: + self._step += 1 + stem = f"{self._step:03d}-{re.sub(r'[^a-zA-Z0-9_-]+', '-', label)}" + png_path = self._dir / f"{stem}.png" + ocr_path = self._dir / f"{stem}.ocr.txt" + + try: + png = self._cam.capture() + except Exception as exc: # noqa: BLE001 + png = b"" + ocr_str = f"[capture error: {exc}]" + else: + camera_mod.save_capture(png, png_path) + try: + ocr_str = ocr_mod.ocr_text(png) + except Exception as exc: # noqa: BLE001 + ocr_str = f"[ocr error: {exc}]" + ocr_path.write_text(ocr_str or "", encoding="utf-8") + + frame = get_current_frame(self._lines) + entry: dict[str, Any] = { + "step": self._step, + "label": label, + "png_path": str(png_path) if png else None, + "ocr_text": ocr_str, + "frame": ( + { + "idx": frame.idx, + "name": frame.name, + "reason": frame.reason, + } + if frame is not None + else None + ), + } + self.captures.append(entry) + + with self._transcript_path.open("a", encoding="utf-8") as fh: + frame_str = ( + f"frame {frame.idx}/{frame.count} name={frame.name} reason={frame.reason}" + if frame is not None + else "frame " + ) + ocr_summary = (ocr_str or "").replace("\n", " / ")[:80] + fh.write( + f"{self._step}. **{label}** — {frame_str} — OCR: `{ocr_summary}`\n" + ) + return entry + + +@pytest.fixture +def frame_capture( + request: pytest.FixtureRequest, + camera: camera_mod.CameraBackend, + session_seed: str, +) -> Iterator[FrameCapture]: + nodeid = _sanitize_nodeid(request.node.nodeid) + dir_path = CAPTURES_ROOT / session_seed / nodeid + # Fresh directory per test run so reruns don't mix old and new images. + if dir_path.exists(): + shutil.rmtree(dir_path) + + lines = getattr(request.node, "_debug_log_buffer", []) + fc = FrameCapture(camera, dir_path, lines, nodeid) + # Stash so pytest_runtest_makereport can embed captures in HTML extras. + request.node._ui_captures = fc.captures # type: ignore[attr-defined] + yield fc + + +# ---------- Pre-test home-state reset -------------------------------------- + + +def _send_event(port: str, event: InputEventCode) -> None: + try: + admin_mod.send_input_event(event_code=int(event), port=port) + except Exception: # noqa: BLE001 + # Treat a failed event as soft — the subsequent frame-log assertion + # surfaces the real problem with better context. + pass + + +@pytest.fixture(autouse=True) +def ui_home_state( + request: pytest.FixtureRequest, + hub_devices: dict[str, Any], + _ui_screen_kept_on: None, +) -> Iterator[None]: + """Before every UI test, jump to frame 0 (usually `home`) via FN_F1 and + confirm the device emitted the expected frame log. + + Why FN_F1 (not BACK): FN_F1 maps to `switchToFrame(0)` and ALWAYS + produces a `reason=fn_f1` log line, regardless of whatever frame the + prior test left us on. BACK is context-sensitive (dismisses overlays + on some frames, no-op on others) and can silently fail to transition. + + This fixture doubles as the macro-presence detector: if no `fn_f1` + log arrives within 5 s, the firmware almost certainly wasn't baked + with `USERPREFS_UI_TEST_LOG`. Skip the tier with an actionable hint + instead of letting every test body fail with a confusing assertion. + + Autouse scope is restricted to `tests/ui/` by virtue of this fixture + living in that directory's conftest.py — no explicit nodeid guard + needed (and earlier attempts at one were wrong, matching `/tests/ui/` + against a nodeid that has no leading slash). + """ + role = next((r for r in UI_CAPABLE_ROLES if r in hub_devices), None) + if role is None: + yield + return + + hub_entry = hub_devices[role] + port = hub_entry.get("port") if isinstance(hub_entry, dict) else hub_entry + lines: list[str] = getattr(request.node, "_debug_log_buffer", []) + start_len = len(lines) + + # First: a wake event. The screen should already be kept on by + # `_ui_screen_kept_on`, but belt + suspenders — if it somehow + # powered off (sleep after factory_reset, etc.), this first FN_F1 + # gets dropped by InputBroker's screenWasOff guard. That's fine; + # the second FN_F1 below lands cleanly. + _send_event(port, InputEventCode.FN_F1) + time.sleep(0.4) + _send_event(port, InputEventCode.FN_F1) + + # Wait for the fn_f1 transition log. Any new `reason=fn_f1` line + # after call-start counts — we don't care about the name (it should + # be `home` or `deviceFocused` depending on board-specific frame order). + from ._screen_log import wait_for_reason + + try: + wait_for_reason(lines, "fn_f1", timeout_s=5.0) + except TimeoutError: + # One more try — FreeRTOS queue may be draining slowly. + _send_event(port, InputEventCode.FN_F1) + try: + wait_for_reason(lines, "fn_f1", timeout_s=5.0) + except TimeoutError: + # Look at what the _debug_log_buffer actually contains to + # disambiguate "macro off" from "macro on but event lost". + frame_lines = [ln for ln in lines[start_len:] if "Screen: frame" in ln] + processing_lines = [ + ln for ln in lines[start_len:] if "Processing input event" in ln + ] + if frame_lines: + pytest.skip( + f"ui_home_state: events fire but none reach Screen " + f"(saw {len(frame_lines)} frame line(s), " + f"{len(processing_lines)} admin inject(s)). " + f"Device may be in an unusual state — try `--force-bake`." + ) + else: + pytest.skip( + "ui_home_state: no `Screen: frame` log after FN_F1. " + "Firmware not baked with USERPREFS_UI_TEST_LOG — " + "run with `--force-bake` to reflash, or verify the " + "macro is active in the bake." + ) + yield + + +# ---------- Small helpers reused by tests --------------------------------- + + +def send_event( + port: str, event: InputEventCode | int | str, **kwargs: Any +) -> dict[str, Any]: + """Thin wrapper so tests read `send_event(port, InputEventCode.RIGHT)`.""" + return admin_mod.send_input_event(event_code=event, port=port, **kwargs) + + +__all__ = [ + "FrameCapture", + "UI_CAPABLE_ROLES", + "send_event", + "wait_for_frame", + "FrameEvent", +] + + +# Make the helpers discoverable to test modules via `from .conftest import …`. +# pytest auto-loads conftest.py, but the symbols above are also re-exported +# for readability in the test files. diff --git a/mcp-server/tests/ui/test_input_fn_jump.py b/mcp-server/tests/ui/test_input_fn_jump.py new file mode 100644 index 000000000..047aff7d2 --- /dev/null +++ b/mcp-server/tests/ui/test_input_fn_jump.py @@ -0,0 +1,61 @@ +"""FN_F1..F5 directly jumps to frame 0..4 via Screen::handleInputEvent. + +Parametrized over the 5 function keys. Each expects a +`Screen: frame / name=... reason=fn_f` log line, with +`idx == k-1`. We don't hardcode the frame *name* because the layout +depends on which modules are compiled in for this board. +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import get_current_frame, wait_for_reason +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(120) +@pytest.mark.parametrize( + "event,expected_idx,reason", + [ + (InputEventCode.FN_F1, 0, "fn_f1"), + (InputEventCode.FN_F2, 1, "fn_f2"), + (InputEventCode.FN_F3, 2, "fn_f3"), + (InputEventCode.FN_F4, 3, "fn_f4"), + (InputEventCode.FN_F5, 4, "fn_f5"), + ], + ids=["FN_F1", "FN_F2", "FN_F3", "FN_F4", "FN_F5"], +) +def test_fn_jump_direct_frame( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, + event: InputEventCode, + expected_idx: int, + reason: str, +) -> None: + lines: list[str] = request.node._debug_log_buffer + start = get_current_frame(lines) + assert start is not None, "no frame log yet — USERPREFS_UI_TEST_LOG not wired?" + assert start.name in ( + "home", + "deviceFocused", + ), f"setup expected frame 0 landing, got {start.name!r}" + frame_capture("initial") + + if start.count <= expected_idx: + pytest.skip( + f"device has {start.count} frames; FN_F{expected_idx + 1} needs > {expected_idx}" + ) + + send_event(ui_port, event) + time.sleep(0.1) + evt = wait_for_reason(lines, reason, timeout_s=5.0) + assert evt.idx == expected_idx, ( + f"FN_F{expected_idx + 1} expected idx={expected_idx}, got {evt.idx} " + f"(name={evt.name}, count={evt.count})" + ) + frame_capture(f"after-{reason}") diff --git a/mcp-server/tests/ui/test_input_fn_oob.py b/mcp-server/tests/ui/test_input_fn_oob.py new file mode 100644 index 000000000..a33ff1cc5 --- /dev/null +++ b/mcp-server/tests/ui/test_input_fn_oob.py @@ -0,0 +1,61 @@ +"""Out-of-bounds FN_F5 when the device has <5 frames: no crash, idx unchanged. + +`Screen::handleInputEvent` dispatches FN_F5 unconditionally to +`ui->switchToFrame(4)`. The OLEDDisplayUi library typically clamps or +silently ignores out-of-range indices, but firmware bugs have existed +here — this test protects against a regression that would wedge the UI. + +If this test fails, first check: did the device actually crash (Guru +Meditation in the log)? Or did switchToFrame accept an OOB index and +leave the UI blank? +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import get_current_frame, wait_for_reason +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(90) +def test_fn_f5_out_of_bounds( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + lines: list[str] = request.node._debug_log_buffer + start = get_current_frame(lines) + assert start is not None + + if start.count > 5: + pytest.skip( + f"device has {start.count} frames; FN_F5 is in-bounds — not testing OOB here" + ) + + frame_capture("initial-home") + send_event(ui_port, InputEventCode.FN_F5) + time.sleep(0.5) + + try: + wait_for_reason(lines, "fn_f5", timeout_s=3.0) + except TimeoutError: + # Firmware may have ignored the event entirely — acceptable. + pass + + # Capture whatever is on screen (OCR will tell us if something weird + # happened). Device must remain responsive — subsequent events should + # still land. + frame_capture("after-fn_f5-oob") + + # Send a RIGHT to confirm the UI is still alive. If this times out, + # the OOB switchToFrame wedged the UI. + send_event(ui_port, InputEventCode.RIGHT) + post = wait_for_reason(lines, "next", timeout_s=5.0) + assert ( + post is not None + ), "UI wedged after OOB FN_F5 — RIGHT no longer produces frame log" + frame_capture("after-recovery-right") diff --git a/mcp-server/tests/ui/test_input_menu.py b/mcp-server/tests/ui/test_input_menu.py new file mode 100644 index 000000000..8799d7dfb --- /dev/null +++ b/mcp-server/tests/ui/test_input_menu.py @@ -0,0 +1,68 @@ +"""SELECT on the home frame opens the home menu; BACK closes it. + +The home menu is an overlay (menuHandler::homeBaseMenu), not a frame +transition — so we verify via OCR difference between before/after +captures rather than a `Screen: frame` log line. The underlying +mechanism is still InputBroker → Screen::handleInputEvent → menu +callback. +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import get_current_frame +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(120) +def test_select_opens_home_menu( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + lines: list[str] = request.node._debug_log_buffer + start = get_current_frame(lines) + assert start is not None + if start.name not in ("home", "deviceFocused"): + pytest.skip( + f"SELECT on {start.name!r} doesn't open homeBaseMenu; " + "test is only valid when the landing frame is home/deviceFocused" + ) + + initial = frame_capture("initial") + send_event(ui_port, InputEventCode.SELECT) + time.sleep(0.8) + opened = frame_capture("after-select") + + # The menu is an overlay (not a frame change). We cannot use log + # assertion — instead, OCR should differ because a menu list is now + # drawn on top. + initial_text = (initial.get("ocr_text") or "").strip() + opened_text = (opened.get("ocr_text") or "").strip() + if initial_text and opened_text: + # When OCR is available, require *some* difference between the two + # frames — even a single menu title changes the transcribed text. + assert initial_text != opened_text, ( + f"expected OCR diff after SELECT; both read {initial_text!r}. " + "If both are empty, check camera alignment + OCR backend." + ) + + # Back out — the menu dismisses on BACK. + send_event(ui_port, InputEventCode.BACK) + time.sleep(0.8) + closed = frame_capture("after-back") + + # Soft check: OCR after BACK should look different from the menu + # (either back to home or onto a previous frame — BACK's exact + # behavior when the menu is up vs. not-up varies). We don't assert + # equality because OLED rendering is pixel-stable but camera sampling + # introduces noise. + if opened_text and closed.get("ocr_text"): + close_text = (closed.get("ocr_text") or "").strip() + assert ( + close_text != opened_text + ), f"after BACK, OCR still looks like the menu: {close_text!r}" diff --git a/mcp-server/tests/ui/test_input_message_scroll.py b/mcp-server/tests/ui/test_input_message_scroll.py new file mode 100644 index 000000000..85dc2d8e2 --- /dev/null +++ b/mcp-server/tests/ui/test_input_message_scroll.py @@ -0,0 +1,60 @@ +"""Once we navigate to the textMessage frame, UP/DOWN exercises the +message-scroll path (or opens CannedMessages on empty devices). + +Weaker than a "no frame change" assertion because on a fresh bench +device the message store is usually empty, and the firmware's UP +handler in that case launches CannedMessage — which DOES rebuild +frames. We just verify the path doesn't crash + produce captures for +visual inspection. +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import get_current_frame, wait_for_frame +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(180) +def test_up_down_on_textmessage_survives( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + lines: list[str] = request.node._debug_log_buffer + frame_capture("initial") + + # Walk RIGHT until we land on textMessage — up to 15 hops. + for _i in range(15): + send_event(ui_port, InputEventCode.RIGHT) + time.sleep(0.3) + current = get_current_frame(lines) + if current is not None and current.name == "textMessage": + break + else: + pytest.skip( + "couldn't reach textMessage frame within 15 RIGHTs — not present on this board" + ) + + wait_for_frame(lines, "textMessage", timeout_s=5.0) + frame_capture("on-textMessage") + + # UP and DOWN exercise the message-scroll / canned-message-launch path. + # Capture after each so the HTML report shows any visual effect. + send_event(ui_port, InputEventCode.UP) + time.sleep(0.3) + frame_capture("after-up") + + send_event(ui_port, InputEventCode.DOWN) + time.sleep(0.3) + frame_capture("after-down") + + # Soft check: we should still be in a reachable frame (not wedged). + # The next test's `ui_home_state` will error out if the device is + # unresponsive, so we don't need a stricter guarantee here. + final = get_current_frame(lines) + assert final is not None, "no frame log after UP/DOWN — event path broke" diff --git a/mcp-server/tests/ui/test_input_navigation.py b/mcp-server/tests/ui/test_input_navigation.py new file mode 100644 index 000000000..1fe00b134 --- /dev/null +++ b/mcp-server/tests/ui/test_input_navigation.py @@ -0,0 +1,93 @@ +"""INPUT_BROKER_RIGHT cycles forward through frames; INPUT_BROKER_LEFT backs. + +The simplest UI test: fire N RIGHT events and assert the frame index +moves forward by N (modulo frameCount). Each step captures an image + +OCR for the HTML report. +""" + +from __future__ import annotations + +import time +from typing import Any + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import get_current_frame, wait_for_frame +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(120) +def test_input_right_cycles_frames( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + lines: list[str] = request.node._debug_log_buffer + start = get_current_frame(lines) + assert start is not None, "no frame log yet — USERPREFS_UI_TEST_LOG not wired?" + # FN_F1 in ui_home_state lands on frame 0. The name at frame 0 varies + # by board (home on heltec-v3, deviceFocused on others) — accept either. + assert start.name in ( + "home", + "deviceFocused", + ), f"setup expected home/deviceFocused at frame 0, got {start.name!r}" + + frame_capture("initial") + visited = [start.idx] + + for step in range(4): + send_event(ui_port, InputEventCode.RIGHT) + # Each RIGHT should bump the frame index by 1. The log fires with + # `reason=next` from showFrame(NEXT). + before_count = len(list(_frame_events(lines))) + deadline = time.monotonic() + 5.0 + while time.monotonic() < deadline: + if len(list(_frame_events(lines))) > before_count: + break + time.sleep(0.1) + evt = get_current_frame(lines) + assert evt is not None + assert ( + evt.reason == "next" + ), f"step {step}: expected reason=next, got {evt.reason!r}" + visited.append(evt.idx) + frame_capture(f"after-right-{step + 1}") + + # Sanity: each index should differ from its predecessor. + diffs = [visited[i + 1] - visited[i] for i in range(len(visited) - 1)] + assert all( + d in (1, -(start.count - 1)) for d in diffs + ), f"expected monotonic +1 steps (or a wrap), got visited={visited} diffs={diffs}" + + +@pytest.mark.timeout(120) +def test_input_left_returns_to_home( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + """After RIGHT×3 + LEFT×3, we should end up back on the starting frame.""" + lines: list[str] = request.node._debug_log_buffer + start = get_current_frame(lines) + assert start is not None + start_name = start.name + frame_capture("initial") + for _ in range(3): + send_event(ui_port, InputEventCode.RIGHT) + time.sleep(0.3) + frame_capture("after-right-3") + + for _ in range(3): + send_event(ui_port, InputEventCode.LEFT) + time.sleep(0.3) + + # Back to whichever frame we started on (home or deviceFocused). + wait_for_frame(lines, start_name, timeout_s=5.0) + frame_capture(f"after-left-3-back-{start_name}") + + +def _frame_events(lines: list[str]) -> Any: + from ._screen_log import iter_frame_events + + return iter_frame_events(lines) diff --git a/mcp-server/tests/ui/test_input_node_scroll.py b/mcp-server/tests/ui/test_input_node_scroll.py new file mode 100644 index 000000000..594b358a0 --- /dev/null +++ b/mcp-server/tests/ui/test_input_node_scroll.py @@ -0,0 +1,51 @@ +"""On the nodelist_nodes frame, UP/DOWN scrolls the list via +`NodeListRenderer::scrollUp/scrollDown` (src/graphics/Screen.cpp:1779-1788). +The firmware returns 0 before notifying observers, so no frame-change +log fires. Verify the path doesn't crash and we stay on nodelist_nodes. +""" + +from __future__ import annotations + +import time + +import pytest +from meshtastic_mcp.input_events import InputEventCode + +from ._screen_log import assert_no_frame_change, get_current_frame, wait_for_frame +from .conftest import FrameCapture, send_event + + +@pytest.mark.timeout(180) +def test_up_down_on_nodelist_no_frame_change( + ui_port: str, + frame_capture: FrameCapture, + request: pytest.FixtureRequest, +) -> None: + lines: list[str] = request.node._debug_log_buffer + frame_capture("initial") + + # Walk RIGHT until we land on nodelist_nodes. + for _i in range(15): + send_event(ui_port, InputEventCode.RIGHT) + time.sleep(0.3) + current = get_current_frame(lines) + if current is not None and current.name == "nodelist_nodes": + break + else: + pytest.skip("couldn't reach nodelist_nodes within 15 RIGHTs") + + wait_for_frame(lines, "nodelist_nodes", timeout_s=5.0) + frame_capture("on-nodelist") + + # UP/DOWN on nodelist scroll internally + `return 0` before + # notifyObservers — no frame-change log. Verify. + send_event(ui_port, InputEventCode.UP) + assert_no_frame_change(lines, wait_s=1.5) + send_event(ui_port, InputEventCode.DOWN) + assert_no_frame_change(lines, wait_s=1.5) + + final = get_current_frame(lines) + assert ( + final is not None and final.name == "nodelist_nodes" + ), f"UP/DOWN moved us off nodelist_nodes; now on {final!r}" + frame_capture("after-up-down") diff --git a/mcp-server/tests/unit/test_input_event_codes.py b/mcp-server/tests/unit/test_input_event_codes.py new file mode 100644 index 000000000..f92698edf --- /dev/null +++ b/mcp-server/tests/unit/test_input_event_codes.py @@ -0,0 +1,90 @@ +"""Pin `InputEventCode` values to the firmware `input_broker_event` enum. + +If this test fails, someone changed the firmware enum (or this Python +mirror) and they must stay in sync — the admin RPC sends these as u8 +wire values directly. + +Also exercises `coerce_event_code` for the happy + error paths. +""" + +from __future__ import annotations + +import pytest +from meshtastic_mcp.input_events import InputEventCode, coerce_event_code + + +class TestInputEventCodeValues: + """These values MUST match src/input/InputBroker.h exactly.""" + + def test_navigation_keys(self) -> None: + assert int(InputEventCode.UP) == 17 + assert int(InputEventCode.DOWN) == 18 + assert int(InputEventCode.LEFT) == 19 + assert int(InputEventCode.RIGHT) == 20 + + def test_action_keys(self) -> None: + assert int(InputEventCode.SELECT) == 10 + assert int(InputEventCode.CANCEL) == 24 + assert int(InputEventCode.BACK) == 27 + + def test_long_press_variants(self) -> None: + assert int(InputEventCode.SELECT_LONG) == 11 + assert int(InputEventCode.UP_LONG) == 12 + assert int(InputEventCode.DOWN_LONG) == 13 + + def test_fn_keys(self) -> None: + assert int(InputEventCode.FN_F1) == 0xF1 + assert int(InputEventCode.FN_F2) == 0xF2 + assert int(InputEventCode.FN_F3) == 0xF3 + assert int(InputEventCode.FN_F4) == 0xF4 + assert int(InputEventCode.FN_F5) == 0xF5 + + def test_system_events(self) -> None: + assert int(InputEventCode.SHUTDOWN) == 0x9B + assert int(InputEventCode.GPS_TOGGLE) == 0x9E + assert int(InputEventCode.SEND_PING) == 0xAF + + def test_auto_increment_block(self) -> None: + # C enum: `BACK = 27, USER_PRESS, ALT_PRESS, ALT_LONG` → 28, 29, 30. + assert int(InputEventCode.USER_PRESS) == 28 + assert int(InputEventCode.ALT_PRESS) == 29 + assert int(InputEventCode.ALT_LONG) == 30 + + +class TestCoerceEventCode: + def test_int_passthrough(self) -> None: + assert coerce_event_code(20) == 20 + assert coerce_event_code(0) == 0 + assert coerce_event_code(255) == 255 + + def test_enum_passthrough(self) -> None: + assert coerce_event_code(InputEventCode.RIGHT) == 20 + assert coerce_event_code(InputEventCode.FN_F1) == 0xF1 + + def test_name_case_insensitive(self) -> None: + assert coerce_event_code("right") == 20 + assert coerce_event_code("RIGHT") == 20 + assert coerce_event_code("Right") == 20 + + def test_input_broker_prefix_stripped(self) -> None: + assert coerce_event_code("INPUT_BROKER_FN_F1") == 0xF1 + assert coerce_event_code("input_broker_select") == 10 + + def test_hyphen_and_underscore_equivalence(self) -> None: + assert coerce_event_code("fn-f1") == 0xF1 + + def test_int_out_of_range_raises(self) -> None: + with pytest.raises(ValueError, match="u8"): + coerce_event_code(256) + with pytest.raises(ValueError, match="u8"): + coerce_event_code(-1) + + def test_unknown_name_raises(self) -> None: + with pytest.raises(ValueError, match="unknown event code name"): + coerce_event_code("NOT_A_KEY") + + def test_wrong_type_raises(self) -> None: + with pytest.raises(TypeError): + coerce_event_code(1.5) # type: ignore[arg-type] + with pytest.raises(TypeError): + coerce_event_code(None) # type: ignore[arg-type] diff --git a/mcp-server/tests/unit/test_uhubctl_parser.py b/mcp-server/tests/unit/test_uhubctl_parser.py new file mode 100644 index 000000000..373147950 --- /dev/null +++ b/mcp-server/tests/unit/test_uhubctl_parser.py @@ -0,0 +1,148 @@ +"""Pin the `uhubctl` default-output parser against canned real-world samples. + +uhubctl's output format has been stable since v2.x but occasionally adds +new hub-descriptor fields (e.g. the `, ppps` marker). The parser uses loose +regexes to tolerate additions; this test keeps us honest. + +Samples captured from: +- v2.6.0 on macOS (Homebrew) — two USB2 hubs, one populated with an + nRF52 and a CP2102, plus chained USB3 hubs. +- v2.5.0 on Linux (hypothetical — reconstructed from the project README). +""" + +from __future__ import annotations + +import pytest +from meshtastic_mcp.uhubctl import ( + ROLE_VIDS, + UhubctlError, + parse_list_output, +) + +# Actual `uhubctl` stdout on the developer's macOS bench, Apr 2026. +_SAMPLE_MACOS_V26 = """\ +Current status for hub 1-1.3 [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports, ppps] + Port 1: 0100 power + Port 2: 0103 power enable connect [239a:8029 RAKwireless WisCore RAK4631 Board 920456B1E6972262] + Port 3: 0103 power enable connect [10c4:ea60 Silicon Labs CP2102 USB to UART Bridge Controller 0001] + Port 4: 0100 power +Current status for hub 1-2.3 [2109:0817 VIA Labs, Inc. USB3.0 Hub, USB 3.10, 4 ports, ppps] + Port 1: 02a0 power 5gbps Rx.Detect + Port 2: 02a0 power 5gbps Rx.Detect + Port 3: 02a0 power 5gbps Rx.Detect + Port 4: 02a0 power 5gbps Rx.Detect +Current status for hub 1-1 [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports, ppps] + Port 1: 0100 power + Port 2: 0100 power + Port 3: 0503 power highspeed enable connect [2109:2817 VIA Labs, Inc. USB2.0 Hub, USB 2.10, 4 ports, ppps] + Port 4: 0100 power +""" + + +# Minimal Linux-style sample (fewer hubs, shows a non-PPPS hub). +_SAMPLE_LINUX_NONPPPS = """\ +Current status for hub 2-1.4 [05e3:0608 GenesysLogic USB2.1 Hub, USB 2.10, 4 ports] + Port 1: 0507 power highspeed suspend enable connect [239a:0029 Adafruit Feather Bootloader] + Port 2: 0100 power + Port 3: 0100 power + Port 4: 0100 power +""" + + +class TestParseListOutput: + def test_parses_macos_sample_hub_count(self) -> None: + hubs = parse_list_output(_SAMPLE_MACOS_V26) + assert len(hubs) == 3 + + def test_parses_hub_location_and_vid(self) -> None: + hubs = parse_list_output(_SAMPLE_MACOS_V26) + via_hub = hubs[0] + assert via_hub["location"] == "1-1.3" + assert via_hub["vid"] == 0x2109 + assert via_hub["pid"] == 0x2817 + assert via_hub["ppps"] is True + + def test_parses_port_with_device(self) -> None: + hubs = parse_list_output(_SAMPLE_MACOS_V26) + nrf52_hub = hubs[0] + port2 = next(p for p in nrf52_hub["ports"] if p["port"] == 2) + assert port2["device_vid"] == 0x239A + assert port2["device_pid"] == 0x8029 + assert "RAKwireless" in port2["device_desc"] + + def test_empty_port_has_no_device(self) -> None: + hubs = parse_list_output(_SAMPLE_MACOS_V26) + nrf52_hub = hubs[0] + port1 = next(p for p in nrf52_hub["ports"] if p["port"] == 1) + assert port1["device_vid"] is None + assert port1["device_pid"] is None + assert port1["device_desc"] is None + + def test_ports_count(self) -> None: + hubs = parse_list_output(_SAMPLE_MACOS_V26) + for hub in hubs: + assert len(hub["ports"]) == 4 # each sample hub has 4 ports + + def test_non_ppps_hub_flagged(self) -> None: + hubs = parse_list_output(_SAMPLE_LINUX_NONPPPS) + assert len(hubs) == 1 + assert hubs[0]["ppps"] is False + + def test_handles_empty_input(self) -> None: + assert parse_list_output("") == [] + + def test_handles_malformed_lines_gracefully(self) -> None: + # Lines that don't match HUB_RE or PORT_RE are ignored silently. + garbage = "uhubctl: warning: something weird\n" + _SAMPLE_LINUX_NONPPPS + hubs = parse_list_output(garbage) + assert len(hubs) == 1 + + +class TestRoleVids: + def test_nrf52_mapped(self) -> None: + assert 0x239A in ROLE_VIDS["nrf52"] + + def test_esp32s3_covers_both_vids(self) -> None: + # Espressif native USB + CP2102 USB-UART on heltec-v3 boards. + assert 0x303A in ROLE_VIDS["esp32s3"] + assert 0x10C4 in ROLE_VIDS["esp32s3"] + + +class TestResolveTargetErrorPaths: + def test_unknown_role_raises(self, monkeypatch: pytest.MonkeyPatch) -> None: + from meshtastic_mcp.uhubctl import resolve_target + + # Clear any env-var pinning that might make this pass accidentally. + for key in ( + "MESHTASTIC_UHUBCTL_LOCATION_FLUX", + "MESHTASTIC_UHUBCTL_PORT_FLUX", + ): + monkeypatch.delenv(key, raising=False) + with pytest.raises(UhubctlError, match="unknown role"): + resolve_target("flux") + + def test_invalid_env_port_raises(self, monkeypatch: pytest.MonkeyPatch) -> None: + from meshtastic_mcp.uhubctl import resolve_target + + monkeypatch.setenv("MESHTASTIC_UHUBCTL_LOCATION_NRF52", "1-1.3") + monkeypatch.setenv("MESHTASTIC_UHUBCTL_PORT_NRF52", "not-an-int") + with pytest.raises(UhubctlError, match="not a valid integer"): + resolve_target("nrf52") + + def test_env_var_pinning_wins(self, monkeypatch: pytest.MonkeyPatch) -> None: + from meshtastic_mcp.uhubctl import resolve_target + + # Env-var pinning should NOT require uhubctl to be running / installed. + monkeypatch.setenv("MESHTASTIC_UHUBCTL_LOCATION_NRF52", "9-9.9") + monkeypatch.setenv("MESHTASTIC_UHUBCTL_PORT_NRF52", "7") + assert resolve_target("nrf52") == ("9-9.9", 7) + + def test_normalize_role_strips_alt_suffix( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + from meshtastic_mcp.uhubctl import resolve_target + + # esp32s3_alt collapses to esp32s3 for env-var lookup. + monkeypatch.setenv("MESHTASTIC_UHUBCTL_LOCATION_ESP32S3", "2-2") + monkeypatch.setenv("MESHTASTIC_UHUBCTL_PORT_ESP32S3", "3") + assert resolve_target("esp32s3_alt") == ("2-2", 3) diff --git a/mcp-server/tests/unit/test_ui_screen_log.py b/mcp-server/tests/unit/test_ui_screen_log.py new file mode 100644 index 000000000..55029b38c --- /dev/null +++ b/mcp-server/tests/unit/test_ui_screen_log.py @@ -0,0 +1,80 @@ +"""Pin the `Screen: frame N/M name=X reason=Y` regex + FrameEvent dataclass. + +The firmware-side format lives in `src/graphics/Screen.cpp::logFrameChange`; +if the format string changes, this test — and the parser in +`tests/ui/_screen_log.py` — have to be updated together. +""" + +from __future__ import annotations + +from tests.ui._screen_log import FRAME_RE, FrameEvent, iter_frame_events + + +class TestFrameEventParse: + def test_exact_firmware_output(self) -> None: + raw = "Screen: frame 2/8 name=home reason=next" + evt = FrameEvent.parse(raw) + assert evt is not None + assert evt.idx == 2 + assert evt.count == 8 + assert evt.name == "home" + assert evt.reason == "next" + assert evt.raw == raw + + def test_with_log_prefix(self) -> None: + """Log lines may be preamble-wrapped by the firmware LOG_INFO macro + (timestamp, severity, etc.) — the regex uses .search() not .match() + so prefixes are fine.""" + raw = "[INFO] 00:12:34 567 Screen: frame 4/12 name=nodelist_nodes reason=fn_f3 " + evt = FrameEvent.parse(raw) + assert evt is not None + assert evt.idx == 4 + assert evt.count == 12 + assert evt.name == "nodelist_nodes" + assert evt.reason == "fn_f3" + + def test_rebuild_reason(self) -> None: + evt = FrameEvent.parse("Screen: frame 0/5 name=deviceFocused reason=rebuild") + assert evt is not None + assert evt.reason == "rebuild" + + def test_all_fn_reasons(self) -> None: + for k in range(1, 6): + evt = FrameEvent.parse( + f"Screen: frame {k - 1}/8 name=settings reason=fn_f{k}" + ) + assert evt is not None and evt.reason == f"fn_f{k}" + + def test_unknown_name_is_preserved(self) -> None: + """If the reverse-map returns 'unknown', that still parses cleanly.""" + evt = FrameEvent.parse("Screen: frame 99/100 name=unknown reason=prev") + assert evt is not None and evt.name == "unknown" + + def test_non_matching_line_returns_none(self) -> None: + assert FrameEvent.parse("BOOT Booting firmware 2.7.23") is None + assert FrameEvent.parse("") is None + assert FrameEvent.parse("Screen: without the right format") is None + + +class TestIterFrameEvents: + def test_filters_non_matching_lines(self) -> None: + lines = [ + "Booting...", + "Screen: frame 1/5 name=home reason=rebuild", + "Some other log line", + "Screen: frame 2/5 name=textMessage reason=next", + ] + evts = list(iter_frame_events(lines)) + assert len(evts) == 2 + assert evts[0].reason == "rebuild" + assert evts[1].reason == "next" + + +class TestRegexAnchoring: + def test_regex_is_compiled(self) -> None: + assert FRAME_RE.search("Screen: frame 0/0 name=home reason=next") is not None + + def test_regex_allows_unusual_names(self) -> None: + r"""Name is `\S+`, so compound names with underscores/digits match.""" + m = FRAME_RE.search("Screen: frame 5/10 name=nodelist_hopsignal reason=fn_f2") + assert m is not None and m["name"] == "nodelist_hopsignal" diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index b9745b29a..3d13a68af 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -96,7 +96,6 @@ class ScanI2C CW2015, SCD30, ADS1115, - CST3530, } DeviceType; // typedef uint8_t DeviceAddress; diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 55ec93db5..60e1c43a6 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1265,6 +1265,10 @@ void Screen::setFrames(FrameFocus focus) // Store the info about this frameset, for future setFrames calls this->framesetInfo = fsi; +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("rebuild", ui->getUiState()->currentFrame); +#endif + setFastFramerate(); // Draw ASAP } @@ -1419,11 +1423,77 @@ void Screen::handleOnPress() } } +#ifdef USERPREFS_UI_TEST_LOG +void Screen::logFrameChange(const char *reason, uint8_t targetIdx) +{ + // Reverse-map an index to a stable name string keyed off FramePositions + // field names — so the pytest harness can assert `name=nodelist_nodes` + // without caring about how the positions were ordered this boot. + const auto &p = framesetInfo.positions; + const char *name = "unknown"; + if (targetIdx == p.home) + name = "home"; + else if (targetIdx == p.deviceFocused) + name = "deviceFocused"; + else if (targetIdx == p.textMessage) + name = "textMessage"; + else if (targetIdx == p.nodelist_nodes) + name = "nodelist_nodes"; + else if (targetIdx == p.nodelist_location) + name = "nodelist_location"; + else if (targetIdx == p.nodelist_lastheard) + name = "nodelist_lastheard"; + else if (targetIdx == p.nodelist_hopsignal) + name = "nodelist_hopsignal"; + else if (targetIdx == p.nodelist_distance) + name = "nodelist_distance"; + else if (targetIdx == p.nodelist_bearings) + name = "nodelist_bearings"; + else if (targetIdx == p.system) + name = "system"; + else if (targetIdx == p.gps) + name = "gps"; + else if (targetIdx == p.lora) + name = "lora"; + else if (targetIdx == p.clock) + name = "clock"; + else if (targetIdx == p.chirpy) + name = "chirpy"; + else if (targetIdx == p.fault) + name = "fault"; + else if (targetIdx == p.waypoint) + name = "waypoint"; + else if (targetIdx == p.focusedModule) + name = "focusedModule"; + else if (targetIdx == p.log) + name = "log"; + else if (targetIdx == p.settings) + name = "settings"; + else if (targetIdx == p.wifi) + name = "wifi"; + else if (p.firstFavorite != 255 && p.lastFavorite != 255 && targetIdx >= p.firstFavorite && targetIdx <= p.lastFavorite) + name = "favorite"; + LOG_INFO("Screen: frame %u/%u name=%s reason=%s", (unsigned)targetIdx, (unsigned)framesetInfo.frameCount, name, reason); +} +#endif + void Screen::showFrame(FrameDirection direction) { // Only advance frames when UI is stable if (ui->getUiState()->frameState == FIXED) { +#ifdef USERPREFS_UI_TEST_LOG + // Log the *intended* target before the (async) transition fires, so + // tests see a deterministic record of what was requested. + if (framesetInfo.frameCount > 0) { + uint8_t curr = ui->getUiState()->currentFrame; + uint8_t target = (direction == FrameDirection::NEXT) + ? (uint8_t)((curr + 1) % framesetInfo.frameCount) + : (uint8_t)((curr + framesetInfo.frameCount - 1) % framesetInfo.frameCount); + logFrameChange(direction == FrameDirection::NEXT ? "next" : "prev", target); + } +#endif + if (direction == FrameDirection::NEXT) { ui->nextFrame(); } else { @@ -1755,22 +1825,37 @@ int Screen::handleInputEvent(const InputEvent *event) showFrame(FrameDirection::NEXT); } else if (event->inputEvent == INPUT_BROKER_FN_F1) { this->ui->switchToFrame(0); +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("fn_f1", 0); +#endif lastScreenTransition = millis(); setFastFramerate(); } else if (event->inputEvent == INPUT_BROKER_FN_F2) { this->ui->switchToFrame(1); +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("fn_f2", 1); +#endif lastScreenTransition = millis(); setFastFramerate(); } else if (event->inputEvent == INPUT_BROKER_FN_F3) { this->ui->switchToFrame(2); +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("fn_f3", 2); +#endif lastScreenTransition = millis(); setFastFramerate(); } else if (event->inputEvent == INPUT_BROKER_FN_F4) { this->ui->switchToFrame(3); +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("fn_f4", 3); +#endif lastScreenTransition = millis(); setFastFramerate(); } else if (event->inputEvent == INPUT_BROKER_FN_F5) { this->ui->switchToFrame(4); +#ifdef USERPREFS_UI_TEST_LOG + logFrameChange("fn_f5", 4); +#endif lastScreenTransition = millis(); setFastFramerate(); } else if (event->inputEvent == INPUT_BROKER_UP_LONG) { diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index e259f7691..023f36f38 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -673,6 +673,16 @@ class Screen : public concurrency::OSThread void handleOnPress(); void handleStartFirmwareUpdateScreen(); +#ifdef USERPREFS_UI_TEST_LOG + // Test-only: emits one LOG_INFO line on every frame transition so the + // pytest harness can assert which frame is shown. Gated behind a macro + // so the chatty log doesn't ship in release builds. Enabled via + // build_testing_profile(enable_ui_log=True) in mcp-server/userprefs.py. + // Member function (not free) because FramesetInfo is a private nested + // type — only methods of Screen can reach it. + void logFrameChange(const char *reason, uint8_t targetIdx); +#endif + // Info collected by setFrames method. // Index location of specific frames. // - Used to apply the FrameFocus parameter of setFrames diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 7492d7361..8a1843bcb 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -1489,8 +1489,15 @@ void AdminModule::handleSendInputEvent(const meshtastic_AdminMessage_InputEvent LOG_DEBUG("Processing input event: event_code=%u, kb_char=%u, touch_x=%u, touch_y=%u", inputEvent.event_code, inputEvent.kb_char, inputEvent.touch_x, inputEvent.touch_y); - // Create InputEvent for injection - InputEvent event = {.inputEvent = (input_broker_event)inputEvent.event_code, + // Create InputEvent for injection. + // + // `.source` MUST be a non-null C string: the LOG_INFO below formats it + // with %s, and passing NULL to the esp-log formatter crashes with + // Guru Meditation LoadProhibited at strlen(NULL). Other InputBroker + // sources (buttons, rotary) always set this; the admin path was the + // only one leaving it default-null. + InputEvent event = {.source = "admin", + .inputEvent = (input_broker_event)inputEvent.event_code, .kbchar = (unsigned char)inputEvent.kb_char, .touchX = inputEvent.touch_x, .touchY = inputEvent.touch_y}; diff --git a/userPrefs.jsonc b/userPrefs.jsonc index b81f09362..a8201bab3 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -57,6 +57,7 @@ // "USERPREFS_MQTT_ROOT_TOPIC": "event/REPLACEME", // "USERPREFS_RINGTONE_NAG_SECS": "60", // "USERPREFS_NODEINFO_REPLY_SUPPRESS_SECS": "43200", + // "USERPREFS_UI_TEST_LOG": "true", // Test-only: emits `Screen: frame N/M name=... reason=...` log per UI transition (for the mcp-server ui test tier); off in release builds. "USERPREFS_RINGTONE_RTTTL": "24:d=32,o=5,b=565:f6,p,f6,4p,p,f6,p,f6,2p,p,b6,p,b6,p,b6,p,b6,p,b,p,b,p,b,p,b,p,b,p,b,p,b,p,b,1p.,2p.,p", // "USERPREFS_NETWORK_IPV6_ENABLED": "1", "USERPREFS_TZ_STRING": "tzplaceholder " From 8627bce1a1fc175c402cfe352523300b84e2e75f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 04:55:10 -0500 Subject: [PATCH 081/150] Upgrade trunk (#10125) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index d0cbaa8bc..7a8ca0203 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.517 - - renovate@43.110.9 - - prettier@3.8.1 + - checkov@3.2.524 + - renovate@43.132.1 + - prettier@3.8.3 - trufflehog@3.94.3 - yamllint@1.38.0 - bandit@1.9.4 - - trivy@0.69.3 + - trivy@0.70.0 - taplo@0.10.0 - - ruff@0.15.9 + - ruff@0.15.11 - isort@8.0.1 - markdownlint@0.48.0 - oxipng@10.1.0 From eba74fa6e26ba15626afe0e0a873dbc1a9a67875 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 06:08:28 -0500 Subject: [PATCH 082/150] Update GxEPD2 to v1.6.9 (#10212) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32/m5stack_coreink/platformio.ini | 2 +- variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini | 2 +- variants/esp32s3/esp32-s3-pico/platformio.ini | 2 +- variants/esp32s3/t-deck-pro-v1_1/platformio.ini | 2 +- variants/esp32s3/t-deck-pro/platformio.ini | 2 +- variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini | 2 +- variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini | 2 +- variants/nrf52840/MakePython_nRF52840_eink/platformio.ini | 2 +- variants/nrf52840/TWC_mesh_v4/platformio.ini | 2 +- variants/nrf52840/rak4631_epaper/platformio.ini | 2 +- variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/variants/esp32/m5stack_coreink/platformio.ini b/variants/esp32/m5stack_coreink/platformio.ini index e107bd893..70ada7bf3 100644 --- a/variants/esp32/m5stack_coreink/platformio.ini +++ b/variants/esp32/m5stack_coreink/platformio.ini @@ -19,7 +19,7 @@ build_flags = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib lewisxhe/SensorLib@0.3.4 lib_ignore = diff --git a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini index 90e4910f4..71116279c 100644 --- a/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini +++ b/variants/esp32s3/diy/my_esp32s3_diy_eink/platformio.ini @@ -11,7 +11,7 @@ upload_speed = 921600 lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 build_unflags = ${esp32s3_base.build_unflags} -DARDUINO_USB_MODE=1 diff --git a/variants/esp32s3/esp32-s3-pico/platformio.ini b/variants/esp32s3/esp32-s3-pico/platformio.ini index 64f50f80e..b5ff66b85 100644 --- a/variants/esp32s3/esp32-s3-pico/platformio.ini +++ b/variants/esp32s3/esp32-s3-pico/platformio.ini @@ -23,4 +23,4 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 diff --git a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini index 1a9b20f76..22432d769 100644 --- a/variants/esp32s3/t-deck-pro-v1_1/platformio.ini +++ b/variants/esp32s3/t-deck-pro-v1_1/platformio.ini @@ -30,7 +30,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 diff --git a/variants/esp32s3/t-deck-pro/platformio.ini b/variants/esp32s3/t-deck-pro/platformio.ini index 93ef8babf..d1a2398a4 100644 --- a/variants/esp32s3/t-deck-pro/platformio.ini +++ b/variants/esp32s3/t-deck-pro/platformio.ini @@ -34,7 +34,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 # renovate: datasource=git-refs depName=CSE_Touch packageName=https://github.com/CIRCUITSTATE/CSE_Touch gitBranch=main https://github.com/CIRCUITSTATE/CSE_Touch/archive/b44f23b6f870b848f1fbe453c190879bc6cfaafa.zip # renovate: datasource=github-tags depName=CSE_CST328 packageName=CIRCUITSTATE/CSE_CST328 diff --git a/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini index fd159a6d2..e0cdd73c5 100644 --- a/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini +++ b/variants/nrf52840/Dongle_nRF52840-pca10059-v1/platformio.ini @@ -12,5 +12,5 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/Dongle_ lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 debug_tool = jlink diff --git a/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini index 39b5dfbd4..217e0dd3a 100644 --- a/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini +++ b/variants/nrf52840/ME25LS01-4Y10TD_e-ink/platformio.ini @@ -16,7 +16,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/ME25LS0 lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 ; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm) upload_protocol = nrfutil ;upload_port = /dev/ttyACM1 diff --git a/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini b/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini index ebea1ce97..d89ef348d 100644 --- a/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini +++ b/variants/nrf52840/MakePython_nRF52840_eink/platformio.ini @@ -15,6 +15,6 @@ lib_deps = # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master https://github.com/meshtastic/ESP32_Codec2/archive/633326c78ac251c059ab3a8c430fcdf25b41672f.zip # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 debug_tool = jlink ;upload_port = /dev/ttyACM4 \ No newline at end of file diff --git a/variants/nrf52840/TWC_mesh_v4/platformio.ini b/variants/nrf52840/TWC_mesh_v4/platformio.ini index c529caa0b..8f7479f74 100644 --- a/variants/nrf52840/TWC_mesh_v4/platformio.ini +++ b/variants/nrf52840/TWC_mesh_v4/platformio.ini @@ -9,5 +9,5 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/TWC_mes lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 debug_tool = jlink diff --git a/variants/nrf52840/rak4631_epaper/platformio.ini b/variants/nrf52840/rak4631_epaper/platformio.ini index caa6ea328..728581e35 100644 --- a/variants/nrf52840/rak4631_epaper/platformio.ini +++ b/variants/nrf52840/rak4631_epaper/platformio.ini @@ -15,7 +15,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631 lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 # renovate: datasource=custom.pio depName=Melopero RV3028 packageName=melopero/library/Melopero RV3028 melopero/Melopero RV3028@1.2.0 # renovate: datasource=custom.pio depName=RAK NCP5623 RGB LED packageName=rakwireless/library/RAKwireless NCP5623 RGB LED library diff --git a/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini b/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini index 84a582fd9..994b54a40 100644 --- a/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini +++ b/variants/nrf52840/rak4631_epaper_onrxtx/platformio.ini @@ -17,7 +17,7 @@ build_src_filter = ${nrf52_base.build_src_filter} +<../variants/nrf52840/rak4631 lib_deps = ${nrf52840_base.lib_deps} # renovate: datasource=custom.pio depName=GxEPD2 packageName=zinggjm/library/GxEPD2 - zinggjm/GxEPD2@1.6.8 + zinggjm/GxEPD2@1.6.9 # renovate: datasource=custom.pio depName=Melopero RV3028 packageName=melopero/library/Melopero RV3028 melopero/Melopero RV3028@1.2.0 # renovate: datasource=custom.pio depName=RAK NCP5623 RGB LED packageName=rakwireless/library/RAKwireless NCP5623 RGB LED library From 84ce1ea14768a073f4bf0ee5f09cbb9c31e70930 Mon Sep 17 00:00:00 2001 From: nightjoker7 <47129685+nightjoker7@users.noreply.github.com> Date: Tue, 21 Apr 2026 09:50:01 -0500 Subject: [PATCH 083/150] SX126x: re-apply 0x8B5 register in resetAGC() to preserve RX sensitivity (#10219) The CALIBRATE_ALL (0x7F) command inside resetAGC() clears bit 0 of the undocumented 0x8B5 register. That bit is set once in init() by #9571 and #9777 to improve SX1262 RX sensitivity, and the AGC-reset path was not re-applying it. Result: every SX1262 node silently loses the RX sensitivity patch ~60s after boot and never recovers until reboot. Empirically confirmed on Heltec Mesh Node T114 (nRF52840 + SX1262): - Post-calibration read of 0x8B5 = 0x04 (bit 0 cleared) - After re-apply: 0x05 (bit 0 set) Reproducible every AGC_RESET_INTERVAL_MS tick. Fix re-applies the register bit alongside the existing post-calibration re-applies (setDio2AsRfSwitch, setRxBoostedGainMode). --- src/mesh/SX126xInterface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index 2e9a3250d..e777f204d 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -448,6 +448,15 @@ template void SX126xInterface::resetAGC() // RX boosted gain mode lora.setRxBoostedGainMode(config.lora.sx126x_rx_boosted_gain); + // Re-apply the undocumented 0x8B5 RX sensitivity patch that was set in init(). + // The CALIBRATE_ALL (0x7F) command above clears bit 0 of register 0x8B5, which + // silently removes the RX sensitivity improvement introduced in #9571 / #9777. + // Without this re-apply, every SX1262 node loses its RX boost ~60s after boot + // and never recovers until reboot. See empirical evidence in the PR description. + if (module.SPIsetRegValue(0x8B5, 0x01, 0, 0) != RADIOLIB_ERR_NONE) { + LOG_WARN("SX126x resetAGC: failed to re-apply 0x8B5 RX sensitivity patch"); + } + // 6. Resume receiving startReceive(); } From 5d9a2564e489f8216ba649f6c65a5a0eb708acff Mon Sep 17 00:00:00 2001 From: Jaime Roldan Date: Tue, 21 Apr 2026 09:52:19 -0500 Subject: [PATCH 084/150] fix(nodedb): force null-terminate name fields in UserLite/User conversions (#8174) (#10218) --- src/mesh/TypeConversions.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesh/TypeConversions.cpp b/src/mesh/TypeConversions.cpp index 75195bd42..201a703e2 100644 --- a/src/mesh/TypeConversions.cpp +++ b/src/mesh/TypeConversions.cpp @@ -81,7 +81,9 @@ meshtastic_UserLite TypeConversions::ConvertToUserLite(meshtastic_User user) meshtastic_UserLite lite = meshtastic_UserLite_init_default; strncpy(lite.long_name, user.long_name, sizeof(lite.long_name)); + lite.long_name[sizeof(lite.long_name) - 1] = '\0'; strncpy(lite.short_name, user.short_name, sizeof(lite.short_name)); + lite.short_name[sizeof(lite.short_name) - 1] = '\0'; lite.hw_model = user.hw_model; lite.role = user.role; lite.is_licensed = user.is_licensed; @@ -99,7 +101,9 @@ meshtastic_User TypeConversions::ConvertToUser(uint32_t nodeNum, meshtastic_User snprintf(user.id, sizeof(user.id), "!%08x", nodeNum); strncpy(user.long_name, lite.long_name, sizeof(user.long_name)); + user.long_name[sizeof(user.long_name) - 1] = '\0'; strncpy(user.short_name, lite.short_name, sizeof(user.short_name)); + user.short_name[sizeof(user.short_name) - 1] = '\0'; user.hw_model = lite.hw_model; user.role = lite.role; user.is_licensed = lite.is_licensed; From e1f50434890afa6263388781de4a5e4040cc3c11 Mon Sep 17 00:00:00 2001 From: Catalin Patulea Date: Fri, 10 Apr 2026 14:20:25 -0700 Subject: [PATCH 085/150] Delete PointerQueue::dequeuePtrFromISR, unused since commit db766f1 (#99). (#10090) --- src/mesh/PointerQueue.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/mesh/PointerQueue.h b/src/mesh/PointerQueue.h index b45245eb8..972eb65fd 100644 --- a/src/mesh/PointerQueue.h +++ b/src/mesh/PointerQueue.h @@ -17,14 +17,4 @@ template class PointerQueue : public TypedQueue return this->dequeue(&p, maxWait) ? p : nullptr; } - -#ifdef HAS_FREE_RTOS - // returns a ptr or null if the queue was empty - T *dequeuePtrFromISR(BaseType_t *higherPriWoken) - { - T *p; - - return this->dequeueFromISR(&p, higherPriWoken) ? p : nullptr; - } -#endif }; From 23321c45882784aa0cdbf5f230709fe725ed7958 Mon Sep 17 00:00:00 2001 From: Darafei Praliaskouski Date: Mon, 13 Apr 2026 21:05:23 +0400 Subject: [PATCH 086/150] Reduce key duplication by enabling hardware RNG (#8803) * Reduce key duplication by enabling hardware RNG * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @Copilot Use micros() for worst case random seed for nrf52 Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Minor cleanup, remove dead code and clarify comment * trunk * Add useRadioEntropy bool, default false. --------- Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Jonathan Bennett --- src/mesh/CryptoEngine.cpp | 10 ++ src/mesh/HardwareRNG.cpp | 159 +++++++++++++++++++++++ src/mesh/HardwareRNG.h | 28 ++++ src/mesh/RadioLibInterface.cpp | 20 ++- src/mesh/RadioLibInterface.h | 6 + src/platform/nrf52/main-nrf52.cpp | 18 +-- src/platform/portduino/PortduinoGlue.cpp | 9 +- src/platform/rp2xx0/main-rp2xx0.cpp | 11 +- 8 files changed, 245 insertions(+), 16 deletions(-) create mode 100644 src/mesh/HardwareRNG.cpp create mode 100644 src/mesh/HardwareRNG.h diff --git a/src/mesh/CryptoEngine.cpp b/src/mesh/CryptoEngine.cpp index 72216a63c..1073cd2e4 100644 --- a/src/mesh/CryptoEngine.cpp +++ b/src/mesh/CryptoEngine.cpp @@ -4,6 +4,7 @@ #include #if !(MESHTASTIC_EXCLUDE_PKI) +#include "HardwareRNG.h" #include "NodeDB.h" #include "aes-ccm.h" #include "meshUtils.h" @@ -26,6 +27,15 @@ void CryptoEngine::generateKeyPair(uint8_t *pubKey, uint8_t *privKey) { // Mix in any randomness we can, to make key generation stronger. CryptRNG.begin(optstr(APP_VERSION)); + + uint8_t hardwareEntropy[64] = {0}; + if (HardwareRNG::fill(hardwareEntropy, sizeof(hardwareEntropy), true)) { + CryptRNG.stir(hardwareEntropy, sizeof(hardwareEntropy)); + } else { + LOG_WARN("Hardware entropy unavailable, falling back to software RNG"); + } + memset(hardwareEntropy, 0, sizeof(hardwareEntropy)); + if (myNodeInfo.device_id.size == 16) { CryptRNG.stir(myNodeInfo.device_id.bytes, myNodeInfo.device_id.size); } diff --git a/src/mesh/HardwareRNG.cpp b/src/mesh/HardwareRNG.cpp new file mode 100644 index 000000000..b455128ac --- /dev/null +++ b/src/mesh/HardwareRNG.cpp @@ -0,0 +1,159 @@ +#include "HardwareRNG.h" + +#include +#include +#include + +#include "configuration.h" + +#if HAS_RADIO +#include "RadioLibInterface.h" +#endif + +#if defined(ARCH_NRF52) +#include +extern Adafruit_nRFCrypto nRFCrypto; +#elif defined(ARCH_ESP32) +#include +#elif defined(ARCH_RP2040) +#include +#elif defined(ARCH_PORTDUINO) +#include +#include +#include +#endif + +namespace HardwareRNG +{ + +namespace +{ +void fillWithRandomDevice(uint8_t *buffer, size_t length) +{ + std::random_device rd; + size_t offset = 0; + while (offset < length) { + uint32_t value = rd(); + size_t toCopy = std::min(length - offset, sizeof(value)); + memcpy(buffer + offset, &value, toCopy); + offset += toCopy; + } +} + +#if HAS_RADIO +bool mixWithLoRaEntropy(uint8_t *buffer, size_t length) +{ + // Only attempt to pull entropy from the modem if it is initialized and exposes the helper. + // When the radio stack is disabled or has not yet been configured, we simply skip this step + // and return false so callers know no extra mixing occurred. + RadioLibInterface *radio = RadioLibInterface::instance; + if (!radio) { + LOG_ERROR("No radio instance available to provide entropy"); + return false; + } + + constexpr size_t chunkSize = 16; + uint8_t scratch[chunkSize]; + size_t offset = 0; + bool mixed = false; + + while (offset < length) { + size_t toCopy = std::min(length - offset, chunkSize); + + // randomBytes() returns false if the modem does not support it or is not ready + // (for instance, when the radio is powered down). We break immediately to avoid + // blocking or returning partially-filled entropy and simply report failure. + if (!radio->randomBytes(scratch, toCopy)) { + break; + } + + for (size_t i = 0; i < toCopy; ++i) { + buffer[offset + i] ^= scratch[i]; + } + + mixed = true; + offset += toCopy; + } + + // Avoid leaving the modem-sourced bytes sitting on the stack longer than needed. + if (mixed) { + memset(scratch, 0, sizeof(scratch)); + } + + return mixed; +} +#endif +} // namespace + +bool fill(uint8_t *buffer, size_t length, bool useRadioEntropy) +{ + if (!buffer || length == 0) { + return false; + } + + bool filled = false; + +#if defined(ARCH_NRF52) + // The Nordic SDK RNG provides cryptographic-quality randomness backed by hardware. + nRFCrypto.begin(); + auto result = nRFCrypto.Random.generate(buffer, length); + nRFCrypto.end(); + filled = result; +#elif defined(ARCH_ESP32) + // ESP32 exposes a true RNG via esp_fill_random(). + esp_fill_random(buffer, length); + filled = true; +#elif defined(ARCH_RP2040) + // RP2040 has a hardware random number generator accessible through the Arduino core. + size_t offset = 0; + while (offset < length) { + uint32_t value = rp2040.hwrand32(); + size_t toCopy = std::min(length - offset, sizeof(value)); + memcpy(buffer + offset, &value, toCopy); + offset += toCopy; + } + filled = true; +#elif defined(ARCH_PORTDUINO) + // Prefer the host OS RNG first when running under Portduino. + ssize_t generated = ::getrandom(buffer, length, 0); + if (generated == static_cast(length)) { + filled = true; + } + + if (!filled) { + fillWithRandomDevice(buffer, length); + filled = true; + } +#endif + + if (!filled) { + // As a last resort, fall back to std::random_device. This should only be reached + // if a platform-specific source was unavailable. + fillWithRandomDevice(buffer, length); + filled = true; + } + +#if HAS_RADIO + if (useRadioEntropy) { + // Best-effort: if the radio is active and can provide modem entropy, XOR it over the + // buffer to improve overall quality. We consider the filling a success if either a + // good platform RNG or the modem RNG provided data, so we return true as long as at + // least one of those steps succeeded. + filled = mixWithLoRaEntropy(buffer, length) || filled; + } +#endif + + return filled; +} + +bool seed(uint32_t &seedOut) +{ + uint32_t candidate = 0; + if (!fill(reinterpret_cast(&candidate), sizeof(candidate), true)) { + return false; + } + seedOut = candidate; + return true; +} + +} // namespace HardwareRNG diff --git a/src/mesh/HardwareRNG.h b/src/mesh/HardwareRNG.h new file mode 100644 index 000000000..2dacb6c23 --- /dev/null +++ b/src/mesh/HardwareRNG.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include + +namespace HardwareRNG +{ + +/** + * Fill the provided buffer with random bytes sourced from the most + * appropriate hardware-backed RNG available on the current platform. + * + * @param buffer Destination buffer for random bytes + * @param length Number of bytes to write + * @param useRadioEntropy If true, attempt to mix radio entropy into the output as well. + * @return true if the buffer was fully populated with entropy, false on failure + */ +bool fill(uint8_t *buffer, size_t length, bool useRadioEntropy = false); + +/** + * Populate a 32-bit seed value with hardware-backed randomness where possible. + * + * @param seedOut Destination for the generated seed value + * @return true if a seed was produced from a reliable entropy source + */ +bool seed(uint32_t &seedOut); + +} // namespace HardwareRNG diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 30cd587da..7ef707e0d 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -246,6 +246,24 @@ bool RadioLibInterface::findInTxQueue(NodeNum from, PacketId id) return txQueue.find(from, id); } +bool RadioLibInterface::randomBytes(uint8_t *buffer, size_t length) +{ + if (!buffer || length == 0 || !iface) { + return false; + } + + // Older RadioLib versions only expose random(min, max), so fill the buffer byte-by-byte. + for (size_t i = 0; i < length; ++i) { + int32_t value = iface->random(0, 255); + if (value < 0) { + return false; + } + buffer[i] = static_cast(value & 0xFF); + } + + return true; +} + /** radio helper thread callback. We never immediately transmit after any operation (either Rx or Tx). Instead we should wait a random multiple of 'slotTimes' (see definition in RadioInterface.h) taken from a contention window (CW) to lower the chance of collision. @@ -587,4 +605,4 @@ bool RadioLibInterface::startSend(meshtastic_MeshPacket *txp) return res == RADIOLIB_ERR_NONE; } -} \ No newline at end of file +} diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index ca3d78503..310ca76bb 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -172,6 +172,12 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified /** Attempt to find a packet in the TxQueue. Returns true if the packet was found. */ virtual bool findInTxQueue(NodeNum from, PacketId id) override; + /** + * Request randomness sourced from the LoRa modem, if supported by the active RadioLib interface. + * @return true if len bytes were produced, false otherwise. + */ + bool randomBytes(uint8_t *buffer, size_t length); + private: /** if we have something waiting to send, start a short (random) timer so we can come check for collision before actually * doing the transmit */ diff --git a/src/platform/nrf52/main-nrf52.cpp b/src/platform/nrf52/main-nrf52.cpp index 73780b6eb..5cf3a4465 100644 --- a/src/platform/nrf52/main-nrf52.cpp +++ b/src/platform/nrf52/main-nrf52.cpp @@ -17,6 +17,7 @@ #include #include // #include +#include "HardwareRNG.h" #include "NodeDB.h" #include "PowerMon.h" #include "error.h" @@ -398,15 +399,14 @@ void nrf52Setup() #endif // Init random seed - union seedParts { - uint32_t seed32; - uint8_t seed8[4]; - } seed; - nRFCrypto.begin(); - nRFCrypto.Random.generate(seed.seed8, sizeof(seed.seed8)); - LOG_DEBUG("Set random seed %u", seed.seed32); - randomSeed(seed.seed32); - nRFCrypto.end(); + uint32_t seed = 0; + if (!HardwareRNG::seed(seed)) { + LOG_WARN("Hardware RNG seed unavailable, using PRNG fallback"); + // Use a hardware timer value as a fallback seed for better entropy + seed = micros(); + } + LOG_DEBUG("Set random seed %u", seed); + randomSeed(seed); // Set up nrfx watchdog. Do not enable the watchdog yet (we do that // the first time through the main loop), so that other threads can diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 4bbdbee7a..9e0a1b2a5 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -1,4 +1,5 @@ #include "CryptoEngine.h" +#include "HardwareRNG.h" #include "PortduinoGPIO.h" #include "SPIChip.h" #include "mesh/RF95Interface.h" @@ -233,7 +234,9 @@ void portduinoSetup() std::cout << "Running in simulated mode." << std::endl; portduino_config.MaxNodes = 200; // Default to 200 nodes // Set the random seed equal to TCPPort to have a different seed per instance - randomSeed(TCPPort); + uint32_t seed = TCPPort; + HardwareRNG::seed(seed); + randomSeed(seed); return; } @@ -512,7 +515,9 @@ void portduinoSetup() #endif printf("MAC ADDRESS: %02X:%02X:%02X:%02X:%02X:%02X\n", dmac[0], dmac[1], dmac[2], dmac[3], dmac[4], dmac[5]); // Rather important to set this, if not running simulated. - randomSeed(time(NULL)); + uint32_t seed = static_cast(time(NULL)); + HardwareRNG::seed(seed); + randomSeed(seed); std::string defaultGpioChipName = gpioChipName + std::to_string(portduino_config.lora_default_gpiochip); diff --git a/src/platform/rp2xx0/main-rp2xx0.cpp b/src/platform/rp2xx0/main-rp2xx0.cpp index 6c73e385a..e59b0a9cd 100644 --- a/src/platform/rp2xx0/main-rp2xx0.cpp +++ b/src/platform/rp2xx0/main-rp2xx0.cpp @@ -1,3 +1,4 @@ +#include "HardwareRNG.h" #include "configuration.h" #include "hardware/xosc.h" #include @@ -98,10 +99,12 @@ void getMacAddr(uint8_t *dmac) void rp2040Setup() { - /* Sets a random seed to make sure we get different random numbers on each boot. - Taken from CPU cycle counter and ROSC oscillator, so should be pretty random. - */ - randomSeed(rp2040.hwrand32()); + /* Sets a random seed to make sure we get different random numbers on each boot. */ + uint32_t seed = 0; + if (!HardwareRNG::seed(seed)) { + seed = rp2040.hwrand32(); + } + randomSeed(seed); #ifdef RP2040_SLOW_CLOCK uint f_pll_sys = frequency_count_khz(CLOCKS_FC0_SRC_VALUE_PLL_SYS_CLKSRC_PRIMARY); From f5be09c123f886aabe0547082049ea053b1f5f1c Mon Sep 17 00:00:00 2001 From: Ruledo Date: Thu, 16 Apr 2026 08:41:06 -0700 Subject: [PATCH 087/150] Add Luckfox Pico Max Waveshare Pico LoRa config (#10175) Add a meshtasticd config for the Luckfox Pico Max with the Waveshare Pico LoRa SX1262 TCXO HAT. Tested on hardware with successful SX1262 init, broadcast, and direct messaging. --- ...fox-pico-max-ws-raspberry-pi-pico-hat.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bin/config.d/lora-luckfox-pico-max-ws-raspberry-pi-pico-hat.yaml diff --git a/bin/config.d/lora-luckfox-pico-max-ws-raspberry-pi-pico-hat.yaml b/bin/config.d/lora-luckfox-pico-max-ws-raspberry-pi-pico-hat.yaml new file mode 100644 index 000000000..e0cc6197b --- /dev/null +++ b/bin/config.d/lora-luckfox-pico-max-ws-raspberry-pi-pico-hat.yaml @@ -0,0 +1,31 @@ +# For use with Armbian luckfox-pico-max +# Waveshare LoRa HAT for Raspberry Pi Pico +# https://www.waveshare.com/wiki/Pico-LoRa-SX1262 + +Meta: + name: luckfox-pico-max-ws-raspberry-pi-pico-hat + support: community + compatible: + - luckfox-pico-max # Armbian + +Lora: + Module: sx1262 + DIO2_AS_RF_SWITCH: true + DIO3_TCXO_VOLTAGE: true + spidev: spidev0.0 + Busy: # GPIO1_C7 / GP2 + pin: 55 + gpiochip: 1 + line: 23 + CS: # GPIO1_C6 / GP3 + pin: 54 + gpiochip: 1 + line: 22 + Reset: # GPIO1_D1 / GP15 + pin: 57 + gpiochip: 1 + line: 25 + IRQ: # GPIO2_A2 / GP20 + pin: 66 + gpiochip: 2 + line: 2 From 25febfdeee26f1d3e53337c54d853ecb158de31e Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 16 Apr 2026 13:12:31 -0500 Subject: [PATCH 088/150] More cleanly remove LED_BUILTIN (#10179) * Test PR to remove LED_BUILTIN Comment out the LED_BUILTIN definition in platformio.ini * Add LED_BUILTIN definition to nrf52840.ini --- platformio.ini | 2 +- variants/nrf52840/nrf52840.ini | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4d66cf538..529dbacab 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,7 @@ build_flags = -Wno-missing-field-initializers -DMESHTASTIC_EXCLUDE_POWERMON=1 -DMESHTASTIC_EXCLUDE_STATUS=1 -D MAX_THREADS=40 ; As we've split modules, we have more threads to manage - -DLED_BUILTIN=-1 + #-DLED_BUILTIN=-1 #-DBUILD_EPOCH=$UNIX_TIME ; set in platformio-custom.py now #-D OLED_PL=1 #-D DEBUG_HEAP=1 ; uncomment to add free heap space / memory leak debugging logs diff --git a/variants/nrf52840/nrf52840.ini b/variants/nrf52840/nrf52840.ini index 09b2ef97d..c5590cbc3 100644 --- a/variants/nrf52840/nrf52840.ini +++ b/variants/nrf52840/nrf52840.ini @@ -4,6 +4,7 @@ extends = nrf52_base build_flags = ${nrf52_base.build_flags} -DSERIAL_BUFFER_SIZE=4096 + -DLED_BUILTIN=-1 lib_deps = ${nrf52_base.lib_deps} @@ -79,4 +80,4 @@ debug_speed = 4000 ; The following is not needed because it automatically tries do this ;debug_server_ready_pattern = -.*GDB server started on port \d+.* -;debug_port = localhost:3333 \ No newline at end of file +;debug_port = localhost:3333 From d8e4389da2bbfc5df6bc3c355d48adbe7209c95d Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 16 Apr 2026 21:34:28 -0500 Subject: [PATCH 089/150] No longer need undefines, thanks to #10179 (#10180) --- platformio.ini | 1 - variants/esp32/chatter2/platformio.ini | 1 - variants/esp32/diy/9m2ibr_aprs_lora_tracker/platformio.ini | 1 - variants/esp32/diy/hydra/platformio.ini | 1 - variants/esp32/diy/v1/platformio.ini | 1 - variants/esp32/heltec_v2.1/platformio.ini | 1 - variants/esp32/heltec_v2/platformio.ini | 1 - variants/esp32/nano-g1-explorer/platformio.ini | 1 - variants/esp32/nano-g1/platformio.ini | 1 - variants/esp32/radiomaster_900_bandit/platformio.ini | 1 - variants/esp32/radiomaster_900_bandit_micro/platformio.ini | 1 - variants/esp32/radiomaster_900_bandit_nano/platformio.ini | 1 - variants/esp32/station-g1/platformio.ini | 1 - variants/esp32/tbeam/platformio.ini | 1 - variants/esp32/tlora_v1/platformio.ini | 1 - variants/esp32/tlora_v2_1_16/platformio.ini | 2 +- variants/esp32/tlora_v2_1_16_tcxo/platformio.ini | 1 - variants/esp32/tlora_v3_3_0_tcxo/platformio.ini | 1 - variants/esp32c6/tlora_c6/platformio.ini | 1 - variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini | 1 - variants/esp32s3/heltec_sensor_hub/platformio.ini | 1 - variants/esp32s3/heltec_v3/platformio.ini | 1 - variants/esp32s3/heltec_v4/platformio.ini | 1 - variants/esp32s3/heltec_wsl_v3/platformio.ini | 1 - variants/rp2040/rpipicow/platformio.ini | 1 - 25 files changed, 1 insertion(+), 25 deletions(-) diff --git a/platformio.ini b/platformio.ini index 529dbacab..cd22fab6e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -58,7 +58,6 @@ build_flags = -Wno-missing-field-initializers -DMESHTASTIC_EXCLUDE_POWERMON=1 -DMESHTASTIC_EXCLUDE_STATUS=1 -D MAX_THREADS=40 ; As we've split modules, we have more threads to manage - #-DLED_BUILTIN=-1 #-DBUILD_EPOCH=$UNIX_TIME ; set in platformio-custom.py now #-D OLED_PL=1 #-D DEBUG_HEAP=1 ; uncomment to add free heap space / memory leak debugging logs diff --git a/variants/esp32/chatter2/platformio.ini b/variants/esp32/chatter2/platformio.ini index 62d23b1e6..a14e407a1 100644 --- a/variants/esp32/chatter2/platformio.ini +++ b/variants/esp32/chatter2/platformio.ini @@ -8,7 +8,6 @@ build_flags = -I variants/esp32/chatter2 -DMESHTASTIC_EXCLUDE_WEBSERVER=1 -DMESHTASTIC_EXCLUDE_PAXCOUNTER=1 - -ULED_BUILTIN lib_deps = ${esp32_base.lib_deps} diff --git a/variants/esp32/diy/9m2ibr_aprs_lora_tracker/platformio.ini b/variants/esp32/diy/9m2ibr_aprs_lora_tracker/platformio.ini index 3fdb738fc..2ddc5a2db 100644 --- a/variants/esp32/diy/9m2ibr_aprs_lora_tracker/platformio.ini +++ b/variants/esp32/diy/9m2ibr_aprs_lora_tracker/platformio.ini @@ -10,7 +10,6 @@ build_flags = -D EBYTE_E22 -D EBYTE_E22_900M30S ; Assume Tx power curve is identical to 900M30S as there is no documentation -I variants/esp32/diy/9m2ibr_aprs_lora_tracker - -ULED_BUILTIN build_src_filter = ${esp32_base.build_src_filter} +<../variants/esp32/diy/9m2ibr_aprs_lora_tracker> \ No newline at end of file diff --git a/variants/esp32/diy/hydra/platformio.ini b/variants/esp32/diy/hydra/platformio.ini index f23224f0b..3afd17e01 100644 --- a/variants/esp32/diy/hydra/platformio.ini +++ b/variants/esp32/diy/hydra/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D DIY_V1 -I variants/esp32/diy/hydra - -ULED_BUILTIN diff --git a/variants/esp32/diy/v1/platformio.ini b/variants/esp32/diy/v1/platformio.ini index 6be2bfd09..3d31fc24a 100644 --- a/variants/esp32/diy/v1/platformio.ini +++ b/variants/esp32/diy/v1/platformio.ini @@ -17,4 +17,3 @@ build_flags = -D DIY_V1 -D EBYTE_E22 -I variants/esp32/diy/v1 - -ULED_BUILTIN diff --git a/variants/esp32/heltec_v2.1/platformio.ini b/variants/esp32/heltec_v2.1/platformio.ini index 9fcb2388a..1f7caa16f 100644 --- a/variants/esp32/heltec_v2.1/platformio.ini +++ b/variants/esp32/heltec_v2.1/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D HELTEC_V2_1 -I variants/esp32/heltec_v2.1 - -ULED_BUILTIN diff --git a/variants/esp32/heltec_v2/platformio.ini b/variants/esp32/heltec_v2/platformio.ini index fc9e05115..5f15fb321 100644 --- a/variants/esp32/heltec_v2/platformio.ini +++ b/variants/esp32/heltec_v2/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D HELTEC_V2_0 -I variants/esp32/heltec_v2 - -ULED_BUILTIN diff --git a/variants/esp32/nano-g1-explorer/platformio.ini b/variants/esp32/nano-g1-explorer/platformio.ini index b27ebf28e..6f57897a8 100644 --- a/variants/esp32/nano-g1-explorer/platformio.ini +++ b/variants/esp32/nano-g1-explorer/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D NANO_G1_EXPLORER -I variants/esp32/nano-g1-explorer - -ULED_BUILTIN diff --git a/variants/esp32/nano-g1/platformio.ini b/variants/esp32/nano-g1/platformio.ini index b2e392dbd..82d0f5e73 100644 --- a/variants/esp32/nano-g1/platformio.ini +++ b/variants/esp32/nano-g1/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D NANO_G1 -I variants/esp32/nano-g1 - -ULED_BUILTIN diff --git a/variants/esp32/radiomaster_900_bandit/platformio.ini b/variants/esp32/radiomaster_900_bandit/platformio.ini index 0012f49d3..6729235ed 100644 --- a/variants/esp32/radiomaster_900_bandit/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit/platformio.ini @@ -9,7 +9,6 @@ build_flags = -DHAS_STK8XXX=1 -O2 -I variants/esp32/radiomaster_900_bandit - -ULED_BUILTIN board_build.f_cpu = 240000000L upload_protocol = esptool lib_deps = diff --git a/variants/esp32/radiomaster_900_bandit_micro/platformio.ini b/variants/esp32/radiomaster_900_bandit_micro/platformio.ini index e58d06f1e..32e9280e1 100644 --- a/variants/esp32/radiomaster_900_bandit_micro/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit_micro/platformio.ini @@ -13,6 +13,5 @@ build_flags = -DCONFIG_DISABLE_HAL_LOCKS=1 -O2 -I variants/esp32/radiomaster_900_bandit_nano - -ULED_BUILTIN board_build.f_cpu = 240000000L upload_protocol = esptool diff --git a/variants/esp32/radiomaster_900_bandit_nano/platformio.ini b/variants/esp32/radiomaster_900_bandit_nano/platformio.ini index 7b3d187bf..924447ee4 100644 --- a/variants/esp32/radiomaster_900_bandit_nano/platformio.ini +++ b/variants/esp32/radiomaster_900_bandit_nano/platformio.ini @@ -16,6 +16,5 @@ build_flags = -DCONFIG_DISABLE_HAL_LOCKS=1 -O2 -I variants/esp32/radiomaster_900_bandit_nano - -ULED_BUILTIN board_build.f_cpu = 240000000L upload_protocol = esptool diff --git a/variants/esp32/station-g1/platformio.ini b/variants/esp32/station-g1/platformio.ini index 5a7f33485..20e29764c 100644 --- a/variants/esp32/station-g1/platformio.ini +++ b/variants/esp32/station-g1/platformio.ini @@ -14,4 +14,3 @@ build_flags = ${esp32_base.build_flags} -D STATION_G1 -I variants/esp32/station-g1 - -ULED_BUILTIN diff --git a/variants/esp32/tbeam/platformio.ini b/variants/esp32/tbeam/platformio.ini index c9e6cce1f..96e9879ce 100644 --- a/variants/esp32/tbeam/platformio.ini +++ b/variants/esp32/tbeam/platformio.ini @@ -16,7 +16,6 @@ board_check = true build_flags = ${esp32_base.build_flags} -D TBEAM_V10 -I variants/esp32/tbeam - -ULED_BUILTIN upload_speed = 921600 [env:tbeam-displayshield] diff --git a/variants/esp32/tlora_v1/platformio.ini b/variants/esp32/tlora_v1/platformio.ini index 5f72d634e..c45cc2ce9 100644 --- a/variants/esp32/tlora_v1/platformio.ini +++ b/variants/esp32/tlora_v1/platformio.ini @@ -13,5 +13,4 @@ build_flags = ${esp32_base.build_flags} -D TLORA_V1 -I variants/esp32/tlora_v1 - -ULED_BUILTIN upload_speed = 115200 diff --git a/variants/esp32/tlora_v2_1_16/platformio.ini b/variants/esp32/tlora_v2_1_16/platformio.ini index 2ea9bbb50..a41c5016e 100644 --- a/variants/esp32/tlora_v2_1_16/platformio.ini +++ b/variants/esp32/tlora_v2_1_16/platformio.ini @@ -12,7 +12,7 @@ extends = esp32_base board = ttgo-lora32-v21 board_check = true build_flags = - ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16 -ULED_BUILTIN + ${esp32_base.build_flags} -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16 upload_speed = 115200 [env:sugarcube] diff --git a/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini b/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini index 235ac7007..3cb64c976 100644 --- a/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini +++ b/variants/esp32/tlora_v2_1_16_tcxo/platformio.ini @@ -7,5 +7,4 @@ build_flags = -D TLORA_V2_1_16 -I variants/esp32/tlora_v2_1_16 -D LORA_TCXO_GPIO=33 - -ULED_BUILTIN upload_speed = 115200 diff --git a/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini b/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini index 38f14ffc5..d3669ce55 100644 --- a/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini +++ b/variants/esp32/tlora_v3_3_0_tcxo/platformio.ini @@ -7,4 +7,3 @@ build_flags = -I variants/esp32/tlora_v2_1_16 -D LORA_TCXO_GPIO=12 -D BUTTON_PIN=0 - -ULED_BUILTIN \ No newline at end of file diff --git a/variants/esp32c6/tlora_c6/platformio.ini b/variants/esp32c6/tlora_c6/platformio.ini index 174e5e297..6b402d7c5 100644 --- a/variants/esp32c6/tlora_c6/platformio.ini +++ b/variants/esp32c6/tlora_c6/platformio.ini @@ -8,4 +8,3 @@ build_flags = -I variants/esp32c6/tlora_c6 -DARDUINO_USB_CDC_ON_BOOT=1 -DARDUINO_USB_MODE=1 - -ULED_BUILTIN diff --git a/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini b/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini index 6dd828433..0bb21581a 100644 --- a/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini +++ b/variants/esp32s3/heltec_capsule_sensor_v3/platformio.ini @@ -6,5 +6,4 @@ board_build.partitions = default_8MB.csv build_flags = ${esp32s3_base.build_flags} -I variants/esp32s3/heltec_capsule_sensor_v3 -D HELTEC_CAPSULE_SENSOR_V3 - -ULED_BUILTIN ;-D DEBUG_DISABLED ; uncomment this line to disable DEBUG output diff --git a/variants/esp32s3/heltec_sensor_hub/platformio.ini b/variants/esp32s3/heltec_sensor_hub/platformio.ini index 9a5384ccd..ab99e51ed 100644 --- a/variants/esp32s3/heltec_sensor_hub/platformio.ini +++ b/variants/esp32s3/heltec_sensor_hub/platformio.ini @@ -7,4 +7,3 @@ build_flags = ${esp32s3_base.build_flags} -I variants/esp32s3/heltec_sensor_hub -D HELTEC_SENSOR_HUB - -ULED_BUILTIN diff --git a/variants/esp32s3/heltec_v3/platformio.ini b/variants/esp32s3/heltec_v3/platformio.ini index fe31df094..2f53c8756 100644 --- a/variants/esp32s3/heltec_v3/platformio.ini +++ b/variants/esp32s3/heltec_v3/platformio.ini @@ -18,4 +18,3 @@ build_flags = ${esp32s3_base.build_flags} -D HELTEC_V3 -I variants/esp32s3/heltec_v3 - -ULED_BUILTIN diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 0336bf983..5a5004a45 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -8,7 +8,6 @@ build_flags = -D HELTEC_V4 -D HAS_LORA_FEM=1 -I variants/esp32s3/heltec_v4 - -ULED_BUILTIN [env:heltec-v4] diff --git a/variants/esp32s3/heltec_wsl_v3/platformio.ini b/variants/esp32s3/heltec_wsl_v3/platformio.ini index 873300c3c..0903a6bc7 100644 --- a/variants/esp32s3/heltec_wsl_v3/platformio.ini +++ b/variants/esp32s3/heltec_wsl_v3/platformio.ini @@ -17,4 +17,3 @@ build_flags = ${esp32s3_base.build_flags} -D HELTEC_WSL_V3 -I variants/esp32s3/heltec_wsl_v3 - -ULED_BUILTIN diff --git a/variants/rp2040/rpipicow/platformio.ini b/variants/rp2040/rpipicow/platformio.ini index 9b4b29a5b..99e02a1aa 100644 --- a/variants/rp2040/rpipicow/platformio.ini +++ b/variants/rp2040/rpipicow/platformio.ini @@ -22,7 +22,6 @@ build_flags = -D HW_SPI1_DEVICE -D HAS_UDP_MULTICAST=1 -fexceptions # for exception handling in MQTT - -ULED_BUILTIN build_src_filter = ${rp2040_base.build_src_filter} + lib_deps = ${rp2040_base.lib_deps} From a8a531546034d95c652b6f6558f4fe38208b5802 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 17:14:12 +0200 Subject: [PATCH 090/150] Upgrade trunk (#10221) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 7a8ca0203..91f3c06fc 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.524 - - renovate@43.132.1 + - renovate@43.136.3 - prettier@3.8.3 - trufflehog@3.94.3 - yamllint@1.38.0 From 5f836cdf3bf28ce08560ea1f1d495ccbac77e060 Mon Sep 17 00:00:00 2001 From: Jennifer Sanchez <67692052+derpyspike@users.noreply.github.com> Date: Tue, 14 Apr 2026 20:11:36 +0200 Subject: [PATCH 091/150] Added support for Spreading Factors 5 and 6 on compatible radios (#10160) --- src/mesh/MeshRadio.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mesh/MeshRadio.h b/src/mesh/MeshRadio.h index 07d956878..646ca86eb 100644 --- a/src/mesh/MeshRadio.h +++ b/src/mesh/MeshRadio.h @@ -4,6 +4,7 @@ #include "MeshTypes.h" #include "PointerQueue.h" #include "configuration.h" +#include "detect/LoRaRadioType.h" // Map from old region names to new region enums struct RegionInfo { @@ -25,7 +26,7 @@ extern const RegionInfo *myRegion; extern void initRegion(); // Valid LoRa spread factor range and defaults -constexpr uint8_t LORA_SF_MIN = 7; +constexpr uint8_t LORA_SF_MIN = 5; constexpr uint8_t LORA_SF_MAX = 12; constexpr uint8_t LORA_SF_DEFAULT = 11; // LONG_FAST default @@ -37,10 +38,14 @@ constexpr uint8_t LORA_CR_DEFAULT = 5; // LONG_FAST default // Default bandwidth in kHz (LONG_FAST) constexpr float LORA_BW_DEFAULT_KHZ = 250.0f; -/// Clamp spread factor to the valid LoRa range [7, 12]. +/// Clamp spread factor to the valid LoRa range [5, 12]. /// Out-of-range values (including 0 from unset preset mode) return LORA_SF_DEFAULT. static inline uint8_t clampSpreadFactor(uint8_t sf) { + // We check for RF95 radios that are incompatible with Spreading Factors 5 and 6. + if (radioType == RF95_RADIO && (sf == 5 || sf == 6)) + return LORA_SF_DEFAULT; + if (sf < LORA_SF_MIN || sf > LORA_SF_MAX) return LORA_SF_DEFAULT; return sf; From d7ba178bf11c5fa1632ee066b7b3e1f64982df31 Mon Sep 17 00:00:00 2001 From: Clive Blackledge Date: Sat, 18 Apr 2026 06:29:30 -0700 Subject: [PATCH 092/150] Fix: prompt markdownlint md040 fix for new prompts. (#10199) * Add ESP32 Power Management lessons learned document Documents our experimentation with ESP-IDF DFS and why it doesn't work well for Meshtastic (RTOS locks, BLE locks, USB issues). Proposes simpler alternative: manual setCpuFrequencyMhz() control with explicit triggers for when to go fast vs slow. * docs(prompts): fix markdown fence language tags * docs: remove ESP32 power management notes --- .github/prompts/new-module.prompt.md | 2 +- .github/prompts/new-variant.prompt.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/prompts/new-module.prompt.md b/.github/prompts/new-module.prompt.md index 8569a622c..08b239597 100644 --- a/.github/prompts/new-module.prompt.md +++ b/.github/prompts/new-module.prompt.md @@ -118,7 +118,7 @@ CallbackObserver statusObserver = Add test suite in `test/test_mymodule/`: -``` +```text test/ └── test_mymodule/ └── test_main.cpp diff --git a/.github/prompts/new-variant.prompt.md b/.github/prompts/new-variant.prompt.md index 1a324cea9..666e264e0 100644 --- a/.github/prompts/new-variant.prompt.md +++ b/.github/prompts/new-variant.prompt.md @@ -6,7 +6,7 @@ Guide for adding a new Meshtastic hardware variant to the firmware. Create under `variants///`: -``` +```text variants/ ├── esp32/ # ESP32 ├── esp32s3/ # ESP32-S3 From 76dea7792913b1bb2a46ee05e4561ffa4fe90290 Mon Sep 17 00:00:00 2001 From: Tom <116762865+NomDeTom@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:30:50 +0100 Subject: [PATCH 093/150] Add authoring guide for native unit tests in README.md (#10201) * Add authoring guide for native unit tests in README.md * Enhance documentation for agent tooling and native unit tests in README and related files --------- Co-authored-by: Ben Meadors --- .github/copilot-instructions.md | 19 ++ test/README.md | 322 ++++++++++++++++++++++++++++++++ 2 files changed, 341 insertions(+) create mode 100644 test/README.md diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 7c71a5014..89e1c5c11 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -296,6 +296,23 @@ Key defines in variant.h: ## Build System +## Agent Tooling Baseline + +Mirror counterpart: `AGENTS.md` under **Agent Tooling Baseline**. + +To reduce avoidable agent mistakes, assume these tools are available (or install them before significant repo work): + +- **Required CLI basics**: `bash`, `git`, `find`, `grep`, `sed`, `awk`, `xargs` +- **Strongly recommended**: `rg` (ripgrep) for fast file/text search, `jq` for JSON processing +- **Build/test tools**: `python3`, `pip`, virtualenv (`python3 -m venv`), `platformio` (`pio`) +- **Containerized native testing**: `docker` (especially important on macOS / non-Linux hosts) + +Fallback expectations for agents: + +- If `rg` is unavailable, use `find` + `grep` instead of failing. +- For native tests on hosts without Linux deps, prefer `./bin/test-native-docker.sh`. +- The simulator helper script is `./bin/test-simulator.sh`. + Uses **PlatformIO** with custom scripts: - `bin/platformio-pre.py` - Pre-build script @@ -448,6 +465,8 @@ Run with: `pio test -e native` Simulation testing: `bin/test-simulator.sh` +Quick entry point for new test modules: `test/README.md` (native unit-test authoring guide, skeleton, pitfalls, and setup checklist). + ### Hardware-in-the-loop tests (`mcp-server/tests/`) Separate pytest suite that exercises real USB-connected Meshtastic devices. See the **MCP Server & Hardware Test Harness** section below for invocation, tier layout, and agent usage rules. diff --git a/test/README.md b/test/README.md new file mode 100644 index 000000000..55dbd4775 --- /dev/null +++ b/test/README.md @@ -0,0 +1,322 @@ +# Native Unit Tests — Authoring Guide + +This directory contains C++ unit tests that run on the host machine via PlatformIO's native environment. Tests use the [Unity](http://www.throwtheswitch.org/unity) framework. + +## Running Tests + +```bash +# All test suites +pio test -e native + +# Single suite +pio test -e native -f test_your_module + +# Verbose (shows build errors in detail) +pio test -e native -f test_your_module -vvv +``` + +### Helper Scripts (Useful Shortcuts) + +These wrappers are handy when local host dependencies are missing or when you want repeatable commands. + +```bash +# Run native tests in Docker (recommended on macOS / non-Linux hosts) +./bin/test-native-docker.sh + +# Pass normal PlatformIO test args through to Dockerized test run +./bin/test-native-docker.sh -f test_your_module + +# Force Docker image rebuild (after dependency changes) +./bin/test-native-docker.sh --rebuild + +# Run simulator integration check (build native first) +pio run -e native && ./bin/test-simulator.sh + +# Build and run meshtasticd natively +./bin/native-run.sh + +# Build and run under gdbserver on localhost:2345 +./bin/native-gdbserver.sh + +# Build native release artifact into ./release/ +./bin/build-native.sh native +``` + +Notes: + +- The repository script name is `./bin/test-simulator.sh` (there is no `test-native-simulator.sh`). +- `./bin/test-native-docker.sh` is the closest match to CI behavior for native tests and avoids host package setup. + +### System Dependencies (Ubuntu/Debian) + +The native build requires several system libraries. Install them all at once: + +```bash +sudo apt-get install -y \ + libbluetooth-dev libgpiod-dev libyaml-cpp-dev openssl libssl-dev \ + libulfius-dev liborcania-dev libusb-1.0-0-dev libi2c-dev libuv1-dev +``` + +See `.github/actions/setup-native/action.yml` for the canonical list. + +## Creating a New Test Suite + +### 1. Directory Structure + +```text +test/test_your_module/test_main.cpp +``` + +One file per suite. No per-test `platformio.ini` is needed — tests build under the `[env:native]` environment defined in the root `platformio.ini`. + +### 2. File Skeleton + +```cpp +#include "MeshTypes.h" // Include BEFORE TestUtil.h (provides NodeNum, etc.) +#include "TestUtil.h" // initializeTestEnvironment(), testDelay() +#include + +#if YOUR_FEATURE_GUARD // Same #if guard as the module under test + +#include "FSCommon.h" +#include "gps/RTC.h" +#include "mesh/NodeDB.h" +#include "modules/YourModule.h" +#include +#include +#include + +// --- Test output helpers --- +// Unity swallows printf/stdout. Only TEST_MESSAGE() output appears in results. +#define MSG_BUF_LEN 200 +#define TEST_MSG_FMT(fmt, ...) do { \ + char _buf[MSG_BUF_LEN]; \ + snprintf(_buf, sizeof(_buf), fmt, __VA_ARGS__); \ + TEST_MESSAGE(_buf); \ +} while(0) + +// --- Tests --- + +void test_example() +{ + TEST_MESSAGE("=== Example test ==="); + TEST_ASSERT_TRUE(true); +} + +// --- Unity lifecycle --- + +void setUp(void) { /* runs before every test */ } +void tearDown(void) { /* runs after every test */ } + +void setup() +{ + initializeTestEnvironment(); // MUST call — sets up RTC, OSThread, console + UNITY_BEGIN(); + RUN_TEST(test_example); + exit(UNITY_END()); // exit() required — Unity runner expects it +} + +void loop() {} + +#else // !YOUR_FEATURE_GUARD + +void setUp(void) {} +void tearDown(void) {} + +void setup() +{ + initializeTestEnvironment(); + UNITY_BEGIN(); + exit(UNITY_END()); +} + +void loop() {} + +#endif +``` + +### 3. Feature Guard + +Wrap the entire test body in the same `#if` guard the module uses (e.g. `#if HAS_VARIABLE_HOPS`, `#if !MESHTASTIC_EXCLUDE_GPS`). When the feature is disabled, the `#else` branch produces an empty passing suite. + +## Common Patterns + +### MockNodeDB + +Most module tests need to inject nodes with controlled hop distances and ages: + +```cpp +class MockNodeDB : public NodeDB +{ + public: + void clearTestNodes() + { + testNodes.clear(); + numMeshNodes = 0; + } + + void addTestNode(NodeNum num, uint8_t hopsAway, bool hasHops, + uint32_t ageSecs, bool viaMqtt = false) + { + meshtastic_NodeInfoLite node = meshtastic_NodeInfoLite_init_zero; + node.num = num; + node.has_hops_away = hasHops; + node.hops_away = hopsAway; + node.via_mqtt = viaMqtt; + node.last_heard = getTime() - ageSecs; + testNodes.push_back(node); + meshNodes = &testNodes; + numMeshNodes = testNodes.size(); + } + + std::vector testNodes; +}; + +static MockNodeDB *mockNodeDB = nullptr; +``` + +Set `nodeDB = mockNodeDB;` in `setUp()`. + +### Test Shim (Exposing Protected/Private Members) + +Subclass the module under test to make protected methods callable and private members writable: + +```cpp +class YourModuleTestShim : public YourModule +{ + public: + // Expose protected methods + using YourModule::runOnce; + using YourModule::someProtectedMethod; + + // Access private members via friend (see below) + void setPrivateField(int x) { privateField = x; } +}; +``` + +In the module header, grant friend access under the `UNIT_TEST` define (set automatically by PlatformIO's test framework): + +```cpp +// In YourModule.h, inside the class body: +#ifdef UNIT_TEST + friend class YourModuleTestShim; +#endif +``` + +### Global Singleton Lifecycle + +Most modules use a global pointer (`extern YourModule *yourModule;`). Manage it carefully: + +```cpp +void setUp(void) { + // ... setup ... +} + +void tearDown(void) { + yourModule = nullptr; // prevent dangling pointer between tests +} + +void test_something() { + auto shim = std::unique_ptr(new YourModuleTestShim()); + yourModule = shim.get(); + // ... test ... + yourModule = nullptr; +} +``` + +## Pitfalls and How to Avoid Them + +### 1. Persisted Filesystem State Leaks Between Tests + +Modules that save state to `/prefs/*.bin` will have that state loaded by the next test's constructor via `loadState()`. This causes values from one test (e.g. rolling averages from a megamesh scenario) to bleed into unrelated tests. + +**Fix:** Delete state files at the start of `setUp()`: + +```cpp +void setUp(void) { + // ... +#ifdef FSCom + FSCom.remove("/prefs/your_module.bin"); +#endif +} +``` + +### 2. File-Scope Mutable Globals Persist Across Tests + +Variables like `static uint8_t someDenominator = 8;` in the module `.cpp` file retain mutations from previous tests. This is distinct from member variables — it affects all instances. + +**Fix:** Add a `static void resetGlobal()` method to the module and call it in `setUp()`. + +### 3. Randomness Breaks Determinism + +If the module uses `rand()` for jitter or similar, test results become non-reproducible. + +**Fix:** Add a static enable/disable flag: + +```cpp +// Module header: +static void setJitter(bool enabled) { s_jitterEnabled = enabled; } + +// Test setUp: +YourModule::setJitter(false); + +// Test tearDown: +YourModule::setJitter(true); +``` + +### 4. Time-Dependent Logic Produces Zeros + +Rolling averages weighted by `elapsedMs / ONE_HOUR_MS` collapse to zero when tests complete in microseconds. Sample windows, EMA alphas, and interval-based accumulators all suffer from this. + +**Fix:** Expose the timestamp via friend access and simulate realistic elapsed time: + +```cpp +// In test shim: +void setWindowStartMs(uint32_t ms) { windowStartMs = ms; } + +// In test: +shim.setWindowStartMs(millis() - 3600000UL); // pretend 1 hour elapsed +``` + +### 5. Capacity Limits Cause Cascading Failures + +Fixed-size data structures (hash sets, ring buffers) overflow when tests inject more data than fits. This triggers early flushes with near-zero time fractions, compounding the time-dependent-zeros problem. + +**Fix:** Simulate multiple realistic time windows rather than one massive burst. Let adaptive mechanisms (if any) self-tune over several rolls. + +## setUp/tearDown Checklist + +- [ ] Create and clear MockNodeDB (if needed) +- [ ] Zero global configs: `config`, `moduleConfig`, `myNodeInfo` +- [ ] Set `nodeDB = mockNodeDB` +- [ ] Delete persisted state files (`FSCom.remove(...)`) +- [ ] Reset file-scope mutable globals +- [ ] Disable randomness/jitter flags +- [ ] In `tearDown`: null the global singleton pointer, restore flags + +## Test Organization + +A well-structured test suite follows this pattern: + +1. **Topology/scenario builders** — static helper functions that set up specific test conditions +2. **Injection helpers** — simulate realistic traffic, time, or event patterns +3. **Scenario tests** — each builds a scenario, runs the module, asserts on outcomes +4. **Lifecycle tests** — state persistence, startup from blank, restart recovery +5. **Summary test** (optional) — emits a scenario table into the log for quick CI review + +## Existing Test Suites + +| Suite | Module Under Test | +| ---------------------------- | ----------------------------- | +| `test_crypto` | CryptoEngine | +| `test_mqtt` | MQTT integration | +| `test_radio` | Radio interface | +| `test_mesh_module` | Module framework | +| `test_meshpacket_serializer` | Packet serialization | +| `test_transmit_history` | Retransmission tracking | +| `test_atak` | ATAK integration | +| `test_default` | Default configuration helpers | +| `test_http_content_handler` | HTTP handling | +| `test_serial` | Serial communication | +| `test_hop_scaling` | Hop scaling algorithm | +| `test_traffic_management` | Traffic management | From 68383c8bd5ae90946e337bd23bde183ddcdce9d1 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 19 Apr 2026 16:05:28 -0500 Subject: [PATCH 094/150] Add encryption overview to agent instructions in AGENTS.md (#10207) * Add encryption overview to agent instructions in AGENTS.md * Update AGENTS.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Clarify nonce and wire overhead details in encryption section of copilot instructions * Enhance encryption documentation in copilot instructions and agents guide for clarity on key management and reset behaviors * Update .github/copilot-instructions.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix botched merge conflict resolution --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 66 ++++++++++++++++++++++++++++++++- AGENTS.md | 9 +++++ src/detect/ScanI2C.h | 1 + 3 files changed, 75 insertions(+), 1 deletion(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 89e1c5c11..2d7457102 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -70,6 +70,70 @@ PKI (Public Key Infrastructure) messages have special handling: - Accepted on a special "PKI" channel - Allow encrypted DMs between nodes that discovered each other on downlink-enabled channels +## Encryption & Key Management + +Meshtastic packets on the air are typically encrypted one of two ways: the **per-channel symmetric** layer (AES-CTR with a shared PSK) for broadcasts and channel traffic, and the **per-peer PKI** layer (X25519 ECDH → AES-256-CCM) for direct messages and remote admin. A channel with a 0-byte PSK (or Ham mode, which wipes PSKs) transmits cleartext — see the size table below. Both are implemented in `src/mesh/CryptoEngine.cpp`; the send/receive dispatch lives in `src/mesh/Router.cpp`; admin authorization lives in `src/modules/AdminModule.cpp`. + +### High-level model + +- **Channels** are symmetric rooms: anyone with the PSK can read any message on the channel. Channel 0 is the "primary" channel and ships with the short-form default PSK on factory devices, forming the public mesh most users join. (The LoRa modem preset `LONG_FAST` lives on `config.lora.modem_preset` and is an independent field — don't conflate "channel 0 default PSK" with the modem preset name.) +- **DMs** addressed to a single node require PKI so that other holders of the channel PSK can't read them. Outside Ham mode, Meshtastic does not fall back to channel-symmetric encryption when the destination public key is unknown. +- **Remote admin** is a DM carrying an `AdminMessage`. The receiver only acts on it if the sender's public key is on its allowlist (`config.security.admin_key[0..2]`). +- **Ham mode** (`owner.is_licensed=true`, where `owner` is the local `meshtastic_User` record) disables PKI entirely and sends cleartext — FCC Part 97 prohibits encryption on amateur bands. +- **No ratchet, no session.** Every packet is encrypted from scratch — a stateless design that matches the high-loss, store-and-forward nature of LoRa. + +### Symmetric channel encryption (AES-CTR) + +`CryptoEngine::encryptPacket` / `decrypt` / `encryptAESCtr` in `src/mesh/CryptoEngine.cpp`. + +- **Cipher**: AES-CTR, AES-128 or AES-256 depending on key length. Same routine in both directions (CTR is a stream cipher, so encrypt == decrypt). +- **Key**: `ChannelSettings.psk` bytes. Size semantics: + - **0 bytes** → no encryption, cleartext on the air + - **1 byte** → short-form index into the well-known `defaultpsk[]` in `src/mesh/Channels.h`. Index 0 = cleartext; 1 = defaultpsk unchanged; 2..255 = defaultpsk with its last byte incremented by (index − 1). This is what the CLI's `--ch-set psk default` produces. + - **16 bytes** → raw AES-128 key + - **32 bytes** → raw AES-256 key + - **2..15 bytes** → zero-padded to 16 and used as AES-128 (with a warn log); **17..31 bytes** → zero-padded to 32 and used as AES-256 (with a warn log). Defensive fallback for malformed PSK input, not something to rely on. +- **Nonce (128 bit)**: `packet_id` (u64 LE) ‖ `from_node` (u32 LE) ‖ `block_counter` (u32, starts at 0). Built in `CryptoEngine::initNonce`. +- **No AEAD**: channel packets carry no MAC, so the channel-hash byte is not an integrity or authenticity check. `Channels::getHash` is a 1-byte XOR-derived hint over the channel name bytes and PSK bytes that helps receivers pick a candidate channel/PSK for decryption. Because it is only a small hint and collisions are easy to find, it should be described purely as a PSK-selection aid, not as a security filter an attacker cannot bypass. +- **Channel 0 is special in one way only**: it's the channel the Router attempts PKI decryption on before falling through to AES-CTR. Non-zero channels always go straight to AES-CTR. + +### PKI encryption for DMs (X25519 ECDH + AES-256-CCM) + +`CryptoEngine::encryptCurve25519` / `decryptCurve25519` in `src/mesh/CryptoEngine.cpp`. + +- **Keypair**: Curve25519 (aka X25519), 32-byte public + 32-byte private. Stored in `config.security.public_key` / `private_key`; the public half is mirrored into `owner.public_key` so it rides along in NodeInfo broadcasts and propagates through the mesh like any other identity field. +- **Key generation** (`generateKeyPair`): stirs `HardwareRNG::fill()` (64 B from platform TRNG when available), the 16-byte `myNodeInfo.device_id`, and a call to `random()` into the rweather/Crypto library's software RNG, then `Curve25519::dh1`. `regeneratePublicKey` recomputes the public half from a known private (used when restoring from backup). +- **Keygen entry points**: at boot, `NodeDB` calls `generateKeyPair` (or `regeneratePublicKey` when a stored private key is present and passes a low-entropy check) **directly** when `!owner.is_licensed` and `config.lora.region != UNSET`. `ensurePkiKeys` wraps the same logic for runtime/admin flows — it's the path `AdminModule::handleSetConfig` runs when first assigning a valid region or when security config is written; **do not assume it's the universal boot-time gate**, because the NodeDB path bypasses it. +- **Handshake**: `Curve25519::dh2(local_private, remote_public) → 32-byte shared secret → SHA-256 → 32-byte AES-256 key`. Recomputed per packet. The SHA-256 step is effectively a KDF over the raw ECDH output. +- **Cipher**: AES-256-CCM via `aes_ccm_ae` / `aes_ccm_ad` (`src/mesh/aes-ccm.cpp`). MAC length (the `M` parameter) is **8 bytes**. No AAD — the MAC covers ciphertext only. +- **Nonce (13 bytes / 104 bit)**: `aes_ccm_ae`/`aes_ccm_ad` use a 13-byte CCM nonce (`L = 2` is hardcoded in `src/mesh/aes-ccm.cpp`), not a 16-byte nonce. For PKI packets, `CryptoEngine::initNonce(fromNode, packetNum, extraNonce)` starts from the usual packet-derived nonce material, then overwrites nonce bytes `4..7` with a fresh 32-bit `extraNonce = random()`. The effective nonce bytes are therefore: bytes `0..3` = `packet_id`, bytes `4..7` = transmitted `extraNonce`, bytes `8..11` = `from_node`, byte `12` = `0x00`. The receiver reconstructs the same 13-byte nonce from the packet metadata plus the appended `extraNonce`. +- **Wire overhead**: 12 bytes appended to the ciphertext = 8-byte MAC ‖ 4-byte extraNonce. Defined as `MESHTASTIC_PKC_OVERHEAD = 12` in `src/mesh/RadioInterface.h`. Only the 4-byte `extraNonce` is sent; the rest of the 13-byte CCM nonce is reconstructed from packet fields as described above. The Router's send path checks this overhead against `MAX_LORA_PAYLOAD_LEN` before committing to PKI. +- **Send selection** (`Router::send`): the sender enters the PKI path when **all** hold — we're the originator AND not Ham mode AND not Portduino simradio AND not on the `serial`/`gpio` channels (unless the packet is already marked `pki_encrypted`) AND `config.security.private_key.size == 32` AND destination is a single node (not broadcast) AND the portnum isn't infrastructure. `TRACEROUTE_APP`, `NODEINFO_APP`, `ROUTING_APP`, and `POSITION_APP` are routed through channel encryption even when DMed (these need to be readable by relaying peers). Once on the PKI path, if the destination's public key isn't in our NodeDB the send **fails** with `PKI_SEND_FAIL_PUBLIC_KEY` — it does not silently fall back to channel encryption. If the client explicitly set `pki_encrypted=true` and any condition blocks PKI, the send fails with `PKI_FAILED`. +- **Receive selection** (`Router::perhapsDecode`): try PKI decrypt first when `channel == 0` AND `isToUs(p)` AND not broadcast AND both peers have public keys in NodeDB AND `rawSize > MESHTASTIC_PKC_OVERHEAD`. On success the packet gets `pki_encrypted=true` stamped and the sender's public key copied into `p->public_key` for downstream authorization. + +### Remote admin authorization + +Implemented in `src/modules/AdminModule.cpp` → `handleReceivedProtobuf`. The authorization check runs in this order: + +1. **Response messages** — if `messageIsResponse(r)` is true (the payload is a response to one of our earlier admin requests), it's accepted without any further check. The in-file comment flags this as a known-untightened gap: a stricter implementation would remember which `public_key` we last queried and reject responses that don't match. +2. **Local admin** — `mp.from == 0` (phone app over BLE, serial CLI, internal module); never travels over the air. **Rejected** if `config.security.is_managed` is true, because managed devices expect admin to arrive over the air through an authorized remote path. +3. **Legacy admin channel (deprecated)** — the packet arrived on a channel named literally `"admin"`. Gated by `config.security.admin_channel_enabled`; returns `NOT_AUTHORIZED` if the flag is false. Kept for backward compatibility; new deployments should use PKI admin. +4. **PKI admin (preferred for remote)** — `mp.pki_encrypted == true` AND `mp.public_key` matches one of `config.security.admin_key[0..2]` (up to three authorized 32-byte Curve25519 public keys, typically copied from the admin node's own `user.public_key`). +5. **Fallthrough** → `NOT_AUTHORIZED`. + +On top of authorization, any remote admin message that **mutates** state (not a request, not a response) also has to pass a session-key check (`checkPassKey`): the client must first pull a fresh 8-byte `session_passkey` via `get_admin_session_key_request`, then echo that passkey back in the mutating message. The device rotates the passkey after 150 s and rejects values older than 300 s — a narrow anti-replay window on top of the PKI layer. + +`config.security.is_managed = true` disables **local** admin writes (`mp.from == 0` is rejected). It does not by itself force every admin action through PKI — the legacy `"admin"` channel still authorizes remote admin when `config.security.admin_channel_enabled == true`. The AdminModule refuses to persist `is_managed=true` unless at least one `admin_key` is populated — a deliberate guard against operators locking themselves out. + +### Key-rotation hazards (actions that invalidate peers) + +- **`factory_reset_device`** (the "full" variant, calls `NodeDB::factoryReset(eraseBleBonds=true)`) → **wipes** the X25519 private key; a fresh keypair is generated on the next region-set. Every existing peer holds the old public key, so DMs to this node silently fail PKI decrypt until every peer re-exchanges NodeInfo. +- **`factory_reset_config`** (the "partial" variant, calls `NodeDB::factoryReset()` with `eraseBleBonds=false`) → **preserves** the X25519 private key in `installDefaultConfig(preserveKey=true)`; the public key is zeroed and gets rebuilt from the preserved private key on the next boot via the NodeDB path's `regeneratePublicKey` call. Identity is preserved and the mesh does not need to re-exchange keys. +- **`region=UNSET → valid region`** → `ensurePkiKeys` runs inside the same `handleSetConfig` path; missing keys get generated at that moment. +- **Ham mode transitions** — entering Ham mode (`user.is_licensed=true`) runs `Channels::ensureLicensedOperation`, which **wipes every channel PSK** (all traffic becomes cleartext) and disables the legacy admin channel. The X25519 private key is preserved on the device but not used because `Router::send` skips PKI when `owner.is_licensed` is true. Leaving Ham mode re-enables PKI with the preserved keypair but does not restore the wiped channel PSKs — the operator has to re-set them. +- **Channel 0 PSK change** → every peer must re-learn the channel hash; cached NodeInfo becomes temporarily unreachable until the next broadcast. +- **`security.private_key` blanked via admin** → regenerates both halves (unless in Ham mode) and propagates the new public key via NodeInfo. + ## Project Structure ``` @@ -80,7 +144,7 @@ firmware/ │ │ ├── NodeDB.* # Node database management │ │ ├── Router.* # Packet routing │ │ ├── Channels.* # Channel management -│ │ ├── CryptoEngine.* # AES-CCM encryption +│ │ ├── CryptoEngine.* # AES-CTR (channels) + X25519 ECDH→AES-256-CCM (PKI for DMs/admin) │ │ ├── *Interface.* # Radio interface implementations │ │ ├── api/ # WiFi/Ethernet server APIs (ServerAPI, PacketAPI) │ │ ├── http/ # HTTP server (WebServer, ContentHandler) diff --git a/AGENTS.md b/AGENTS.md index b3fa1970c..8f3474640 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -48,6 +48,15 @@ Three test-and-diagnose workflows exist as slash commands: Bodies live in `.claude/commands/` and `.github/prompts/` respectively. `.claude/commands/README.md` is the index. +## Encryption at a glance + +Two layers, both in `src/mesh/CryptoEngine.cpp`: + +- **Channel (symmetric)** — **AES-CTR** with a channel-wide PSK (AES-128 or AES-256). Nonce = packet_id ‖ from_node ‖ block_counter. No AEAD; integrity is soft (channel-hash filter). The well-known default PSK lives in `src/mesh/Channels.h`; a 1-byte PSK is a short-form index into it. +- **Per-peer PKI** — **X25519 ECDH** (Curve25519, 32-byte keys) → SHA-256 → **AES-256-CCM** with an 8-byte MAC. Fresh 32-bit `extraNonce` per packet, sent in the clear alongside the MAC. 12-byte wire overhead (`MESHTASTIC_PKC_OVERHEAD`). Used for DMs. Also used for remote admin (`src/modules/AdminModule.cpp`), where AdminMessage authorization is gated by `config.security.admin_key[0..2]`. Disabled entirely in Ham mode (`user.is_licensed=true`). + +Key rotation to never trigger casually: only the **full** factory reset (`factory_reset_device`, `eraseBleBonds=true`) wipes `security.private_key` and regenerates the keypair — every peer holds the old public key, so DMs silently fail PKI decrypt until NodeInfo re-exchanges. The **partial** config reset (`factory_reset_config`) preserves the private key and doesn't invalidate peer relationships. Explicitly blanking `security.private_key` via admin also triggers regen. See the **Encryption & Key Management** section of `.github/copilot-instructions.md` for the full spec (nonce layout, send/receive selection logic including infrastructure-portnum exceptions, admin-key + session-passkey authorization, `is_managed` scope, key-rotation hazards). + ## House rules - **No destructive device operations without operator approval.** `factory_reset`, `erase_and_flash`, `reboot`, `shutdown`, history-rewriting git ops — describe the action and stop. Operator authorizes. diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 3d13a68af..054c7854b 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -34,6 +34,7 @@ class ScanI2C SHT31, SHT4X, SHTC3, + SHTXX, LPS22HB, QMC6310U, QMC6310N, From 9361b85f47aab6c0c6f9205ac25beac134e90535 Mon Sep 17 00:00:00 2001 From: George <509474+giannoug@users.noreply.github.com> Date: Tue, 21 Apr 2026 23:35:02 +0300 Subject: [PATCH 095/150] feat(t5s3-epaper): add InkHUD port for LilyGo T5 E-Paper S3 Pro (#10211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * niche: add InkHUD port for LilyGo T5-E-Paper-S3-Pro (ED047TC1) Add a NicheGraphics EInk driver adapter for the 4.7" ED047TC1 parallel e-paper display used on the T5-E-Paper-S3-Pro (H752-01). The driver wraps FastEPD and handles the polarity difference between InkHUD's buffer format (0xFF = white) and FastEPD's (0x00 = white). Rewrite variants/esp32s3/t5s3_epaper/nicheGraphics.h which was an incomplete copy of the Heltec VM-E290 setup referencing undefined SPI pin macros and a non-existent BUTTON_PIN_SECONDARY. The board uses a parallel display, not the small SPI DEPG0290BNS800 that was referenced. * fix: guard inputBroker null dereference in TouchScreenImpl1::init() When MESHTASTIC_EXCLUDE_INPUTBROKER is defined (e.g. InkHUD builds), inputBroker is nullptr. Calling inputBroker->registerSource() in that state caused a LoadProhibited panic on any board that has both HAS_TOUCHSCREEN=1 and the InputBroker excluded. Add a null check before registerSource() to prevent the crash. * niche: fix display rotation for T5-E-Paper-S3-Pro InkHUD port Set rotation=3 (270° CW) in nicheGraphics.h to correct for FastEPD scanning the ED047TC1 panel in portrait orientation, resulting in correct landscape display output. * fix: update buffer format descriptions and remove polarity inversion for InkHUD and FastEPD * fix: update ED047TC1 driver to handle inactive pixel borders and adjust safe-area dimensions * fix: comment out ruler diagnostic for E-Ink driver * feat: implement TouchInkHUDBridge for direct touch event handling in InkHUD * niche: add FreeSans 18pt/24pt Win1253 (Greek) fonts for larger InkHUD displays Add Win1253-encoded FreeSans 18pt and 24pt font headers to support Greek script on larger InkHUD screens (e.g., the 4.7" ED047TC1 at ~234 DPI). Register FREESANS_24PT_WIN1253 and FREESANS_18PT_WIN1253 macros in AppletFont.h. Set fontLarge=24pt, fontMedium=18pt, fontSmall=12pt in nicheGraphics.h for the T5-E-Paper-S3-Pro. * feat(ed047tc1): use true partial update for FAST refresh Replace fullUpdate(CLEAR_FAST) with partialUpdate() for FAST display updates. FastEPD's partialUpdate() diffs pCurrent against pPrevious and only applies the update waveform to rows that have changed, leaving unchanged rows with a neutral signal. This reduces visible flicker on routine updates (new messages, position changes) — only the affected region of the screen refreshes. Full-screen CLEAR_SLOW updates are preserved for periodic ghosting cleanup, driven by InkHUD's setDisplayResilience() ratio. * feat(t5s3-epaper): enable frontlight via LatchingBacklight Wire up BOARD_BL_EN (GPIO11) to InkHUD's LatchingBacklight driver. Enable the backlight menu item so users can toggle "Keep Backlight On" via Settings. The backlight turns on automatically when the menu opens and off when it closes. * Fix RTC chip (PCF8563 not PCF85063) and GT911 I2C address collision - variant.h used PCF85063_RTC but the board has a PCF8563. The difference is the RAM register: PCF85063 has 1 byte of RAM; PCF8563 does not. The PCF85063 driver was trying to write this register on init, failing every time, and setDateTime writes were silently discarded — RTC time was never persisted across reboots. Switch to PCF8563_RTC/PCF8563_INT. Before: [E][SensorPCF85063.hpp:375] initImpl(): Failed to write to RAM memory register. Maybe this chip is pcf8563. Read RTC time from PCF85063 getDateTime as 2026-04-05 00:00:23 PCF85063 setDateTime 2026-04-05 18:40:59 Read RTC time from PCF85063 getDateTime as 2026-04-05 00:00:19 ← lost After: PCF8563 found at address 0x51 Read RTC time from PCF8563 getDateTime as 2026-04-05 18:58:37 ← persisted PCF8563 setDateTime 2026-04-05 18:58:44 Read RTC time from PCF8563 getDateTime as 2026-04-05 18:58:44 ← round-trips - GT911 touch was initialized with GT911_SLAVE_ADDRESS_L (0x5D), which collides with the SFA30 air quality sensor also at 0x5D on the same I2C bus. Switch to GT911_SLAVE_ADDRESS_H (0x14): the library drives INT high during reset to program the GT911 to address 0x14, eliminating the address conflict. Before: SFA30 found at address 0x5d [I][TouchDrvGT911.hpp:568] initImpl(): Try using 0x5D as the device address After: SFA30 found at address 0x5d [I][TouchDrvGT911.hpp:544] initImpl(): Try using 0x14 as the device address * t5s3_epaper: fix GT911 ghost-SFA30 via early I2C address latch Investigation findings ---------------------- Boot logs showed "SFA30 found at address 0x5d" on every cold power-on, and AirQualityTelemetry was registering an SFA30 sensor. However, every readMeasuredValues() call returned error 268 (0x010C = Sensirion WriteError | I2cAddressNack), meaning the I2C write to 0x5D was being NACK'd — inconsistent with a real SFA30. Root cause: the GT911 touch controller latches its I2C address from the INT pin level at reset time (GT911 datasheet §4.3). GPIO3 (INT) defaults LOW on ESP32-S3 cold boot → GT911 always powers up at 0x5D (SLAVE_ADDRESS_L). The I2C scanner runs before lateInitVariant() had a chance to reprogram the chip. The scanner's SFA30 detection (ScanI2CTwoWire.cpp) sends the 2-byte command 0xD060 to 0x5D and requests 48 bytes back. GT911 ACKs the write (treating it as a register address) and returns 48 bytes of register data, passing the length check — a false-positive SFA30 detection. Confirmed via second cold-boot log: after the previous commit moved GT911 to 0x14 in lateInitVariant(), address 0x5D *still* appeared in the scan because the scanner runs first. The board has no physical SFA30 fitted. Fix --- Add the GT911 address-latch reset sequence to earlyInitVariant(), before Wire is initialised and before the I2C scan runs. Per the datasheet: drive RST LOW, drive INT HIGH (selects address 0x14 / SLAVE_ADDRESS_H), hold >100 µs, release RST, wait >5 ms startup. GPIO-only, no Wire dependency. lateInitVariant() then repeats this sequence internally via touch.begin(); the double-reset is harmless. Verified in boot log: Before: "SFA30 found at address 0x5d", 5 I2C devices, NACK errors After: no SFA30 entry, 4 I2C devices (TCA9535/PCF8563/BQ27220/BQ25896), GT911 found at 0x14 and touch initialised successfully, AirQualityTelemetry registers no sensors (correct — no SFA30 present) * t5s3_epaper: add variant_shutdown() for touch sleep and backlight off Put GT911 into low-power standby (command 0x05) and drive BOARD_BL_EN LOW before deep sleep to avoid unnecessary current draw. * t5s3_epaper: fix touch gesture routing and coordinate mapping readTouch() now transforms raw GT911 axes to visual-frame coordinates based on the current display rotation (rotation=3 is the hardware identity). This ensures TouchScreenBase detects swipe direction correctly regardless of which rotation the user has selected. TouchInkHUDBridge dynamically sets joystick.alignment = (4-rotation)%4 on each touch event so that (rotation+alignment)%4==0 always, keeping nav calls pass-through without remapping. nicheGraphics.h now calls loadSettings() first so that rotation is persisted across reboots. rotation=3 and other first-boot defaults are only applied when tips.firstBoot is set. alignment is recomputed from the loaded rotation on every boot. Co-Authored-By: Claude Sonnet 4.6 * t5s3_epaper: fix GT911 sleep timing via notifyDeepSleep observer touch.sleep() was called from variant_shutdown(), which runs inside cpuDeepSleep() — after Wire.end() had already torn down the I2C bus in doDeepSleep(). This caused Wire NULL TX buffer errors and left the GT911 awake during deep sleep. Register a CallbackObserver on notifyDeepSleep, which fires before Wire.end(), so the I2C command reaches the chip while the bus is live. Pattern matches LatchingBacklight and other NicheGraphics components. Co-Authored-By: Claude Sonnet 4.6 * t5s3_epaper: fix touch nav and applet defaults in nicheGraphics Enable joystick mode post-begin so menu scroll and swipe-up/down gestures are not silently dropped by the joystick.enabled gate in Events.cpp. Activate DMs and Channel 0/1 applets with correct autoshow defaults matching the mini-epaper-s3 reference pattern. Co-Authored-By: Claude Sonnet 4.6 * Update nicheGraphics.h * t5s3_epaper: fix ED047TC1 driver docs and remove spurious beginPolling Addressing PR review comments: Remove beginPolling(1, 0) after the blocking FastEPD update — it incorrectly set updateRunning=true for one loop cycle after the hardware was already done, causing busy() to briefly return true. Since isUpdateDone() always returns true, no polling is needed. Also fix stale comments: safe-area buffer size was 944×532, now 944×523; V_OFFSET_ROWS didn't exist, replaced with the actual V_OFFSET_TOP=9 / V_OFFSET_BOTTOM=8 constant names. * t5s3_epaper: clean up applet addition formatting in setupNicheGraphics * t5s3_epaper: guard ED047TC1.cpp against non-T5S3 InkHUD builds The InkHUD base config pulls in all of src/graphics/niche/ so every InkHUD device compiled ED047TC1.cpp, triggering the #error on line 48 for boards that define neither T5_S3_EPAPER_PRO_V1 nor V2. Wrap the file body with #ifdef T5_S3_EPAPER_PRO so it is only compiled for T5S3 targets. The #error is preserved inside the guard to catch future hardware revisions that forget to update the driver. Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Sonnet 4.6 Co-authored-by: HarukiToreda <116696711+HarukiToreda@users.noreply.github.com> --- src/graphics/niche/Drivers/EInk/ED047TC1.cpp | 122 + src/graphics/niche/Drivers/EInk/ED047TC1.h | 90 + .../niche/Fonts/FreeSans18pt_Win1253.h | 1467 ++++++++++ .../niche/Fonts/FreeSans24pt_Win1253.h | 2429 +++++++++++++++++ src/graphics/niche/InkHUD/AppletFont.h | 4 + src/input/TouchScreenImpl1.cpp | 3 +- variants/esp32s3/t5s3_epaper/nicheGraphics.h | 89 +- variants/esp32s3/t5s3_epaper/variant.cpp | 141 +- variants/esp32s3/t5s3_epaper/variant.h | 4 +- 9 files changed, 4295 insertions(+), 54 deletions(-) create mode 100644 src/graphics/niche/Drivers/EInk/ED047TC1.cpp create mode 100644 src/graphics/niche/Drivers/EInk/ED047TC1.h create mode 100644 src/graphics/niche/Fonts/FreeSans18pt_Win1253.h create mode 100644 src/graphics/niche/Fonts/FreeSans24pt_Win1253.h diff --git a/src/graphics/niche/Drivers/EInk/ED047TC1.cpp b/src/graphics/niche/Drivers/EInk/ED047TC1.cpp new file mode 100644 index 000000000..f1189045b --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ED047TC1.cpp @@ -0,0 +1,122 @@ +/* + + NicheGraphics parallel E-Ink driver for the LilyGo T5-S3-ePaper-Pro (ED047TC1). + + InkHUD buffer format : 1bpp, horizontal bytes, MSB = leftmost pixel, 1 = white + FastEPD buffer format: 1bpp, horizontal bytes, MSB = leftmost pixel, 1 = white + + Both formats share the same pixel layout and polarity (1 = white, 0 = black). + The InkHUD safe-area buffer (944×523) is copied into the centre of the physical + 960×540 FastEPD buffer so content clears the panel's inactive edge border. + See ED047TC1.h for the H_OFFSET_BYTES / V_OFFSET_TOP / V_OFFSET_BOTTOM constants. + +*/ + +// Ruler diagnostic — uncomment to draw calibration lines at each physical edge. +// #define EINK_EDGE_LINES + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS +#ifdef T5_S3_EPAPER_PRO + +#include "./ED047TC1.h" + +#include "FastEPD.h" +#include "configuration.h" + +using namespace NicheGraphics::Drivers; + +void ED047TC1::begin(SPIClass *spi, uint8_t pin_dc, uint8_t pin_cs, uint8_t pin_busy, uint8_t pin_rst) +{ + // Parallel display — SPI parameters are not used + (void)spi; + (void)pin_dc; + (void)pin_cs; + (void)pin_busy; + (void)pin_rst; + + epaper = new FASTEPD; + +#if defined(T5_S3_EPAPER_PRO_V1) + epaper->initPanel(BB_PANEL_LILYGO_T5PRO, 28000000); +#elif defined(T5_S3_EPAPER_PRO_V2) + epaper->initPanel(BB_PANEL_LILYGO_T5PRO_V2, 28000000); + // Initialize all PCA9535 port-0 pins as outputs / HIGH + for (int i = 0; i < 8; i++) { + epaper->ioPinMode(i, OUTPUT); + epaper->ioWrite(i, HIGH); + } +#else +#error "ED047TC1 driver: unsupported variant — define T5_S3_EPAPER_PRO_V1 or T5_S3_EPAPER_PRO_V2" +#endif + + epaper->setMode(BB_MODE_1BPP); + epaper->clearWhite(); + epaper->fullUpdate(true); // Blocking initial clear +} + +void ED047TC1::update(uint8_t *imageData, UpdateTypes type) +{ + if (!epaper) + return; + + // InkHUD renders into a DISPLAY_WIDTH × DISPLAY_HEIGHT safe-area buffer. + // We need to place that into the centre of the physical 960×540 FastEPD buffer, + // leaving blank margins at every edge to avoid the panel's inactive border. + const uint32_t srcRowBytes = (DISPLAY_WIDTH + 7) / 8; // bytes per row in InkHUD buffer (118) + const uint32_t dstRowBytes = (960 + 7) / 8; // bytes per row in physical buffer (120) + const uint32_t dstTotalRows = 540; + + uint8_t *cur = epaper->currentBuffer(); + + // Fill physical buffer with white (0xFF = white in FastEPD 1bpp) + memset(cur, 0xFF, dstRowBytes * dstTotalRows); + + // Copy each InkHUD row into the physical buffer with horizontal + vertical offsets + for (uint32_t row = 0; row < DISPLAY_HEIGHT; row++) { + const uint8_t *srcRow = imageData + row * srcRowBytes; + uint8_t *dstRow = cur + (row + V_OFFSET_TOP) * dstRowBytes + H_OFFSET_BYTES; + memcpy(dstRow, srcRow, srcRowBytes); + } + +#ifdef EINK_EDGE_LINES + // Draw a 1px black box at the exact boundary of the safe area within the + // physical buffer. If the margins are correct, all 4 lines should be + // fully visible and right at the edge of the usable display area. + + auto setPixelBlack = [&](uint32_t col, uint32_t row) { cur[row * dstRowBytes + col / 8] &= ~(0x80 >> (col % 8)); }; + + const uint32_t safeX = H_OFFSET_BYTES * 8; + const uint32_t safeY = V_OFFSET_TOP; + const uint32_t safeW = DISPLAY_WIDTH; + const uint32_t safeH = DISPLAY_HEIGHT; + + // Top edge: horizontal line at safeY + for (uint32_t col = safeX; col < safeX + safeW; col++) + setPixelBlack(col, safeY); + + // Bottom edge: horizontal line at safeY + safeH - 1 + for (uint32_t col = safeX; col < safeX + safeW; col++) + setPixelBlack(col, safeY + safeH - 1); + + // Left edge: vertical line at safeX + for (uint32_t row = safeY; row < safeY + safeH; row++) + setPixelBlack(safeX, row); + + // Right edge: vertical line at safeX + safeW - 1 + for (uint32_t row = safeY; row < safeY + safeH; row++) + setPixelBlack(safeX + safeW - 1, row); +#endif + + if (type == FULL) { + epaper->fullUpdate(CLEAR_SLOW, false); + epaper->backupPlane(); // Sync pPrevious so next partialUpdate has a correct baseline + } else { + // FAST: true partial update — compares pCurrent vs pPrevious and only applies + // the update waveform to rows that actually changed. Unchanged rows get a neutral + // signal (no visible effect). partialUpdate() updates pPrevious internally. + epaper->partialUpdate(false, 0, dstTotalRows - 1); + } +} + +#endif // T5_S3_EPAPER_PRO +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS diff --git a/src/graphics/niche/Drivers/EInk/ED047TC1.h b/src/graphics/niche/Drivers/EInk/ED047TC1.h new file mode 100644 index 000000000..3540481e7 --- /dev/null +++ b/src/graphics/niche/Drivers/EInk/ED047TC1.h @@ -0,0 +1,90 @@ +/* + + E-Ink display driver adapter + - ED047TC1 (via FastEPD library) + - Manufacturer: E Ink / used in LilyGo T5-E-Paper-S3-Pro + - Size: 4.7 inch + - Physical resolution: 960px x 540px + - Interface: 8-bit parallel (NOT SPI) + + Unlike the other NicheGraphics EInk drivers, this one drives a parallel e-paper + panel via the FastEPD library. SPI parameters passed to begin() are ignored. + + The ED047TC1 panel has an inactive pixel border on all four edges (~4–8 physical + pixels). DISPLAY_WIDTH / DISPLAY_HEIGHT expose a reduced "safe area" to InkHUD so + that content is never drawn into this dead zone. The update() method copies the + InkHUD frame buffer into the centre of the larger physical 960×540 buffer, using + H_OFFSET_BYTES (horizontal, whole bytes = 8 pixels per byte), + V_OFFSET_TOP and V_OFFSET_BOTTOM (vertical, pixel rows) to position it. + + Changing these constants shifts content inward from each physical edge: + H_OFFSET_BYTES = 1 → 8px left margin, 8px right margin (960 – 8 – 8 = 944) + V_OFFSET_TOP = 9 → 9px top margin (asymmetric: top ≠ bottom) + V_OFFSET_BOTTOM = 8 → 8px bottom margin (540 – 9 – 8 = 523) + +*/ + +#pragma once + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + +#include "configuration.h" + +#include "./EInk.h" + +// Forward declare to avoid pulling FastEPD into all translation units +class FASTEPD; + +namespace NicheGraphics::Drivers +{ + +class ED047TC1 : public EInk +{ + // Safe-area dimensions exposed to InkHUD (physical panel is 960×540). + // + // The ED047TC1 has an inactive pixel border on all physical edges. + // The physical buffer coordinates do NOT directly match the visual orientation + // due to FastEPD's portrait scan direction and InkHUD's rotation=3 (270° CW): + // + // Physical buffer Visual on device (rotation=3) + // ───────────────── ────────────────────────────── + // Physical LEFT cols → Visual TOP edge + // Physical RIGHT cols → Visual BOTTOM edge + // Physical TOP rows → Visual RIGHT edge + // Physical BOTTOM rows → Visual LEFT edge + // + // Offset constants shift the InkHUD safe-area away from each physical dead zone: + // H_OFFSET_BYTES : whole bytes from physical left (8px per byte, affects visual TOP) + // Physical right margin = 960 − H_OFFSET_BYTES×8 − DISPLAY_WIDTH (affects visual BOTTOM) + // V_OFFSET_TOP : pixel rows from physical top (affects visual RIGHT) + // V_OFFSET_BOTTOM: pixel rows from physical bottom (affects visual LEFT) + // + // Calibrated by flashing a 1px border box and adjusting until all 4 sides are visible. + + static constexpr uint16_t DISPLAY_WIDTH = 944; // 960 − H_OFFSET_BYTES×8 − right_margin (8+8 = 16px) + static constexpr uint16_t DISPLAY_HEIGHT = 523; // 540 − V_OFFSET_TOP − V_OFFSET_BOTTOM (9+8 = 17px) + + static constexpr uint8_t H_OFFSET_BYTES = 1; // visual TOP : 8px physical left margin + // visual BOTTOM: 960−8−944=8px physical right margin + static constexpr uint8_t V_OFFSET_TOP = 9; // visual RIGHT : CONFIRMED OK + static constexpr uint8_t V_OFFSET_BOTTOM = 8; // visual LEFT : 8px physical bottom margin + + static constexpr UpdateTypes supported = static_cast(FULL | FAST); + + public: + ED047TC1() : EInk(DISPLAY_WIDTH, DISPLAY_HEIGHT, supported) {} + + // EInk interface — SPI params are not used for this parallel display + void begin(SPIClass *spi, uint8_t pin_dc, uint8_t pin_cs, uint8_t pin_busy, uint8_t pin_rst = 0xFF) override; + void update(uint8_t *imageData, UpdateTypes type) override; + + protected: + bool isUpdateDone() override { return true; } // FastEPD updates are blocking + + private: + FASTEPD *epaper = nullptr; +}; + +} // namespace NicheGraphics::Drivers + +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS diff --git a/src/graphics/niche/Fonts/FreeSans18pt_Win1253.h b/src/graphics/niche/Fonts/FreeSans18pt_Win1253.h new file mode 100644 index 000000000..9b29f32b5 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans18pt_Win1253.h @@ -0,0 +1,1467 @@ +// trunk-ignore-all(clang-format) +#pragma once +/* PROPERTIES + +FONT_NAME FreeSans18pt_Win1253 +*/ +const uint8_t FreeSans18pt_Win1253Bitmaps[] PROGMEM = { + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x23, 0x00, + 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x04, 0x30, + 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x01, 0x84, + 0x00, 0x00, 0x01, 0x82, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, 0x01, 0x81, + 0x80, 0x00, 0x03, 0x80, 0xBF, 0xC0, 0x03, 0x00, 0x7C, 0x30, 0x03, 0x00, + 0x60, 0x18, 0x01, 0x00, 0x20, 0x04, 0x01, 0x80, 0x10, 0x06, 0x7F, 0xC0, + 0x0C, 0x06, 0x30, 0x00, 0x07, 0xFF, 0xD8, 0x00, 0x03, 0xE0, 0x2C, 0x00, + 0x01, 0x80, 0x1E, 0x00, 0x01, 0xC0, 0x0F, 0x00, 0x01, 0xA0, 0x05, 0x80, + 0x03, 0x9C, 0x06, 0xC0, 0x03, 0x07, 0xFE, 0x60, 0x00, 0x06, 0x01, 0xB0, + 0x00, 0x03, 0x00, 0x58, 0x00, 0x01, 0x80, 0x2C, 0x00, 0x00, 0xC0, 0x16, + 0x00, 0x00, 0x3E, 0x1B, 0xF8, 0x00, 0x3F, 0xF9, 0xFF, 0x80, 0x10, 0x10, + 0x00, 0x60, 0x08, 0x08, 0x00, 0x1E, 0x06, 0x04, 0x00, 0x03, 0xFF, 0xFE, + 0x00, 0x00, 0x06, 0x1E, 0x00, 0x00, 0x00, 0x79, 0xF0, 0x00, 0x07, 0xFF, + 0xEC, 0x00, 0x0E, 0x03, 0x02, 0x00, 0x0C, 0x01, 0x01, 0x0F, 0xFC, 0x00, + 0x80, 0x87, 0xE0, 0x00, 0x7F, 0xF3, 0x00, 0x00, 0x1E, 0x0D, 0x80, 0x00, + 0x18, 0x02, 0xC0, 0x00, 0x0C, 0x01, 0x60, 0x00, 0x06, 0x00, 0xB0, 0x00, + 0x03, 0x80, 0xD8, 0x00, 0x60, 0xFF, 0xCC, 0x00, 0x1C, 0xC0, 0x36, 0x00, + 0x03, 0x40, 0x0B, 0x00, 0x00, 0xE0, 0x07, 0x80, 0x00, 0x38, 0x03, 0xC0, + 0x00, 0x1F, 0x81, 0x60, 0x00, 0x07, 0xFF, 0xBF, 0xE0, 0x06, 0x01, 0x00, + 0x30, 0x02, 0x00, 0xC0, 0x08, 0x01, 0x00, 0x20, 0x06, 0x00, 0xC0, 0x30, + 0x01, 0x80, 0x3F, 0x18, 0x00, 0x70, 0x13, 0xF8, 0x00, 0x0C, 0x0C, 0x00, + 0x00, 0x03, 0x06, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00, 0x00, 0x30, 0x80, + 0x00, 0x00, 0x08, 0x40, 0x00, 0x00, 0x04, 0x30, 0x00, 0x00, 0x02, 0x18, + 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x46, + 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x07, + 0xFC, 0x00, 0x00, 0x07, 0x80, 0xE0, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, + 0xC0, 0x00, 0x18, 0x00, 0x20, 0x00, 0x01, 0x80, 0x08, 0x00, 0x00, 0x08, + 0x02, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x18, 0x10, 0x00, 0x00, + 0x01, 0x04, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x02, 0x20, 0x00, + 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x80, 0x70, 0x07, 0x00, 0xA0, + 0x31, 0x01, 0x18, 0x0C, 0x04, 0x30, 0x61, 0x01, 0x80, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xA8, 0x00, + 0x54, 0x18, 0x2A, 0x00, 0x12, 0x83, 0x05, 0x40, 0x02, 0xA0, 0x50, 0x00, + 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x02, 0x40, 0x10, 0x01, 0x00, 0x44, + 0x03, 0x80, 0xE0, 0x10, 0x80, 0x0F, 0xE0, 0x02, 0x08, 0x00, 0x00, 0x00, + 0x81, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, + 0x01, 0x00, 0x10, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x30, 0x00, 0x0C, + 0x00, 0x18, 0x00, 0x00, 0xF0, 0x1E, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0xC0, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, + 0x60, 0x00, 0xC0, 0x00, 0x00, 0x60, 0x00, 0x0C, 0x00, 0x00, 0x30, 0x00, + 0x01, 0x80, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x02, + 0x00, 0x06, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x0C, 0x00, 0x06, 0x10, 0x00, + 0x86, 0x00, 0x00, 0xC2, 0x00, 0x22, 0x00, 0x00, 0x08, 0x80, 0x11, 0x00, + 0x00, 0x01, 0x10, 0x04, 0x40, 0x00, 0x00, 0x44, 0x01, 0x03, 0xE0, 0x0F, + 0x81, 0x00, 0x81, 0x8C, 0x06, 0x30, 0x20, 0x20, 0x41, 0x01, 0x04, 0x08, + 0x08, 0x00, 0x00, 0x00, 0x02, 0x03, 0xE0, 0x00, 0x00, 0x0F, 0x83, 0x98, + 0x00, 0x00, 0x02, 0x31, 0x86, 0x00, 0x00, 0x00, 0xC2, 0xC1, 0x00, 0x00, + 0x00, 0x10, 0xE0, 0x4F, 0x80, 0x03, 0xE4, 0x18, 0x32, 0x1F, 0xFF, 0x09, + 0x06, 0x08, 0xE0, 0x00, 0x0E, 0x61, 0x4E, 0x1F, 0xFF, 0xFF, 0x0C, 0x8F, + 0x87, 0xFF, 0xFF, 0xC3, 0xC0, 0x20, 0xFF, 0xFF, 0xE0, 0x80, 0x0C, 0x0F, + 0x83, 0xE0, 0x60, 0x01, 0x81, 0xC0, 0x70, 0x30, 0x00, 0x20, 0x0F, 0xE0, + 0x18, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0xC0, 0x00, 0x06, 0x00, + 0x00, 0x18, 0x00, 0x03, 0x00, 0x00, 0x03, 0x80, 0x03, 0x00, 0x00, 0x00, + 0x3C, 0x07, 0x80, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x0C, + 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x08, 0x40, 0x00, 0x00, 0x71, 0xC0, 0x00, 0x03, 0x9F, 0x0C, 0x00, 0x00, + 0xFA, 0x30, 0x07, 0x00, 0x11, 0xC3, 0x01, 0xB0, 0x02, 0x18, 0x30, 0x62, + 0x00, 0x61, 0x83, 0x08, 0xC0, 0x06, 0x18, 0x31, 0x18, 0x01, 0xE1, 0x83, + 0x23, 0x00, 0x66, 0x18, 0x34, 0x20, 0x08, 0x61, 0x83, 0x84, 0x01, 0x86, + 0x18, 0x38, 0xC0, 0x18, 0x61, 0x83, 0x08, 0x03, 0x86, 0x10, 0x41, 0x00, + 0xF8, 0x60, 0x18, 0x30, 0x31, 0x86, 0x02, 0x02, 0x06, 0x18, 0x40, 0x40, + 0x60, 0xC1, 0x80, 0x08, 0x04, 0x0C, 0x18, 0x01, 0x00, 0x80, 0xC1, 0x00, + 0x20, 0x18, 0x0C, 0x00, 0x06, 0x01, 0x10, 0xC0, 0x00, 0xC0, 0x23, 0x8C, + 0x00, 0x0C, 0x06, 0x10, 0xC0, 0x00, 0x01, 0xE0, 0x0C, 0x00, 0x00, 0x37, + 0x00, 0xC0, 0x00, 0x04, 0x60, 0x0C, 0x00, 0x01, 0x80, 0x00, 0xC0, 0x00, + 0x20, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x00, 0x07, + 0x00, 0xC0, 0x00, 0x00, 0x7F, 0xF0, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, + 0x00, 0x0C, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0xD0, 0x00, + 0x00, 0xE0, 0x12, 0x00, 0x00, 0x16, 0x04, 0x60, 0x00, 0x02, 0x71, 0x8C, + 0x00, 0x00, 0x63, 0x20, 0x80, 0x00, 0x0C, 0x1F, 0xD0, 0x78, 0x00, 0x8E, + 0x0F, 0xFD, 0x00, 0x12, 0x00, 0x30, 0x60, 0x02, 0x80, 0x02, 0x08, 0x00, + 0x60, 0x00, 0x22, 0x00, 0x7C, 0x00, 0x06, 0xC0, 0xFD, 0x00, 0x00, 0x50, + 0x30, 0x20, 0x00, 0x0C, 0x06, 0x08, 0x00, 0x00, 0x80, 0x71, 0x00, 0x00, + 0x18, 0x03, 0x20, 0x00, 0x02, 0xC0, 0x3C, 0x00, 0x00, 0x4C, 0x01, 0x80, + 0x00, 0x08, 0x60, 0x10, 0x00, 0x01, 0x06, 0x07, 0x00, 0x00, 0x40, 0xC0, + 0xA0, 0x00, 0x0B, 0xF0, 0x36, 0x00, 0x03, 0xE0, 0x04, 0x40, 0x00, 0x60, + 0x01, 0x04, 0x00, 0x14, 0x00, 0x60, 0xC0, 0x04, 0x80, 0x0B, 0xFF, 0x07, + 0x10, 0x01, 0xF0, 0xBF, 0xC3, 0x00, 0x00, 0x10, 0x4C, 0x60, 0x00, 0x03, + 0x18, 0xE4, 0x00, 0x00, 0x62, 0x06, 0x80, 0x00, 0x0C, 0xC0, 0x70, 0x00, + 0x00, 0xB0, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x03, 0x83, 0x80, 0x00, 0x00, + 0x30, 0x06, 0x00, 0x00, 0x03, 0x00, 0x18, 0x00, 0x00, 0x30, 0x00, 0x60, + 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x07, 0xC0, + 0x00, 0x60, 0x00, 0xC3, 0x80, 0x01, 0x00, 0x0C, 0x04, 0x00, 0x08, 0x00, + 0xC0, 0x30, 0x00, 0x40, 0x04, 0x00, 0x80, 0x02, 0x00, 0x20, 0x04, 0x00, + 0x18, 0x0F, 0x00, 0x00, 0x01, 0xF1, 0xC0, 0x00, 0x00, 0x00, 0xC8, 0x00, + 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x00, + 0x00, 0x03, 0x0F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x30, 0x03, 0x00, 0x38, 0x03, 0x80, + 0x38, 0x03, 0xC0, 0x3C, 0x03, 0xC0, 0x1E, 0x01, 0xE0, 0x1E, 0x00, 0xE0, + 0x0E, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x80, 0x30, 0x00, 0x00, 0x1C, 0x03, 0x80, 0x00, 0x01, 0xE0, + 0x3C, 0x00, 0x00, 0x0F, 0x01, 0xC0, 0x00, 0x00, 0x70, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x00, 0x1C, 0x0C, 0x00, 0x00, 0x00, + 0x70, 0x02, 0x00, 0x00, 0x00, 0xC0, 0x01, 0x00, 0x00, 0x01, 0x80, 0x00, + 0x80, 0x00, 0x01, 0x80, 0x00, 0x40, 0x00, 0x03, 0x00, 0x00, 0x40, 0x00, + 0x3F, 0x00, 0x00, 0x20, 0x00, 0xE1, 0xC0, 0x00, 0x20, 0x01, 0x80, 0x60, + 0x00, 0x20, 0x01, 0x00, 0x20, 0x00, 0x20, 0x02, 0x00, 0x10, 0x00, 0x20, + 0x02, 0x00, 0x10, 0x00, 0x20, 0x06, 0x00, 0x00, 0x00, 0x38, 0x1E, 0x00, + 0x00, 0x00, 0x0C, 0x70, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, + 0x03, 0x80, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x01, 0x80, + 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, + 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, 0x02, 0x18, 0x20, 0x00, 0x00, 0x0C, + 0x0F, 0xF0, 0x00, 0x00, 0x70, 0x00, 0x0F, 0xFC, 0x00, 0x80, 0x00, 0x03, + 0xE7, 0x03, 0x00, 0x00, 0x00, 0x01, 0xFC, 0x00, 0x01, 0xF0, 0x00, 0x1F, + 0x00, 0x0F, 0xFC, 0x01, 0xFF, 0x80, 0x39, 0xDC, 0x07, 0x3B, 0x80, 0xF2, + 0xDC, 0x1E, 0x5B, 0x83, 0xB4, 0xEC, 0x6E, 0x9D, 0x8D, 0x38, 0xCD, 0x93, + 0x19, 0x9E, 0x30, 0xCB, 0xA3, 0x19, 0x64, 0x31, 0x69, 0xC7, 0x3B, 0x8C, + 0x52, 0x71, 0x8B, 0x4F, 0x96, 0x94, 0x61, 0x93, 0x8F, 0xA7, 0x18, 0x63, + 0xA3, 0x0D, 0xC6, 0x18, 0xE4, 0xC3, 0x19, 0x86, 0x39, 0x68, 0x87, 0x31, + 0x8E, 0x5A, 0x71, 0xCB, 0x53, 0x96, 0x9C, 0x62, 0xD1, 0x25, 0xA7, 0x18, + 0x64, 0xE2, 0x69, 0xC6, 0x18, 0xE8, 0xC4, 0x70, 0x86, 0x39, 0x70, 0xD0, + 0xE1, 0x8E, 0x5A, 0x21, 0xE0, 0xE2, 0xD2, 0x9C, 0x62, 0x81, 0xA4, 0xE3, + 0x08, 0xB7, 0x01, 0x38, 0xC3, 0x19, 0x34, 0x01, 0x30, 0xC7, 0x2E, 0x30, + 0x01, 0x31, 0xCB, 0x4C, 0x40, 0x01, 0x72, 0xD3, 0x8D, 0x00, 0x03, 0xB4, + 0xE3, 0x1C, 0x00, 0x03, 0x38, 0xC3, 0x38, 0x00, 0x03, 0x30, 0xC7, 0x60, + 0x00, 0x01, 0x31, 0xCB, 0x00, 0x00, 0x01, 0x72, 0x54, 0x00, 0x00, 0x01, + 0xB4, 0x70, 0x00, 0x00, 0x01, 0x18, 0x40, 0x00, 0x00, 0x01, 0x93, 0x00, + 0x00, 0x00, 0x01, 0xBC, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x38, 0x00, + 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, 0x01, 0xFE, + 0x00, 0x00, 0x00, 0x3F, 0xE0, 0x00, 0x00, 0x0F, 0xFF, 0xC0, 0x00, 0x01, + 0xFF, 0xFE, 0x00, 0x00, 0x3F, 0xFF, 0xC0, 0x00, 0x07, 0xFF, 0xFC, 0x00, + 0x03, 0xFF, 0xFF, 0x80, 0x00, 0xFF, 0xFF, 0xF0, 0x00, 0x3F, 0xFF, 0xFE, + 0x00, 0x07, 0xFF, 0xFF, 0xE0, 0x01, 0xFF, 0xFF, 0xFE, 0x00, 0x3F, 0xFF, + 0xFF, 0xE0, 0x07, 0xE1, 0xF8, 0xFC, 0x00, 0xF8, 0x1E, 0x0F, 0x80, 0x3E, + 0x71, 0x98, 0xF8, 0x1F, 0xCF, 0x37, 0x9F, 0xC7, 0xF9, 0xC6, 0x63, 0xFC, + 0xFF, 0x01, 0xE0, 0x7F, 0xBF, 0xF0, 0x7C, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, + 0x03, 0xFF, 0xBF, 0xF0, 0x00, 0x7F, 0xE7, 0xFE, 0x00, 0x1F, 0xFC, 0x7F, + 0xE0, 0x03, 0xFF, 0x0F, 0xFE, 0x00, 0xFF, 0xC0, 0xFF, 0xF0, 0x7F, 0xF0, + 0x07, 0xFF, 0xFF, 0xFC, 0x00, 0x7F, 0xFF, 0xFF, 0x00, 0x03, 0xFF, 0xFF, + 0x00, 0x00, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x00, 0x0C, 0x20, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, + 0x00, 0x20, 0x80, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x00, 0x7C, 0x00, + 0x00, 0x00, 0x3F, 0xE0, 0x00, 0x00, 0x1C, 0x07, 0x00, 0x00, 0x06, 0x00, + 0x30, 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x43, 0x00, 0x30, 0x00, 0x18, + 0xC0, 0x03, 0x00, 0x02, 0x30, 0x00, 0x20, 0x00, 0x44, 0x00, 0x04, 0x00, + 0x11, 0x80, 0x00, 0xC0, 0x02, 0x20, 0x00, 0x08, 0x00, 0x40, 0x00, 0x01, + 0x00, 0x08, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0x04, 0x00, 0x20, 0x00, + 0x00, 0x80, 0x0C, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x03, 0x00, 0x20, + 0x00, 0x00, 0x20, 0x0D, 0xFF, 0xFE, 0x04, 0x01, 0xE0, 0x00, 0x00, 0x40, + 0x40, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x44, 0x07, 0xFF, 0xFC, + 0x04, 0xFF, 0xF8, 0x0F, 0xFE, 0xBF, 0xFF, 0x01, 0xFF, 0xFF, 0xFF, 0xE0, + 0x3F, 0xFF, 0xFF, 0xFE, 0x0F, 0xFF, 0xC7, 0xFF, 0xC1, 0xFF, 0xF0, 0x3F, + 0xFC, 0x7F, 0xF8, 0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, 0x07, 0xFC, 0x00, + 0x00, 0x07, 0x00, 0xF0, 0x00, 0x03, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x00, + 0x18, 0x00, 0x20, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x08, 0x02, 0x00, + 0x00, 0x00, 0x80, 0x82, 0x00, 0x02, 0x08, 0x11, 0xC0, 0x00, 0x71, 0x04, + 0xE0, 0x00, 0x03, 0x11, 0x90, 0x00, 0x00, 0x33, 0x26, 0x00, 0x00, 0x03, + 0x24, 0x0E, 0x00, 0x0F, 0x05, 0x87, 0xF0, 0x07, 0xF0, 0x61, 0xCF, 0x01, + 0xE7, 0x0C, 0x09, 0x80, 0x0C, 0x81, 0x81, 0x30, 0x01, 0x90, 0x30, 0x26, + 0x00, 0x32, 0x06, 0x04, 0xC0, 0x06, 0x40, 0xC0, 0x98, 0xF8, 0xC8, 0x18, + 0x13, 0xFF, 0xF9, 0x03, 0x02, 0x70, 0x07, 0x20, 0xD0, 0x4C, 0x00, 0x64, + 0x12, 0x09, 0x80, 0x0C, 0x82, 0x61, 0x3F, 0xFF, 0x90, 0xC4, 0x27, 0xFF, + 0xF2, 0x10, 0xC4, 0xFF, 0xFE, 0x46, 0x08, 0x9F, 0xDF, 0xC8, 0x80, 0x93, + 0x00, 0x19, 0x30, 0x1A, 0x60, 0x03, 0x2C, 0x01, 0xCC, 0x00, 0x67, 0x80, + 0xC1, 0x80, 0x1C, 0x18, 0x10, 0x18, 0x03, 0x01, 0x03, 0x03, 0xC1, 0xE0, + 0x60, 0x20, 0x18, 0x30, 0x08, 0x06, 0x03, 0xFF, 0x02, 0x00, 0x3F, 0x80, + 0x3F, 0x80, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, + 0x24, 0x80, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, 0x06, 0xC8, 0x00, 0x00, + 0x01, 0x93, 0x00, 0x00, 0x00, 0x55, 0xC0, 0x00, 0x00, 0x1F, 0xF0, 0x00, + 0x00, 0x04, 0x44, 0x00, 0x00, 0x01, 0x11, 0x00, 0x00, 0x00, 0xC4, 0x40, + 0x00, 0x00, 0x31, 0x10, 0x00, 0x00, 0x0C, 0x46, 0x00, 0x00, 0x02, 0x11, + 0x80, 0x00, 0x00, 0x84, 0x20, 0x00, 0x00, 0x61, 0x08, 0x00, 0x00, 0x18, + 0x43, 0x00, 0x00, 0x04, 0x10, 0xC0, 0x00, 0x01, 0x04, 0x10, 0x00, 0x00, + 0x41, 0x04, 0x00, 0x00, 0x30, 0x41, 0x00, 0x00, 0x3C, 0x10, 0x78, 0x00, + 0x7E, 0x04, 0x0F, 0x80, 0x7A, 0x01, 0x01, 0xBC, 0x70, 0xC0, 0x40, 0x43, + 0xD0, 0x10, 0x10, 0x30, 0x10, 0x06, 0x0C, 0x0C, 0x00, 0x00, 0xC7, 0xC6, + 0x00, 0x00, 0x13, 0x1B, 0x00, 0x00, 0x07, 0x83, 0x80, 0x00, 0x00, 0xF1, + 0xE0, 0x00, 0x00, 0x1C, 0x70, 0x00, 0x00, 0x03, 0x18, 0x00, 0x00, 0x03, + 0x83, 0x80, 0x00, 0x01, 0x80, 0x30, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, + 0x07, 0xFC, 0x00, 0x00, 0x07, 0x80, 0xF0, 0x00, 0x01, 0x80, 0x03, 0x80, + 0x00, 0xC0, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, + 0x08, 0x02, 0x00, 0x00, 0x00, 0x80, 0x83, 0x00, 0x00, 0x08, 0x10, 0xE0, + 0x00, 0x01, 0x84, 0x30, 0x00, 0x00, 0x10, 0x8C, 0x00, 0x00, 0x03, 0x21, + 0x00, 0x00, 0x10, 0x24, 0x03, 0x00, 0x0E, 0x04, 0x80, 0xF0, 0x03, 0x00, + 0xE0, 0x1E, 0x01, 0xC0, 0x0C, 0x03, 0xC0, 0x3E, 0x01, 0x80, 0x30, 0x00, + 0xF0, 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, + 0x00, 0x1E, 0x18, 0x00, 0x07, 0x07, 0xE1, 0x00, 0x00, 0x30, 0xFF, 0x90, + 0x00, 0x02, 0x1F, 0xFA, 0x00, 0x00, 0x43, 0xFF, 0x40, 0x00, 0x30, 0x7F, + 0xE4, 0x00, 0x01, 0x0F, 0xFC, 0x80, 0x00, 0x20, 0xFF, 0x88, 0x00, 0x0C, + 0x3F, 0xE1, 0x80, 0x06, 0x07, 0xF0, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0xE0, 0x01, 0x80, 0x00, 0x30, 0x00, + 0x0C, 0x00, 0x1C, 0x00, 0x00, 0x70, 0x1E, 0x00, 0x00, 0x01, 0xFE, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xC0, 0x30, 0x00, 0xC0, 0xC0, + 0x00, 0x30, 0x30, 0x40, 0x30, 0x04, 0x04, 0x30, 0x04, 0x01, 0x00, 0x08, + 0x00, 0x00, 0x24, 0x02, 0x3C, 0x00, 0x09, 0x80, 0x99, 0x80, 0x02, 0x00, + 0x2C, 0x20, 0x00, 0x80, 0x06, 0x08, 0xF0, 0x20, 0x01, 0x86, 0x47, 0x18, + 0x1C, 0x3F, 0x10, 0x7C, 0x01, 0x0C, 0x04, 0x00, 0x00, 0x0F, 0x80, 0x80, + 0x00, 0x0C, 0x78, 0x21, 0x80, 0x02, 0x13, 0x08, 0x20, 0x01, 0x04, 0x7E, + 0x00, 0x00, 0x41, 0x1E, 0x00, 0x00, 0x30, 0x8D, 0x00, 0x0C, 0x0C, 0x66, + 0x23, 0x04, 0x07, 0x11, 0x08, 0x42, 0x01, 0x40, 0x41, 0x01, 0x80, 0x48, + 0x00, 0x40, 0x60, 0x32, 0x00, 0x7C, 0x10, 0x0C, 0x43, 0xE7, 0x8C, 0x07, + 0x88, 0x01, 0x3F, 0x01, 0x21, 0x00, 0x47, 0x80, 0xCC, 0x30, 0x20, 0x00, + 0x31, 0x83, 0xF0, 0x00, 0xCC, 0x38, 0xF0, 0x00, 0x05, 0x83, 0xF0, 0x04, + 0x01, 0x30, 0xE0, 0x01, 0x80, 0xC7, 0xE0, 0x00, 0x60, 0xA1, 0xE0, 0x00, + 0x00, 0x69, 0xC0, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x07, + 0xFC, 0x00, 0x00, 0x07, 0x00, 0x70, 0x00, 0x03, 0x80, 0x03, 0x80, 0x00, + 0xC0, 0x00, 0x18, 0x00, 0x20, 0x00, 0x00, 0x80, 0x08, 0x00, 0x00, 0x08, + 0x02, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, + 0x01, 0x04, 0x00, 0x00, 0x00, 0x11, 0x80, 0x00, 0x00, 0x02, 0x20, 0x00, + 0x00, 0x00, 0x24, 0x01, 0x80, 0x18, 0x05, 0x80, 0x78, 0x07, 0x80, 0xA0, + 0x0F, 0x00, 0xF0, 0x0C, 0x01, 0xE0, 0x1E, 0x01, 0x80, 0x18, 0x01, 0x80, + 0x30, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, + 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x07, 0xC0, 0x01, 0xF0, 0x70, 0x87, + 0xFF, 0xC2, 0x12, 0x1C, 0x00, 0x01, 0xC2, 0x41, 0xFF, 0xFF, 0xF0, 0x4C, + 0x3F, 0xFF, 0xFE, 0x10, 0x83, 0xFF, 0xFF, 0x82, 0x08, 0x1F, 0x03, 0xC0, + 0x81, 0x01, 0xC0, 0x30, 0x10, 0x10, 0x07, 0xF8, 0x04, 0x01, 0x00, 0x00, + 0x01, 0x00, 0x10, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x30, 0x00, 0x1C, + 0x00, 0x1C, 0x00, 0x00, 0xE0, 0x0E, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x00, + 0x00, 0x07, 0xFC, 0x00, 0x00, 0x07, 0x80, 0xE0, 0x00, 0x01, 0x80, 0x03, + 0x00, 0x00, 0xC0, 0x00, 0x18, 0x00, 0x20, 0x00, 0x01, 0x80, 0x08, 0x00, + 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x18, 0x10, + 0x10, 0x01, 0x81, 0x04, 0x1C, 0x00, 0x1E, 0x10, 0x8E, 0x00, 0x00, 0xF2, + 0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x04, 0x80, 0xF0, 0x07, + 0xC0, 0xA0, 0x67, 0x81, 0x9C, 0x0C, 0x08, 0x70, 0x61, 0xC1, 0x83, 0x0F, + 0x18, 0x3C, 0x30, 0x63, 0xE3, 0x0F, 0x86, 0x0C, 0xFC, 0x73, 0xF0, 0xC1, + 0xFB, 0x8F, 0xEE, 0x18, 0x1F, 0xE0, 0xFF, 0x83, 0x03, 0xFC, 0x0F, 0xE0, + 0x50, 0x1E, 0x00, 0xF8, 0x12, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x02, 0x08, 0x00, + 0x00, 0x00, 0x81, 0x00, 0x3F, 0x80, 0x30, 0x10, 0x04, 0x10, 0x04, 0x01, + 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x30, + 0x00, 0x0C, 0x00, 0x18, 0x00, 0x00, 0xF0, 0x1E, 0x00, 0x00, 0x03, 0xFE, + 0x00, 0x00, 0x00, 0x03, 0xFC, 0x00, 0x00, 0x00, 0x70, 0x0E, 0x02, 0x00, + 0x06, 0x00, 0x0E, 0x0C, 0x00, 0x60, 0x00, 0x0E, 0x58, 0x02, 0x00, 0x00, + 0x0F, 0x20, 0x10, 0x00, 0x00, 0x18, 0x40, 0x80, 0x00, 0x00, 0x41, 0x86, + 0x00, 0x00, 0x01, 0x02, 0x10, 0x00, 0x00, 0x08, 0x04, 0x80, 0x00, 0x00, + 0x20, 0x12, 0x00, 0x00, 0x00, 0x80, 0x50, 0x00, 0x00, 0x02, 0x01, 0x40, + 0x00, 0x00, 0x0C, 0x0D, 0x01, 0xF0, 0x1F, 0x18, 0x68, 0x0C, 0x60, 0xC6, + 0x3E, 0x20, 0x00, 0x82, 0x08, 0x08, 0x80, 0x00, 0x00, 0x00, 0x22, 0x00, + 0x00, 0x00, 0x00, 0x88, 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, + 0x08, 0x80, 0x00, 0x00, 0x00, 0x22, 0x0F, 0xC0, 0x03, 0xE0, 0x84, 0x21, + 0xFF, 0xF0, 0x84, 0x10, 0xE0, 0x00, 0x0E, 0x10, 0x41, 0xFF, 0xFF, 0xF8, + 0x40, 0x87, 0xFF, 0xFF, 0xC2, 0x02, 0x0F, 0xFF, 0xFE, 0x08, 0x04, 0x0F, + 0x83, 0xF0, 0x40, 0x10, 0x1C, 0x07, 0x03, 0x00, 0x20, 0x0F, 0xE0, 0x08, + 0x00, 0x40, 0x00, 0x00, 0x40, 0x00, 0x80, 0x00, 0x06, 0x00, 0x01, 0x80, + 0x00, 0x30, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x03, 0xC0, 0x70, 0x00, + 0x00, 0x01, 0xFF, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x01, 0xF8, 0x00, + 0x00, 0x0F, 0xC0, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x0F, 0xF0, + 0x00, 0x01, 0xFF, 0x80, 0x00, 0x3F, 0xF8, 0x00, 0x87, 0xFF, 0x80, 0x18, + 0x7F, 0x78, 0x03, 0x8F, 0xCF, 0x00, 0x38, 0xF8, 0xF0, 0x07, 0x9F, 0x0F, + 0x00, 0x79, 0xE0, 0xF0, 0x0F, 0xDE, 0x0F, 0x04, 0xFF, 0xC0, 0xF9, 0xCF, + 0xFC, 0x0F, 0xFE, 0xFF, 0xC0, 0x7F, 0xEF, 0xFC, 0x07, 0xFF, 0xFF, 0xC0, + 0x3F, 0xFF, 0xF6, 0x01, 0xFF, 0xFF, 0x60, 0x0F, 0xFF, 0xE0, 0x00, 0xFF, + 0x7E, 0x00, 0x07, 0xE7, 0xE0, 0x00, 0x7E, 0x7E, 0x00, 0x07, 0xE3, 0xE0, + 0x00, 0x7C, 0x1E, 0x00, 0x0F, 0xC1, 0xF0, 0x00, 0xF8, 0x0F, 0x80, 0x1F, + 0x00, 0x3E, 0x07, 0xC0, 0x01, 0xFF, 0xF8, 0x00, 0x03, 0xFC, 0x00, 0x00, + 0x0F, 0xFC, 0x00, 0x00, 0x01, 0xC0, 0x38, 0x00, 0x00, 0x38, 0x00, 0x60, + 0x00, 0x03, 0x00, 0x00, 0x80, 0x00, 0x10, 0x00, 0x02, 0x00, 0x01, 0x00, + 0x00, 0x18, 0x00, 0x18, 0x1F, 0x80, 0x60, 0x01, 0x81, 0x86, 0x01, 0x00, + 0x08, 0x08, 0x10, 0x0C, 0x00, 0xC0, 0xC0, 0xF8, 0x30, 0x04, 0x16, 0x03, + 0x60, 0x80, 0x60, 0xF0, 0x13, 0x06, 0x02, 0x01, 0x80, 0x10, 0x18, 0x30, + 0x04, 0x00, 0x80, 0x61, 0x00, 0x30, 0x0C, 0x01, 0x18, 0x00, 0xC0, 0x20, + 0x0C, 0xC0, 0x03, 0x01, 0x00, 0x34, 0x01, 0xF8, 0x04, 0x00, 0xA0, 0x00, + 0x60, 0x30, 0x05, 0x00, 0x01, 0x00, 0xC0, 0x38, 0x00, 0x0C, 0x01, 0x80, + 0xC0, 0x00, 0x20, 0x04, 0x06, 0x00, 0x01, 0x80, 0x00, 0x38, 0x00, 0x06, + 0x00, 0x01, 0xC0, 0x00, 0x18, 0x00, 0x1B, 0x00, 0x00, 0x60, 0x00, 0xCC, + 0x00, 0x01, 0x80, 0x0C, 0x38, 0x00, 0x06, 0x00, 0x40, 0x7C, 0x00, 0x7E, + 0x0E, 0x00, 0xFF, 0xFF, 0x3F, 0xC0, 0x00, 0x00, 0x7F, 0xC0, 0x00, 0x00, + 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x30, 0x01, 0x80, 0x00, 0x00, 0x10, + 0x00, 0x30, 0x00, 0x00, 0x08, 0x00, 0x06, 0x00, 0x00, 0x06, 0x00, 0x00, + 0xC0, 0x00, 0x03, 0x00, 0x00, 0x18, 0x01, 0xC0, 0x80, 0x00, 0x02, 0x0F, + 0xC8, 0x40, 0x00, 0x00, 0xC6, 0x71, 0x30, 0x70, 0x18, 0x19, 0x1C, 0x78, + 0x1C, 0x0E, 0x03, 0x85, 0x03, 0x03, 0x01, 0x81, 0x83, 0x60, 0x40, 0x00, + 0x00, 0xC0, 0x8C, 0x18, 0x00, 0x00, 0x20, 0x61, 0x83, 0x00, 0xE0, 0x18, + 0x30, 0x20, 0x40, 0x38, 0x04, 0x18, 0x0C, 0x18, 0x00, 0x03, 0x04, 0x03, + 0x82, 0x00, 0x00, 0x83, 0x80, 0xA0, 0x80, 0x00, 0x60, 0xA0, 0x6C, 0x30, + 0x00, 0x18, 0x68, 0x13, 0x0C, 0x00, 0x04, 0x13, 0x04, 0x41, 0x00, 0x01, + 0x04, 0x41, 0x10, 0x40, 0x00, 0x41, 0x10, 0x40, 0x10, 0x00, 0x10, 0x04, + 0x10, 0x04, 0x00, 0x04, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x41, 0x80, + 0xC0, 0x00, 0x40, 0x30, 0x20, 0x3F, 0xFF, 0xF8, 0x08, 0x0E, 0x18, 0xFF, + 0xC3, 0x0C, 0x00, 0xFC, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x07, 0xFC, 0x00, + 0x00, 0x07, 0x80, 0xE0, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x00, + 0x18, 0x00, 0x20, 0x00, 0x01, 0x80, 0x08, 0x00, 0x00, 0x08, 0x02, 0x00, + 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x18, 0x10, 0x00, 0x00, 0x01, 0x04, + 0x00, 0x00, 0x00, 0x10, 0x80, 0x00, 0x00, 0x02, 0x20, 0x7E, 0x01, 0xF8, + 0x24, 0x1F, 0xE0, 0x7F, 0x84, 0x82, 0xF4, 0x0B, 0xD0, 0xA0, 0x9E, 0x42, + 0x79, 0x0C, 0x10, 0x88, 0x42, 0x21, 0x82, 0x01, 0x08, 0x04, 0x30, 0x40, + 0x21, 0x00, 0x86, 0x04, 0x08, 0x10, 0x20, 0xC0, 0xC3, 0x03, 0x0C, 0x18, + 0x07, 0x80, 0x1E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, + 0x12, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, + 0x00, 0x10, 0x80, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x00, 0x81, 0x00, + 0x7F, 0xE0, 0x30, 0x10, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, + 0x10, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, 0x30, 0x00, 0x0C, 0x00, 0x18, + 0x00, 0x00, 0xF0, 0x1E, 0x00, 0x00, 0x03, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x7F, 0x80, 0x00, 0x00, 0x00, 0xE0, 0x1C, 0x00, 0x00, 0x00, 0xC0, 0x00, + 0xC0, 0x00, 0x00, 0xC0, 0x00, 0x1C, 0x00, 0x00, 0x60, 0x00, 0x01, 0x80, + 0x00, 0x30, 0x00, 0x00, 0x30, 0x00, 0x18, 0x00, 0x00, 0x06, 0x00, 0x0C, + 0x00, 0x00, 0x00, 0xC0, 0x03, 0x00, 0x00, 0xF0, 0x30, 0x01, 0x80, 0x00, + 0x66, 0x06, 0x00, 0x60, 0x78, 0x10, 0x81, 0x80, 0x30, 0x13, 0x04, 0x00, + 0x30, 0x0C, 0x08, 0x00, 0x00, 0x0C, 0x07, 0x02, 0x00, 0x00, 0x43, 0x01, + 0x80, 0x00, 0x00, 0x10, 0x60, 0x60, 0x00, 0x00, 0x08, 0x18, 0x18, 0x00, + 0x00, 0x04, 0x06, 0x06, 0x00, 0x00, 0x06, 0x01, 0x81, 0x81, 0xC0, 0x07, + 0x00, 0x60, 0x60, 0x3E, 0x0F, 0x00, 0x18, 0x18, 0x01, 0xFF, 0x00, 0x06, + 0x07, 0xE0, 0x00, 0x00, 0x0F, 0x87, 0xCD, 0xC0, 0x00, 0x66, 0x79, 0x31, + 0x50, 0x00, 0x27, 0x12, 0x46, 0x32, 0x00, 0x19, 0x88, 0x98, 0x8C, 0x80, + 0x04, 0x46, 0x7B, 0x11, 0x20, 0x01, 0x11, 0x36, 0x22, 0x08, 0x00, 0x40, + 0x99, 0xC4, 0x01, 0x00, 0x10, 0x0C, 0xF8, 0x80, 0x40, 0x08, 0x06, 0x79, + 0x80, 0x10, 0x02, 0x00, 0x26, 0x30, 0x04, 0x00, 0x80, 0x11, 0x40, 0x01, + 0x00, 0x20, 0x00, 0xD8, 0x00, 0xC0, 0x0C, 0x00, 0x61, 0x80, 0x38, 0x07, + 0x00, 0x60, 0x38, 0x37, 0xFF, 0xB0, 0x70, 0x01, 0xF8, 0x00, 0x07, 0xE0, + 0x00, 0x00, 0x07, 0xFC, 0x00, 0x00, 0x07, 0x80, 0xE0, 0x00, 0x01, 0x80, + 0x03, 0x00, 0x00, 0xC0, 0x00, 0x18, 0x00, 0x20, 0x00, 0x01, 0x80, 0x08, + 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x00, 0x80, 0x81, 0xC0, 0x00, 0x18, + 0x10, 0x70, 0x00, 0x01, 0x04, 0x18, 0x00, 0x00, 0x10, 0x86, 0x00, 0x00, + 0x02, 0x20, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x02, 0x04, 0x80, 0x30, + 0x01, 0xC0, 0xA0, 0x0F, 0x00, 0x60, 0x0C, 0x01, 0xE0, 0x18, 0x01, 0x80, + 0x3C, 0x07, 0xC0, 0x30, 0x03, 0x00, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x50, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x04, 0x02, 0x40, 0x38, + 0x01, 0x80, 0x44, 0x01, 0xC0, 0xE0, 0x10, 0x80, 0x07, 0xE0, 0x02, 0x08, + 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x30, 0x10, 0x00, 0x00, 0x04, + 0x01, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x40, 0x01, 0x80, 0x00, + 0x30, 0x00, 0x0C, 0x00, 0x18, 0x00, 0x00, 0xF0, 0x1E, 0x00, 0x00, 0x03, + 0xFE, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0x00, 0x00, 0x03, 0xB8, 0x1C, 0x00, + 0x00, 0x60, 0xC0, 0x30, 0x00, 0x18, 0x00, 0x00, 0x80, 0x03, 0x00, 0x07, + 0xE4, 0x00, 0x61, 0xC0, 0x03, 0x20, 0x0C, 0x1E, 0x00, 0x01, 0x00, 0x81, + 0xE0, 0x00, 0x08, 0x10, 0x1E, 0x01, 0x80, 0xC3, 0x00, 0xC0, 0x3C, 0x04, + 0x20, 0x00, 0x03, 0xC0, 0x26, 0x00, 0x00, 0x3C, 0x02, 0x60, 0x00, 0x01, + 0x80, 0x24, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x14, 0x00, + 0x7F, 0x00, 0x01, 0x40, 0x1C, 0x1C, 0x00, 0x14, 0x00, 0x00, 0x60, 0x01, + 0x40, 0x00, 0x02, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0xF8, 0x00, 0x00, + 0x00, 0x18, 0x80, 0xFC, 0x00, 0x03, 0x8C, 0xF0, 0x20, 0x00, 0x28, 0x78, + 0x06, 0x00, 0x02, 0x40, 0x07, 0x80, 0x00, 0x64, 0x01, 0xC0, 0x00, 0x04, + 0x40, 0x3C, 0x00, 0x00, 0xC4, 0x00, 0x40, 0x00, 0x18, 0x40, 0x04, 0x00, + 0x01, 0x04, 0x01, 0xC0, 0x00, 0x20, 0x40, 0x04, 0x00, 0x0C, 0x04, 0x00, + 0xC0, 0x01, 0x80, 0x60, 0x04, 0x00, 0x70, 0x03, 0x00, 0x60, 0x3C, 0x00, + 0x18, 0x1F, 0xFF, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x1D, 0xFC, + 0x00, 0x00, 0x0C, 0xC4, 0x80, 0x00, 0x06, 0x19, 0x9C, 0x00, 0x07, 0x06, + 0x66, 0xE0, 0x01, 0x03, 0x33, 0x43, 0x00, 0xC0, 0x8C, 0xD8, 0x30, 0x10, + 0x06, 0x66, 0x01, 0x04, 0x00, 0x31, 0x00, 0x10, 0x80, 0x00, 0xC0, 0x01, + 0x10, 0x00, 0x68, 0x00, 0x32, 0x07, 0xF3, 0x00, 0x02, 0x41, 0x84, 0xC0, + 0x00, 0x64, 0x00, 0x70, 0x00, 0x04, 0xC0, 0x18, 0x03, 0x80, 0x8C, 0x1F, + 0x00, 0x78, 0x1B, 0xFF, 0xE0, 0x0F, 0x01, 0x60, 0x3C, 0x01, 0xE0, 0x2C, + 0x03, 0x00, 0x38, 0x05, 0x80, 0x00, 0x00, 0x00, 0xB0, 0x00, 0x00, 0x00, + 0x16, 0x00, 0x00, 0x00, 0x02, 0xC0, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, + 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x20, 0x18, 0x00, 0x80, 0x46, 0x03, + 0xFF, 0xF0, 0x08, 0x40, 0x00, 0x00, 0x02, 0x0C, 0x00, 0x00, 0x00, 0x40, + 0x80, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x06, 0x01, 0x80, 0x00, 0x01, + 0x80, 0x18, 0x00, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x10, 0x00, 0x0C, 0x00, + 0x0C, 0x00, 0x00, 0x70, 0x0E, 0x00, 0x00, 0x01, 0xFE, 0x00, 0x00, 0x01, + 0xC0, 0x00, 0x01, 0xF8, 0x00, 0x00, 0x86, 0x00, 0x00, 0x41, 0xC0, 0x00, + 0x30, 0x30, 0x00, 0x1C, 0x0C, 0x00, 0x1B, 0x83, 0x80, 0x08, 0x60, 0x60, + 0x04, 0x18, 0x18, 0x03, 0x07, 0x04, 0x00, 0xC1, 0x83, 0x00, 0x30, 0x60, + 0x80, 0x1F, 0xF0, 0x60, 0x3C, 0x3E, 0x10, 0x30, 0x03, 0x8C, 0x70, 0x00, + 0x62, 0x60, 0x10, 0x11, 0x20, 0x7E, 0x0C, 0xF0, 0x61, 0x82, 0x6C, 0xE0, + 0x61, 0xB3, 0xC0, 0x10, 0x0B, 0x80, 0x08, 0x07, 0x60, 0x04, 0x03, 0x18, + 0x02, 0x03, 0x86, 0x03, 0x01, 0xC1, 0x01, 0x80, 0xE0, 0x61, 0x80, 0x58, + 0x1F, 0x80, 0x24, 0x00, 0x00, 0x33, 0x00, 0x00, 0x10, 0xC0, 0x00, 0x18, + 0x30, 0x00, 0x18, 0x0C, 0x00, 0x18, 0x03, 0x80, 0x18, 0x00, 0xFF, 0xF8, + 0x00, 0x0F, 0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0x00, 0x3F, 0xFC, 0xE1, 0xF8, 0x7E, 0x1F, 0x87, 0xE1, 0xF8, 0x7E, 0x1F, + 0x87, 0xE1, 0xC0, 0x00, 0x38, 0x30, 0x00, 0x30, 0x70, 0x00, 0x70, 0x70, + 0x00, 0x70, 0x70, 0x00, 0x70, 0xE0, 0x00, 0x60, 0xE0, 0x00, 0xE0, 0xE0, + 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0x01, 0xC1, 0xC0, + 0x01, 0xC1, 0xC0, 0x01, 0xC1, 0x80, 0x03, 0x83, 0x80, 0x03, 0x83, 0x80, + 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFC, 0x07, 0x07, 0x00, + 0x07, 0x07, 0x00, 0x07, 0x06, 0x00, 0x0E, 0x0E, 0x00, 0x0E, 0x0E, 0x00, + 0x0E, 0x0E, 0x00, 0x0E, 0x0C, 0x00, 0x01, 0x80, 0x00, 0xC0, 0x00, 0x60, + 0x00, 0x30, 0x00, 0xFF, 0x81, 0xFF, 0xF1, 0xFF, 0xF8, 0xF3, 0x0C, 0xF1, + 0x80, 0x70, 0xC0, 0x38, 0x60, 0x1C, 0x30, 0x0F, 0x18, 0x03, 0xFC, 0x00, + 0xFF, 0xC0, 0x1F, 0xF8, 0x01, 0xFF, 0x00, 0xC7, 0x80, 0x61, 0xE0, 0x30, + 0x70, 0x18, 0x38, 0x0C, 0x1E, 0x06, 0x1F, 0xC3, 0x3E, 0xFF, 0xFE, 0x3F, + 0xFE, 0x03, 0xFC, 0x00, 0x30, 0x00, 0x18, 0x00, 0x0C, 0x00, 0x06, 0x00, + 0x03, 0x00, 0x1F, 0x80, 0x06, 0x01, 0xFE, 0x00, 0x70, 0x1E, 0x78, 0x03, + 0x00, 0xE1, 0xC0, 0x30, 0x0E, 0x07, 0x03, 0x80, 0x70, 0x38, 0x18, 0x03, + 0x81, 0xC1, 0xC0, 0x1C, 0x0E, 0x0C, 0x00, 0xE0, 0x70, 0xC0, 0x07, 0x03, + 0x8E, 0x00, 0x1C, 0x38, 0x60, 0x00, 0xF3, 0xC7, 0x00, 0x03, 0xFC, 0x30, + 0xFC, 0x0F, 0xC3, 0x0F, 0xF0, 0x00, 0x38, 0xF3, 0xC0, 0x01, 0x87, 0x0E, + 0x00, 0x1C, 0x70, 0x38, 0x00, 0xC3, 0x81, 0xC0, 0x0C, 0x1C, 0x0E, 0x00, + 0xE0, 0xE0, 0x70, 0x06, 0x07, 0x03, 0x80, 0x70, 0x38, 0x1C, 0x03, 0x00, + 0xE1, 0xC0, 0x30, 0x07, 0x9E, 0x03, 0x80, 0x1F, 0xE0, 0x18, 0x00, 0x7E, + 0x00, 0x01, 0xFC, 0x00, 0x07, 0xFF, 0x00, 0x0F, 0xFF, 0x00, 0x1F, 0x03, + 0x00, 0x1E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x1C, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x1F, 0xC0, + 0x00, 0x3D, 0xE0, 0x0E, 0x78, 0xF0, 0x0E, 0x70, 0x78, 0x1E, 0xF0, 0x3C, + 0x1C, 0xE0, 0x1F, 0x1C, 0xE0, 0x0F, 0xB8, 0xE0, 0x07, 0xF8, 0xE0, 0x03, + 0xF0, 0xF0, 0x01, 0xF0, 0x78, 0x03, 0xF0, 0x3E, 0x0F, 0xF8, 0x3F, 0xFF, + 0x7C, 0x0F, 0xFE, 0x3E, 0x03, 0xF8, 0x1F, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, + 0x0E, 0x1E, 0x1C, 0x18, 0x38, 0x38, 0x70, 0x70, 0x70, 0x70, 0xE0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0x60, 0x70, 0x70, 0x70, 0x38, + 0x38, 0x1C, 0x1C, 0x1C, 0x0E, 0x07, 0xE0, 0x70, 0x70, 0x38, 0x38, 0x1C, + 0x1C, 0x0E, 0x0E, 0x0E, 0x0E, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x0E, 0x0E, 0x0E, 0x0E, 0x1C, 0x1C, 0x38, 0x38, 0x78, 0x70, + 0xE0, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x41, 0x82, 0xF1, 0x8F, 0x39, + 0x9C, 0x1F, 0xF8, 0x07, 0xE0, 0x07, 0xE0, 0x1F, 0xF0, 0x39, 0x9C, 0xF1, + 0x8F, 0x41, 0x82, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x00, 0x38, 0x00, + 0x00, 0x70, 0x00, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x03, 0x80, 0x00, + 0x07, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x70, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x07, + 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x38, 0x00, 0x00, 0x70, + 0x00, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x03, 0x80, 0x00, 0x07, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x77, 0x77, 0x6E, 0xEC, 0xFF, 0xFF, 0xFF, 0xE0, + 0xFF, 0xF0, 0x00, 0x70, 0x0F, 0x00, 0xE0, 0x0E, 0x01, 0xE0, 0x1C, 0x01, + 0xC0, 0x1C, 0x03, 0x80, 0x38, 0x03, 0x80, 0x78, 0x07, 0x00, 0x70, 0x0F, + 0x00, 0xE0, 0x0E, 0x00, 0xE0, 0x1C, 0x01, 0xC0, 0x1C, 0x03, 0x80, 0x38, + 0x03, 0x80, 0x78, 0x07, 0x00, 0x70, 0x0F, 0x00, 0xE0, 0x00, 0x03, 0xF0, + 0x03, 0xFF, 0x01, 0xFF, 0xE0, 0xF8, 0x7C, 0x38, 0x07, 0x1E, 0x01, 0xE7, + 0x00, 0x39, 0xC0, 0x0E, 0xE0, 0x01, 0xF8, 0x00, 0x7E, 0x00, 0x1F, 0x80, + 0x07, 0xE0, 0x01, 0xF8, 0x00, 0x7E, 0x00, 0x1F, 0x80, 0x07, 0xE0, 0x01, + 0xF8, 0x00, 0x77, 0x00, 0x39, 0xC0, 0x0E, 0x78, 0x07, 0x8E, 0x01, 0xC3, + 0xE1, 0xF0, 0x7F, 0xF8, 0x0F, 0xFC, 0x00, 0xFC, 0x00, 0x1F, 0x81, 0xFF, + 0x03, 0xFE, 0x07, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, + 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, + 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, + 0x00, 0x70, 0x00, 0xE0, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x3F, 0xE0, + 0xFF, 0xF8, 0xFF, 0xFC, 0xF0, 0x3E, 0x80, 0x0E, 0x00, 0x0F, 0x00, 0x07, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x1C, + 0x00, 0x38, 0x00, 0x78, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0x80, + 0x0F, 0x00, 0x1E, 0x00, 0x3C, 0x00, 0xF8, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x1F, 0xE0, 0x3F, 0xFC, 0x1F, 0xFF, 0x0C, 0x07, 0xC0, 0x00, + 0xF0, 0x00, 0x38, 0x00, 0x1C, 0x00, 0x0E, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x07, 0x81, 0xFF, 0x80, 0xFF, 0x00, 0x7F, 0xE0, 0x00, 0x7C, 0x00, 0x0E, + 0x00, 0x07, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x00, 0x70, 0x00, 0x78, 0x00, + 0x3B, 0x00, 0x7D, 0xFF, 0xFC, 0xFF, 0xFC, 0x1F, 0xF0, 0x00, 0x00, 0x3E, + 0x00, 0x07, 0xC0, 0x01, 0xF8, 0x00, 0x77, 0x00, 0x0E, 0xE0, 0x03, 0x9C, + 0x00, 0xE3, 0x80, 0x1C, 0x70, 0x07, 0x0E, 0x00, 0xE1, 0xC0, 0x38, 0x38, + 0x0E, 0x07, 0x01, 0xC0, 0xE0, 0x70, 0x1C, 0x1C, 0x03, 0x83, 0x80, 0x70, + 0xE0, 0x0E, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0xE0, + 0x00, 0x1C, 0x00, 0x03, 0x80, 0x00, 0x70, 0x00, 0x0E, 0x00, 0x01, 0xC0, + 0x7F, 0xFE, 0x3F, 0xFF, 0x1F, 0xFF, 0x8E, 0x00, 0x07, 0x00, 0x03, 0x80, + 0x01, 0xC0, 0x00, 0xE0, 0x00, 0x70, 0x00, 0x3F, 0xF0, 0x1F, 0xFE, 0x0F, + 0xFF, 0xC6, 0x03, 0xE0, 0x00, 0x78, 0x00, 0x1E, 0x00, 0x07, 0x00, 0x03, + 0x80, 0x01, 0xC0, 0x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, 0xFE, 0x01, 0xFE, 0x00, 0x07, 0xF0, + 0x07, 0xFF, 0x03, 0xFF, 0xE1, 0xF0, 0x7C, 0x70, 0x07, 0x3C, 0x01, 0xEE, + 0x00, 0x3B, 0x80, 0x0E, 0xE0, 0x03, 0xF8, 0x00, 0xFE, 0x00, 0x3F, 0xC0, + 0x1F, 0x70, 0x07, 0xDF, 0x07, 0xF3, 0xFF, 0xDC, 0x7F, 0xE7, 0x07, 0xF1, + 0xC0, 0x00, 0xF0, 0x00, 0x38, 0x00, 0x0E, 0x00, 0x07, 0x00, 0x03, 0xC3, + 0x03, 0xE0, 0xFF, 0xF0, 0x3F, 0xF8, 0x03, 0xF8, 0x00, 0xFF, 0xF0, 0x00, + 0x00, 0x00, 0x3F, 0xFC, 0x77, 0x77, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, + 0x77, 0x6E, 0xEC, 0x00, 0x00, 0x04, 0x00, 0x00, 0xF0, 0x00, 0x1F, 0xC0, + 0x03, 0xFE, 0x00, 0x3F, 0xC0, 0x07, 0xFC, 0x00, 0xFF, 0x80, 0x0F, 0xF0, + 0x00, 0xFF, 0x00, 0x03, 0xE0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, + 0x0F, 0xF8, 0x00, 0x07, 0xFC, 0x00, 0x03, 0xFC, 0x00, 0x03, 0xFE, 0x00, + 0x01, 0xFC, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x40, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, + 0x80, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0xE0, 0x00, 0x1F, 0xF0, 0x00, 0x0F, + 0xF0, 0x00, 0x0F, 0xF8, 0x00, 0x07, 0xFC, 0x00, 0x03, 0xFC, 0x00, 0x03, + 0xFC, 0x00, 0x01, 0xF0, 0x00, 0x3F, 0xC0, 0x03, 0xFC, 0x00, 0x7F, 0xC0, + 0x0F, 0xF8, 0x00, 0xFF, 0x00, 0x1F, 0xF0, 0x00, 0xFE, 0x00, 0x03, 0xC0, + 0x00, 0x08, 0x00, 0x00, 0x00, 0x1F, 0xC1, 0xFF, 0xCF, 0xFF, 0xBC, 0x1E, + 0x80, 0x3C, 0x00, 0x70, 0x01, 0xC0, 0x07, 0x00, 0x78, 0x03, 0xE0, 0x1F, + 0x00, 0xF8, 0x07, 0xC0, 0x3C, 0x00, 0xE0, 0x03, 0x80, 0x0E, 0x00, 0x38, + 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x03, 0x80, 0x0E, + 0x00, 0x38, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0xFF, 0xFC, 0x00, 0x07, + 0xFF, 0xFE, 0x00, 0x1F, 0x80, 0x7E, 0x00, 0x7C, 0x00, 0x3E, 0x01, 0xE0, + 0x00, 0x1E, 0x07, 0x80, 0x00, 0x1E, 0x1E, 0x00, 0x00, 0x1E, 0x38, 0x0F, + 0x8E, 0x1C, 0xF0, 0x7F, 0xDC, 0x39, 0xC1, 0xFF, 0xF8, 0x3F, 0x83, 0xC1, + 0xF0, 0x7E, 0x0F, 0x01, 0xE0, 0xFC, 0x1C, 0x01, 0xC1, 0xF8, 0x38, 0x03, + 0x83, 0xF0, 0x70, 0x07, 0x07, 0xE0, 0xE0, 0x0E, 0x1F, 0xC1, 0xC0, 0x1C, + 0x3B, 0x83, 0xC0, 0x78, 0xF7, 0x83, 0xC1, 0xF3, 0xC7, 0x07, 0xFF, 0xFF, + 0x0E, 0x07, 0xFD, 0xF8, 0x0E, 0x03, 0xE3, 0xC0, 0x1E, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x02, 0x00, 0x3F, 0x00, 0x0E, 0x00, + 0x1F, 0x80, 0xFC, 0x00, 0x1F, 0xFF, 0xF0, 0x00, 0x0F, 0xFF, 0x80, 0x00, + 0x07, 0xF8, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0xF8, 0x00, 0x01, 0xF0, + 0x00, 0x07, 0x70, 0x00, 0x0E, 0xE0, 0x00, 0x1D, 0xC0, 0x00, 0x71, 0xC0, + 0x00, 0xE3, 0x80, 0x03, 0xC7, 0x80, 0x07, 0x07, 0x00, 0x0E, 0x0E, 0x00, + 0x3C, 0x1E, 0x00, 0x70, 0x1C, 0x00, 0xE0, 0x38, 0x03, 0x80, 0x38, 0x07, + 0x00, 0x70, 0x1E, 0x00, 0xF0, 0x3F, 0xFF, 0xE0, 0x7F, 0xFF, 0xC1, 0xFF, + 0xFF, 0xC3, 0x80, 0x03, 0x87, 0x00, 0x07, 0x1C, 0x00, 0x07, 0x38, 0x00, + 0x0E, 0x70, 0x00, 0x1D, 0xC0, 0x00, 0x1C, 0xFF, 0xF8, 0x3F, 0xFF, 0x8F, + 0xFF, 0xF3, 0x80, 0x3C, 0xE0, 0x07, 0xB8, 0x00, 0xEE, 0x00, 0x3B, 0x80, + 0x0E, 0xE0, 0x03, 0xB8, 0x01, 0xEE, 0x00, 0xF3, 0xFF, 0xF8, 0xFF, 0xFC, + 0x3F, 0xFF, 0xCE, 0x00, 0xFB, 0x80, 0x0E, 0xE0, 0x01, 0xF8, 0x00, 0x7E, + 0x00, 0x1F, 0x80, 0x07, 0xE0, 0x01, 0xF8, 0x00, 0xFE, 0x00, 0xFB, 0xFF, + 0xFC, 0xFF, 0xFE, 0x3F, 0xFE, 0x00, 0x00, 0x7F, 0x80, 0x1F, 0xFF, 0x83, + 0xFF, 0xFE, 0x3F, 0x01, 0xF3, 0xE0, 0x01, 0x9E, 0x00, 0x05, 0xE0, 0x00, + 0x0E, 0x00, 0x00, 0x70, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, + 0x00, 0x0E, 0x00,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, 0xFF, 0xB8, 0x00, 0x70, 0x00, 0xE0, 0x01, + 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, + 0x00, 0xE0, 0x01, 0xC0, 0x00, 0x00, 0xFF, 0x80, 0x0F, 0xFF, 0xC0, 0xFF, + 0xFF, 0x87, 0xE0, 0x3E, 0x3E, 0x00, 0x18, 0xE0, 0x00, 0x27, 0x80, 0x00, + 0x1C, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x0E, 0x00, 0x00, 0x38, + 0x00, 0x00, 0xE0, 0x07, 0xFF, 0x80, 0x1F, 0xFE, 0x00, 0x7F, 0xF8, 0x00, + 0x07, 0xE0, 0x00, 0x1D, 0xC0, 0x00, 0x77, 0x00, 0x01, 0xDE, 0x00, 0x07, + 0x38, 0x00, 0x1C, 0xF8, 0x00, 0x71, 0xF8, 0x07, 0xC3, 0xFF, 0xFE, 0x03, + 0xFF, 0xE0, 0x03, 0xFE, 0x00, 0xE0, 0x00, 0xFC, 0x00, 0x1F, 0x80, 0x03, + 0xF0, 0x00, 0x7E, 0x00, 0x0F, 0xC0, 0x01, 0xF8, 0x00, 0x3F, 0x00, 0x07, + 0xE0, 0x00, 0xFC, 0x00, 0x1F, 0x80, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF8, 0x00, 0x3F, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x00, 0x1F, + 0x80, 0x03, 0xF0, 0x00, 0x7E, 0x00, 0x0F, 0xC0, 0x01, 0xF8, 0x00, 0x3F, + 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x00, 0x1C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, + 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 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+ 0x79, 0xC0, 0x07, 0x38, 0x00, 0xE7, 0x00, 0x0E, 0xE0, 0x01, 0xDC, 0x00, + 0x1C, 0x07, 0xFC, 0x07, 0xFF, 0xC3, 0xFF, 0xF1, 0xF0, 0x0C, 0xF0, 0x00, + 0x38, 0x00, 0x0E, 0x00, 0x03, 0x80, 0x00, 0xE0, 0x00, 0x3C, 0x00, 0x07, + 0xC0, 0x00, 0xFF, 0x80, 0x1F, 0xFC, 0x00, 0xFF, 0xC0, 0x01, 0xF8, 0x00, + 0x1E, 0x00, 0x03, 0xC0, 0x00, 0x70, 0x00, 0x1C, 0x00, 0x07, 0x00, 0x01, + 0xE0, 0x00, 0xEF, 0x00, 0xFB, 0xFF, 0xFC, 0xFF, 0xFE, 0x0F, 0xFE, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0xE0, 0x00, 0x07, + 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, + 0x03, 0x80, 0x00, 0x1C, 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, + 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, + 0x1C, 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, + 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0xE0, 0x00, 0xFC, + 0x00, 0x1F, 0x80, 0x03, 0xF0, 0x00, 0x7E, 0x00, 0x0F, 0xC0, 0x01, 0xF8, + 0x00, 0x3F, 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x00, 0x1F, 0x80, 0x03, 0xF0, + 0x00, 0x7E, 0x00, 0x0F, 0xC0, 0x01, 0xF8, 0x00, 0x3F, 0x00, 0x07, 0xE0, + 0x00, 0xFC, 0x00, 0x1F, 0x80, 0x03, 0xF8, 0x00, 0xF7, 0x00, 0x1C, 0xF0, + 0x07, 0x8F, 0x01, 0xE1, 0xFF, 0xFC, 0x0F, 0xFE, 0x00, 0x7F, 0x00, 0xE0, + 0x00, 0x0E, 0xE0, 0x00, 0x39, 0xC0, 0x00, 0x73, 0x80, 0x01, 0xE3, 0x80, + 0x03, 0x87, 0x00, 0x07, 0x0F, 0x00, 0x1E, 0x0E, 0x00, 0x38, 0x1C, 0x00, + 0x70, 0x3C, 0x01, 0xE0, 0x38, 0x03, 0x80, 0x70, 0x07, 0x00, 0x70, 0x1C, + 0x00, 0xE0, 0x38, 0x01, 0xE0, 0xF0, 0x01, 0xC1, 0xC0, 0x03, 0x83, 0x80, + 0x07, 0x8F, 0x00, 0x07, 0x1C, 0x00, 0x0E, 0x38, 0x00, 0x0E, 0xE0, 0x00, + 0x1D, 0xC0, 0x00, 0x3F, 0x80, 0x00, 0x3E, 0x00, 0x00, 0x7C, 0x00, 0x00, + 0xF8, 0x00, 0xE0, 0x03, 0xC0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0x70, 0x07, + 0xE0, 0x0E, 0x70, 0x07, 0xE0, 0x0E, 0x70, 0x07, 0xE0, 0x0E, 0x70, 0x0F, + 0xF0, 0x0E, 0x38, 0x0E, 0x70, 0x1C, 0x38, 0x0E, 0x70, 0x1C, 0x38, 0x0E, + 0x70, 0x1C, 0x38, 0x1E, 0x78, 0x1C, 0x1C, 0x1C, 0x38, 0x38, 0x1C, 0x1C, + 0x38, 0x38, 0x1C, 0x1C, 0x38, 0x38, 0x1C, 0x1C, 0x38, 0x38, 0x0E, 0x38, + 0x1C, 0x70, 0x0E, 0x38, 0x1C, 0x70, 0x0E, 0x38, 0x1C, 0x70, 0x0E, 0x38, + 0x1C, 0x70, 0x0F, 0x70, 0x0E, 0xE0, 0x07, 0x70, 0x0E, 0xE0, 0x07, 0x70, + 0x0E, 0xE0, 0x07, 0x70, 0x0E, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x03, 0xE0, + 0x07, 0xC0, 0x03, 0xE0, 0x07, 0xC0, 0x03, 0xE0, 0x07, 0xC0, 0x78, 0x00, + 0x78, 0xF0, 0x03, 0xC1, 0xC0, 0x0E, 0x07, 0x80, 0x78, 0x0F, 0x03, 0xC0, + 0x1C, 0x0E, 0x00, 0x78, 0x78, 0x00, 0xF3, 0xC0, 0x01, 0xCE, 0x00, 0x07, + 0xF8, 0x00, 0x0F, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x03, 0xF0, + 0x00, 0x0F, 0xC0, 0x00, 0x7F, 0x80, 0x03, 0xCF, 0x00, 0x0E, 0x1C, 0x00, + 0x78, 0x78, 0x03, 0xC0, 0xF0, 0x0E, 0x01, 0xC0, 0x78, 0x07, 0x83, 0xC0, + 0x0F, 0x0E, 0x00, 0x1C, 0x78, 0x00, 0x7B, 0xC0, 0x00, 0xF0, 0xF0, 0x00, + 0x7B, 0xC0, 0x07, 0x8E, 0x00, 0x38, 0x78, 0x03, 0xC1, 0xE0, 0x3C, 0x07, + 0x01, 0xC0, 0x3C, 0x1E, 0x00, 0xF1, 0xE0, 0x03, 0x8E, 0x00, 0x1E, 0xF0, + 0x00, 0x7F, 0x00, 0x01, 0xF0, 0x00, 0x0F, 0x80, 0x00, 0x38, 0x00, 0x01, + 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x1C, 0x00, + 0x00, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, + 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, + 0xBF, 0xFF, 0xFC, 0x00, 0x01, 0xC0, 0x00, 0x1E, 0x00, 0x01, 0xE0, 0x00, + 0x1E, 0x00, 0x01, 0xE0, 0x00, 0x0E, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x0F, 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, 0x1C, 0x0F, + 0x01, 0xC1, 0xC0, 0x38, 0x38, 0x07, 0x8F, 0x00, 0x71, 0xC0, 0x0E, 0x38, + 0x00, 0xEE, 0x00, 0x1D, 0xC0, 0x03, 0xF8, 0x00, 0x3E, 0x00, 0x07, 0xC0, + 0x00, 0xE0, 0x1E, 0x01, 0xFC, 0x0F, 0xC0, 0xF7, 0x03, 0xF0, 0x39, 0xC0, + 0xFC, 0x0E, 0x70, 0x3F, 0x03, 0x9E, 0x1C, 0xE1, 0xE3, 0x87, 0x38, 0x70, + 0xE1, 0xCE, 0x1C, 0x38, 0x73, 0x87, 0x07, 0x38, 0x73, 0x81, 0xCE, 0x1C, + 0xE0, 0x73, 0x87, 0x38, 0x1D, 0xE1, 0xEE, 0x03, 0xF0, 0x3F, 0x00, 0xFC, + 0x0F, 0xC0, 0x3F, 0x03, 0xF0, 0x0F, 0xC0, 0xFC, 0x01, 0xE0, 0x1E, 0x00, + 0x78, 0x07, 0x80, 0x78, 0x01, 0xE7, 0x80, 0x78, 0x78, 0x1E, 0x07, 0x03, + 0x80, 0xF0, 0xF0, 0x0F, 0x3C, 0x00, 0xFF, 0x00, 0x0F, 0xC0, 0x00, 0xF0, + 0x00, 0x1E, 0x00, 0x07, 0xE0, 0x01, 0xFE, 0x00, 0x79, 0xC0, 0x1E, 0x3C, + 0x03, 0x83, 0xC0, 0xF0, 0x38, 0x3C, 0x07, 0x8F, 0x00, 0x7B, 0xC0, 0x07, + 0x80, 0xE0, 0x00, 0xEE, 0x00, 0x39, 0xC0, 0x07, 0x1C, 0x01, 0xE3, 0x80, + 0x38, 0x78, 0x0F, 0x07, 0x01, 0xC0, 0xF0, 0x38, 0x0E, 0x0E, 0x01, 0xC1, + 0xC0, 0x1C, 0x78, 0x03, 0x8E, 0x00, 0x79, 0xC0, 0x07, 0x70, 0x00, 0xFE, + 0x00, 0x0F, 0xC0, 0x01, 0xF0, 0x00, 0x1E, 0x00, 0x03, 0x80, 0x00, 0x70, + 0x00, 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 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x0F, 0xFE, 0x01, + 0xFF, 0xF0, 0x3E, 0x0F, 0x07, 0x80, 0x30, 0xF0, 0x01, 0x0E, 0x00, 0x00, + 0xE0, 0x00, 0x1C, 0x00, 0x07, 0xFF, 0xF0, 0xFF, 0xFE, 0x01, 0xC0, 0x00, + 0x1C, 0x00, 0x01, 0xC0, 0x00, 0x1C, 0x00, 0x07, 0xFF, 0xC0, 0xFF, 0xF8, + 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0xE0, 0x00, 0x0F, 0x00, 0x10, 0x78, + 0x03, 0x03, 0xE0, 0xF0, 0x1F, 0xFF, 0x00, 0xFF, 0xE0, 0x03, 0xF8, 0x77, + 0x77, 0x6E, 0xEC, 0x00, 0x7E, 0x01, 0xFC, 0x07, 0xF8, 0x1E, 0x00, 0x38, + 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x1F, 0xFC, 0x3F, 0xF8, 0x7F, 0xF0, + 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, + 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, + 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x01, + 0xE0, 0x7F, 0x80, 0xFE, 0x01, 0xF8, 0x00, 0x71, 0xDC, 0x77, 0x1D, 0xC7, + 0x61, 0xB8, 0xEE, 0x3B, 0x0C, 0xE0, 0x0E, 0x00, 0xFC, 0x01, 0xC0, 0x1F, + 0x80, 0x38, 0x03, 0xF0, 0x07, 0x00, 0x70, 0x03, 0x80, 0x07, 0x00, 0x0E, + 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x7F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFC, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, + 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, + 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, + 0x38, 0x00, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, + 0x70, 0x00, 0xE0, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x0E, 0x00, 0x1C, + 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, 0x00, + 0x0E, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xE0, 0x01, 0xC0, 0x03, + 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x1F, 0x80, 0x06, + 0x00, 0x00, 0x07, 0xF8, 0x01, 0xC0, 0x00, 0x01, 0xE7, 0x80, 0x30, 0x00, + 0x00, 0x38, 0x70, 0x0C, 0x00, 0x00, 0x0E, 0x07, 0x03, 0x80, 0x00, 0x01, + 0xC0, 0xE0, 0x60, 0x00, 0x00, 0x38, 0x1C, 0x1C, 0x00, 0x00, 0x07, 0x03, + 0x83, 0x00, 0x00, 0x00, 0xE0, 0x70, 0xC0, 0x00, 0x00, 0x1C, 0x0E, 0x38, + 0x00, 0x00, 0x01, 0xC3, 0x86, 0x00, 0x00, 0x00, 0x3C, 0xF1, 0xC0, 0x00, + 0x00, 0x03, 0xFC, 0x30, 0xFC, 0x03, 0xF0, 0x3F, 0x0C, 0x3F, 0xC0, 0xFF, + 0x00, 0x03, 0x8F, 0x3C, 0x3C, 0xF0, 0x00, 0x61, 0xC3, 0x87, 0x0E, 0x00, + 0x1C, 0x70, 0x39, 0xC0, 0xE0, 0x03, 0x0E, 0x07, 0x38, 0x1C, 0x00, 0xC1, + 0xC0, 0xE7, 0x03,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 0xF0, 0x00, 0x73, 0xE0, 0x01, 0xC7, 0xC0, 0x07, + 0x1D, 0xC0, 0x00, 0x3B, 0x80, 0x00, 0x77, 0x00, 0x01, 0xC7, 0x00, 0x03, + 0x8E, 0x00, 0x0F, 0x1E, 0x00, 0x1C, 0x1C, 0x00, 0x38, 0x38, 0x00, 0xF0, + 0x78, 0x01, 0xC0, 0x70, 0x03, 0x80, 0xE0, 0x0E, 0x00, 0xE0, 0x1C, 0x01, + 0xC0, 0x78, 0x03, 0xC0, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, + 0x0E, 0x00, 0x0E, 0x1C, 0x00, 0x1C, 0x70, 0x00, 0x1C, 0xE0, 0x00, 0x39, + 0xC0, 0x00, 0x77, 0x00, 0x00, 0x70, 0x00, 0xFE, 0x00, 0xFF, 0xC0, 0xFF, + 0xE0, 0xF0, 0x30, 0x70, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1C, 0x00, 0x0E, + 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, 0x00, 0xE0, 0x03, 0xFF, 0xE1, + 0xFF, 0xF0, 0xFF, 0xF8, 0x0E, 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0, + 0x00, 0xE0, 0x00, 0x70, 0x00, 0x38, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xC0, 0x40, 0x00, 0x5C, 0x00, 0x1D, 0xE7, 0xCF, 0x1F, 0xFF, 0xC1, + 0xFF, 0xF0, 0x3C, 0x1E, 0x07, 0x01, 0xC1, 0xC0, 0x1C, 0x38, 0x03, 0x87, + 0x00, 0x70, 0xE0, 0x0E, 0x1C, 0x01, 0xC1, 0xC0, 0x70, 0x3C, 0x1E, 0x0F, + 0xFF, 0xC1, 0xFF, 0xFC, 0x79, 0xF1, 0xDC, 0x00, 0x1D, 0x00, 0x01, 0x00, + 0xF0, 0x01, 0xEE, 0x00, 0x39, 0xE0, 0x0F, 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 0x7C, 0x07, + 0x80, 0xF0, 0x1F, 0x07, 0x71, 0xC7, 0xF0, 0x7C, 0x00, 0x00, 0x38, 0x00, + 0x00, 0x70, 0x00, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x03, 0x80, 0x00, + 0x07, 0x00, 0x00, 0x0E, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFC, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x03, 0x80, 0x00, 0x07, + 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xC0, 0x7E, 0x3F, 0xEC, 0x1C, 0x03, 0x00, 0xC0, 0x70, 0x18, 0x0C, 0x0E, + 0x07, 0x03, 0x81, 0xC0, 0xFF, 0xFF, 0xF0, 0x1F, 0x8F, 0xF9, 0x83, 0x80, + 0x30, 0x0E, 0x3F, 0x87, 0xF0, 0x07, 0x00, 0x60, 0x0C, 0x01, 0xC0, 0xFF, + 0xFC, 0xFE, 0x00, 0x0F, 0x1E, 0x1C, 0x38, 0x70, 0xE0, 0x01, 0xE0, 0x78, + 0x0E, 0x03, 0x80, 0xE0, 0x38, 0x00, 0x07, 0x8F, 0xF1, 0xFE, 0x3F, 0xC7, + 0x80, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x1D, 0xF0, 0x00, 0x73, 0xE0, + 0x01, 0xC7, 0xC0, 0x07, 0x1D, 0xC0, 0x00, 0x3B, 0x80, 0x00, 0x77, 0x00, + 0x01, 0xC7, 0x00, 0x03, 0x8E, 0x00, 0x0F, 0x1E, 0x00, 0x1C, 0x1C, 0x00, + 0x38, 0x38, 0x00, 0xF0, 0x78, 0x01, 0xC0, 0x70, 0x03, 0x80, 0xE0, 0x0E, + 0x00, 0xE0, 0x1C, 0x01, 0xC0, 0x78, 0x03, 0xC0, 0xFF, 0xFF, 0x81, 0xFF, + 0xFF, 0x07, 0xFF, 0xFF, 0x0E, 0x00, 0x0E, 0x1C, 0x00, 0x1C, 0x70, 0x00, + 0x1C, 0xE0, 0x00, 0x39, 0xC0, 0x00, 0x77, 0x00, 0x00, 0x70, 0xFF, 0xF0, + 0x07, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x77, 0xFF, 0xF9, 0xCF, 0xFF, 0xF7, + 0x1F, 0xFF, 0xEC, 0x38, 0x00, 0x00, 0x70, 0x00, 0x00, 0xE0, 0x00, 0x01, + 0xC0, 0x00, 0x03, 0x80, 0x00, 0x07, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, + 0x00, 0x00, 0x3F, 0xFF, 0x80, 0x7F, 0xFF, 0x00, 0xFF, 0xFE, 0x01, 0xC0, + 0x00, 0x03, 0x80, 0x00, 0x07, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, + 0x00, 0x38, 0x00, 0x00, 0x70, 0x00, 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, + 0x03, 0xFF, 0xFC, 0x07, 0xFF, 0xF8, 0x0F, 0xFF, 0xF0, 0x07, 0x00, 0x00, + 0x03, 0x80, 0x00, 0x01, 0xDC, 0x00, 0x1C, 0xE7, 0x00, 0x07, 0x31, 0xC0, + 0x01, 0xD8, 0x70, 0x00, 0x70, 0x1C, 0x00, 0x1C, 0x07, 0x00, 0x07, 0x01, + 0xC0, 0x01, 0xC0, 0x70, 0x00, 0x70, 0x1C, 0x00, 0x1C, 0x07, 0x00, 0x07, + 0x01, 0xC0, 0x01, 0xC0, 0x7F, 0xFF, 0xF0, 0x1F, 0xFF, 0xFC, 0x07, 0xFF, + 0xFF, 0x01, 0xC0, 0x01, 0xC0, 0x70, 0x00, 0x70, 0x1C, 0x00, 0x1C, 0x07, + 0x00, 0x07, 0x01, 0xC0, 0x01, 0xC0, 0x70, 0x00, 0x70, 0x1C, 0x00, 0x1C, + 0x07, 0x00, 0x07, 0x01, 0xC0, 0x01, 0xC0, 0x70, 0x00, 0x70, 0x1C, 0x00, + 0x1C, 0x07, 0x00, 0x07, 0x07, 0x03, 0x81, 0xDC, 0xE7, 0x71, 0xD8, 0x70, + 0x1C, 0x07, 0x01, 0xC0, 0x70, 0x1C, 0x07, 0x01, 0xC0, 0x70, 0x1C, 0x07, + 0x01, 0xC0, 0x70, 0x1C, 0x07, 0x01, 0xC0, 0x70, 0x1C, 0x07, 0x01, 0xC0, + 0x70, 0x1C, 0x07, 0x81, 0x01, 0x83, 0x03, 0x87, 0x03, 0x87, 0x03, 0x87, + 0x03, 0x87, 0x03, 0x87, 0x03, 0x87, 0x07, 0x0E, 0x1C, 0x38, 0x70, 0xE1, + 0xC3, 0x87, 0x0E, 0x1C, 0x38, 0x30, 0x60, 0x40, 0x80, 0x07, 0x00, 0x00, + 0x01, 0xC0, 0x00, 0x00, 0x70, 0x7F, 0x80, 0x1C, 0x3F, 0xFC, 0x03, 0x1F, + 0xFF, 0xC0, 0xC7, 0xE0, 0x7C, 0x01, 0xE0, 0x03, 0xC0, 0x78, 0x00, 0x3C, + 0x0E, 0x00, 0x03, 0x81, 0xC0, 0x00, 0x78, 0x70, 0x00, 0x07, 0x0E, 0x00, + 0x00, 0xE1, 0xC0, 0x00, 0x1E, 0x38, 0x00, 0x01, 0xC7, 0x00, 0x00, 0x38, + 0xE0, 0x00, 0x07, 0x1C, 0x00, 0x00, 0xE3, 0x80, 0x00, 0x3C, 0x70, 0x00, + 0x07, 0x0E, 0x00, 0x00, 0xE0, 0xE0, 0x00, 0x3C, 0x1C, 0x00, 0x07, 0x03, + 0xC0, 0x01, 0xE0, 0x3C, 0x00, 0x78, 0x03, 0xF0, 0x3E, 0x00, 0x3F, 0xFF, + 0x80, 0x03, 0xFF, 0xE0, 0x00, 0x0F, 0xE0, 0x00, 0x3C, 0x00, 0x07, 0x07, + 0xE0, 0x00, 0x30, 0x33, 0x00, 0x03, 0x00, 0x18, 0x00, 0x38, 0x00, 0xC0, + 0x01, 0x80, 0x06, 0x00, 0x1C, 0x00, 0x30, 0x01, 0xC0, 0x01, 0x80, 0x0C, + 0x00, 0x0C, 0x00, 0xE0, 0x00, 0x60, 0x06, 0x00, 0x03, 0x00, 0x60, 0x00, + 0x18, 0x07, 0x1F, 0x8F, 0xFC, 0x31, 0xFF, 0x7F, 0xE3, 0x08, 0x1C, 0x00, + 0x38, 0x00, 0x60, 0x01, 0x80, 0x03, 0x00, 0x18, 0x00, 0x30, 0x01, 0xC0, + 0x03, 0x80, 0x0C, 0x00, 0x38, 0x00, 0xE0, 0x03, 0x80, 0x06, 0x00, 0x38, + 0x00, 0x60, 0x03, 0x80, 0x07, 0x00, 0x38, 0x00, 0x30, 0x03, 0xFF, 0x03, + 0x00, 0x1F, 0xF8, 0x38, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xE0, + 0x00, 0x00, 0x1C, 0xE0, 0x00, 0xF3, 0x8F, 0x00, 0x0E, 0x70, 0x78, 0x01, + 0xE6, 0x03, 0x80, 0x3C, 0x00, 0x3C, 0x03, 0x80, 0x01, 0xE0, 0x78, 0x00, + 0x0E, 0x0F, 0x00, 0x00, 0xF0, 0xE0, 0x00, 0x07, 0x1E, 0x00, 0x00, 0x3B, + 0xC0, 0x00, 0x03, 0xF8, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0xE0, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0xE0, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x0E, 0x00, 0x0F, 0x00, 0x00, + 0x01, 0xC0, 0x00, 0x00, 0x70, 0x7F, 0x80, 0x1C, 0x3F, 0xFC, 0x07, 0x1F, + 0xFF, 0xE1, 0xC7, 0xE0, 0x7E, 0x01, 0xF0, 0x03, 0xE0, 0x38, 0x00, 0x3C, + 0x0F, 0x00, 0x03, 0xC1, 0xC0, 0x00, 0x38, 0x78, 0x00, 0x07, 0x0E, 0x00, + 0x00, 0x71, 0xC0, 0x00, 0x0E, 0x38, 0x00, 0x01, 0xC7, 0x00, 0x00, 0x38, + 0xE0, 0x00, 0x07, 0x1C, 0x00, 0x00, 0xE3, 0x80, 0x00, 0x3C, 0x38, 0x00, + 0x07, 0x07, 0x00, 0x00, 0xE0, 0xF0, 0x00, 0x38, 0x0E, 0x00, 0x07, 0x00, + 0xE0, 0x01, 0xC0, 0x0E, 0x00, 0x70, 0x00, 0xE0, 0x1C, 0x03, 0xFE, 0x07, + 0xFC, 0x7F, 0xC0, 0xFF, 0x8F, 0xF8, 0x1F, 0xF0, 0x00, 0xE0, 0x38, 0x0E, + 0x03, 0x80, 0x60, 0x18, 0x00, 0x07, 0x8F, 0xF1, 0xFE, 0x3F, 0xC7, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x0E, 0x01, + 0xC0, 0x38, 0x07, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x0E, 0x01, 0xC0, + 0x3C, 0x03, 0x80, 0x7F, 0x07, 0xE0, 0x7C, 0x00, 0x7C, 0x00, 0x00, 0xF8, + 0x00, 0x01, 0xF0, 0x00, 0x07, 0x70, 0x00, 0x0E, 0xE0, 0x00, 0x1D, 0xC0, + 0x00, 0x71, 0xC0, 0x00, 0xE3, 0x80, 0x03, 0xC7, 0x80, 0x07, 0x07, 0x00, + 0x0E, 0x0E, 0x00, 0x3C, 0x1E, 0x00, 0x70, 0x1C, 0x00, 0xE0, 0x38, 0x03, + 0x80, 0x38, 0x07, 0x00, 0x70, 0x1E, 0x00, 0xF0, 0x3F, 0xFF, 0xE0, 0x7F, + 0xFF, 0xC1, 0xFF, 0xFF, 0xC3, 0x80, 0x03, 0x87, 0x00, 0x07, 0x1C, 0x00, + 0x07, 0x38, 0x00, 0x0E, 0x70, 0x00, 0x1D, 0xC0, 0x00, 0x1C, 0xFF, 0xF8, + 0x3F, 0xFF, 0x8F, 0xFF, 0xF3, 0x80, 0x3C, 0xE0, 0x07, 0xB8, 0x00, 0xEE, + 0x00, 0x3B, 0x80, 0x0E, 0xE0, 0x03, 0xB8, 0x01, 0xEE, 0x00, 0xF3, 0xFF, + 0xF8, 0xFF, 0xFC, 0x3F, 0xFF, 0xCE, 0x00, 0xFB, 0x80, 0x0E, 0xE0, 0x01, + 0xF8, 0x00, 0x7E, 0x00, 0x1F, 0x80, 0x07, 0xE0, 0x01, 0xF8, 0x00, 0xFE, + 0x00, 0xFB, 0xFF, 0xFC, 0xFF, 0xFE, 0x3F, 0xFE, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, + 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, 0x1C, 0x00, 0x38, + 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x80, 0x07, 0x00, 0x0E, 0x00, + 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x00, 0x00, 0x7C, + 0x00, 0x00, 0xF8, 0x00, 0x01, 0xF0, 0x00, 0x07, 0x70, 0x00, 0x0E, 0xE0, + 0x00, 0x1D, 0xC0, 0x00, 0x71, 0xC0, 0x00, 0xE3, 0x80, 0x03, 0xC7, 0x80, + 0x07, 0x07, 0x00, 0x0E, 0x0E, 0x00, 0x3C, 0x1E, 0x00, 0x70, 0x1C, 0x00, + 0xE0, 0x38, 0x03, 0x80, 0x38, 0x07, 0x00, 0x70, 0x1E, 0x00, 0xF0, 0x38, + 0x00, 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0xF8, 0x1C, 0x3F, 0x03, 0xC7, 0xE0, 0x38, 0xFC, + 0x07, 0x9F, 0x80, 0x73, 0xF0, 0x0F, 0x7E, 0x00, 0xEF, 0xC0, 0x1F, 0xF8, + 0x01, 0xFF, 0x00, 0x3F, 0xE0, 0x03, 0xFC, 0x00, 0x7C, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFC, 0x3F, 0xFC, 0x3F, + 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0xFF, 0x00, 0x03, 0xFF, 0xC0, 0x0F, 0xFF, 0xF0, 0x1F, 0x81, + 0xF8, 0x3E, 0x00, 0x7C, 0x3C, 0x00, 0x3C, 0x78, 0x00, 0x1E, 0x70, 0x00, + 0x0E, 0x70, 0x00, 0x0E, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x07, 0x70, 0x00, 0x0E, 0x70, 0x00, 0x0E, 0x78, 0x00, + 0x1E, 0x3C, 0x00, 0x3C, 0x3E, 0x00, 0x7C, 0x1F, 0x81, 0xF8, 0x0F, 0xFF, + 0xF0, 0x03, 0xFF, 0xC0, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF0, 0x00, 0x7E, 0x00, 0x0F, 0xC0, 0x01, 0xF8, 0x00, 0x3F, + 0x00, 0x07, 0xE0, 0x00, 0xFC, 0x00, 0x1F, 0x80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x00, 0x00, + 0x70, 0x00, 0x03, 0x80, 0x00, 0x1C, 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00, + 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, + 0x80, 0x00, 0xF0, 0x00, 0x7B, 0xC0, 0x07, 0x8E, 0x00, 0x38, 0x78, 0x03, + 0xC1, 0xE0, 0x3C, 0x07, 0x01, 0xC0, 0x3C, 0x1E, 0x00, 0xF1, 0xE0, 0x03, + 0x8E, 0x00, 0x1E, 0xF0, 0x00, 0x7F, 0x00, 0x01, 0xF0, 0x00, 0x0F, 0x80, + 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, + 0x80, 0x00, 0x1C, 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, + 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x07, 0x00, 0x00, 0x1F, 0xF0, 0x00, + 0x7F, 0xFF, 0x00, 0x7F, 0xFF, 0xC0, 0x7E, 0x73, 0xF0, 0x78, 0x38, 0x3C, + 0x78, 0x1C, 0x0F, 0x38, 0x0E, 0x03, 0xB8, 0x07, 0x00, 0xFC, 0x03, 0x80, + 0x7E, 0x01, 0xC0, 0x3F, 0x00, 0xE0, 0x1F, 0x80, 0x70, 0x0F, 0xC0, 0x38, + 0x07, 0x70, 0x1C, 0x07, 0x3C, 0x0E, 0x07, 0x8F, 0x07, 0x07, 0x83, 0xF3, + 0x9F, 0x80, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0x80, 0x03, 0xFE, 0x00, 0x00, + 0x38, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x78, 0x00, 0x78, + 0xF0, 0x03, 0xC1, 0xC0, 0x0E, 0x07, 0x80, 0x78, 0x0F, 0x03, 0xC0, 0x1C, + 0x0E, 0x00, 0x78, 0x78, 0x00, 0xF3, 0xC0, 0x01, 0xCE, 0x00, 0x07, 0xF8, + 0x00, 0x0F, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x03, 0xF0, 0x00, + 0x0F, 0xC0, 0x00, 0x7F, 0x80, 0x03, 0xCF, 0x00, 0x0E, 0x1C, 0x00, 0x78, + 0x78, 0x03, 0xC0, 0xF0, 0x0E, 0x01, 0xC0, 0x78, 0x07, 0x83, 0xC0, 0x0F, + 0x0E, 0x00, 0x1C, 0x78, 0x00, 0x7B, 0xC0, 0x00, 0xF0, 0xE0, 0x1C, 0x03, + 0xF0, 0x0E, 0x01, 0xF8, 0x07, 0x00, 0xFC, 0x03, 0x80, 0x7E, 0x01, 0xC0, + 0x3F, 0x00, 0xE0, 0x1F, 0x80, 0x70, 0x0F, 0xC0, 0x38, 0x07, 0xE0, 0x1C, + 0x03, 0xF0, 0x0E, 0x01, 0xF8, 0x07, 0x00, 0xFE, 0x03, 0x80, 0xE7, 0x01, + 0xC0, 0x73, 0x80, 0xE0, 0x38, 0xE0, 0x70, 0x38, 0x78, 0x38, 0x3C, 0x1E, + 0x1C, 0x3C, 0x07, 0xCE, 0x7C, 0x01, 0xFF, 0xFC, 0x00, 0x7F, 0xFC, 0x00, + 0x0F, 0xF8, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x70, 0x00, 0x00, 0x38, 0x00, + 0x00, 0x1C, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03, 0xFF, + 0xC0, 0x0F, 0xFF, 0xF0, 0x1F, 0x81, 0xF8, 0x3E, 0x00, 0x7C, 0x3C, 0x00, + 0x1C, 0x78, 0x00, 0x1E, 0x70, 0x00, 0x0E, 0xF0, 0x00, 0x0F, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x07, 0xE0, 0x00, 0x07, 0x70, 0x00, 0x0E, 0x70, 0x00, + 0x0E, 0x78, 0x00, 0x1E, 0x38, 0x00, 0x1C, 0x1C, 0x00, 0x38, 0x0E, 0x00, + 0x70, 0x07, 0x00, 0xE0, 0xFF, 0x81, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0x81, + 0xFF, 0xF1, 0xFE, 0x3F, 0xC7, 0xF8, 0xF0, 0x00, 0x00, 0x03, 0x80, 0x70, + 0x0E, 0x01, 0xC0, 0x38, 0x07, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x0E, + 0x01, 0xC0, 0x38, 0x07, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x0E, 0x01, + 0xC0, 0x38, 0x07, 0x00, 0xE0, 0x1C, 0x03, 0x80, 0x70, 0x07, 0x8F, 0x00, + 0x3C, 0x78, 0x01, 0xE3, 0xC0, 0x0F, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0xC0, 0x01, 0xEF, 0x00, 0x1E, 0x38, 0x00, 0xE1, 0xE0, 0x0F, 0x07, + 0x80, 0xF0, 0x1C, 0x07, 0x00, 0xF0, 0x78, 0x03, 0xC7, 0x80, 0x0E, 0x38, + 0x00, 0x7B, 0xC0, 0x01, 0xFC, 0x00, 0x07, 0xC0, 0x00, 0x3E, 0x00, 0x00, + 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, + 0x00, 0x70, 0x00, 0x03, 0x80, 0x00, 0x1C, 0x00, 0x00, 0xE0, 0x00, 0x07, + 0x00, 0x00, 0x38, 0x00, 0x01, 0xC0, 0x00, 0x0E, 0x00, 0x00, 0x1C, 0x00, + 0x07, 0x80, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x0E, 0x00, 0x03, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x38, 0x7F, 0xCF, 0x1F, + 0xFD, 0xC7, 0x87, 0xB8, 0xE0, 0x7F, 0x3C, 0x07, 0xC7, 0x00, 0xF8, 0xE0, + 0x1F, 0x1C, 0x03, 0xC3, 0x80, 0x38, 0x70, 0x07, 0x0E, 0x01, 0xE1, 0xC0, + 0x3C, 0x3C, 0x0F, 0xC3, 0x81, 0xF8, 0x78, 0x7F, 0x87, 0xFF, 0xFC, 0x7F, + 0xCF, 0x83, 0xF0, 0xF0, 0x00, 0x1C, 0x00, 0x70, 0x01, 0xC0, 0x07, 0x00, + 0x0C, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x7F, + 0xF1, 0xFF, 0xE7, 0x80, 0xCE, 0x00, 0x1C, 0x00, 0x3C, 0x00, 0x3F, 0xE0, + 0x1F, 0xC0, 0x7F, 0x83, 0xC0, 0x0F, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x78, + 0x00, 0xF8, 0x06, 0xFF, 0xFC, 0xFF, 0xF8, 0x3F, 0xC0, 0x00, 0x0E, 0x00, + 0x1C, 0x00, 0x38, 0x00, 0x70, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xE3, 0xF0, 0xEF, 0xFC, 0xFF, 0xFE, 0xFC, 0x1E, 0xF8, + 0x0F, 0xF0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, + 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, + 0x07, 0xE0, 0x07, 0xE0, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x07, 0x07, 0x03, 0x83, 0x83, + 0x83, 0x80, 0x00, 0x00, 0x00, 0x70, 0x38, 0x1C, 0x0E, 0x07, 0x03, 0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 0x7F, 0xFF, 0x7F, 0xFF, 0x7F, 0xFF, 0x00, 0x7E, 0x00, 0xF8, 0x03, + 0xE0, 0x07, 0xC0, 0x0F, 0x80, 0x1E, 0x00, 0x1C, 0x00, 0x38, 0x00, 0x78, + 0x00, 0x70, 0x00, 0x70, 0x00, 0xE0, 0x00, 0xE0, 0x00, 0xE0, 0x00, 0xE0, + 0x00, 0xE0, 0x00, 0xE0, 0x00, 0xF0, 0x00, 0x70, 0x00, 0x78, 0x00, 0x3E, + 0x00, 0x1F, 0xF8, 0x0F, 0xFE, 0x01, 0xFE, 0x00, 0x0F, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x1C, 0xE3, 0xF0, 0xEF, + 0xFC, 0xFF, 0xFE, 0xFC, 0x1E, 0xF8, 0x0F, 0xF0, 0x07, 0xE0, 0x07, 0xE0, + 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, + 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0xE0, 0x07, 0x00, + 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, + 0x07, 0x03, 0xF0, 0x03, 0xFF, 0x01, 0xFF, 0xE0, 0xF8, 0x7C, 0x38, 0x07, + 0x1E, 0x01, 0xE7, 0x00, 0x39, 0xC0, 0x0E, 0xF0, 0x03, 0xF8, 0x00, 0x7E, + 0x00, 0x1F, 0x80, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, + 0x07, 0xE0, 0x01, 0xF8, 0x00, 0x7E, 0x00, 0x1D, 0xC0, 0x0E, 0x70, 0x03, + 0x9E, 0x01, 0xE3, 0x80, 0x70, 0xF8, 0x7C, 0x1F, 0xFE, 0x03, 0xFF, 0x00, + 0x3F, 0x00, 0xE0, 0xE0, 0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, 0x38, 0x38, 0x0F, + 0xCE, 0x01, 0xF3, 0x80, 0x7C, 0x03, 0xF8, 0x03, 0xFF, 0x81, 0xFF, 0xF0, + 0xF0, 0x3C, 0x78, 0x07, 0x9C, 0x00, 0xEE, 0x00, 0x3F, 0x80, 0x07, 0xE0, + 0x01, 0xF8, 0x00, 0x7E, 0x00, 0x1F, 0x80, 0x07, 0xE0, 0x03, 0xFC, 0x00, + 0xEF, 0x80, 0x7B, 0xF0, 0x3C, 0xEF, 0xFF, 0x39, 0xFF, 0x0E, 0x3F, 0x03, + 0x80, 0x00, 0xE0, 0x00, 0x38, 0x00, 0x0E, 0x00, 0x03, 0x80, 0x00, 0xE0, + 0x00, 0x38, 0x00, 0x00, 0x03, 0xF8, 0x1F, 0xFC, 0x7F, 0xF9, 0xF0, 0x37, + 0x80, 0x0E, 0x00, 0x3C, 0x00, 0x70, 0x00, 0xE0, 0x01, 0xC0, 0x03, 0x80, + 0x07, 0x00, 0x0F, 0x00, 0x0E, 0x00, 0x1E, 0x00, 0x1F, 0x00, 0x1F, 0xF0, + 0x1F, 0xF8, 0x0F, 0xF0, 0x00, 0xF0, 0x00, 0xE0, 0x01, 0xC0, 0x07, 0x80, + 0x1E, 0x00, 0x3C, 0x00, 0x70, 0x07, 0xFF, 0xF1, 0xFF, 0xFF, 0x3F, 0xFF, + 0xF7, 0xC0, 0xF0, 0x78, 0x07, 0x87, 0x00, 0x38, 0xE0, 0x03, 0xCE, 0x00, + 0x1C, 0xE0, 0x01, 0xCE, 0x00, 0x1C, 0xE0, 0x01, 0xCE, 0x00, 0x1C, 0xF0, + 0x03, 0xC7, 0x00, 0x38, 0x78, 0x07, 0x83, 0xC0, 0xF0, 0x3F, 0xFE, 0x00, + 0xFF, 0xC0, 0x03, 0xF0, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, + 0x38, 0x00, 0x1C, 0x00, 0x0E, 0x00, 0x07, 0x00, 0x03, 0x80, 0x01, 0xC0,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0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, + 0x07, 0x00, 0x01, 0xC3, 0x80, 0x00, 0xE3, 0x80, 0x00, 0x39, 0xC0, 0x00, + 0x1C, 0xE0, 0x00, 0x0E, 0xE0, 0x00, 0x03, 0xF0, 0x00, 0x01, 0xF8, 0x07, + 0x00, 0xFC, 0x03, 0x80, 0x7E, 0x01, 0xC0, 0x3F, 0x00, 0xE0, 0x1F, 0x80, + 0x70, 0x0F, 0xE0, 0x7C, 0x0F, 0x70, 0x36, 0x07, 0x3C, 0x3B, 0x87, 0x8F, + 0xFD, 0xFF, 0x83, 0xFC, 0x7F, 0x80, 0xFC, 0x1F, 0x80, +}; + +const GFXglyph FreeSans18pt_Win1253Glyphs[] PROGMEM = { +/* 0x01 */ { 0, 33, 36, 45, 6, -29 }, +/* 0x02 */ { 149, 33, 36, 45, 6, -29 }, +/* 0x03 */ { 298, 35, 36, 45, 5, -29 }, +/* 0x04 */ { 456, 42, 36, 45, 1, -29 }, +/* 0x05 */ { 645, 35, 36, 45, 5, -29 }, +/* 0x06 */ { 803, 35, 36, 45, 5, -29 }, +/* 0x07 */ { 961, 0, 0, 0, 0, 0 }, +/* 0x08 */ { 961, 37, 36, 45, 4, -29 }, +/* 0x09 */ { 1128, 40, 28, 45, 2, -25 }, +/* 0x0A */ { 1268, 0, 0, 0, 0, 0 }, +/* 0x0B */ { 1268, 39, 36, 45, 3, -29 }, +/* 0x0C */ { 1444, 35, 36, 45, 5, -29 }, +/* 0x0D */ { 1602, 0, 0, 0, 0, 0 }, +/* 0x0E */ { 1602, 35, 36, 45, 5, -29 }, +/* 0x0F */ { 1760, 35, 37, 45, 5, -29 }, +/* 0x10 */ { 1922, 34, 36, 45, 5, -29 }, +/* 0x11 */ { 2075, 35, 36, 45, 5, -29 }, +/* 0x12 */ { 2233, 34, 36, 45, 5, -29 }, +/* 0x13 */ { 2386, 35, 36, 45, 5, -29 }, +/* 0x14 */ { 2544, 35, 36, 45, 5, -29 }, +/* 0x15 */ { 2702, 38, 36, 45, 4, -29 }, +/* 0x16 */ { 2873, 28, 36, 45, 8, -29 }, +/* 0x17 */ { 2999, 37, 30, 45, 4, -26 }, +/* 0x18 */ { 3138, 42, 30, 45, 1, -26 }, +/* 0x19 */ { 3296, 35, 36, 45, 5, -29 }, +/* 0x1A */ { 3454, 0, 0, 0, 0, 0 }, +/* 0x1B */ { 3454, 42, 37, 45, 1, -29 }, +/* 0x1C */ { 3649, 35, 36, 45, 5, -29 }, +/* 0x1D */ { 3807, 36, 36, 45, 4, -28 }, +/* 0x1E */ { 3969, 35, 36, 45, 4, -29 }, +/* 0x1F */ { 4127, 25, 36, 45, 10, -29 }, +/* 0x20 */ { 4240, 1, 1, 11, 0, 0 }, +/* 0x21 */ { 4241, 3, 26, 14, 5, -25 }, +/* 0x22 */ { 4251, 10, 9, 16, 3, -25 }, +/* 0x23 */ { 4263, 24, 25, 29, 3, -24 }, +/* 0x24 */ { 4338, 17, 32, 22, 3, -26 }, +/* 0x25 */ { 4406, 29, 26, 33, 2, -25 }, +/* 0x26 */ { 4501, 24, 26, 27, 2, -25 }, +/* 0x27 */ { 4579, 3, 9, 10, 3, -25 }, +/* 0x28 */ { 4583, 8, 31, 14, 3, -26 }, +/* 0x29 */ { 4614, 8, 31, 14, 3, -26 }, +/* 0x2A */ { 4645, 16, 16, 18, 1, -25 }, +/* 0x2B */ { 4677, 23, 23, 29, 4, -22 }, +/* 0x2C */ { 4744, 4, 8, 11, 3, -3 }, +/* 0x2D */ { 4748, 9, 3, 13, 2, -10 }, +/* 0x2E */ { 4752, 3, 4, 11, 4, -3 }, +/* 0x2F */ { 4754, 12, 29, 12, 0, -25 }, +/* 0x30 */ { 4798, 18, 26, 22, 2, -25 }, +/* 0x31 */ { 4857, 15, 26, 22, 4, -25 }, +/* 0x32 */ { 4906, 16, 26, 22, 3, -25 }, +/* 0x33 */ { 4958, 17, 26, 22, 3, -25 }, +/* 0x34 */ { 5014, 19, 26, 22, 2, -25 }, +/* 0x35 */ { 5076, 17, 26, 22, 3, -25 }, +/* 0x36 */ { 5132, 18, 26, 22, 2, -25 }, +/* 0x37 */ { 5191, 16, 26, 22, 3, -25 }, +/* 0x38 */ { 5243, 18, 26, 22, 2, -25 }, +/* 0x39 */ { 5302, 18, 26, 22, 2, -25 }, +/* 0x3A */ { 5361, 3, 18, 12, 4, -17 }, +/* 0x3B */ { 5368, 4, 22, 12, 3, -17 }, +/* 0x3C */ { 5379, 22, 19, 29, 4, -19 }, +/* 0x3D */ { 5432, 22, 10, 29, 4, -15 }, +/* 0x3E */ { 5460, 22, 19, 29, 4, -19 }, +/* 0x3F */ { 5513, 14, 26, 19, 3, -25 }, +/* 0x40 */ { 5559, 31, 31, 35, 2, -24 }, +/* 0x41 */ { 5680, 23, 26, 24, 0, -25 }, +/* 0x42 */ { 5755, 18, 26, 24, 3, -25 }, +/* 0x43 */ { 5814, 21, 26, 24, 2, -25 }, +/* 0x44 */ { 5883, 21, 26, 27, 3, -25 }, +/* 0x45 */ { 5952, 16, 26, 22, 3, -25 }, +/* 0x46 */ { 6004, 15, 26, 20, 3, -25 }, +/* 0x47 */ { 6053, 22, 26, 27, 2, -25 }, +/* 0x48 */ { 6125, 19, 26, 26, 3, -25 }, +/* 0x49 */ { 6187, 3, 26, 10, 3, -25 }, +/* 0x4A */ { 6197, 8, 33, 10, -2, -25 }, +/* 0x4B */ { 6230, 20, 26, 23, 3, -25 }, +/* 0x4C */ { 6295, 16, 26, 20, 3, -25 }, +/* 0x4D */ { 6347, 23, 26, 30, 3, -25 }, +/* 0x4E */ { 6422, 19, 26, 26, 3, -25 }, +/* 0x4F */ { 6484, 24, 26, 28, 2, -25 }, +/* 0x50 */ { 6562, 16, 26, 21, 3, -25 }, +/* 0x51 */ { 6614, 24, 31, 28, 2, -25 }, +/* 0x52 */ { 6707, 19, 26, 24, 3, -25 }, +/* 0x53 */ { 6769, 18, 26, 22, 2, -25 }, +/* 0x54 */ { 6828, 21, 26, 21, 0, -25 }, +/* 0x55 */ { 6897, 19, 26, 26, 3, -25 }, +/* 0x56 */ { 6959, 23, 26, 24, 0, -25 }, +/* 0x57 */ { 7034, 32, 26, 35, 1, -25 }, +/* 0x58 */ { 7138, 22, 26, 24, 1, -25 }, +/* 0x59 */ { 7210, 21, 26, 21, 0, -25 }, +/* 0x5A */ { 7279, 21, 26, 24, 2, -25 }, +/* 0x5B */ { 7348, 7, 31, 14, 3, -26 }, +/* 0x5C */ { 7376, 12, 29, 12, 0, -25 }, +/* 0x5D */ { 7420, 7, 31, 14, 3, -26 }, +/* 0x5E */ { 7448, 22, 10, 29, 4, -25 }, +/* 0x5F */ { 7476, 18, 3, 18, 0, 6 }, +/* 0x60 */ { 7483, 8, 6, 18, 3, -27 }, +/* 0x61 */ { 7489, 16, 19, 21, 2, -18 }, +/* 0x62 */ { 7527, 17, 27, 22, 3, -26 }, +/* 0x63 */ { 7585, 15, 19, 19, 2, -18 }, +/* 0x64 */ { 7621, 17, 27, 22, 2, -26 }, +/* 0x65 */ { 7679, 18, 19, 22, 2, -18 }, +/* 0x66 */ { 7722, 12, 27, 12, 1, -26 }, +/* 0x67 */ { 7763, 17, 26, 22, 2, -18 }, +/* 0x68 */ { 7819, 16, 27, 22, 3, -26 }, +/* 0x69 */ { 7873, 3, 27, 10, 3, -26 }, +/* 0x6A */ { 7884, 7, 34, 10, -1, -26 }, +/* 0x6B */ { 7914, 17, 27, 20, 3, -26 }, +/* 0x6C */ { 7972, 3, 27, 10, 3, -26 }, +/* 0x6D */ { 7983, 29, 19, 34, 3, -18 }, +/* 0x6E */ { 8052, 16, 19, 22, 3, -18 }, +/* 0x6F */ { 8090, 18, 19, 21, 2, -18 }, +/* 0x70 */ { 8133, 17, 26, 22, 3, -18 }, +/* 0x71 */ { 8189, 17, 26, 22, 2, -18 }, +/* 0x72 */ { 8245, 11, 19, 14, 3, -18 }, +/* 0x73 */ { 8272, 15, 19, 18, 2, -18 }, +/* 0x74 */ { 8308, 11, 24, 14, 1, -23 }, +/* 0x75 */ { 8341, 16, 19, 22, 3, -18 }, +/* 0x76 */ { 8379, 19, 19, 21, 1, -18 }, +/* 0x77 */ { 8425, 26, 19, 29, 1, -18 }, +/* 0x78 */ { 8487, 19, 19, 21, 1, -18 }, +/* 0x79 */ { 8533, 19, 26, 21, 1, -18 }, +/* 0x7A */ { 8595, 15, 19, 18, 2, -18 }, +/* 0x7B */ { 8631, 13, 32, 22, 5, -26 }, +/* 0x7C */ { 8683, 3, 35, 12, 4, -26 }, +/* 0x7D */ { 8697, 13, 32, 22, 4, -26 }, +/* 0x7E */ { 8749, 22, 6, 29, 4, -13 }, +/* 0x7F */ { 8766, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 8766, 20, 26, 22, 0, -25 }, +/* 0x81 */ { 8831, 0, 0, 0, 0, 0 }, +/* 0x82 */ { 8831, 4, 8, 11, 3, -3 }, +/* 0x83 */ { 8835, 15, 34, 12, -2, -26 }, +/* 0x84 */ { 8899, 10, 8, 18, 3, -3 }, +/* 0x85 */ { 8909, 27, 4, 35, 4, -3 }, +/* 0x86 */ { 8923, 15, 29, 18, 1, -25 }, +/* 0x87 */ { 8978, 15, 29, 18, 1, -25 }, +/* 0x88 */ { 9033, 0, 0, 0, 0, 0 }, +/* 0x89 */ { 9033, 43, 26, 47, 2, -25 }, +/* 0x8A */ { 9173, 0, 0, 0, 0, 0 }, +/* 0x8B */ { 9173, 8, 16, 14, 3, -17 }, +/* 0x8C */ { 9189, 0, 0, 0, 0, 0 }, +/* 0x8D */ { 9189, 0, 0, 0, 0, 0 }, +/* 0x8E */ { 9189, 0, 0, 0, 0, 0 }, +/* 0x8F */ { 9189, 0, 0, 0, 0, 0 }, +/* 0x90 */ { 9189, 0, 0, 0, 0, 0 }, +/* 0x91 */ { 9189, 4, 8, 11, 3, -25 }, +/* 0x92 */ { 9193, 4, 8, 11, 3, -25 }, +/* 0x93 */ { 9197, 10, 8, 18, 3, -25 }, +/* 0x94 */ { 9207, 10, 8, 18, 3, -25 }, +/* 0x95 */ { 9217, 10, 10, 21, 5, -17 }, +/* 0x96 */ { 9230, 14, 3, 18, 2, -10 }, +/* 0x97 */ { 9236, 32, 3, 35, 2, -10 }, +/* 0x98 */ { 9248, 0, 0, 0, 0, 0 }, +/* 0x99 */ { 9248, 22, 10, 35, 5, -25 }, +/* 0x9A */ { 9276, 0, 0, 0, 0, 0 }, +/* 0x9B */ { 9276, 8, 16, 14, 3, -17 }, +/* 0x9C */ { 9292, 0, 0, 0, 0, 0 }, +/* 0x9D */ { 9292, 0, 0, 0, 0, 0 }, +/* 0x9E */ { 9292, 0, 0, 0, 0, 0 }, +/* 0x9F */ { 9292, 0, 0, 0, 0, 0 }, +/* 0xA0 */ { 9292, 1, 1, 11, 0, 0 }, +/* 0xA1 */ { 9293, 11, 11, 18, 4, -33 }, +/* 0xA2 */ { 9309, 23, 28, 24, 0, -27 }, +/* 0xA3 */ { 9390, 17, 26, 22, 2, -25 }, +/* 0xA4 */ { 9446, 19, 19, 22, 2, -19 }, +/* 0xA5 */ { 9492, 19, 26, 22, 1, -25 }, +/* 0xA6 */ { 9554, 3, 31, 12, 4, -24 }, +/* 0xA7 */ { 9566, 14, 29, 18, 2, -25 }, +/* 0xA8 */ { 9617, 11, 4, 18, 4, -26 }, +/* 0xA9 */ { 9623, 25, 25, 35, 5, -24 }, +/* 0xAA */ { 9702, 0, 0, 0, 0, 0 }, +/* 0xAB */ { 9702, 15, 16, 21, 3, -17 }, +/* 0xAC */ { 9732, 22, 10, 29, 4, -14 }, +/* 0xAD */ { 9760, 9, 3, 13, 2, -10 }, +/* 0xAE */ { 9764, 25, 25, 35, 5, -24 }, +/* 0xAF */ { 9843, 35, 3, 35, 0, -10 }, +/* 0xB0 */ { 9857, 11, 11, 18, 3, -25 }, +/* 0xB1 */ { 9873, 23, 22, 29, 3, -21 }, +/* 0xB2 */ { 9937, 10, 14, 14, 2, -25 }, +/* 0xB3 */ { 9955, 11, 14, 14, 2, -25 }, +/* 0xB4 */ { 9975, 8, 6, 18, 7, -27 }, +/* 0xB5 */ { 9981, 11, 11, 18, 4, -33 }, +/* 0xB6 */ { 9997, 23, 28, 24, 0, -27 }, +/* 0xB7 */ { 10078, 3, 4, 11, 4, -13 }, +/* 0xB8 */ { 10080, 23, 28, 26, 0, -27 }, +/* 0xB9 */ { 10161, 26, 28, 30, 0, -27 }, +/* 0xBA */ { 10252, 10, 28, 14, 0, -27 }, +/* 0xBB */ { 10287, 15, 16, 21, 3, -17 }, +/* 0xBC */ { 10317, 27, 28, 28, 0, -27 }, +/* 0xBD */ { 10412, 29, 26, 34, 3, -25 }, +/* 0xBE */ { 10507, 28, 28, 29, 0, -27 }, +/* 0xBF */ { 10605, 27, 28, 29, 0, -27 }, +/* 0xC0 */ { 10700, 11, 34, 12, 0, -33 }, +/* 0xC1 */ { 10747, 23, 26, 24, 0, -25 }, +/* 0xC2 */ { 10822, 18, 26, 24, 3, -25 }, +/* 0xC3 */ { 10881, 15, 26, 19, 3, -25 }, +/* 0xC4 */ { 10930, 23, 26, 24, 0, -25 }, +/* 0xC5 */ { 11005, 16, 26, 22, 3, -25 }, +/* 0xC6 */ { 11057, 21, 26, 24, 2, -25 }, +/* 0xC7 */ { 11126, 19, 26, 26, 3, -25 }, +/* 0xC8 */ { 11188, 24, 26, 28, 2, -25 }, +/* 0xC9 */ { 11266, 3, 26, 10, 3, -25 }, +/* 0xCA */ { 11276, 20, 26, 23, 3, -25 }, +/* 0xCB */ { 11341, 23, 26, 24, 0, -25 }, +/* 0xCC */ { 11416, 23, 26, 30, 3, -25 }, +/* 0xCD */ { 11491, 19, 26, 26, 3, -25 }, +/* 0xCE */ { 11553, 16, 26, 22, 3, -25 }, +/* 0xCF */ { 11605, 24, 26, 28, 2, -25 }, +/* 0xD0 */ { 11683, 19, 26, 25, 3, -25 }, +/* 0xD1 */ { 11745, 16, 26, 21, 3, -25 }, +/* 0xD2 */ { 11797, 0, 0, 0, 0, 0 }, +/* 0xD3 */ { 11797, 16, 26, 22, 3, -25 }, +/* 0xD4 */ { 11849, 21, 26, 21, 0, -25 }, +/* 0xD5 */ { 11918, 21, 26, 21, 0, -25 }, +/* 0xD6 */ { 11987, 25, 26, 29, 2, -25 }, +/* 0xD7 */ { 12069, 22, 26, 24, 1, -25 }, +/* 0xD8 */ { 12141, 25, 26, 29, 2, -25 }, +/* 0xD9 */ { 12223, 24, 26, 28, 2, -25 }, +/* 0xDA */ { 12301, 11, 32, 10, -1, -31 }, +/* 0xDB */ { 12345, 21, 32, 21, 0, -31 }, +/* 0xDC */ { 12429, 19, 28, 23, 2, -27 }, +/* 0xDD */ { 12496, 15, 28, 19, 2, -27 }, +/* 0xDE */ { 12549, 16, 35, 22, 3, -27 }, +/* 0xDF */ { 12619, 9, 28, 12, 3, -27 }, +/* 0xE0 */ { 12651, 16, 35, 21, 3, -33 }, +/* 0xE1 */ { 12721, 19, 19, 23, 2, -18 }, +/* 0xE2 */ { 12767, 17, 34, 22, 3, -26 }, +/* 0xE3 */ { 12840, 19, 26, 21, 1, -18 }, +/* 0xE4 */ { 12902, 18, 26, 22, 2, -25 }, +/* 0xE5 */ { 12961, 15, 19, 19, 2, -18 }, +/* 0xE6 */ { 12997, 16, 34, 20, 2, -26 }, +/* 0xE7 */ { 13065, 16, 26, 22, 3, -18 }, +/* 0xE8 */ { 13117, 18, 27, 22, 2, -26 }, +/* 0xE9 */ { 13178, 8, 19, 12, 3, -18 }, +/* 0xEA */ { 13197, 17, 19, 21, 3, -18 }, +/* 0xEB */ { 13238, 19, 27, 21, 1, -26 }, +/* 0xEC */ { 13303, 18, 26, 22, 3, -18 }, +/* 0xED */ { 13362, 17, 19, 20, 1, -18 }, +/* 0xEE */ { 13403, 15, 34, 19, 2, -26 }, +/* 0xEF */ { 13467, 18, 19, 21, 2, -18 }, +/* 0xF0 */ { 13510, 18, 19, 21, 2, -18 }, +/* 0xF1 */ { 13553, 18, 26, 23, 3, -18 }, +/* 0xF2 */ { 13612, 15, 26, 20, 2, -18 }, +/* 0xF3 */ { 13661, 20, 19, 23, 2, -18 }, +/* 0xF4 */ { 13709, 17, 19, 21, 2, -18 }, +/* 0xF5 */ { 13750, 16, 19, 21, 3, -17 }, +/* 0xF6 */ { 13788, 19, 26, 23, 2, -18 }, +/* 0xF7 */ { 13850, 18, 26, 20, 1, -18 }, +/* 0xF8 */ { 13909, 19, 26, 23, 2, -18 }, +/* 0xF9 */ { 13971, 25, 19, 29, 2, -17 }, +/* 0xFA */ { 14031, 11, 27, 12, 0, -26 }, +/* 0xFB */ { 14069, 16, 28, 21, 3, -26 }, +/* 0xFC */ { 14125, 18, 28, 21, 2, -27 }, +/* 0xFD */ { 14188, 16, 29, 21, 3, -27 }, +/* 0xFE */ { 14246, 25, 29, 29, 2, -27 }, +/* 0xFF */ { 14337, 0, 0, 0, 0, 0 }, +}; + +const GFXfont FreeSans18pt_Win1253 PROGMEM = { +(uint8_t*)FreeSans18pt_Win1253Bitmaps, +(GFXglyph*)FreeSans18pt_Win1253Glyphs, +0x01, 0xFF, 41 +}; diff --git a/src/graphics/niche/Fonts/FreeSans24pt_Win1253.h b/src/graphics/niche/Fonts/FreeSans24pt_Win1253.h new file mode 100644 index 000000000..7efefd443 --- /dev/null +++ b/src/graphics/niche/Fonts/FreeSans24pt_Win1253.h @@ -0,0 +1,2429 @@ +// trunk-ignore-all(clang-format) +#pragma once +/* PROPERTIES + +FONT_NAME FreeSans24pt_Win1253 +*/ +const uint8_t FreeSans24pt_Win1253Bitmaps[] PROGMEM = { + 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, + 0x00, 0x0C, 0xE0, 0x00, 0x00, 0x00, 0x03, 0x0C, 0x00, 0x00, 0x00, 0x00, + 0x60, 0xC0, 0x00, 0x00, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x01, 0x83, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x60, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x00, + 0x00, 0x00, 0x00, 0xC1, 0x80, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, + 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x01, 0xC0, 0xC0, 0x00, 0x00, 0x00, + 0x70, 0x30, 0x00, 0x00, 0x00, 0x1C, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, + 0xC0, 0x00, 0x00, 0x03, 0x80, 0x13, 0xFF, 0x00, 0x00, 0xE0, 0x07, 0xFF, + 0xF0, 0x00, 0x70, 0x00, 0xF0, 0x06, 0x00, 0x0C, 0x00, 0x38, 0x00, 0xC0, + 0x03, 0x00, 0x06, 0x00, 0x18, 0x00, 0x60, 0x00, 0xC0, 0x03, 0x01, 0xFC, + 0x00, 0x18, 0x00, 0x67, 0xFF, 0x00, 0x03, 0x80, 0x38, 0xC0, 0x00, 0x00, + 0x3F, 0xFF, 0xD8, 0x00, 0x00, 0x07, 0xFE, 0x1F, 0x00, 0x00, 0x01, 0xE0, + 0x01, 0xE0, 0x00, 0x00, 0x3C, 0x00, 0x1C, 0x00, 0x00, 0x0F, 0x00, 0x03, + 0x80, 0x00, 0x03, 0xA0, 0x00, 0xF0, 0x00, 0x00, 0xE6, 0x00, 0x1E, 0x00, + 0x00, 0x78, 0xF0, 0x1F, 0xC0, 0x00, 0x1C, 0x0F, 0xFF, 0xD8, 0x00, 0x02, + 0x01, 0xC0, 0x7B, 0x00, 0x00, 0x00, 0x60, 0x03, 0xE0, 0x00, 0x00, 0x0C, + 0x00, 0x3C, 0x00, 0x00, 0x01, 0x80, 0x07, 0x80, 0x00, 0x00, 0x30, 0x00, + 0xF0, 0x00, 0x00, 0x07, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x7F, 0x86, 0xFF, + 0x80, 0x00, 0x1F, 0xFF, 0x9F, 0xFE, 0x00, 0x03, 0x00, 0xC0, 0x01, 0xF0, + 0x00, 0xC0, 0x18, 0x00, 0x07, 0x00, 0x18, 0x03, 0x00, 0x00, 0x3C, 0x01, + 0x80, 0x60, 0x00, 0x03, 0xFC, 0x7E, 0x1C, 0x00, 0x00, 0x0F, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x01, 0x80, 0xF8, 0x00, + 0x00, 0x0F, 0xFF, 0xFF, 0x80, 0x00, 0x07, 0xE0, 0x78, 0x38, 0x00, 0x03, + 0xC0, 0x0C, 0x03, 0x00, 0x00, 0xE0, 0x03, 0x00, 0x60, 0x00, 0xF8, 0x00, + 0x60, 0x0C, 0x3F, 0xFC, 0x00, 0x06, 0x03, 0xC7, 0xF8, 0x00, 0x00, 0xFF, + 0xFC, 0xC0, 0x00, 0x00, 0x0F, 0xE0, 0xD8, 0x00, 0x00, 0x03, 0x80, 0x0F, + 0x00, 0x00, 0x00, 0x60, 0x01, 0xE0, 0x00, 0x00, 0x0C, 0x00, 0x3C, 0x00, + 0x00, 0x01, 0x80, 0x07, 0x80, 0x00, 0x00, 0x30, 0x01, 0xB0, 0x00, 0x04, + 0x03, 0xFF, 0xF6, 0x00, 0x00, 0xE0, 0x7F, 0xFE, 0xC0, 0x00, 0x0F, 0x1C, + 0x01, 0xF8, 0x00, 0x00, 0x73, 0x00, 0x0F, 0x00, 0x00, 0x07, 0xC0, 0x01, + 0xE0, 0x00, 0x00, 0x78, 0x00, 0x1C, 0x00, 0x00, 0x07, 0x80, 0x07, 0x80, + 0x00, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0xFF, 0x3F, 0xC0, 0x00, + 0x01, 0xFF, 0xFE, 0xFF, 0xE0, 0x00, 0x70, 0x03, 0x80, 0x7E, 0x00, 0x0C, + 0x00, 0x30, 0x00, 0xC0, 0x01, 0x80, 0x06, 0x00, 0x18, 0x00, 0x30, 0x00, + 0xC0, 0x01, 0x80, 0x07, 0x00, 0x18, 0x00, 0x18, 0x00, 0x78, 0x03, 0x00, + 0x01, 0xC0, 0x0F, 0xFF, 0xC0, 0x00, 0x1E, 0x00, 0x8F, 0xF0, 0x00, 0x00, + 0xE0, 0x18, 0x00, 0x00, 0x00, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x60, 0x00, 0x00, 0x00, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, + 0x00, 0x00, 0x00, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x01, 0x83, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x60, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x00, 0x00, 0x00, + 0x00, 0xC1, 0x80, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x03, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x61, 0x80, 0x00, 0x00, 0x00, 0x06, 0x70, + 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xF8, 0x00, + 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0xE0, 0x00, 0x00, 0x07, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, + 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x0E, 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1C, + 0x30, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x70, 0x00, 0x00, 0x00, 0x00, 0x0C, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x03, 0xC0, 0x03, 0xC0, 0x06, + 0x60, 0x07, 0xE0, 0x07, 0xE0, 0x06, 0xC0, 0x0C, 0x30, 0x0C, 0x30, 0x03, + 0xC0, 0x18, 0x30, 0x0C, 0x38, 0x03, 0xC0, 0x18, 0x18, 0x18, 0x18, 0x03, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x0D, 0x00, 0x00, 0x4A, 0x03, + 0xC0, 0x69, 0x00, 0x00, 0xD2, 0x03, 0xC0, 0x4B, 0x00, 0x00, 0x96, 0x03, + 0xC0, 0xD2, 0x00, 0x01, 0xA4, 0x03, 0x60, 0x10, 0x00, 0x00, 0x20, 0x06, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, + 0x70, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x30, 0x00, 0xC0, 0x03, 0x00, 0x0C, + 0x38, 0x01, 0xF0, 0x0F, 0x80, 0x1C, 0x18, 0x00, 0x7F, 0xFE, 0x00, 0x18, + 0x1C, 0x00, 0x0F, 0xF0, 0x00, 0x30, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x70, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, + 0x03, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x00, + 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, + 0x00, 0x1F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, + 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFC, + 0x00, 0x00, 0x00, 0x00, 0x0F, 0xC0, 0x0F, 0xC0, 0x00, 0x00, 0x00, 0x1F, + 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, + 0x00, 0x1C, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x18, 0x00, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x80, 0x00, + 0x1C, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x1C, 0x1C, 0x00, 0x00, 0x38, + 0x38, 0x00, 0x0C, 0x3C, 0x00, 0x00, 0x0F, 0x0C, 0x00, 0x0E, 0x38, 0x00, + 0x00, 0x01, 0xC7, 0x00, 0x06, 0x38, 0x00, 0x00, 0x00, 0x71, 0x80, 0x07, + 0x18, 0x00, 0x00, 0x00, 0x18, 0xE0, 0x03, 0x08, 0x00, 0x00, 0x00, 0x04, + 0x30, 0x01, 0x80, 0x3E, 0x00, 0x07, 0xC0, 0x18, 0x00, 0xC0, 0x71, 0xC0, + 0x0C, 0x38, 0x0C, 0x00, 0xC0, 0x60, 0x30, 0x0C, 0x06, 0x03, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x80, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xC0, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0xE0, 0x1F, 0x60, 0x00, 0x00, + 0x00, 0x06, 0xF8, 0x3C, 0x30, 0x00, 0x00, 0x00, 0x03, 0x0E, 0x38, 0x10, + 0x00, 0x00, 0x00, 0x00, 0x83, 0x98, 0x18, 0x00, 0x00, 0x00, 0x00, 0x40, + 0xD8, 0x0C, 0x60, 0x00, 0x00, 0x06, 0x30, 0x3C, 0x04, 0x6F, 0xC0, 0x00, + 0xFF, 0x98, 0x1E, 0x02, 0x30, 0x1F, 0xFF, 0xE0, 0xC4, 0x0F, 0x03, 0x1C, + 0x00, 0x00, 0x00, 0xE2, 0x07, 0x81, 0x07, 0xE0, 0x00, 0x07, 0xE1, 0x83, + 0x61, 0x83, 0xFF, 0xFF, 0xFF, 0xF0, 0x63, 0x1F, 0xC0, 0xFF, 0xFF, 0xFF, + 0xF0, 0x3F, 0x86, 0x30, 0x3F, 0xFF, 0xFF, 0xF0, 0x32, 0x00, 0x18, 0x0F, + 0xFF, 0xFF, 0xF0, 0x18, 0x00, 0x06, 0x03, 0xFC, 0x0F, 0xF0, 0x18, 0x00, + 0x03, 0x80, 0x78, 0x01, 0xE0, 0x1C, 0x00, 0x00, 0xE0, 0x0E, 0x01, 0xC0, + 0x1C, 0x00, 0x00, 0x30, 0x00, 0xFF, 0x00, 0x0C, 0x00, 0x00, 0x0E, 0x00, + 0x00, 0x00, 0x1C, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0xE0, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, + 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x00, 0x00, 0x01, 0xF8, + 0x01, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xFF, 0xE0, 0x00, 0x00, 0x00, + 0x00, 0x01, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0C, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x1F, 0x03, 0x80, 0x00, 0x00, + 0x1F, 0x3F, 0x03, 0x00, 0x00, 0x00, 0x7F, 0xC3, 0x00, 0x07, 0x80, 0x00, + 0xC7, 0x83, 0x00, 0x1F, 0x80, 0x03, 0x07, 0x03, 0x00, 0x63, 0x00, 0x06, + 0x07, 0x03, 0x01, 0xC6, 0x00, 0x06, 0x07, 0x03, 0x03, 0x0C, 0x00, 0x06, + 0x07, 0x03, 0x06, 0x18, 0x00, 0x0E, 0x07, 0x03, 0x0C, 0x30, 0x00, 0x7E, + 0x07, 0x03, 0x18, 0x60, 0x00, 0xC6, 0x07, 0x03, 0x30, 0xC0, 0x03, 0x06, + 0x07, 0x03, 0x61, 0x80, 0x06, 0x06, 0x07, 0x03, 0xC1, 0x80, 0x0E, 0x06, + 0x07, 0x03, 0x83, 0x00, 0x0E, 0x06, 0x07, 0x03, 0x06, 0x00, 0x0E, 0x06, + 0x06, 0x06, 0x06, 0x00, 0x3E, 0x06, 0x00, 0x18, 0x0C, 0x00, 0xFE, 0x06, + 0x00, 0x30, 0x18, 0x03, 0x8E, 0x06, 0x00, 0x40, 0x18, 0x06, 0x0E, 0x06, + 0x01, 0x80, 0x30, 0x0C, 0x0E, 0x00, 0x03, 0x00, 0x30, 0x1C, 0x0E, 0x00, + 0x06, 0x00, 0x60, 0x1C, 0x0E, 0x00, 0x0C, 0x00, 0x60, 0x1C, 0x0E, 0x00, + 0x18, 0x00, 0xC0, 0x1C, 0x08, 0x00, 0x30, 0x01, 0x80, 0x1C, 0x00, 0x00, + 0x30, 0x03, 0x0C, 0x1C, 0x00, 0x00, 0x60, 0x02, 0x0C, 0x1C, 0x00, 0x00, + 0x60, 0x0F, 0x0E, 0x1C, 0x00, 0x00, 0xC0, 0x1B, 0x0C, 0x1C, 0x00, 0x00, + 0x00, 0x36, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x67, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0xC7, 0x80, 0x1C, 0x00, 0x00, 0x03, 0x07, 0x00, 0x1C, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x18, 0x00, 0x00, 0x1C, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x0C, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x0E, 0x00, 0x03, + 0x00, 0x00, 0x00, 0x0F, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x07, 0x80, 0xF0, + 0x00, 0x00, 0x00, 0x03, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0xFC, 0x00, + 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xB0, 0x00, 0x00, 0x01, 0x80, 0x06, 0x60, 0x00, 0x00, + 0x07, 0x80, 0x1C, 0xC0, 0x00, 0x00, 0x0F, 0xC0, 0x31, 0x80, 0x00, 0x00, + 0x19, 0xC0, 0xC3, 0x00, 0x00, 0x00, 0x11, 0xE1, 0x82, 0x00, 0x00, 0x00, + 0x30, 0xE6, 0x06, 0x00, 0x00, 0x00, 0x60, 0xFF, 0xCC, 0x00, 0x00, 0x00, + 0xC1, 0xFF, 0xF8, 0x3F, 0x80, 0x01, 0x8F, 0x80, 0xFF, 0xFF, 0x00, 0x01, + 0xBC, 0x00, 0x7E, 0x06, 0x00, 0x03, 0xE0, 0x00, 0x38, 0x18, 0x00, 0x07, + 0x80, 0x00, 0x38, 0x70, 0x00, 0x0E, 0x00, 0x00, 0x39, 0xC0, 0x01, 0xF8, + 0x00, 0x00, 0x33, 0x00, 0xFF, 0xF0, 0x00, 0x00, 0x7C, 0x03, 0xF0, 0xC0, + 0x00, 0x00, 0x78, 0x06, 0x03, 0x80, 0x00, 0x00, 0xE0, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0xC0, 0x0F, 0x0C, 0x00, 0x00, 0x01, 0xE0, 0x07, 0x18, 0x00, + 0x00, 0x03, 0xE0, 0x07, 0xB0, 0x00, 0x00, 0x06, 0xF0, 0x03, 0xE0, 0x00, + 0x00, 0x0C, 0x70, 0x01, 0xC0, 0x00, 0x00, 0x18, 0x78, 0x01, 0x80, 0x00, + 0x00, 0x30, 0x38, 0x03, 0x80, 0x00, 0x00, 0xC0, 0x30, 0x0F, 0x00, 0x00, + 0x01, 0x8F, 0xE0, 0x3F, 0x00, 0x00, 0x07, 0xFF, 0x00, 0x66, 0x00, 0x00, + 0x0F, 0xC0, 0x01, 0x8E, 0x00, 0x00, 0x38, 0x00, 0x07, 0x0E, 0x00, 0x00, + 0xF0, 0x00, 0x0C, 0x0E, 0x00, 0x03, 0xE0, 0x00, 0x30, 0x3F, 0x00, 0x1E, + 0xC0, 0x00, 0x6F, 0xFF, 0x80, 0xF8, 0x80, 0x00, 0xFE, 0x0F, 0xFF, 0xC1, + 0x80, 0x00, 0xC0, 0x19, 0xFF, 0x83, 0x00, 0x00, 0x00, 0x30, 0x33, 0x86, + 0x00, 0x00, 0x00, 0x60, 0xE3, 0xCC, 0x00, 0x00, 0x00, 0x41, 0x81, 0xCC, + 0x00, 0x00, 0x00, 0xC6, 0x01, 0xF8, 0x00, 0x00, 0x01, 0x9C, 0x00, 0xF0, + 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x06, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x1F, 0x00, + 0x00, 0x00, 0x00, 0xE0, 0x01, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x70, + 0x00, 0x00, 0x00, 0xE0, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x60, 0x00, 0x06, + 0x00, 0x00, 0x00, 0x60, 0x00, 0x01, 0x80, 0x00, 0x00, 0x30, 0x00, 0x00, + 0xC0, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x30, 0x00, 0x07, 0xFE, 0x00, 0x00, + 0x18, 0x00, 0x07, 0x83, 0xC0, 0x00, 0x0C, 0x00, 0x07, 0x00, 0x60, 0x00, + 0x02, 0x00, 0x03, 0x00, 0x18, 0x00, 0x01, 0x00, 0x03, 0x80, 0x06, 0x00, + 0x01, 0x80, 0x01, 0x80, 0x03, 0x00, 0x00, 0xC0, 0x00, 0xC0, 0x01, 0x80, + 0x00, 0x70, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x3E, 0x0F, 0xF0, 0x00, 0x00, + 0x00, 0x01, 0xCF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x01, 0x9E, 0x00, 0x00, + 0x00, 0x00, 0x03, 0xC7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x60, 0x00, 0x60, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x78, + 0x00, 0x78, 0x00, 0x78, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x7C, 0x00, 0x3E, + 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x07, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x00, + 0x00, 0x70, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x78, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0x7C, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x7C, 0x00, 0x00, + 0x00, 0x1E, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x07, 0x00, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF8, + 0x00, 0x00, 0x00, 0x00, 0x0F, 0x80, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x00, 0x70, 0x00, 0x00, 0x00, 0x03, 0x80, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0x1C, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x03, 0x80, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x0C, + 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x30, 0x00, 0x00, 0xFF, 0xE0, 0x00, + 0x00, 0xE0, 0x00, 0x07, 0x83, 0xC0, 0x00, 0x01, 0x80, 0x00, 0x38, 0x03, + 0x80, 0x00, 0x06, 0x00, 0x01, 0xC0, 0x07, 0x00, 0x00, 0x18, 0x00, 0x06, + 0x00, 0x0C, 0x00, 0x00, 0x60, 0x00, 0x38, 0x00, 0x38, 0x00, 0x01, 0x80, + 0x00, 0xC0, 0x00, 0x60, 0x00, 0x06, 0x00, 0x03, 0x00, 0x01, 0x80, 0x00, + 0x1C, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x03, 0xF0, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xB8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x60, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x19, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x80, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x81, 0x80, 0x00, 0x00, 0x00, 0x38, + 0x0F, 0xFF, 0x00, 0x00, 0x00, 0x0F, 0xC0, 0x07, 0xF7, 0x00, 0x60, 0x00, + 0x7C, 0x00, 0x00, 0x0F, 0xFF, 0xC0, 0x07, 0x00, 0x00, 0x00, 0x07, 0xF3, + 0xC0, 0x78, 0x00, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xF8, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x1F, 0xE0, 0x00, + 0x1F, 0xFE, 0x00, 0x07, 0xFF, 0x80, 0x07, 0xCF, 0xF8, 0x01, 0xF3, 0xBE, + 0x00, 0xFC, 0xD9, 0xC0, 0x38, 0x3C, 0xF0, 0x1F, 0xEC, 0xFE, 0x07, 0xE3, + 0x6F, 0x83, 0xB7, 0xC7, 0xB0, 0xDF, 0x33, 0xD8, 0x33, 0x1C, 0x39, 0x99, + 0xBB, 0x1C, 0xC7, 0xF0, 0xC1, 0xD9, 0xD9, 0xF0, 0xCE, 0x6F, 0x0E, 0x1E, + 0xFF, 0x8F, 0x0E, 0x66, 0x70, 0xF1, 0xB6, 0x78, 0x30, 0xF6, 0xC3, 0x8D, + 0x99, 0xE1, 0x83, 0x8D, 0xBC, 0x3C, 0xCD, 0x8E, 0x1C, 0x3C, 0xCF, 0xE3, + 0x6C, 0x78, 0x61, 0xE3, 0x6C, 0x7F, 0x33, 0x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x00, 0x03, 0x8E, 0x1C, + 0x00, 0x00, 0x00, 0x00, 0x0C, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x67, + 0x60, 0x00, 0x00, 0x00, 0x00, 0x03, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1F, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x03, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x3F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, 0x01, + 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x03, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x07, + 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x1F, + 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0x80, 0x00, 0x01, 0xFF, + 0xFF, 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x3F, 0xFF, + 0xFF, 0xFC, 0x00, 0x00, 0x7F, 0xFF, 0xFF, 0xF8, 0x00, 0x01, 0xFF, 0xFF, + 0xFF, 0xF8, 0x00, 0x03, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x0F, 0xFF, 0xFF, + 0xFF, 0xF8, 0x00, 0x1F, 0xFF, 0xFF, 0xFF, 0xF8, 0x00, 0x3F, 0xE3, 0xFF, + 0x1F, 0xF0, 0x00, 0x7F, 0x03, 0xF8, 0x0F, 0xE0, 0x00, 0xFC, 0x03, 0xE0, + 0x0F, 0xE0, 0x07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, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x06, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xF8, 0x00, 0x00, 0x00, 0x03, + 0xC0, 0x3C, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x0E, 0x00, 0x00, 0x01, 0x80, 0x00, 0x0E, 0x00, 0x00, 0x06, 0x04, + 0x00, 0x0C, 0x00, 0x00, 0x08, 0x38, 0x00, 0x0C, 0x00, 0x00, 0x30, 0xE0, + 0x00, 0x08, 0x00, 0x00, 0x43, 0x00, 0x00, 0x18, 0x00, 0x01, 0x86, 0x00, + 0x00, 0x10, 0x00, 0x03, 0x18, 0x00, 0x00, 0x30, 0x00, 0x04, 0x30, 0x00, + 0x00, 0x60, 0x00, 0x18, 0x40, 0x00, 0x00, 0xC0, 0x00, 0x30, 0x00, 0x00, + 0x00, 0x80, 0x00, 0x60, 0x00, 0x00, 0x01, 0x00, 0x00, 0xC0, 0x00, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x0C, 0x00, 0x04, 0x00, 0x00, 0x00, 0x18, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x30, 0x00, 0x30, 0x00, 0x00, 0x00, 0x20, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x60, 0x00, 0x80, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x3F, 0xFF, 0xFE, 0x00, + 0x80, 0x07, 0xE0, 0x00, 0x00, 0x01, 0x80, 0x18, 0x00, 0x00, 0x00, 0x01, + 0x80, 0x60, 0x00, 0x00, 0x00, 0x03, 0x81, 0x80, 0x00, 0x00, 0x00, 0x03, + 0x86, 0x00, 0x00, 0x00, 0x00, 0x03, 0x18, 0x00, 0xFF, 0xFF, 0xF0, 0x03, + 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xC3, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFB, + 0xFF, 0xFF, 0xC0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x1F, 0xFF, 0xFB, + 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xF3, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0x81, + 0xFF, 0xFF, 0x87, 0xFF, 0xFC, 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, + 0x03, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x0E, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x00, 0x03, + 0x80, 0x00, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x0E, 0x08, 0x00, 0x00, 0x30, 0x70, 0x1C, + 0x3C, 0x00, 0x00, 0x3C, 0x38, 0x18, 0xE0, 0x00, 0x00, 0x0F, 0x18, 0x39, + 0xC0, 0x00, 0x00, 0x03, 0x9C, 0x33, 0x80, 0x00, 0x00, 0x01, 0xCC, 0x73, + 0x00, 0x00, 0x00, 0x00, 0xCC, 0x60, 0x1F, 0x00, 0x00, 0xF8, 0x06, 0x60, + 0x7F, 0xC0, 0x03, 0xFE, 0x06, 0x60, 0xF3, 0xE0, 0x07, 0x8F, 0x06, 0xC0, + 0xF3, 0xA0, 0x07, 0x8F, 0x03, 0xC0, 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, + 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, + 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, + 0x33, 0x80, 0x03, 0x8C, 0x03, 0xC0, 0x33, 0xBF, 0xFB, 0x8C, 0x03, 0xC0, + 0x33, 0xFC, 0x7F, 0x8C, 0x03, 0xC0, 0x33, 0xC0, 0x07, 0x8C, 0x03, 0x60, + 0x33, 0x80, 0x03, 0x8C, 0x06, 0x60, 0x33, 0x80, 0x03, 0x8C, 0x06, 0x60, + 0x33, 0x80, 0x03, 0x8C, 0x06, 0x30, 0x33, 0xFF, 0xFF, 0x8C, 0x0C, 0x30, + 0x33, 0xFF, 0xFF, 0x8C, 0x0C, 0x38, 0x33, 0xFF, 0xFF, 0x8C, 0x18, 0x18, + 0x33, 0xFF, 0xFF, 0x8C, 0x18, 0x0C, 0x33, 0xFF, 0xFF, 0x8C, 0x30, 0x0E, + 0x33, 0xF0, 0x1F, 0x8C, 0x70, 0x06, 0x33, 0x80, 0x03, 0x8C, 0x60, 0x03, + 0x33, 0x80, 0x03, 0x8C, 0xC0, 0x01, 0xB3, 0x80, 0x03, 0x8D, 0x80, 0x07, + 0xF3, 0x80, 0x03, 0x8F, 0xC0, 0x0E, 0x03, 0x80, 0x03, 0x80, 0xF0, 0x0C, + 0x01, 0xE0, 0x0F, 0x00, 0x30, 0x07, 0x00, 0x78, 0x1C, 0x00, 0xE0, 0x03, + 0x00, 0x18, 0x18, 0x00, 0xC0, 0x03, 0x80, 0x3F, 0xFC, 0x03, 0xC0, 0x01, + 0xFF, 0xF7, 0xEF, 0xFF, 0x80, 0x00, 0x7F, 0xC0, 0x03, 0xFE, 0x00, 0x00, + 0x00, 0x1D, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x80, 0x00, 0x00, 0x00, + 0x03, 0x33, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xCC, 0x00, 0x00, 0x00, 0x00, + 0x3F, 0xF0, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x06, + 0x33, 0x00, 0x00, 0x00, 0x00, 0x18, 0xC4, 0x00, 0x00, 0x00, 0x00, 0x63, + 0x18, 0x00, 0x00, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x00, 0x00, 0x07, 0x7B, + 0x80, 0x00, 0x00, 0x00, 0x18, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x43, 0x18, + 0x00, 0x00, 0x00, 0x03, 0x0C, 0x60, 0x00, 0x00, 0x00, 0x0C, 0x30, 0x80, + 0x00, 0x00, 0x00, 0x30, 0xC3, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x0C, 0x00, + 0x00, 0x00, 0x03, 0x0C, 0x30, 0x00, 0x00, 0x00, 0x0C, 0x30, 0xC0, 0x00, + 0x00, 0x00, 0x60, 0xC3, 0x00, 0x00, 0x00, 0x01, 0x83, 0x06, 0x00, 0x00, + 0x00, 0x06, 0x0C, 0x18, 0x00, 0x00, 0x00, 0x30, 0x30, 0x60, 0x00, 0x00, + 0x00, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x03, 0x03, 0x03, 0x00, 0x00, 0x00, + 0x0C, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x30, 0x30, 0x30, 0x00, 0x00, 0x01, + 0x80, 0xC0, 0xC0, 0x00, 0x00, 0x36, 0x03, 0x01, 0xA0, 0x00, 0x03, 0xF0, + 0x0C, 0x07, 0xF0, 0x00, 0x3F, 0x80, 0x30, 0x07, 0xF0, 0x03, 0xCC, 0x00, + 0xC0, 0x18, 0xF0, 0x7C, 0x18, 0x03, 0x00, 0x60, 0xF3, 0xC0, 0x60, 0x0C, + 0x01, 0x80, 0xE0, 0x01, 0xC0, 0x30, 0x0C, 0x00, 0x80, 0x03, 0x01, 0xE0, + 0x70, 0x00, 0x00, 0x06, 0x1F, 0xC1, 0x80, 0x00, 0x00, 0x1C, 0x63, 0x8C, + 0x00, 0x00, 0x00, 0x3B, 0x03, 0x70, 0x00, 0x00, 0x00, 0x7C, 0x0F, 0x80, + 0x00, 0x00, 0x00, 0xF0, 0x7C, 0x00, 0x00, 0x00, 0x01, 0xE1, 0xE0, 0x00, + 0x00, 0x00, 0x03, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x07, 0x00, 0x38, 0x00, 0x00, + 0x00, 0x38, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, + 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, + 0xE0, 0x00, 0x00, 0x07, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x03, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x03, 0x00, 0x00, 0x00, 0x60, 0x0E, + 0x0F, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x1C, 0x00, 0x00, 0x00, 0x30, 0x18, + 0x30, 0x00, 0x00, 0x00, 0x18, 0x38, 0x60, 0x00, 0x00, 0x00, 0x1C, 0x30, + 0x40, 0x00, 0x00, 0x18, 0x0C, 0x70, 0x03, 0xC0, 0x00, 0x78, 0x0C, 0x60, + 0x03, 0xC0, 0x00, 0xE0, 0x06, 0x60, 0x07, 0xE0, 0x03, 0xC0, 0x06, 0x60, + 0x07, 0xE0, 0x07, 0x00, 0x06, 0xC0, 0x07, 0xE0, 0x0F, 0xC0, 0x03, 0xC0, + 0x03, 0xC0, 0x07, 0xF8, 0x03, 0xC0, 0x03, 0xC0, 0x00, 0x38, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x1F, 0x83, 0xC0, 0x00, 0x00, 0xE0, 0x3F, 0xC3, 0xC0, + 0x00, 0x00, 0xF0, 0x3F, 0xC0, 0x60, 0x00, 0x00, 0x38, 0x3F, 0xFC, 0x60, + 0x00, 0x00, 0x18, 0x3F, 0xFE, 0x60, 0x00, 0x00, 0x38, 0x3F, 0xFF, 0x70, + 0x00, 0x00, 0x70, 0x3F, 0xFF, 0x30, 0x00, 0x00, 0x70, 0x1F, 0xFF, 0x38, + 0x00, 0x00, 0x18, 0x1F, 0xFF, 0x18, 0x00, 0x00, 0x18, 0x1F, 0xFE, 0x1C, + 0x00, 0x00, 0x38, 0x3F, 0xFC, 0x0E, 0x00, 0x00, 0xF0, 0x3F, 0xF8, 0x07, + 0x00, 0x00, 0xE0, 0x0F, 0xE0, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, + 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x38, 0x01, 0x80, 0x00, 0x00, + 0x07, 0xE0, 0x06, 0x00, 0x00, 0xC0, 0x3C, 0x00, 0x00, 0x38, 0x03, 0x01, + 0xC0, 0x18, 0x00, 0x60, 0x1C, 0x06, 0x00, 0x60, 0x00, 0xC0, 0x00, 0x38, + 0x00, 0xC0, 0x03, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x0E, 0x00, 0x03, 0x0E, + 0x00, 0x00, 0x19, 0x80, 0x0C, 0xFE, 0x00, 0x00, 0x67, 0x00, 0x37, 0x18, + 0x00, 0x01, 0x84, 0x00, 0xF8, 0x30, 0xF0, 0x06, 0x00, 0x01, 0xC0, 0xC7, + 0xF0, 0x18, 0x00, 0x03, 0x02, 0x38, 0xF0, 0xE0, 0x1C, 0x0F, 0xF8, 0xC0, + 0xF7, 0x00, 0x78, 0x3F, 0xC3, 0x00, 0xF8, 0x00, 0x40, 0x40, 0x0C, 0x00, + 0x00, 0x00, 0x1F, 0x80, 0x18, 0x00, 0x00, 0x01, 0xFF, 0x80, 0x60, 0x60, + 0x00, 0x0F, 0x1F, 0x80, 0xC1, 0x80, 0x00, 0x30, 0x67, 0x03, 0x06, 0x00, + 0x01, 0xC1, 0x8E, 0x38, 0x00, 0x00, 0x06, 0x06, 0x0F, 0xE0, 0x00, 0x00, + 0x18, 0x18, 0x3E, 0x00, 0x07, 0x00, 0xE0, 0xE3, 0xF0, 0x00, 0x3C, 0x03, + 0x83, 0x0C, 0xC1, 0x81, 0xC0, 0x1E, 0x18, 0x71, 0x87, 0x0C, 0x00, 0x78, + 0x61, 0x86, 0x08, 0x30, 0x01, 0xF0, 0x06, 0x18, 0x00, 0x80, 0x0C, 0xC0, + 0x00, 0x30, 0x06, 0x00, 0x33, 0x00, 0x00, 0xC0, 0x18, 0x01, 0xC6, 0x00, + 0x1F, 0xC0, 0x60, 0x07, 0x1C, 0x0F, 0xEF, 0x81, 0x00, 0x1C, 0x38, 0x3E, + 0x37, 0x8C, 0x00, 0xD8, 0x70, 0x00, 0xCF, 0xE0, 0x03, 0x30, 0xE0, 0x06, + 0x0F, 0x00, 0x18, 0xE1, 0xF0, 0x38, 0x00, 0x00, 0x61, 0xC1, 0xFF, 0xC0, + 0x00, 0x73, 0xC3, 0x81, 0xFC, 0x00, 0x01, 0xCF, 0x07, 0x87, 0xC0, 0x00, + 0x00, 0x36, 0x07, 0xFC, 0x00, 0x20, 0x01, 0x9C, 0x0F, 0x80, 0x00, 0xC0, + 0x06, 0x3C, 0xF8, 0x00, 0x03, 0x00, 0x30, 0x3F, 0x00, 0x00, 0x04, 0x0C, + 0xC1, 0xF0, 0x00, 0x00, 0x00, 0x3B, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x6F, + 0xE0, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x07, 0x80, 0x00, 0x00, + 0x07, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x30, 0x00, 0x00, 0x0C, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x01, + 0x80, 0x00, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0C, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x30, + 0x03, 0xC0, 0x03, 0xC0, 0x0C, 0x60, 0x03, 0xC0, 0x03, 0xC0, 0x06, 0x60, + 0x07, 0xE0, 0x07, 0xE0, 0x06, 0x60, 0x07, 0xE0, 0x07, 0xE0, 0x06, 0xC0, + 0x07, 0xE0, 0x07, 0xE0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, + 0x03, 0xC0, 0x03, 0xC0, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, + 0x60, 0x00, 0x00, 0x06, 0x03, 0xC0, 0xDF, 0x80, 0x01, 0xFF, 0x03, 0x60, + 0xC0, 0x7F, 0xFF, 0x83, 0x06, 0x60, 0xE0, 0x00, 0x00, 0x07, 0x06, 0x60, + 0xFE, 0x00, 0x00, 0x7F, 0x06, 0x30, 0x7F, 0xFF, 0xFF, 0xFE, 0x0C, 0x30, + 0x3F, 0xFF, 0xFF, 0xFC, 0x0C, 0x38, 0x1F, 0xFF, 0xFF, 0xF8, 0x18, 0x18, + 0x0F, 0xFF, 0xFF, 0xF0, 0x18, 0x0C, 0x07, 0xF8, 0x1F, 0xE0, 0x30, 0x0C, + 0x01, 0xE0, 0x07, 0x80, 0x30, 0x06, 0x00, 0x70, 0x0E, 0x00, 0x60, 0x03, + 0x00, 0x0F, 0xF0, 0x00, 0xC0, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x00, + 0xC0, 0x00, 0x00, 0x03, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, + 0x1C, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x00, 0x00, 0xE0, 0x00, 0x00, + 0x01, 0xE0, 0x07, 0x80, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, + 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, + 0xE0, 0x00, 0x00, 0x07, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x03, + 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0E, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x1C, 0x03, 0x00, 0x01, 0x80, 0x30, 0x18, + 0x07, 0x00, 0x00, 0xE0, 0x18, 0x38, 0x3C, 0x00, 0x00, 0x7C, 0x1C, 0x30, + 0xF8, 0x00, 0x00, 0x1F, 0x0C, 0x70, 0x40, 0x00, 0x00, 0x02, 0x0C, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, + 0x0F, 0xC0, 0x03, 0xF0, 0x06, 0xC0, 0x11, 0xE0, 0x06, 0x38, 0x03, 0xC0, + 0x60, 0xF8, 0x18, 0x1E, 0x03, 0xC0, 0x40, 0xF8, 0x10, 0x1E, 0x03, 0xC0, + 0xC0, 0xFC, 0x30, 0x1F, 0x03, 0xC0, 0xC1, 0xFC, 0x30, 0x3F, 0x03, 0xC0, + 0xE3, 0xFC, 0x38, 0xFF, 0x03, 0xC0, 0xFF, 0x3C, 0x3F, 0xCF, 0x03, 0xC0, + 0xFF, 0x3C, 0x3F, 0xCF, 0x03, 0xC0, 0x7F, 0xF8, 0x1F, 0xFE, 0x03, 0xC0, + 0x7F, 0xF8, 0x1F, 0xFE, 0x03, 0x60, 0x3F, 0xF0, 0x0F, 0xFC, 0x06, 0x60, + 0x0F, 0xC0, 0x03, 0xF0, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1C, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x00, 0x07, 0xE0, 0x00, 0x70, 0x06, + 0x00, 0x1F, 0xF0, 0x00, 0x60, 0x03, 0x00, 0x08, 0x10, 0x00, 0xC0, 0x03, + 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, + 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xE0, 0x00, 0x00, + 0x00, 0x1F, 0x80, 0x1F, 0x00, 0x60, 0x00, 0x0F, 0x80, 0x00, 0x78, 0x0E, + 0x00, 0x03, 0xC0, 0x00, 0x03, 0xC3, 0xC0, 0x00, 0xE0, 0x00, 0x00, 0x1C, + 0xCC, 0x00, 0x38, 0x00, 0x00, 0x01, 0xF8, 0xC0, 0x1C, 0x00, 0x00, 0x00, + 0x1E, 0x1C, 0x03, 0x00, 0x00, 0x00, 0x01, 0x81, 0x80, 0xC0, 0x00, 0x00, + 0x00, 0x70, 0x38, 0x38, 0x00, 0x00, 0x00, 0x0C, 0x03, 0x0E, 0x00, 0x00, + 0x00, 0x03, 0x80, 0x71, 0x80, 0x00, 0x00, 0x00, 0x60, 0x06, 0x70, 0x00, + 0x00, 0x00, 0x0C, 0x00, 0xCC, 0x00, 0x00, 0x00, 0x01, 0x80, 0x1B, 0x80, + 0x00, 0x00, 0x00, 0x30, 0x03, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x6C, + 0x00, 0x00, 0x00, 0x20, 0x60, 0x19, 0x80, 0x1F, 0xC0, 0x3F, 0x86, 0x06, + 0x60, 0x06, 0x1C, 0x0E, 0x38, 0x3F, 0x8C, 0x00, 0x81, 0x81, 0x01, 0x00, + 0x31, 0x80, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x60, 0x30, 0x00, 0x00, 0x07, 0x01, 0x8C, 0x0D, 0xF8, + 0x00, 0x1F, 0xE0, 0x70, 0xC1, 0x80, 0xFF, 0xFE, 0x06, 0x0C, 0x18, 0x38, + 0x00, 0x00, 0x01, 0x81, 0x83, 0x07, 0xF0, 0x00, 0x03, 0xF0, 0x30, 0x70, + 0x7F, 0xFF, 0xFF, 0xFC, 0x0C, 0x06, 0x07, 0xFF, 0xFF, 0xFF, 0x81, 0x80, + 0xE0, 0x7F, 0xFF, 0xFF, 0xE0, 0x70, 0x0C, 0x07, 0xFF, 0xFF, 0xF8, 0x0C, + 0x01, 0xC0, 0x7F, 0x81, 0xFE, 0x03, 0x00, 0x1C, 0x07, 0xC0, 0x0F, 0x00, + 0xE0, 0x01, 0x80, 0x1C, 0x03, 0x80, 0x38, 0x00, 0x18, 0x00, 0xFF, 0x80, + 0x0E, 0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0x80, 0x00, 0x1C, 0x00, 0x00, + 0x00, 0xE0, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x38, 0x00, 0x00, 0x1E, 0x00, + 0x00, 0x1E, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x0F, + 0xC0, 0x0F, 0xC0, 0x00, 0x00, 0x00, 0x7F, 0xFF, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x00, 0x0F, + 0xE0, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0x01, 0xFE, 0x00, 0x00, + 0x00, 0x0F, 0xF8, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x03, 0xFF, + 0x00, 0x00, 0x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00, 0x0F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xF8, 0x00, + 0x00, 0x00, 0x00, 0xFC, 0x1F, 0xC0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x38, + 0x00, 0x00, 0x00, 0x70, 0x00, 0x07, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, + 0x60, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x06, 0x00, 0x00, + 0x01, 0x80, 0x00, 0x03, 0x00, 0x10, 0x00, 0x30, 0x00, 0x01, 0x80, 0x3F, + 0x80, 0x0E, 0x00, 0x00, 0x60, 0x1C, 0x70, 0x01, 0x80, 0x00, 0x30, 0x0E, + 0x06, 0x00, 0x30, 0x00, 0x18, 0x03, 0x00, 0xC0, 0x0E, 0x00, 0x06, 0x00, + 0x80, 0x37, 0x81, 0x80, 0x03, 0x00, 0x60, 0x07, 0x60, 0x30, 0x00, 0xC1, + 0xF8, 0x01, 0x98, 0x0C, 0x00, 0x60, 0x1E, 0x00, 0x46, 0x01, 0x80, 0x18, + 0x00, 0x80, 0x01, 0x80, 0x30, 0x0C, 0x00, 0x30, 0x00, 0xC0, 0x0E, 0x03, + 0x00, 0x0C, 0x00, 0x30, 0x01, 0x81, 0x80, 0x01, 0x80, 0x0C, 0x00, 0x30, + 0x60, 0x00, 0x70, 0x03, 0x00, 0x06, 0x18, 0x00, 0x0E, 0x00, 0x60, 0x01, + 0x8C, 0x00, 0x0F, 0xC0, 0x18, 0x00, 0x33, 0x00, 0x0F, 0xF0, 0x03, 0x00, + 0x0C, 0xC0, 0x01, 0x06, 0x00, 0x60, 0x01, 0xB0, 0x00, 0x01, 0x80, 0x0C, + 0x00, 0x6C, 0x00, 0x00, 0x20, 0x01, 0xC0, 0x0B, 0x00, 0x00, 0x0C, 0x00, + 0x38, 0x03, 0xC0, 0x00, 0x01, 0x80, 0x06, 0x00, 0xF0, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x3C, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x0D, 0x80, 0x00, 0x03, + 0x80, 0x00, 0x03, 0x60, 0x00, 0x00, 0x70, 0x00, 0x00, 0x9C, 0x00, 0x00, + 0x0E, 0x00, 0x00, 0x63, 0x80, 0x00, 0x01, 0xC0, 0x00, 0x18, 0x70, 0x00, + 0x00, 0x38, 0x00, 0x0C, 0x0F, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0xF8, + 0x00, 0x00, 0x70, 0x03, 0x80, 0x0F, 0xFF, 0x7F, 0xFF, 0xFF, 0xC0, 0x00, + 0x7F, 0xFF, 0xF0, 0xFF, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x0F, 0xC3, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xE0, + 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0xC0, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x80, 0x00, 0x01, 0x80, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xC0, + 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0xE0, 0x00, 0x70, 0x0C, 0x00, 0x00, + 0x00, 0x60, 0x1C, 0xFC, 0x0C, 0x00, 0x00, 0x00, 0x30, 0x3E, 0xC6, 0x18, + 0x04, 0x00, 0x60, 0x18, 0x63, 0xC6, 0x38, 0x0E, 0x00, 0xF0, 0x18, 0xC3, + 0xC3, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x83, 0xC1, 0xF0, 0x0F, 0x00, 0xF0, + 0x0F, 0x83, 0x60, 0x30, 0x0E, 0x00, 0x60, 0x18, 0x06, 0x60, 0x18, 0x00, + 0x00, 0x00, 0x18, 0x0E, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x30, 0x0C, 0x38, + 0x0C, 0x00, 0x38, 0x00, 0x60, 0x18, 0x1C, 0x06, 0x00, 0x3C, 0x00, 0x60, + 0x30, 0x0C, 0x06, 0x00, 0x7C, 0x00, 0xC0, 0x70, 0x06, 0x03, 0x00, 0x38, + 0x00, 0xC0, 0x60, 0x07, 0x03, 0x00, 0x00, 0x01, 0x80, 0xE0, 0x07, 0x01, + 0x80, 0x00, 0x01, 0x81, 0xE0, 0x0D, 0x81, 0x80, 0x00, 0x01, 0x81, 0xA0, + 0x0D, 0x81, 0x80, 0x00, 0x03, 0x03, 0x30, 0x08, 0xC0, 0xC0, 0x00, 0x03, + 0x03, 0x30, 0x18, 0xC0, 0xC0, 0x00, 0x03, 0x03, 0x10, 0x18, 0xC0, 0xC0, + 0x00, 0x03, 0x02, 0x10, 0x18, 0xC0, 0xC0, 0x00, 0x02, 0x02, 0x18, 0x18, + 0x00, 0xC0, 0x00, 0x02, 0x00, 0x18, 0x18, 0x00, 0xC0, 0x00, 0x06, 0x00, + 0x18, 0x18, 0x00, 0xC0, 0x00, 0x02, 0x00, 0x18, 0x18, 0x00, 0xC0, 0x00, + 0x02, 0x00, 0x18, 0x18, 0x00, 0xC0, 0x00, 0x03, 0x00, 0x10, 0x08, 0x00, + 0xC0, 0x00, 0x03, 0x00, 0x30, 0x0C, 0x01, 0xFF, 0xFF, 0xFF, 0x00, 0x70, + 0x06, 0x03, 0xFF, 0xFF, 0xFF, 0x80, 0xE0, 0x03, 0xFF, 0x00, 0x00, 0x00, + 0xFF, 0xC0, 0x01, 0xFE, 0x00, 0x00, 0x00, 0x7F, 0x80, 0x00, 0x00, 0x1F, + 0xF8, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x07, 0xE0, + 0x07, 0xE0, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x3C, 0x00, + 0x00, 0x3C, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, 0xE0, 0x00, + 0x00, 0x07, 0x00, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0x70, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x38, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x30, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x70, 0x0F, 0xC0, 0x03, 0xF0, 0x0C, 0x60, 0x3F, 0xF0, + 0x0F, 0xFC, 0x06, 0x60, 0x6F, 0xD8, 0x1B, 0xF6, 0x06, 0x60, 0x6F, 0xD8, + 0x1B, 0xF6, 0x06, 0xC0, 0xC7, 0x8C, 0x31, 0xE3, 0x03, 0xC0, 0xC0, 0x0C, + 0x30, 0x03, 0x03, 0xC0, 0xC0, 0x0C, 0x30, 0x03, 0x03, 0xC0, 0xC0, 0x0C, + 0x30, 0x03, 0x03, 0xC0, 0xE0, 0x1C, 0x38, 0x07, 0x03, 0xC0, 0x60, 0x18, + 0x18, 0x06, 0x03, 0xC0, 0x38, 0x70, 0x0E, 0x1C, 0x03, 0xC0, 0x1F, 0xE0, + 0x07, 0xF8, 0x03, 0xC0, 0x0F, 0xC0, 0x03, 0xF0, 0x03, 0xC0, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x1C, 0x18, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1C, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x0E, 0x00, 0x3F, 0xFC, 0x00, 0x70, 0x06, 0x00, 0x3F, + 0xFC, 0x00, 0x60, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03, 0x80, 0x00, + 0x00, 0x01, 0x80, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x00, 0x00, 0x70, 0x00, + 0x00, 0x0E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x1F, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x01, 0xFF, + 0xFF, 0x80, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x01, + 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x0F, 0xFF, 0xF8, 0x00, 0x00, 0x00, + 0x00, 0x7E, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x0F, 0x80, + 0x00, 0x00, 0x03, 0xC0, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x07, 0x00, 0x00, + 0x00, 0xE0, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x38, + 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x0C, 0x00, + 0x00, 0x60, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x01, 0xC0, 0x00, 0x00, 0x78, 0x03, 0x80, 0x01, 0x80, 0x00, + 0x01, 0x8C, 0x01, 0x80, 0x03, 0x80, 0x00, 0x01, 0x06, 0x01, 0xC0, 0x03, + 0x00, 0x7C, 0x03, 0x00, 0x00, 0xC0, 0x03, 0x00, 0xC7, 0x03, 0x00, 0x00, + 0xC0, 0x06, 0x01, 0x83, 0x00, 0x00, 0x00, 0x60, 0x06, 0x01, 0x80, 0x00, + 0x00, 0x00, 0x60, 0x06, 0x01, 0x80, 0x00, 0x00, 0x60, 0x60, 0x0C, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x70, 0x0C, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, + 0x0C, 0x00, 0x00, 0x00, 0x01, 0x80, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x03, + 0x00, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x30, 0x0C, 0x02, 0x00, + 0x00, 0x1C, 0x00, 0x30, 0x0C, 0x03, 0xC0, 0x00, 0x70, 0x00, 0x30, 0x0C, + 0x00, 0xF8, 0x03, 0xC0, 0x00, 0x30, 0x0C, 0x00, 0x1F, 0xFF, 0x00, 0x00, + 0x30, 0x0D, 0xC0, 0x00, 0x00, 0x00, 0x03, 0xB0, 0x1E, 0x60, 0x00, 0x00, + 0x00, 0x04, 0xF8, 0x3E, 0x31, 0xC0, 0x00, 0x03, 0x88, 0x7C, 0x22, 0x1A, + 0x60, 0x00, 0x06, 0x58, 0xC4, 0x23, 0x0E, 0x30, 0x00, 0x0C, 0x70, 0xC4, + 0x31, 0x8C, 0x30, 0x00, 0x0C, 0x61, 0x8C, 0x70, 0x84, 0x30, 0x00, 0x0C, + 0x63, 0x0E, 0xC8, 0xC2, 0x30, 0x00, 0x0C, 0x42, 0x1B, 0xC4, 0x60, 0x18, + 0x00, 0x18, 0x04, 0x23, 0xE6, 0x20, 0x18, 0x00, 0x18, 0x04, 0x47, 0x63, + 0x00, 0x18, 0x00, 0x18, 0x00, 0x86, 0x71, 0x80, 0x0C, 0x00, 0x30, 0x01, + 0x0E, 0xCC, 0x00, 0x0C, 0x00, 0x30, 0x00, 0x3B, 0xC6, 0x00, 0x0C, 0x00, + 0x30, 0x00, 0x63, 0xC2, 0x00, 0x0C, 0x00, 0x30, 0x00, 0x43, 0x60, 0x00, + 0x0C, 0x00, 0x30, 0x00, 0x06, 0x30, 0x00, 0x18, 0x00, 0x18, 0x00, 0x0C, + 0x1C, 0x00, 0x18, 0x00, 0x18, 0x00, 0x38, 0x07, 0x00, 0x3F, 0xC3, 0xFC, + 0x00, 0xE0, 0x01, 0xC0, 0xE7, 0xFF, 0xE7, 0x03, 0x80, 0x00, 0x3F, 0x80, + 0x00, 0x01, 0xFC, 0x00, 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x1F, + 0x00, 0x00, 0xF8, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x0E, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x07, 0x00, 0x01, 0x80, + 0x00, 0x00, 0x01, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x0E, 0x03, 0x80, 0x00, 0x00, 0x70, 0x1C, 0x0F, + 0x80, 0x00, 0x00, 0x30, 0x18, 0x1C, 0x00, 0x00, 0x00, 0x18, 0x38, 0x38, + 0x00, 0x00, 0x00, 0x1C, 0x30, 0x70, 0x00, 0x00, 0x00, 0x0C, 0x70, 0x60, + 0x00, 0x00, 0x00, 0x0C, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, + 0x00, 0x00, 0x18, 0x06, 0x60, 0x03, 0xC0, 0x00, 0x78, 0x06, 0xC0, 0x03, + 0xC0, 0x00, 0xE0, 0x03, 0xC0, 0x07, 0xE0, 0x03, 0xC0, 0x03, 0xC0, 0x07, + 0xE0, 0x07, 0x00, 0x03, 0xC0, 0x07, 0xE0, 0x0F, 0xC0, 0x03, 0xC0, 0x03, + 0xC0, 0x07, 0xF8, 0x03, 0xC0, 0x03, 0x80, 0x00, 0x38, 0x03, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x03, 0x60, 0x00, + 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x03, + 0x00, 0x00, 0x40, 0x06, 0x70, 0x03, 0xC0, 0x01, 0xC0, 0x0C, 0x30, 0x01, + 0xF0, 0x0F, 0x80, 0x0C, 0x38, 0x00, 0x7F, 0xFE, 0x00, 0x1C, 0x18, 0x00, + 0x0F, 0xF0, 0x00, 0x18, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0E, 0x00, + 0x00, 0x00, 0x00, 0x70, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0x03, 0x00, + 0x00, 0x00, 0x00, 0xC0, 0x03, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0xE0, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x70, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x3C, + 0x00, 0x00, 0x3C, 0x00, 0x00, 0x1F, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x07, + 0xE0, 0x07, 0xE0, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, + 0x1F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x7F, 0xEF, 0xF8, 0x00, 0x00, 0x00, + 0xFB, 0xC0, 0x1F, 0x00, 0x00, 0x00, 0xF0, 0x70, 0x03, 0xC0, 0x00, 0x01, + 0xE0, 0x08, 0x00, 0x78, 0x00, 0x01, 0xC0, 0x00, 0x3F, 0x8E, 0x00, 0x01, + 0xC1, 0xE0, 0x1F, 0xF3, 0x80, 0x01, 0xC0, 0xF0, 0x00, 0x3C, 0xE0, 0x01, + 0xC0, 0xFC, 0x00, 0x00, 0x38, 0x01, 0xC0, 0x7E, 0x00, 0x00, 0x0E, 0x00, + 0xC0, 0x3F, 0x00, 0x78, 0x03, 0x00, 0xE0, 0x1F, 0x00, 0x3C, 0x01, 0xC0, + 0x60, 0x07, 0x80, 0x3F, 0x00, 0x60, 0x60, 0x00, 0x00, 0x1F, 0x80, 0x18, + 0x30, 0x00, 0x00, 0x0F, 0xC0, 0x0C, 0x38, 0x00, 0x00, 0x03, 0xC0, 0x03, + 0x18, 0x00, 0x00, 0x01, 0xE0, 0x01, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x80, 0x00, 0x7F, 0x00, 0x00, + 0x06, 0xC0, 0x01, 0xFF, 0xE0, 0x00, 0x03, 0x60, 0x00, 0xE0, 0x3C, 0x00, + 0x01, 0xB0, 0x00, 0x00, 0x07, 0x00, 0x00, 0xD8, 0x00, 0x00, 0x01, 0x80, + 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0x1E, 0x30, 0x01, 0xFC, 0x00, 0x00, 0x1B, 0x0C, 0x07, 0x03, 0x00, + 0x00, 0x0D, 0x86, 0x0C, 0x01, 0x80, 0x00, 0x06, 0x61, 0x98, 0x03, 0xC0, + 0x00, 0x03, 0x30, 0x70, 0x0F, 0xC0, 0x00, 0x03, 0x08, 0x00, 0x1F, 0x80, + 0x00, 0x01, 0x86, 0x00, 0x1E, 0x00, 0x00, 0x01, 0x83, 0x00, 0x3E, 0x00, + 0x00, 0x01, 0xC1, 0x80, 0x1B, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x08, 0x80, + 0x00, 0x00, 0xC0, 0x60, 0x00, 0x40, 0x00, 0x00, 0xE0, 0x30, 0x00, 0xF0, + 0x00, 0x00, 0xE0, 0x18, 0x00, 0xD8, 0x00, 0x00, 0xE0, 0x0C, 0x00, 0x0C, + 0x00, 0x00, 0xE0, 0x06, 0x00, 0x0C, 0x00, 0x01, 0xE0, 0x01, 0x00, 0x0F, + 0x00, 0x03, 0xC0, 0x00, 0xC0, 0x01, 0x80, 0x07, 0x80, 0x00, 0x30, 0x01, + 0xFE, 0xFF, 0x00, 0x00, 0x0E, 0x03, 0xBF, 0xFC, 0x00, 0x00, 0x01, 0xFE, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0xF0, 0x00, 0x00, 0x00, + 0x03, 0x9C, 0xC8, 0x00, 0x00, 0x00, 0x0E, 0x19, 0x8E, 0x00, 0x00, 0x00, + 0x78, 0x33, 0x9F, 0xC0, 0x00, 0x03, 0xC0, 0x67, 0x3D, 0xF0, 0x00, 0x0E, + 0x01, 0xCC, 0x6C, 0x3C, 0x00, 0x18, 0x07, 0x38, 0xC8, 0x0E, 0x00, 0x30, + 0x04, 0x63, 0x10, 0x03, 0x80, 0x60, 0x00, 0xC6, 0x60, 0x01, 0xC0, 0x60, + 0x00, 0x18, 0xC0, 0x00, 0xE0, 0xC0, 0x00, 0x13, 0x00, 0x00, 0x60, 0xC0, + 0x00, 0x0F, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x1B, 0x00, 0x00, 0x38, 0xC0, + 0x3F, 0x63, 0x00, 0x00, 0x18, 0xC0, 0x60, 0x8E, 0x00, 0x00, 0x0C, 0xC0, + 0x00, 0x1C, 0x00, 0x00, 0x0C, 0x60, 0x00, 0x78, 0x00, 0x00, 0x06, 0x70, + 0x00, 0xE0, 0x01, 0xC0, 0x06, 0x38, 0x03, 0xE0, 0x03, 0xE0, 0x06, 0x1C, + 0x1F, 0xF0, 0x03, 0xF0, 0x07, 0x1F, 0xFB, 0xF0, 0x03, 0xF0, 0x03, 0x30, + 0x83, 0xF0, 0x03, 0xF0, 0x03, 0x30, 0x01, 0xE0, 0x03, 0xE0, 0x03, 0x30, + 0x01, 0xE0, 0x01, 0xC0, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, 0x00, 0x00, 0x00, 0x00, 0x03, 0x30, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x03, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x18, 0x00, 0x00, 0x00, 0x00, 0x06, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x0C, 0x00, 0xE0, 0x01, 0x80, 0x0E, 0x0C, + 0x00, 0xFF, 0xFF, 0xC0, 0x0C, 0x0C, 0x00, 0x1F, 0xFE, 0x00, 0x1C, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x03, 0x00, 0x00, 0x00, 0x00, 0x38, 0x03, + 0x00, 0x00, 0x00, 0x00, 0x70, 0x01, 0x80, 0x00, 0x00, 0x00, 0x60, 0x00, + 0xC0, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x60, 0x00, 0x00, 0x03, 0x80, 0x00, + 0x38, 0x00, 0x00, 0x07, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, + 0x0F, 0x80, 0x00, 0x7C, 0x00, 0x00, 0x03, 0xF0, 0x03, 0xF0, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, 0x06, 0x38, 0x00, 0x00, + 0x03, 0x07, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0x00, 0x00, 0x18, 0x0E, 0x00, + 0x00, 0x07, 0x01, 0xC0, 0x00, 0x03, 0xE0, 0x3C, 0x00, 0x01, 0xDC, 0x03, + 0x80, 0x00, 0x61, 0xC0, 0x70, 0x00, 0x18, 0x38, 0x06, 0x00, 0x06, 0x07, + 0x00, 0xC0, 0x00, 0xC0, 0xF0, 0x30, 0x00, 0x38, 0x0C, 0x06, 0x00, 0x07, + 0x01, 0x81, 0xC0, 0x00, 0xE0, 0x60, 0x30, 0x00, 0x1F, 0xEC, 0x06, 0x00, + 0x3F, 0x7F, 0x01, 0x80, 0x1C, 0x01, 0xF8, 0x30, 0x1E, 0x00, 0x0F, 0x0C, + 0x0E, 0x00, 0x00, 0xE3, 0x0E, 0x00, 0x00, 0x18, 0x63, 0x00, 0x7C, 0x03, + 0x19, 0x80, 0x7F, 0xC0, 0xC6, 0x60, 0x78, 0x38, 0x19, 0x98, 0x38, 0x06, + 0x06, 0x23, 0xFC, 0x00, 0xC0, 0xCC, 0x7C, 0x00, 0x30, 0x03, 0x3C, 0x00, + 0x0C, 0x00, 0xDF, 0x80, 0x03, 0x00, 0x3E, 0x30, 0x00, 0xC0, 0x0F, 0x0E, + 0x00, 0x30, 0x03, 0xC1, 0x80, 0x0C, 0x00, 0xB0, 0x30, 0x06, 0x00, 0x6C, + 0x0E, 0x03, 0x80, 0x1B, 0x01, 0xC1, 0xC0, 0x06, 0x60, 0x3F, 0xE0, 0x03, + 0x18, 0x03, 0xE0, 0x00, 0xC7, 0x00, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x00, 0x06, 0x07, 0x00, 0x00, 0x03, 0x00, 0xE0, 0x00, + 0x01, 0xC0, 0x1C, 0x00, 0x00, 0xE0, 0x03, 0xC0, 0x00, 0xF0, 0x00, 0x3E, + 0x01, 0xF0, 0x00, 0x03, 0xFF, 0xF0, 0x00, 0x00, 0x1F, 0xE0, 0x00, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xC0, 0xF0, 0x7F, + 0x83, 0xFC, 0x1F, 0xE0, 0xFF, 0x07, 0xF8, 0x3F, 0xC1, 0xFE, 0x0F, 0xF0, + 0x7F, 0x83, 0xFC, 0x1F, 0xE0, 0xFF, 0x07, 0x80, 0x00, 0x07, 0x81, 0xE0, + 0x00, 0x07, 0x81, 0xE0, 0x00, 0x07, 0x01, 0xE0, 0x00, 0x0F, 0x01, 0xC0, + 0x00, 0x0F, 0x03, 0xC0, 0x00, 0x0F, 0x03, 0xC0, 0x00, 0x0E, 0x03, 0xC0, + 0x00, 0x1E, 0x03, 0x80, 0x00, 0x1E, 0x03, 0x80, 0x00, 0x1E, 0x07, 0x80, + 0x1F, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, 0x1F, 0xFF, 0xFF, 0xFF, + 0x1F, 0xFF, 0xFF, 0xFF, 0x00, 0x3C, 0x0F, 0x00, 0x00, 0x38, 0x0F, 0x00, + 0x00, 0x78, 0x0E, 0x00, 0x00, 0x78, 0x1E, 0x00, 0x00, 0x70, 0x1E, 0x00, + 0x00, 0xF0, 0x1E, 0x00, 0x00, 0xF0, 0x1C, 0x00, 0xFF, 0xFF, 0xFF, 0xF8, + 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xF8, + 0x01, 0xE0, 0x78, 0x00, 0x01, 0xC0, 0x78, 0x00, 0x01, 0xC0, 0x78, 0x00, + 0x03, 0xC0, 0x70, 0x00, 0x03, 0xC0, 0xF0, 0x00, 0x03, 0xC0, 0xF0, 0x00, + 0x03, 0x80, 0xF0, 0x00, 0x07, 0x80, 0xE0, 0x00, 0x07, 0x80, 0xE0, 0x00, + 0x07, 0x81, 0xE0, 0x00, 0x00, 0x30, 0x00, 0x00, 0xC0, 0x00, 0x03, 0x00, + 0x00, 0x0C, 0x00, 0x00, 0x30, 0x00, 0x07, 0xFF, 0x00, 0xFF, 0xFF, 0x07, + 0xFF, 0xFC, 0x3F, 0xFF, 0xF1, 0xF8, 0xC1, 0xCF, 0x83, 0x00, 0x3C, 0x0C, + 0x00, 0xF0, 0x30, 0x03, 0xC0, 0xC0, 0x0F, 0x03, 0x00, 0x3E, 0x0C, 0x00, + 0x7E, 0x30, 0x01, 0xFF, 0xC0, 0x03, 0xFF, 0xE0, 0x03, 0xFF, 0xF0, 0x03, + 0xFF, 0xE0, 0x00, 0xFF, 0xC0, 0x03, 0x1F, 0x80, 0x0C, 0x1F, 0x00, 0x30, + 0x7C, 0x00, 0xC0, 0xF0, 0x03, 0x03, 0xC0, 0x0C, 0x0F, 0x00, 0x30, 0x7E, + 0x00, 0xC3, 0xEF, 0x83, 0x3F, 0xBF, 0xFF, 0xFC, 0xFF, 0xFF, 0xE1, 0xFF, + 0xFF, 0x00, 0x7F, 0xE0, 0x00, 0x0C, 0x00, 0x00, 0x30, 0x00, 0x00, 0xC0, + 0x00, 0x03, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x30, 0x00, 0x00, 0xC0, 0x00, + 0x07, 0xE0, 0x00, 0x0E, 0x00, 0x3F, 0xF0, 0x00, 0x3C, 0x00, 0xFF, 0xF0, + 0x00, 0x70, 0x03, 0xE1, 0xE0, 0x01, 0xE0, 0x07, 0x81, 0xE0, 0x03, 0x80, + 0x0F, 0x03, 0xC0, 0x0F, 0x00, 0x3C, 0x03, 0xC0, 0x3C, 0x00, 0x78, 0x07, + 0x80, 0x70, 0x00, 0xF0, 0x0F, 0x01, 0xE0, 0x01, 0xE0, 0x1E, 0x03, 0x80, + 0x03, 0xC0, 0x3C, 0x0F, 0x00, 0x07, 0x80, 0x78, 0x1C, 0x00, 0x0F, 0x00, + 0xF0, 0x70, 0x00, 0x0F, 0x03, 0xC1, 0xE0, 0x00, 0x1E, 0x07, 0x83, 0x80, + 0x00, 0x3E, 0x1F, 0x0F, 0x00, 0x00, 0x3F, 0xFC, 0x1C, 0x00, 0x00, 0x3F, + 0xF0, 0x78, 0x1F, 0x80, 0x1F, 0x81, 0xE0, 0xFF, 0xC0, 0x00, 0x03, 0x83, + 0xFF, 0xC0, 0x00, 0x0F, 0x0F, 0x87, 0xC0, 0x00, 0x1C, 0x1E, 0x07, 0x80, + 0x00, 0x78, 0x3C, 0x0F, 0x00, 0x00, 0xE0, 0xF0, 0x0F, 0x00, 0x03, 0x81, + 0xE0, 0x1E, 0x00, 0x0F, 0x03, 0xC0, 0x3C, 0x00, 0x1C, 0x07, 0x80, 0x78, + 0x00, 0x78, 0x0F, 0x00, 0xF0, 0x00, 0xE0, 0x1E, 0x01, 0xE0, 0x03, 0xC0, + 0x3C, 0x03, 0xC0, 0x07, 0x00, 0x3C, 0x0F, 0x00, 0x1C, 0x00, 0x78, 0x1E, + 0x00, 0x78, 0x00, 0xF8, 0x78, 0x00, 0xE0, 0x00, 0xFF, 0xF0, 0x03, 0xC0, + 0x00, 0xFF, 0xC0, 0x07, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x3F, 0x80, 0x00, + 0x00, 0xFF, 0xF0, 0x00, 0x03, 0xFF, 0xF8, 0x00, 0x07, 0xFF, 0xF8, 0x00, + 0x07, 0xE0, 0x78, 0x00, 0x0F, 0x80, 0x08, 0x00, 0x0F, 0x80, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, + 0x07, 0xE0, 0x00, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, + 0x1F, 0xFC, 0x00, 0x00, 0x1E, 0x7E, 0x00, 0x3C, 0x3E, 0x3F, 0x00, 0x3C, + 0x7C, 0x1F, 0x80, 0x7C, 0x78, 0x0F, 0xC0, 0x78, 0xF8, 0x07, 0xE0, 0x78, + 0xF0, 0x03, 0xF0, 0x78, 0xF0, 0x01, 0xF8, 0xF0, 0xF0, 0x00, 0xFC, 0xF0, + 0xF0, 0x00, 0x7E, 0xE0, 0xF0, 0x00, 0x3F, 0xE0, 0xF8, 0x00, 0x1F, 0xC0, + 0x78, 0x00, 0x0F, 0xC0, 0x7C, 0x00, 0x0F, 0xC0, 0x3E, 0x00, 0x3F, 0xE0, + 0x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xCF, 0x9F, 0x0E, 0x1F, 0xF0, 0x70, 0x7A, 0x03, 0x80, 0x80, 0x1C, + 0x00, 0x00, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x80, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xE0, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x03, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFC, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xE0, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x3C, 0xF3, 0xCF, 0x3C, 0xE7, 0x9C, 0x73, 0xCE, 0x00, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x00, 0x1F, + 0x00, 0x1E, 0x00, 0x1E, 0x00, 0x3E, 0x00, 0x3C, 0x00, 0x3C, 0x00, 0x3C, + 0x00, 0x78, 0x00, 0x78, 0x00, 0x78, 0x00, 0xF8, 0x00, 0xF0, 0x00, 0xF0, + 0x01, 0xF0, 0x01, 0xE0, 0x01, 0xE0, 0x01, 0xE0, 0x03, 0xC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x0F, + 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, + 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x07, 0xFC, 0x00, 0xFF, 0xFE, 0x0F, 0xFF, 0xFE, 0x3F, + 0xFF, 0xFC, 0xFE, 0x03, 0xF3, 0x80, 0x03, 0xE8, 0x00, 0x07, 0x80, 0x00, + 0x1F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, + 0x00, 0x00, 0x3C, 0x00, 0x01, 0xE0, 0x00, 0x0F, 0x80, 0x00, 0x3C, 0x00, + 0x01, 0xF0, 0x00, 0x0F, 0x80, 0x00, 0x7C, 0x00, 0x03, 0xE0, 0x00, 0x1F, + 0x00, 0x00, 0xF8, 0x00, 0x07, 0xC0, 0x00, 0x3E, 0x00, 0x01, 0xF0, 0x00, + 0x0F, 0x80, 0x00, 0x7C, 0x00, 0x03, 0xE0, 0x00, 0x1F, 0x00, 0x00, 0xF8, + 0x00, 0x07, 0xC0, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xC0, 0x0F, 0xFE, 0x00, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, + 0x83, 0xFF, 0xFF, 0x87, 0x00, 0x3F, 0x80, 0x00, 0x1F, 0x00, 0x00, 0x1F, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x78, 0x00, 0x00, 0xF0, + 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1F, 0x00, 0x00, 0xFC, 0x01, + 0xFF, 0xF0, 0x03, 0xFF, 0x80, 0x07, 0xFF, 0x80, 0x0F, 0xFF, 0xC0, 0x00, + 0x1F, 0xC0, 0x00, 0x0F, 0xC0, 0x00, 0x07, 0x80, 0x00, 0x0F, 0x80, 0x00, + 0x0F, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x78, 0x00, 0x00, + 0xF0, 0x00, 0x03, 0xE0, 0x00, 0x0F, 0xA0, 0x00, 0x3F, 0x7C, 0x01, 0xFC, + 0xFF, 0xFF, 0xF1, 0xFF, 0xFF, 0xC1, 0xFF, 0xFE, 0x00, 0x3F, 0xE0, 0x00, + 0x00, 0x03, 0xF0, 0x00, 0x03, 0xF8, 0x00, 0x01, 0xFC, 0x00, 0x01, 0xFE, + 0x00, 0x01, 0xEF, 0x00, 0x00, 0xE7, 0x80, 0x00, 0xF3, 0xC0, 0x00, 0xF1, + 0xE0, 0x00, 0x78, 0xF0, 0x00, 0x78, 0x78, 0x00, 0x78, 0x3C, 0x00, 0x3C, + 0x1E, 0x00, 0x3C, 0x0F, 0x00, 0x3C, 0x07, 0x80, 0x1E, 0x03, 0xC0, 0x1E, + 0x01, 0xE0, 0x1E, 0x00, 0xF0, 0x0F, 0x00, 0x78, 0x0F, 0x00, 0x3C, 0x0F, + 0x80, 0x1E, 0x07, 0x80, 0x0F, 0x07, 0x80, 0x07, 0x83, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x3C, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x07, 0x80, 0x00, 0x03, + 0xC0, 0x00, 0x01, 0xE0, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x78, 0x00, 0x7F, + 0xFF, 0xE1, 0xFF, 0xFF, 0x87, 0xFF, 0xFE, 0x1F, 0xFF, 0xF8, 0x78, 0x00, + 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x01, + 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0xFE, 0x00, 0x7F, 0xFF, 0x01, 0xFF, + 0xFF, 0x07, 0xFF, 0xFE, 0x1E, 0x03, 0xFC, 0x40, 0x01, 0xF0, 0x00, 0x03, + 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, + 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, + 0x07, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0xFA, 0x00, 0x07, 0xCF, 0x00, 0x7F, + 0x3F, 0xFF, 0xF8, 0xFF, 0xFF, 0xC3, 0xFF, 0xFC, 0x01, 0xFF, 0xC0, 0x00, + 0x00, 0x1F, 0xF0, 0x00, 0xFF, 0xFC, 0x03, 0xFF, 0xFC, 0x07, 0xFF, 0xFC, + 0x0F, 0xE0, 0x0C, 0x1F, 0x80, 0x00, 0x1E, 0x00, 0x00, 0x3E, 0x00, 0x00, + 0x3C, 0x00, 0x00, 0x78, 0x00, 0x00, 0x78, 0x00, 0x00, 0x78, 0x00, 0x00, + 0xF8, 0x7F, 0x00, 0xF1, 0xFF, 0xE0, 0xF3, 0xFF, 0xF0, 0xF7, 0xFF, 0xF8, + 0xFF, 0xC1, 0xFC, 0xFF, 0x00, 0x7E, 0xFE, 0x00, 0x3E, 0xFC, 0x00, 0x1E, + 0xFC, 0x00, 0x1F, 0xF8, 0x00, 0x0F, 0xF8, 0x00, 0x0F, 0xF8, 0x00, 0x0F, + 0x78, 0x00, 0x0F, 0x78, 0x00, 0x0F, 0x78, 0x00, 0x0F, 0x7C, 0x00, 0x1F, + 0x3C, 0x00, 0x1E, 0x3E, 0x00, 0x3E, 0x1F, 0x00, 0x7C, 0x1F, 0xC1, 0xFC, + 0x0F, 0xFF, 0xF8, 0x07, 0xFF, 0xF0, 0x03, 0xFF, 0xE0, 0x00, 0x7F, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, + 0x00, 0x78, 0x00, 0x03, 0xE0, 0x00, 0x0F, 0x00, 0x00, 0x7C, 0x00, 0x01, + 0xE0, 0x00, 0x07, 0x80, 0x00, 0x3E, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, + 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x03, 0xE0, 0x00, 0x0F, 0x00, 0x00, + 0x3C, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x3E, 0x00, 0x00, 0xF0, + 0x00, 0x03, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x03, 0xE0, 0x00, + 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x3E, + 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xFF, + 0x00, 0x07, 0xFF, 0xE0, 0x0F, 0xFF, 0xF0, 0x1F, 0xFF, 0xF8, 0x3F, 0x81, + 0xFC, 0x3E, 0x00, 0x7C, 0x7C, 0x00, 0x3E, 0x78, 0x00, 0x1E, 0x78, 0x00, + 0x1E, 0x78, 0x00, 0x1E, 0x78, 0x00, 0x1E, 0x78, 0x00, 0x1E, 0x3C, 0x00, + 0x3C, 0x3E, 0x00, 0x7C, 0x1F, 0x81, 0xF8, 0x0F, 0xFF, 0xF0, 0x03, 0xFF, + 0xC0, 0x07, 0xFF, 0xE0, 0x1F, 0xFF, 0xF8, 0x3F, 0x81, 0xFC, 0x7C, 0x00, + 0x3E, 0x78, 0x00, 0x1E, 0xF8, 0x00, 0x1F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, + 0x0F,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 0x00, 0x08, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0xFE, 0x00, 0x00, + 0x3F, 0xF0, 0x00, 0x07, 0xFF, 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x7F, 0xF8, + 0x00, 0x1F, 0xFE, 0x00, 0x03, 0xFF, 0x80, 0x00, 0xFF, 0xF0, 0x00, 0x3F, + 0xFC, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x7F, 0xC0, + 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x03, 0xFF, 0x80, + 0x00, 0x07, 0xFF, 0x80, 0x00, 0x07, 0xFF, 0x80, 0x00, 0x07, 0xFF, 0x80, + 0x00, 0x07, 0xFF, 0x00, 0x00, 0x0F, 0xFC, 0x00, 0x00, 0x0F, 0xE0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0x08, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x80, 0x00, 0x00, + 0x07, 0x80, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x01, 0xFF, 0x80, 0x00, 0x07, + 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x0F, + 0xFF, 0x00, 0x00, 0x0F, 0xFE, 0x00, 0x00, 0x1F, 0xFE, 0x00, 0x00, 0x1F, + 0xFE, 0x00, 0x00, 0x1F, 0xF0, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x07, 0xFC, + 0x00, 0x01, 0xFF, 0xE0, 0x00, 0x7F, 0xF8, 0x00, 0x0F, 0xFE, 0x00, 0x03, + 0xFF, 0xC0, 0x00, 0xFF, 0xF0, 0x00, 0x3F, 0xFC, 0x00, 0x07, 0xFF, 0x00, + 0x00, 0x7F, 0xE0, 0x00, 0x03, 0xF8, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x0F, 0xFF, 0x07, 0xFF, 0xF3, 0xFF, + 0xFE, 0xF8, 0x1F, 0xB8, 0x01, 0xF8, 0x00, 0x7C, 0x00, 0x0F, 0x00, 0x03, + 0xC0, 0x00, 0xF0, 0x00, 0x3C, 0x00, 0x1E, 0x00, 0x0F, 0x80, 0x07, 0xC0, + 0x03, 0xE0, 0x01, 0xF8, 0x00, 0xFC, 0x00, 0x7E, 0x00, 0x1F, 0x00, 0x0F, + 0x80, 0x03, 0xC0, 0x00, 0xF0, 0x00, 0x3C, 0x00, 0x0F, 0x00, 0x03, 0xC0, + 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, + 0x3E, 0x00, 0x0F, 0x80, 0x03, 0xE0, 0x00, 0xF8, 0x00, 0x3E, 0x00, 0x00, + 0x00, 0x7F, 0xC0, 0x00, 0x00, 0x03, 0xFF, 0xFC, 0x00, 0x00, 0x07, 0xFF, + 0xFF, 0xC0, 0x00, 0x0F, 0xFF, 0xFF, 0xF0, 0x00, 0x0F, 0xF8, 0x03, 0xFE, + 0x00, 0x0F, 0xE0, 0x00, 0x3F, 0x80, 0x0F, 0xC0, 0x00, 0x07, 0xE0, 0x0F, + 0x80, 0x00, 0x01, 0xF8, 0x0F, 0x80, 0x00, 0x00, 0x7C, 0x0F, 0x80, 0x00, + 0x00, 0x1F, 0x07, 0x80, 0x00, 0x00, 0x07, 0x87, 0xC0, 0x1F, 0x87, 0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 0x00, 0x0F, 0xF0, 0x00, 0x1F, 0xF0, 0x00, 0x3E, 0xF0, 0x00, 0xFE, + 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xF0, 0xFF, 0xFF, 0x80, + 0x00, 0x0F, 0xFC, 0x00, 0x07, 0xFF, 0xF8, 0x01, 0xFF, 0xFF, 0xE0, 0x3F, + 0xFF, 0xFF, 0x07, 0xF0, 0x07, 0xF0, 0xFC, 0x00, 0x0F, 0x1F, 0x00, 0x00, + 0x31, 0xE0, 0x00, 0x01, 0x3E, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x78, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x03, 0xE0, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x11, 0xF0, 0x00, 0x03, 0x0F, 0xC0, 0x00, + 0xF0, 0x7F, 0x80, 0x7F, 0x03, 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFE, 0x00, + 0x7F, 0xFF, 0x80, 0x00, 0xFF, 0xC0, 0xFF, 0xFF, 0x00, 0x07, 0xFF, 0xFF, + 0x80, 0x3F, 0xFF, 0xFF, 0x01, 0xFF, 0xFF, 0xFC, 0x0F, 0x00, 0x1F, 0xF8, + 0x78, 0x00, 0x0F, 0xE3, 0xC0, 0x00, 0x1F, 0x1E, 0x00, 0x00, 0x7C, 0xF0, + 0x00, 0x01, 0xE7, 0x80, 0x00, 0x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F0, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, + 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, + 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xFF, 0xFF, 0xEF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xEF, 0xFF, 0xFE, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, + 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, + 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0xFC, + 0x00, 0x01, 0xFF, 0xFF, 0x00, 0x1F, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFE, + 0x07, 0xF8, 0x07, 0xF8, 0x3F, 0x00, 0x01, 0xE1, 0xF0, 0x00, 0x01, 0x8F, + 0x80, 0x00, 0x02, 0x3E, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x07, 0x80, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x03, 0xC0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x03, 0xC0, 0x00, 0xFF, 0xFF, 0x00, 0x03, 0xFF, 0xFC, 0x00, 0x0F, 0xFF, + 0xF0, 0x00, 0x3F, 0xFF, 0xC0, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x03, 0xDE, + 0x00, 0x00, 0x0F, 0x78, 0x00, 0x00, 0x3D, 0xE0, 0x00, 0x00, 0xF7, 0xC0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, 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, + 0x1E, 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x1E, + 0x03, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x3C, 0x07, 0x80, 0xF0, 0x3C, 0x07, + 0x83, 0xF7, 0xFC, 0xFF, 0x9F, 0xC3, 0xE0, 0x00, 0xF0, 0x00, 0x1F, 0x9E, + 0x00, 0x07, 0xE3, 0xC0, 0x01, 0xF8, 0x78, 0x00, 0x7E, 0x0F, 0x00, 0x1F, + 0x81, 0xE0, 0x07, 0xE0, 0x3C, 0x01, 0xF8, 0x07, 0x80, 0x7E, 0x00, 0xF0, + 0x1F, 0x80, 0x1E, 0x07, 0xE0, 0x03, 0xC3, 0xF0, 0x00, 0x78, 0xFC, 0x00, + 0x0F, 0x3F, 0x00, 0x01, 0xEF, 0xC0, 0x00, 0x3F, 0xF0, 0x00, 0x07, 0xFC, + 0x00, 0x00, 0xFF, 0x80, 0x00, 0x1F, 0xF8, 0x00, 0x03, 0xDF, 0x80, 0x00, + 0x79, 0xF8, 0x00, 0x0F, 0x1F, 0x80, 0x01, 0xE0, 0xF8, 0x00, 0x3C, 0x0F, + 0x80, 0x07, 0x80, 0xF8, 0x00, 0xF0, 0x0F, 0x80, 0x1E, 0x00, 0xF8, 0x03, + 0xC0, 0x0F, 0x80, 0x78, 0x00, 0xF8, 0x0F, 0x00, 0x0F, 0x81, 0xE0, 0x00, + 0xF8, 0x3C, 0x00, 0x0F, 0x87, 0x80, 0x00, 0xF8, 0xF0, 0x00, 0x0F, 0x9E, + 0x00, 0x00, 0xFC, 0xF0, 0x00, 0x07, 0x80, 0x00, 0x3C, 0x00, 0x01, 0xE0, + 0x00, 0x0F, 0x00, 0x00, 0x78, 0x00, 0x03, 0xC0, 0x00, 0x1E, 0x00, 0x00, + 0xF0, 0x00, 0x07, 0x80, 0x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x00, 0x00, 0x00, 0x0F, + 0xF0, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x03, 0xFF, + 0xFF, 0xC0, 0x07, 0xF0, 0x0F, 0xE0, 0x0F, 0xC0, 0x03, 0xF0, 0x1F, 0x80, + 0x01, 0xF8, 0x3E, 0x00, 0x00, 0x7C, 0x3E, 0x00, 0x00, 0x7C, 0x7C, 0x00, + 0x00, 0x3C, 0x78, 0x00, 0x00, 0x3E, 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, + 0x00, 0x1E, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, + 0x00, 0x1E, 0x78, 0x00, 0x00, 0x1E, 0x7C, 0x00, 0x00, 0x3E, 0x3E, 0x00, + 0x00, 0x7C, 0x3E, 0x00, 0x00, 0x7C, 0x1F, 0x80, 0x01, 0xF8, 0x0F, 0xC0, + 0x03, 0xF0, 0x07, 0xF0, 0x0F, 0xE0, 0x03, 0xFF, 0xFF, 0xC0, 0x01, 0xFF, + 0xFF, 0x80, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00, 0x00, + 0x1F, 0x80, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x00, 0x07, 0xE0, 0x00, 0x00, + 0x03, 0xF0, 0x00, 0x00, 0x01, 0xF8, 0xFF, 0xFE, 0x00, 0x1F, 0xFF, 0xF8, + 0x03, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xF8, 0x0F, 0x00, 0x3F, 0x81, 0xE0, + 0x01, 0xF0, 0x3C, 0x00, 0x1F, 0x07, 0x80, 0x01, 0xE0, 0xF0, 0x00, 0x3C, + 0x1E, 0x00, 0x07, 0x83, 0xC0, 0x00, 0xF0, 0x78, 0x00, 0x1E, 0x0F, 0x00, + 0x03, 0xC1, 0xE0, 0x00, 0xF8, 0x3C, 0x00, 0x3E, 0x07, 0x80, 0x1F, 0xC0, + 0xFF, 0xFF, 0xF0, 0x1F, 0xFF, 0xFC, 0x03, 0xFF, 0xFE, 0x00, 0x7F, 0xFF, + 0xF0, 0x0F, 0x00, 0x7E, 0x01, 0xE0, 0x03, 0xE0, 0x3C, 0x00, 0x3E, 0x07, + 0x80, 0x07, 0xC0, 0xF0, 0x00, 0x7C, 0x1E, 0x00, 0x07, 0x83, 0xC0, 0x00, + 0xF8, 0x78, 0x00, 0x0F, 0x0F, 0x00, 0x01, 0xF1, 0xE0, 0x00, 0x1E, 0x3C, + 0x00, 0x03, 0xE7, 0x80, 0x00, 0x3E, 0xF0, 0x00, 0x03, 0xDE, 0x00, 0x00, + 0x7C, 0x00, 0xFF, 0x80, 0x07, 0xFF, 0xF8, 0x1F, 0xFF, 0xFC, 0x3F, 0xFF, + 0xFC, 0x3F, 0x00, 0xFC, 0x7C, 0x00, 0x1C, 0x78, 0x00, 0x04, 0xF0, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0xF0, 0x00, 0x00, 0xF0, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0xF8, 0x00, 0x00, 0x7C, 0x00, 0x00, 0x7F, 0xC0, 0x00, 0x3F, 0xFE, + 0x00, 0x3F, 0xFF, 0xC0, 0x0F, 0xFF, 0xF0, 0x03, 0xFF, 0xF8, 0x00, 0x7F, + 0xFC, 0x00, 0x03, 0xFE, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x3F, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x1E, 0xE0, 0x00, 0x3E, 0xFE, 0x01, + 0xFC, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xF8, 0x3F, 0xFF, 0xE0, 0x03, 0xFF, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, 0xC0, 0x00, + 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, 0xC0, + 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, + 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFE, 0x00, 0x01, + 0xF7, 0x80, 0x00, 0x79, 0xE0, 0x00, 0x1E, 0x7C, 0x00, 0x0F, 0x8F, 0x80, + 0x07, 0xC3, 0xF8, 0x07, 0xF0, 0x7F, 0xFF, 0xF8, 0x0F, 0xFF, 0xFC, 0x00, + 0xFF, 0xFC, 0x00, 0x0F, 0xFC, 0x00, 0xF0, 0x00, 0x00, 0x1E, 0xF0, 0x00, + 0x00, 0x79, 0xE0, 0x00, 0x00, 0xF3, 0xE0, 0x00, 0x03, 0xE3, 0xC0, 0x00, + 0x07, 0x87, 0x80, 0x00, 0x0F, 0x0F, 0x80, 0x00, 0x3E, 0x0F, 0x00, 0x00, + 0x78, 0x1F, 0x00, 0x01, 0xF0, 0x1E, 0x00, 0x03, 0xC0, 0x3C, 0x00, 0x07, + 0x80, 0x7C, 0x00, 0x1F, 0x00, 0x78, 0x00, 0x3C, 0x00, 0xF0, 0x00, 0x78, + 0x00, 0xF0, 0x01, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x03, 0xE0, 0x0F, 0x80, + 0x03, 0xC0, 0x1E, 0x00, 0x07, 0x80, 0x3C, 0x00, 0x0F, 0x80, 0xF8, 0x00, + 0x0F, 0x01, 0xE0, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x1E, 0x0F, 0x00, 0x00, + 0x3C, 0x1E, 0x00, 0x00, 0x7C, 0x7C, 0x00, 0x00, 0x78, 0xF0, 0x00, 0x00, + 0xF1, 0xE0, 0x00, 0x01, 0xF7, 0xC0, 0x00, 0x01, 0xEF, 0x00, 0x00, 0x03, + 0xFE,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0xF8, 0x00, 0x07, 0xF0, 0x00, 0x7F, 0x00, 0x00, 0xFE, + 0x00, 0x0F, 0xE0, 0x00, 0x1F, 0x80, 0x00, 0xFC, 0x00, 0x3E, 0x00, 0x01, + 0xF0, 0xF8, 0x00, 0x1F, 0x03, 0xC0, 0x01, 0xF0, 0x1F, 0x00, 0x0F, 0x80, + 0x7C, 0x00, 0xF8, 0x01, 0xE0, 0x0F, 0x80, 0x0F, 0x80, 0x7C, 0x00, 0x3E, + 0x07, 0xC0, 0x00, 0xF0, 0x7C, 0x00, 0x07, 0xC3, 0xE0, 0x00, 0x1F, 0x3E, + 0x00, 0x00, 0xFB, 0xE0, 0x00, 0x03, 0xFF, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0x00, 0x7F, 0x00, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x0F, 0xC0, 0x00, 0x00, + 0xFE, 0x00, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x07, 0xDF, + 0x00, 0x00, 0x3C, 0x7C, 0x00, 0x03, 0xE1, 0xF0, 0x00, 0x3E, 0x0F, 0x80, + 0x03, 0xE0, 0x3E, 0x00, 0x1F, 0x00, 0xF0, 0x01, 0xF0, 0x07, 0xC0, 0x1F, + 0x00, 0x1F, 0x00, 0xF8, 0x00, 0x78, 0x0F, 0x80, 0x03, 0xE0, 0xF8, 0x00, + 0x0F, 0x87, 0xC0, 0x00, 0x3C, 0x7C, 0x00, 0x01, 0xF7, 0xC0, 0x00, 0x07, + 0xC0, 0xF8, 0x00, 0x01, 0xF7, 0xC0, 0x00, 0x3E, 0x3E, 0x00, 0x07, 0xC3, + 0xE0, 0x00, 0x7C, 0x1F, 0x00, 0x0F, 0x80, 0xF8, 0x01, 0xF0, 0x0F, 0x80, + 0x1F, 0x00, 0x7C, 0x03, 0xE0, 0x03, 0xE0, 0x7C, 0x00, 0x3E, 0x07, 0xC0, + 0x01, 0xF0, 0xF8, 0x00, 0x0F, 0x9F, 0x00, 0x00, 0xF9, 0xF0, 0x00, 0x07, + 0xFE, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0x1F, 0x80, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0x7F, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xE7, 0xFF, + 0xFF, 0xFE, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, + 0x80, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, + 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x3E, + 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x00, 0x00, + 0x01, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, + 0x00, 0x00, 0x1F, 0x00, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, + 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x03, 0xF0, + 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 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00, 0x00, 0xF0, 0x00, 0x01, 0xE0, 0xFE, 0x03, 0xC7, 0xFF, 0x07, + 0x9F, 0xFF, 0x0F, 0x7F, 0xFF, 0x1F, 0xF0, 0x7E, 0x3F, 0x80, 0x3E, 0x7E, + 0x00, 0x3E, 0xF8, 0x00, 0x3D, 0xF0, 0x00, 0x7B, 0xE0, 0x00, 0xFF, 0x80, + 0x00, 0xFF, 0x00, 0x01, 0xFE, 0x00, 0x03, 0xFC, 0x00, 0x07, 0xF8, 0x00, + 0x0F, 0xF0, 0x00, 0x1F, 0xE0, 0x00, 0x3F, 0xC0, 0x00, 0x7F, 0xC0, 0x01, + 0xFF, 0x80, 0x03, 0xDF, 0x00, 0x07, 0xBF, 0x00, 0x1F, 0x7F, 0x00, 0x7C, + 0xFF, 0x83, 0xF1, 0xEF, 0xFF, 0xE3, 0xCF, 0xFF, 0x87, 0x8F, 0xFE, 0x00, + 0x07, 0xE0, 0x00, 0x00, 0x7F, 0x80, 0x3F, 0xFE, 0x07, 0xFF, 0xF0, 0xFF, + 0xFF, 0x1F, 0xC0, 0xF3, 0xF0, 0x01, 0x7C, 0x00, 0x07, 0xC0, 0x00, 0x78, + 0x00, 0x0F, 0x80, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, + 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF8, 0x00, 0x07, 0x80, 0x00, 0x7C, 0x00, 0x03, 0xC0, 0x00, 0x3F, 0x00, + 0x11, 0xFC, 0x0F, 0x0F, 0xFF, 0xF0, 0x7F, 0xFF, 0x03, 0xFF, 0xE0, 0x07, + 0xF0, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x78, 0x00, 0x00, + 0xF0, 0x00, 0x01, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0x80, 0x00, 0x0F, + 0x00, 0x00, 0x1E, 0x01, 0x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1F, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x03, 0xF0, 0x00, 0x03, 0xF8, 0x00, 0x01, 0xFE, 0x00, + 0x01, 0xFF, 0x80, 0x01, 0xF7, 0xC0, 0x01, 0xF1, 0xF0, 0x00, 0xF8, 0x7C, + 0x00, 0xF8, 0x3E, 0x00, 0xF8, 0x0F, 0x80, 0xF8, 0x03, 0xE0, 0x7C, 0x00, + 0xF8, 0x7C, 0x00, 0x7C, 0x7C, 0x00, 0x1F, 0x7C, 0x00, 0x07, 0xC0, 0xF8, + 0x00, 0x0F, 0xBC, 0x00, 0x07, 0x9E, 0x00, 0x03, 0xCF, 0x80, 0x03, 0xE3, + 0xC0, 0x01, 0xE1, 0xF0, 0x01, 0xF0, 0x78, 0x00, 0xF0, 0x3C, 0x00, 0x78, + 0x1F, 0x00, 0x7C, 0x07, 0x80, 0x3C, 0x03, 0xE0, 0x3E, 0x00, 0xF0, 0x1E, + 0x00, 0x78, 0x0F, 0x00, 0x3E, 0x0F, 0x80, 0x0F, 0x07, 0x80, 0x07, 0xC7, + 0xC0, 0x01, 0xE3, 0xC0, 0x00, 0xF1, 0xE0, 0x00, 0x7D, 0xE0, 0x00, 0x1E, + 0xF0, 0x00, 0x0F, 0xF8, 0x00, 0x03, 0xF8, 0x00, 0x01, 0xFC, 0x00, 0x00, + 0xFC, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x0F, 0x80, 0x00, 0x07, 0x80, 0x00, 0x07, 0xC0, 0x00, 0x07, 0xE0, 0x00, + 0x07, 0xE0, 0x00, 0x3F, 0xF0, 0x00, 0x1F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, + 0x07, 0xE0, 0x00, 0x00, 0x7F, 0xFF, 0xFB, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xF0, 0x00, 0x1F, 0x00, 0x01, 0xF8, 0x00, 0x1F, 0x80, 0x00, + 0x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8, 0x00, 0x1E, 0x00, 0x07, 0x80, 0x01, 0xE0, 0x00, 0x78, + 0x00, 0x1E, 0x00, 0x07, 0x80, 0x01, 0xE0, 0x00, 0x78, 0x00, 0x1E, 0x00, + 0x07, 0x80, 0x01, 0xE0, 0x00, 0x7C, 0x00, 0x0F, 0x80, 0x03, 0xFF, 0x00, + 0x3F, 0xC0, 0x0F, 0xF0, 0x07, 0xFC, 0x03, 0xF0, 0x01, 0xF0, 0x00, 0x7C, + 0x00, 0x1E, 0x00, 0x07, 0x80, 0x01, 0xE0, 0x00, 0x78, 0x00, 0x1E, 0x00, + 0x07, 0x80, 0x01, 0xE0, 0x00, 0x78, 0x00, 0x1E, 0x00, 0x07, 0x80, 0x01, + 0xE0, 0x00, 0xF8, 0x00, 0x7E, 0x03, 0xFF, 0x00, 0xFF, 0xC0, 0x3F, 0xE0, + 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x80, 0x00, 0x47, 0xFF, + 0x80, 0x0E, 0xFF, 0xFF, 0x81, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x0F, 0xFF, + 0xFB, 0x80, 0x0F, 0xFF, 0x18, 0x00, 0x0F, 0xE0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0xF8, 0x00, 0x07, 0xFF, 0xC0, 0x03, 0xFF, 0xF8, 0x03, 0xFF, + 0xFF, 0x00, 0xFC, 0x07, 0xC0, 0x7C, 0x00, 0x70, 0x3E, 0x00, 0x0C, 0x0F, + 0x00, 0x01, 0x07, 0xC0, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x3E, 0x00, 0x00, 0x7F, 0xFF, 0xFC, 0x1F, 0xFF, 0xFE, 0x0F, 0xFF, 0xFF, + 0x80, 0x3C, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x3C, 0x00, 0x00, 0x7F, 0xFF, 0xC0,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E7, 0x03, + 0x9E, 0x0F, 0x38, 0x1C, 0x70, 0x39, 0xE0, 0xF3, 0x81, 0xC0, 0xF0, 0x00, + 0xF0, 0x00, 0xFF, 0x00, 0x0F, 0x00, 0x0F, 0xF0, 0x00, 0xF0, 0x00, 0xFF, + 0x00, 0x0F, 0x00, 0x0F, 0xF0, 0x00, 0xF0, 0x00, 0xFF, 0x00, 0x0F, 0x00, + 0x0F, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, + 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, + 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, + 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, + 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, + 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, + 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF0, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x00, + 0x0F, 0x00, 0x00, 0xF0, 0x00, 0x07, 0xE0, 0x00, 0x0E, 0x00, 0x00, 0x00, + 0x07, 0xFE, 0x00, 0x07, 0x80, 0x00, 0x00, 0x03, 0xFF, 0xC0, 0x01, 0xC0, + 0x00, 0x00, 0x01, 0xF0, 0xF0, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x78, 0x1E, + 0x00, 0x38, 0x00, 0x00, 0x00, 0x1E, 0x07, 0x80, 0x1E, 0x00, 0x00, 0x00, + 0x0F, 0x00, 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x3C, 0x03, 0x80, + 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x01, 0xE0, 0x00, 0x00, 0x00, 0x3C, 0x03, + 0xC0, 0x70, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xF0, 0x3C, 0x00, 0x00, 0x00, + 0x03, 0xC0, 0x3C, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x1E, 0x07, 0x83, 0xC0, 0x00, 0x00, 0x00, 0x07, 0x81, + 0xE0, 0xE0, 0x00, 0x00, 0x00, 0x01, 0xF0, 0xF8, 0x78, 0x00, 0x00, 0x00, + 0x00, 0x3F, 0xFC, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFE, 0x0F, 0x03, + 0xF0, 0x00, 0x7E, 0x00, 0x7E, 0x07, 0x83, 0xFF, 0x00, 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, 0x00, 0x78, 0x00, + 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x00, 0x03, 0xE1, 0xF7, 0xC3, 0xEF, 0x87, + 0xDF, 0x0F, 0xBE, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x01, 0xE0, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x7C, 0x7C, 0x00, + 0x00, 0xF1, 0xFC, 0x00, 0x03, 0xC3, 0xF8, 0x00, 0x0F, 0x07, 0xF0, 0x00, + 0x1C, 0x1F, 0xF0, 0x00, 0x00, 0x3D, 0xE0, 0x00, 0x00, 0xFB, 0xE0, 0x00, + 0x01, 0xE3, 0xC0, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x0F, 0x8F, 0x80, 0x00, + 0x1E, 0x0F, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, 0xF0, 0x1E, 0x00, 0x01, + 0xE0, 0x3C, 0x00, 0x07, 0xC0, 0x7C, 0x00, 0x0F, 0x00, 0x78, 0x00, 0x1E, + 0x00, 0xF0, 0x00, 0x7C, 0x01, 0xF0, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xE0, + 0x03, 0xE0, 0x07, 0x80, 0x03, 0xC0, 0x0F, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, + 0xFF, 0x80, 0x7F, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFE, 0x03, 0xE0, 0x00, + 0x3E, 0x07, 0x80, 0x00, 0x3C, 0x1F, 0x00, 0x00, 0x7C, 0x3C, 0x00, 0x00, + 0x78, 0x78, 0x00, 0x00, 0xF1, 0xF0, 0x00, 0x01, 0xF3, 0xC0, 0x00, 0x01, + 0xE7, 0x80, 0x00, 0x03, 0xDE, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x1F, 0xF0, + 0x01, 0xFF, 0xF0, 0x0F, 0xFF, 0xC0, 0x7F, 0xFF, 0x03, 0xF0, 0x0C, 0x0F, + 0x80, 0x00, 0x3C, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, + 0x00, 0x78, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, 0x00, + 0x78, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x03, 0xFF, 0xFF, 0x0F, 0xFF, + 0xFC, 0x3F, 0xFF, 0xF0, 0xFF, 0xFF, 0xC0, 0x1E, 0x00, 0x00, 0x78, 0x00, + 0x01, 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x01, + 0xE0, 0x00, 0x07, 0x80, 0x00, 0x1E, 0x00, 0x00, 0x78, 0x00, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x20, 0x00, + 0x01, 0x1C, 0x00, 0x00, 0xEF, 0x80, 0x00, 0x7D, 0xF0, 0xFC, 0x3E, 0x3E, + 0xFF, 0xDF, 0x07, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, 0xC0, 0x1F, 0x87, 0xE0, + 0x0F, 0x80, 0x7C, 0x03, 0xC0, 0x0F, 0x01, 0xF0, 0x03, 0xE0, 0x78, 0x00, + 0x78, 0x1E, 0x00, 0x1E, 0x07, 0x80, 0x07, 0x81, 0xE0, 0x01, 0xE0, 0x7C, + 0x00, 0xF8, 0x0F, 0x00, 0x3C, 0x03, 0xE0, 0x1F, 0x00, 0x7E, 0x1F, 0x80, + 0x3F, 0xFF, 0xF0, 0x1F, 0xFF, 0xFE, 0x0F, 0xBF, 0xF7, 0xC7, 0xC3, 0xF0, + 0xFB, 0xE0, 0x00, 0x1F, 0x70, 0x00, 0x03, 0x88, 0x00, 0x00, 0x40, 0xF8, + 0x00, 0x07, 0xDE, 0x00, 0x01, 0xE7, 0xC0, 0x00, 0xF8, 0xF8, 0x00, 0x7C, + 0x1E, 0x00, 0x1E, 0x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, 0x03, 0xF0, 0x00, 0x1E, 0x00, 0x03, 0xE0, + 0x00, 0x3C, 0x00, 0x07, 0x80, 0x00, 0xF0, 0x80, 0x3E, 0x1E, 0x0F, 0x83, + 0xFF, 0xE0, 0x7F, 0xF8, 0x03, 0xFC, 0x00, 0xF8, 0x7F, 0xE1, 0xFF, 0x87, + 0xFE, 0x1F, 0xF8, 0x7C, 0x00, 0x07, 0xF8, 0x00, 0x00, 0x0F, 0xFF, 0xC0, + 0x00, 0x0F, 0x80, 0x7C, 0x00, 0x07, 0x00, 0x03, 0x80, 0x03, 0x80, 0x00, + 0x70, 0x01, 0x80, 0x00, 0x06, 0x00, 0xC0, 0x3F, 0xC0, 0xC0, 0x60, 0x3F, + 0xFC, 0x18, 0x38, 0x3F, 0xFF, 0x07, 0x0C, 0x1F, 0x80, 0xC0, 0xC6, 0x07, + 0xC0, 0x00, 0x19, 0x83, 0xE0, 0x00, 0x06, 0x60, 0xF0, 0x00, 0x01, 0xB0, + 0x7C, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, 0x0F, 0x07, 0x80, 0x00, 0x03, + 0xC1, 0xE0, 0x00, 0x00, 0xF0, 0x78, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, + 0x0F, 0x07, 0x80, 0x00, 0x03, 0xC1, 0xF0, 0x00, 0x00, 0xD8, 0x3C, 0x00, + 0x00, 0x66, 0x0F, 0x80, 0x00, 0x19, 0x81, 0xF0, 0x00, 0x06, 0x30, 0x7E, + 0x03, 0x03, 0x0E, 0x0F, 0xFF, 0xC1, 0xC1, 0x80, 0xFF, 0xF0, 0x60, 0x30, + 0x0F, 0xF0, 0x30, 0x06, 0x00, 0x00, 0x18, 0x00, 0xE0, 0x00, 0x1C, 0x00, + 0x1C, 0x00, 0x0E, 0x00, 0x03, 0xE0, 0x1F, 0x00, 0x00, 0x3F, 0xFF, 0x00, + 0x00, 0x01, 0xFE, 0x00, 0x00, 0x00, 0x20, 0x08, 0x03, 0x00, 0xC0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0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x78, 0x00, + 0x00, 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x3F, 0xC3, 0xFF, 0xCF, 0xFF, 0xB0, + 0x1F, 0x00, 0x3C, 0x00, 0x70, 0x01, 0xC0, 0x0E, 0x00, 0x78, 0x03, 0xC0, + 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x03, 0xE0, 0x1E, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xC0, 0x1F, 0xC1, 0xFF, 0xC7, 0xFF, 0x98, 0x0F, 0x00, + 0x1C, 0x00, 0x70, 0x03, 0x83, 0xFE, 0x0F, 0xE0, 0x3F, 0xE0, 0x07, 0x80, + 0x07, 0x00, 0x1C, 0x00, 0x70, 0x03, 0xF0, 0x1F, 0xFF, 0xFB, 0xFF, 0xC3, + 0xFC, 0x00, 0x03, 0xE0, 0xF8, 0x1E, 0x07, 0x81, 0xE0, 0x78, 0x0F, 0x03, + 0xC0, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0xF8, 0x01, 0xE0, 0x07, 0x80, 0x1E, + 0x00, 0x78, 0x00, 0xF0, 0x03, 0xC0, 0x0F, 0x00, 0x00, 0x03, 0xE1, 0xF7, + 0xC3, 0xEF, 0x87, 0xDF, 0x0F, 0xBE, 0x1F, 0x00, 0x00, 0xF8, 0x00, 0x00, + 0x01, 0xE0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, + 0x7C, 0x7C, 0x00, 0x00, 0xF1, 0xFC, 0x00, 0x03, 0xC3, 0xF8, 0x00, 0x0F, + 0x07, 0xF0, 0x00, 0x1C, 0x1F, 0xF0, 0x00, 0x00, 0x3D, 0xE0, 0x00, 0x00, + 0xFB, 0xE0, 0x00, 0x01, 0xE3, 0xC0, 0x00, 0x03, 0xC7, 0x80, 0x00, 0x0F, + 0x8F, 0x80, 0x00, 0x1E, 0x0F, 0x00, 0x00, 0x3C, 0x1E, 0x00, 0x00, 0xF0, + 0x1E, 0x00, 0x01, 0xE0, 0x3C, 0x00, 0x07, 0xC0, 0x7C, 0x00, 0x0F, 0x00, + 0x78, 0x00, 0x1E, 0x00, 0xF0, 0x00, 0x7C, 0x01, 0xF0, 0x00, 0xF0, 0x01, + 0xE0, 0x03, 0xE0, 0x03, 0xE0, 0x07, 0x80, 0x03, 0xC0, 0x0F, 0xFF, 0xFF, + 0x80, 0x3F, 0xFF, 0xFF, 0x80, 0x7F, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFE, + 0x03, 0xE0, 0x00, 0x3E, 0x07, 0x80, 0x00, 0x3C, 0x1F, 0x00, 0x00, 0x7C, + 0x3C, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, 0xF1, 0xF0, 0x00, 0x01, 0xF3, + 0xC0, 0x00, 0x01, 0xE7, 0x80, 0x00, 0x03, 0xDE, 0x00, 0x00, 0x03, 0xC0, + 0xFF, 0xFF, 0xFF, 0x03, 0xC0, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0xE7, 0xFF, 0xFF, 0xE7, 0x8F, + 0xFF, 0xFF, 0xCF, 0x1F, 0xFF, 0xFF, 0xBC, 0x3F, 0xFF, 0xFF, 0xF0, 0x78, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x1E, 0x00, + 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x01, 0xFF, 0xFF, 0xF0, 0x03, 0xFF, 0xFF, 0xE0, 0x07, 0xFF, 0xFF, + 0xC0, 0x0F, 0xFF, 0xFF, 0x80, 0x1E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x00, 0x78, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, + 0x03, 0xC0, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x01, 0xFF, 0xFF, 0xF8, 0x03, 0xFF, 0xFF, 0xF0, 0x07, + 0xFF, 0xFF, 0xE0, 0x0F, 0xFF, 0xFF, 0xC0, 0x03, 0xE0, 0x00, 0x00, 0x00, + 0x78, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, + 0x01, 0xE7, 0x80, 0x00, 0x1E, 0x3C, 0xF0, 0x00, 0x03, 0xCF, 0x1E, 0x00, + 0x00, 0x7B, 0xC3, 0xC0, 0x00, 0x0F, 0x70, 0x78, 0x00, 0x01, 0xE0, 0x0F, + 0x00, 0x00, 0x3C, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x3C, 0x00, 0x00, 0xF0, + 0x07, 0x80, 0x00, 0x1E, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x1E, 0x00, 0x00, + 0x78, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x78, 0x00, 0x01, 0xE0, 0x0F, 0x00, + 0x00, 0x3C, 0x01, 0xFF, 0xFF, 0xFF, 0x80, 0x3F, 0xFF, 0xFF, 0xF0, 0x07, + 0xFF, 0xFF, 0xFE, 0x00, 0xFF, 0xFF, 0xFF, 0xC0, 0x1E, 0x00, 0x00, 0x78, + 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x78, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x00, + 0x3C, 0x01, 0xE0, 0x00, 0x07, 0x80, 0x3C, 0x00, 0x00, 0xF0, 0x07, 0x80, + 0x00, 0x1E, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x1E, 0x00, 0x00, 0x78, 0x03, + 0xC0, 0x00, 0x0F, 0x00, 0x78, 0x00, 0x01, 0xE0, 0x0F, 0x00, 0x00, 0x3C, + 0x01, 0xE0, 0x00, 0x07, 0x80, 0x3C, 0x00, 0x00, 0xF0, 0x07, 0x80, 0x00, + 0x1E, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x03, 0xE0, 0x3E, 0x01, 0xE0, 0x1E, + 0x01, 0xE7, 0x8E, 0x3C, 0xF1, 0xEF, 0x0F, 0xF0, 0x78, 0x03, 0xC0, 0x1E, + 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, 0xC0, + 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, 0x03, + 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x01, 0xE0, 0x0F, 0x00, 0x78, + 0x03, 0xC0, 0x1E, 0x00, 0xF0, 0x07, 0x80, 0x3C, 0x80, 0x20, 0x06, 0x01, + 0x80, 0x38, 0x0E, 0x01, 0xE0, 0x78, 0x07, 0x81, 0xE0, 0x1E, 0x07, 0x80, + 0x78, 0x1E, 0x01, 0xF0, 0x7C, 0x07, 0xC1, 0xF0, 0x1F, 0x07, 0xC0, 0x78, + 0x1E, 0x07, 0xC1, 0xF0, 0x7C, 0x1F, 0x07, 0xC1, 0xF0, 0x78, 0x1E, 0x07, + 0x81, 0xE0, 0x78, 0x1E, 0x07, 0x81, 0xE0, 0x38, 0x0E, 0x01, 0x80, 0x60, + 0x08, 0x02, 0x00, 0x00, 0x03, 0xE0, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0xF0, 0x00, 0x1E, 0x07, + 0xFF, 0xE0, 0x01, 0xE1, 0xFF, 0xFF, 0x80, 0x3C, 0x3F, 0xFF, 0xFC, 0x07, + 0x87, 0xF0, 0x0F, 0xE0, 0x70, 0xFC, 0x00, 0x3F, 0x00, 0x1F, 0x00, 0x01, + 0xF8, 0x03, 0xE0, 0x00, 0x0F, 0x80, 0x3E, 0x00, 0x00, 0x7C, 0x07, 0xC0, + 0x00, 0x03, 0xC0, 0x78, 0x00, 0x00, 0x3E, 0x07, 0x80, 0x00, 0x01, 0xE0, + 0xF8, 0x00, 0x00, 0x1E, 0x0F, 0x00, 0x00, 0x01, 0xF0, 0xF0, 0x00, 0x00, + 0x0F, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x0F, 0x0F, 0x00, + 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0xF0, + 0xF0, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, + 0x1F, 0x0F, 0x80, 0x00, 0x01, 0xE0, 0x78, 0x00, 0x00, 0x1E, 0x07, 0x80, + 0x00, 0x03, 0xE0, 0x7C, 0x00, 0x00, 0x3C, 0x03, 0xE0, 0x00, 0x07, 0xC0, + 0x3E, 0x00, 0x00, 0xF8, 0x01, 0xF0, 0x00, 0x1F, 0x80, 0x0F, 0xC0, 0x03, + 0xF0, 0x00, 0x7F, 0x00, 0xFE, 0x00, 0x03, 0xFF, 0xFF, 0xC0, 0x00, 0x1F, + 0xFF, 0xF8, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, + 0x1F, 0x00, 0x00, 0x1E, 0x01, 0xFE, 0x00, 0x00, 0x78, 0x03, 0xFC, 0x00, + 0x00, 0xE0, 0x07, 0x38, 0x00, 0x03, 0xC0, 0x00, 0x70, 0x00, 0x07, 0x00, + 0x00, 0xE0, 0x00, 0x1E, 0x00, 0x01, 0xC0, 0x00, 0x78, 0x00, 0x03, 0x80, + 0x00, 0xE0, 0x00, 0x07, 0x00, 0x03, 0xC0, 0x00, 0x0E, 0x00, 0x07, 0x00, + 0x00, 0x1C, 0x00, 0x1E, 0x00, 0x00, 0x38, 0x00, 0x78, 0x00, 0x00, 0x70, + 0x00, 0xE0, 0x00, 0x00, 0xE0, 0x03, 0xC0, 0x00, 0x01, 0xC0, 0x07, 0x00, + 0x00, 0x03, 0x80, 0x1E, 0x0F, 0xF0, 0xFF, 0xF8, 0x78, 0x7F, 0xF9, 0xFF, + 0xF0, 0xE0, 0xFF, 0xFB, 0xFF, 0xE3, 0xC1, 0x80, 0xF0, 0x00, 0x07, 0x00, + 0x00, 0xF0, 0x00, 0x1E, 0x00, 0x00, 0xE0, 0x00, 0x78, 0x00, 0x01, 0x80, + 0x00, 0xE0, 0x00, 0x07, 0x00, 0x03, 0xC0, 0x00, 0x1C, 0x00, 0x07, 0x00, + 0x00, 0x78, 0x00, 0x1E, 0x00, 0x01, 0xE0, 0x00, 0x38, 0x00, 0x07, 0x80, + 0x00, 0xE0, 0x00, 0x1E, 0x00, 0x03, 0xC0, 0x00, 0xF8, 0x00, 0x07, 0x00, + 0x03, 0xE0, 0x00, 0x1E, 0x00, 0x1F, 0x00, 0x00, 0x38, 0x00, 0x3F, 0xFF, + 0x00, 0xE0, 0x00, 0x7F, 0xFE, 0x03, 0xC0, 0x00, 0xFF, 0xFC, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, + 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x00, 0x1E, 0x3E, 0x00, 0x00, 0x78, 0xF0, 0x7C, 0x00, 0x03, + 0xE3, 0x81, 0xF0, 0x00, 0x1F, 0x1E, 0x03, 0xE0, 0x00, 0x78, 0xF0, 0x07, + 0xC0, 0x03, 0xE0, 0x00, 0x1F, 0x00, 0x1F, 0x00, 0x00, 0x3E, 0x00, 0x78, + 0x00, 0x00, 0x7C, 0x03, 0xE0, 0x00, 0x00, 0xF0, 0x1F, 0x00, 0x00, 0x03, + 0xE0, 0x78, 0x00, 0x00, 0x07, 0xC3, 0xE0, 0x00, 0x00, 0x0F, 0x1F, 0x00, + 0x00, 0x00, 0x3E, 0x78, 0x00, 0x00, 0x00, 0x7F, 0xE0, 0x00, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x00, 0x03, 0xF8, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x00, + 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x03, + 0xC0, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x03, 0xC0, 0x00, + 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x00, 0xF0, + 0x0F, 0xF8, 0x00, 0x1E, 0x07, 0xFF, 0xE0, 0x03, 0xC1, 0xFF, 0xFF, 0x80, + 0x78, 0x3F, 0xFF, 0xFE, 0x07, 0x07, 0xF8, 0x0F, 0xF0, 0xF0, 0xFC, 0x00, + 0x3F, 0x80, 0x1F, 0x80, 0x00, 0xF8, 0x03, 0xE0, 0x00, 0x07, 0xC0, 0x3E, + 0x00, 0x00, 0x3E, 0x07, 0xC0, 0x00, 0x01, 0xE0, 0x78, 0x00, 0x00, 0x1E, + 0x07, 0x80, 0x00, 0x01, 0xF0, 0x78, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0xF0, + 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x0F, + 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x78, 0x00, 0x00, 0x0F, 0x07, 0x80, 0x00, + 0x01, 0xF0, 0x78, 0x00, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x01, 0xE0, 0x3C, + 0x00, 0x00, 0x3E, 0x01, 0xE0, 0x00, 0x07, 0xC0, 0x1F, 0x00, 0x00, 0x78, + 0x00, 0xF8, 0x00, 0x0F, 0x80, 0x07, 0xC0, 0x01, 0xF0, 0x00, 0x3E, 0x00, + 0x3E, 0x00, 0x01, 0xF0, 0x0F, 0xC0, 0x0F, 0xFF, 0x81, 0xFF, 0xF0, 0xFF, + 0xF8, 0x1F, 0xFF, 0x0F, 0xFF, 0x81, 0xFF, 0xF0, 0xFF, 0xF8, 0x1F, 0xFF, + 0x00, 0x3E, 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x3C, 0x00, + 0xF0, 0x03, 0xC0, 0x07, 0x00, 0x00, 0x03, 0xE1, 0xF7, 0xC3, 0xEF, 0x87, + 0xDF, 0x0F, 0xBE, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0x80, 0x0F, 0x00, 0x1E, + 0x00, 0x3C, 0x00, 0x78, 0x00, 0xF0, 0x01, 0xE0, 0x03, 0xC0, 0x07, 0x80, + 0x0F, 0x00, 0x1E, 0x00, 0x3C, 0x00, 0x78, 0x00, 0xF0, 0x01, 0xE0, 0x03, + 0xC0, 0x03, 0xC0, 0x07, 0x80, 0x0F, 0x80, 0x1F, 0xF0, 0x1F, 0xE0, 0x1F, + 0xC0, 0x0F, 0x80, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, + 0x3F, 0x80, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x01, 0xFF, 0x00, 0x00, 0x03, + 0xDE, 0x00, 0x00, 0x0F, 0xBE, 0x00, 0x00, 0x1E, 0x3C, 0x00, 0x00, 0x3C, + 0x78, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x01, 0xE0, 0xF0, 0x00, 0x03, 0xC1, + 0xE0, 0x00, 0x0F, 0x01, 0xE0, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x7C, 0x07, + 0xC0, 0x00, 0xF0, 0x07, 0x80, 0x01, 0xE0, 0x0F, 0x00, 0x07, 0xC0, 0x1F, + 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x78, 0x00, 0x3C, + 0x00, 0xFF, 0xFF, 0xF8, 0x03, 0xFF, 0xFF, 0xF8, 0x07, 0xFF, 0xFF, 0xF0, + 0x0F, 0xFF, 0xFF, 0xE0, 0x3E, 0x00, 0x03, 0xE0, 0x78, 0x00, 0x03, 0xC1, + 0xF0, 0x00, 0x07, 0xC3, 0xC0, 0x00, 0x07, 0x87, 0x80, 0x00, 0x0F, 0x1F, + 0x00, 0x00, 0x1F, 0x3C, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x3D, 0xE0, + 0x00, 0x00, 0x3C, 0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xE0, 0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0x00, 0x07, + 0x80, 0x00, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, + 0x3F, 0x80, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x01, 0xEF, 0x00, 0x00, 0x03, + 0xDE, 0x00, 0x00, 0x0F, 0xBE, 0x00, 0x00, 0x1E, 0x3C, 0x00, 0x00, 0x3C, + 0x78, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x01, 0xE0, 0xF0, 0x00, 0x03, 0xC1, + 0xE0, 0x00, 0x0F, 0x01, 0xE0, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x7C, 0x07, + 0xC0, 0x00, 0xF0, 0x07, 0x80, 0x01, 0xE0, 0x0F, 0x00, 0x07, 0xC0, 0x1F, + 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x78, 0x00, 0x3C, + 0x00, 0xF0, 0x00, 0x78, 0x03, 0xE0, 0x00, 0xF8, 0x07, 0x80, 0x00, 0xF0, + 0x0F, 0x00, 0x01, 0xE0, 0x3E, 0x00, 0x01, 0xE0, 0x78, 0x00, 0x03, 0xC1, + 0xF0, 0x00, 0x07, 0xC3, 0xC0, 0x00, 0x07, 0x87, 0x80, 0x00, 0x0F, 0x1F, + 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xFD, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, + 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, + 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, 0xFF, 0xFF, 0xBF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFB, 0xFF, 0xFF, 0xEF, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, + 0x03, 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, + 0xC0, 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, + 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x7F, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFE, 0x7F, 0xFF, 0xFF, 0xE7, + 0xFF, 0xFF, 0xFE, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, + 0x1F, 0x80, 0x00, 0x01, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, + 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x01, 0xF0, 0x00, 0x00, + 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x00, + 0x00, 0x01, 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, + 0xF8, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x03, 0xF0, 0x00, 0x00, 0x3E, 0x00, + 0x00, 0x07, 0xC0, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x03, + 0xF0, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x07, 0xC0, 0x00, 0x00, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, 0xC0, 0x00, + 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0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0, 0x00, 0x0F, 0x9E, + 0x00, 0x00, 0xFC, 0x00, 0x07, 0xC0, 0x00, 0x00, 0x1F, 0xC0, 0x00, 0x00, + 0x3F, 0x80, 0x00, 0x00, 0x7F, 0x00, 0x00, 0x01, 0xEF, 0x00, 0x00, 0x03, + 0xDE, 0x00, 0x00, 0x0F, 0xBE, 0x00, 0x00, 0x1E, 0x3C, 0x00, 0x00, 0x3C, + 0x78, 0x00, 0x00, 0xF8, 0xF8, 0x00, 0x01, 0xE0, 0xF0, 0x00, 0x03, 0xC1, + 0xE0, 0x00, 0x0F, 0x01, 0xE0, 0x00, 0x1E, 0x03, 0xC0, 0x00, 0x7C, 0x07, + 0xC0, 0x00, 0xF0, 0x07, 0x80, 0x01, 0xE0, 0x0F, 0x00, 0x07, 0xC0, 0x1F, + 0x00, 0x0F, 0x00, 0x1E, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x78, 0x00, 0x3C, + 0x00, 0xF0, 0x00, 0x78, 0x03, 0xE0, 0x00, 0xF8, 0x07, 0x80, 0x00, 0xF0, + 0x0F, 0x00, 0x01, 0xE0, 0x3E, 0x00, 0x03, 0xE0, 0x78, 0x00, 0x03, 0xC1, + 0xF0, 0x00, 0x07, 0xC3, 0xC0, 0x00, 0x07, 0x87, 0x80, 0x00, 0x0F, 0x1F, + 0x00, 0x00, 0x1F, 0x3C, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x3D, 0xE0, + 0x00, 0x00, 0x3C, 0xFE, 0x00, 0x00, 0xFF, 0xFC, 0x00, 0x01, 0xFF, 0xFC, + 0x00, 0x07, 0xFF, 0xF8, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x1F, 0xFE, 0xF0, + 0x00, 0x7B, 0xFD, 0xE0, 0x00, 0xF7, 0xFB, 0xE0, 0x03, 0xEF, 0xF3, 0xC0, + 0x07, 0x9F, 0xE7, 0x80, 0x0F, 0x3F, 0xC7, 0x80, 0x3C, 0x7F, 0x8F, 0x00, + 0x78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00, + 0x7F, 0xFC, 0x00, 0x0F, 0xFF, 0x00, 0x03, 0xFF, 0xC0, 0x00, 0x7F, 0xF0, + 0x00, 0x1F, 0xFC, 0x00, 0x03, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x87, 0xFF, 0xFC, + 0x3F, 0xFF, 0xE1, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, + 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x01, 0xFF, 0xFF, 0x80, + 0x03, 0xFF, 0xFF, 0xC0, 0x07, 0xF0, 0x0F, 0xE0, 0x0F, 0xC0, 0x03, 0xF0, + 0x1F, 0x80, 0x01, 0xF8, 0x3E, 0x00, 0x00, 0x7C, 0x3E, 0x00, 0x00, 0x7C, + 0x7C, 0x00, 0x00, 0x3C, 0x78, 0x00, 0x00, 0x3E, 0x78, 0x00, 0x00, 0x1E, + 0x78, 0x00, 0x00, 0x1E, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, + 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, + 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, + 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0x78, 0x00, 0x00, 0x1E, + 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x1E, 0x7C, 0x00, 0x00, 0x3C, + 0x3E, 0x00, 0x00, 0x7C, 0x3E, 0x00, 0x00, 0x7C, 0x1F, 0x80, 0x01, 0xF8, + 0x0F, 0xC0, 0x03, 0xF0, 0x07, 0xF0, 0x0F, 0xE0, 0x03, 0xFF, 0xFF, 0xC0, + 0x01, 0xFF, 0xFF, 0x80, 0x00, 0x7F, 0xFE, 0x00, 0x00, 0x0F, 0xF0, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, 0xC0, + 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x3F, + 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, 0x00, + 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, 0x00, + 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0xFF, + 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, 0x00, + 0xFF, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, 0x00, + 0x00, 0xFF, 0x00, 0x00, 0x3F, 0xC0, 0x00, 0x0F, 0xF0, 0x00, 0x03, 0xFC, + 0x00, 0x00, 0xF0, 0xFF, 0xFE, 0x03, 0xFF, 0xFE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 0xF0, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, + 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0xF8, 0x00, + 0x01, 0xF7, 0xC0, 0x00, 0x3E, 0x3E, 0x00, 0x07, 0xC3, 0xE0, 0x00, 0x7C, + 0x1F, 0x00, 0x0F, 0x80, 0xF8, 0x01, 0xF0, 0x0F, 0x80, 0x1F, 0x00, 0x7C, + 0x03, 0xE0, 0x03, 0xE0, 0x7C, 0x00, 0x3E, 0x07, 0xC0, 0x01, 0xF0, 0xF8, + 0x00, 0x0F, 0x9F, 0x00, 0x00, 0xF9, 0xF0, 0x00, 0x07, 0xFE, 0x00, 0x00, + 0x3F, 0xC0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x0F, 0x00,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 0x0F, 0xF0, 0x03, 0xC0, + 0x0F, 0x78, 0x03, 0xC0, 0x1E, 0x78, 0x03, 0xC0, 0x1E, 0x78, 0x03, 0xC0, + 0x1E, 0x7C, 0x03, 0xC0, 0x3C, 0x3E, 0x03, 0xC0, 0x7C, 0x3E, 0x03, 0xC0, + 0x7C, 0x1F, 0x03, 0xC0, 0xF8, 0x0F, 0xC3, 0xC3, 0xF0, 0x07, 0xF3, 0xCF, + 0xE0, 0x03, 0xFF, 0xFF, 0xC0, 0x01, 0xFF, 0xFF, 0x80, 0x00, 0xFF, 0xFF, + 0x00, 0x00, 0x1F, 0xF8, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, + 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x0F, 0xF0, + 0x00, 0x00, 0x7F, 0xFE, 0x00, 0x01, 0xFF, 0xFF, 0x80, 0x03, 0xFF, 0xFF, + 0xC0, 0x07, 0xF0, 0x0F, 0xE0, 0x0F, 0xC0, 0x03, 0xF0, 0x1F, 0x00, 0x00, + 0xF8, 0x3E, 0x00, 0x00, 0x7C, 0x3C, 0x00, 0x00, 0x3C, 0x7C, 0x00, 0x00, + 0x3E, 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x1E, 0xF0, 0x00, 0x00, + 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, + 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, + 0x0F, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x00, 0x00, 0x1F, 0x78, 0x00, 0x00, + 0x1E, 0x78, 0x00, 0x00, 0x1E, 0x7C, 0x00, 0x00, 0x3E, 0x3C, 0x00, 0x00, + 0x3C, 0x3E, 0x00, 0x00, 0x7C, 0x1E, 0x00, 0x00, 0xF8, 0x0F, 0x00, 0x00, + 0xF0, 0x0F, 0x80, 0x01, 0xF0, 0x07, 0xE0, 0x07, 0xE0, 0x03, 0xF0, 0x0F, + 0xC0, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xFF, 0xF8, 0x1F, + 0xFF, 0xFF, 0xF8, 0x1F, 0xFF, 0xF8, 0x7F, 0xE1, 0xFF, 0x87, 0xFE, 0x1F, + 0xF8, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, + 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, + 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x07, + 0x80, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x01, + 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, + 0x78, 0x01, 0xE0, 0x07, 0x80, 0x1E, 0x00, 0x78, 0x01, 0xE0, 0x01, 0xF0, + 0xF8, 0x00, 0x1F, 0x0F, 0x80, 0x01, 0xF0, 0xF8, 0x00, 0x1F, 0x0F, 0x80, + 0x01, 0xF0, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x01, + 0xF7, 0xC0, 0x00, 0x3E, 0x3E, 0x00, 0x07, 0xC3, 0xE0, 0x00, 0x7C, 0x1F, + 0x00, 0x0F, 0x80, 0xF8, 0x01, 0xF0, 0x0F, 0x80, 0x1F, 0x00, 0x7C, 0x03, + 0xE0, 0x03, 0xE0, 0x7C, 0x00, 0x3E, 0x07, 0xC0, 0x01, 0xF0, 0xF8, 0x00, + 0x0F, 0x9F, 0x00, 0x00, 0xF9, 0xF0, 0x00, 0x07, 0xFE, 0x00, 0x00, 0x3F, + 0xC0, 0x00, 0x03, 0xFC, 0x00, 0x00, 0x1F, 0x80, 0x00, 0x00, 0xF0, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, + 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0xE0, 0x00, + 0x00, 0xF0, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x0F, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x03, 0xC0, 0x00, 0x00, 0xE0, 0x00, 0x00, 0x70, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xF0, 0x00, 0x07, + 0xFF, 0x07, 0x83, 0xFF, 0xE3, 0xE1, 0xFF, 0xFC, 0xF0, 0xFC, 0x3F, 0x3C, + 0x3C, 0x03, 0xDF, 0x1F, 0x00, 0xFF, 0x87, 0x80, 0x1F, 0xE1, 0xE0, 0x07, + 0xF8, 0xF8, 0x01, 0xFC, 0x3C, 0x00, 0x7F, 0x0F, 0x00, 0x0F, 0x83, 0xC0, + 0x03, 0xE0, 0xF0, 0x00, 0xF8, 0x3C, 0x00, 0x3C, 0x0F, 0x00, 0x0F, 0x03, + 0xC0, 0x03, 0xE0, 0xF0, 0x01, 0xF8, 0x3C, 0x00, 0x7E, 0x07, 0x80, 0x1F, + 0x81, 0xE0, 0x0F, 0xE0, 0x7C, 0x03, 0xFC, 0x0F, 0x81, 0xFF, 0x83, 0xF0, + 0xFB, 0xFC, 0x7F, 0xFE, 0xFF, 0x0F, 0xFF, 0x1F, 0xC1, 0xFF, 0x81, 0xF0, + 0x1F, 0xC0, 0x00, 0x00, 0x03, 0xC0, 0x00, 0xF8, 0x00, 0x3E, 0x00, 0x07, + 0x80, 0x01, 0xE0, 0x00, 0x78, 0x00, 0x0E, 0x00, 0x03, 0xC0, 0x00, 0xF0, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF, 0x80, 0xFF, 0xFC, 0x3F, 0xFF, + 0x8F, 0xFF, 0xF3, 0xF8, 0x06, 0x7C, 0x00, 0x0F, 0x00, 0x01, 0xE0, 0x00, + 0x3C, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x07, 0xC0, 0x00, 0x3F, 0xE0, + 0x0F, 0xFC, 0x03, 0xFF, 0x81, 0xFF, 0xF0, 0x3F, 0x00, 0x0F, 0x80, 0x01, + 0xE0, 0x00, 0x3C, 0x00, 0x07, 0x80, 0x00, 0xF0, 0x00, 0x1F, 0x00, 0x01, + 0xF8, 0x01, 0x9F, 0xFF, 0xF3, 0xFF, 0xFE, 0x1F, 0xFF, 0xC0, 0x7F, 0xE0, + 0x00, 0x00, 0xF0, 0x00, 0x07, 0x80, 0x00, 0x3C, 0x00, 0x01, 0xF0, 0x00, + 0x07, 0x80, 0x00, 0x3C, 0x00, 0x01, 0xE0, 0x00, 0x07, 0x00, 0x00, 0x38, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0xC0, 0xF1, 0xFF, 0xC3, + 0xCF, 0xFF, 0x8F, 0x7F, 0xFF, 0x3F, 0xE0, 0x7E, 0xFE, 0x00, 0xFB, 0xF0, + 0x01, 0xEF, 0x80, 0x07, 0xFE, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0xC0, 0x00, + 0xFF, 0x00, 0x03, 0xFC, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0xC0, 0x00, 0xFF, + 0x00, 0x03, 0xFC, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0xC0, 0x00, 0xFF, 0x00, + 0x03, 0xFC, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0xC0, 0x00, 0xFF, 0x00, 0x03, + 0xFC, 0x00, 0x0F, 0xF0, 0x00, 0x3F, 0xC0, 0x00, 0xF0, 0x00, 0x03, 0xC0, + 0x00, 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, + 0x0F, 0x00, 0x00, 0x3C, 0x00, 0x00, 0xF0, 0x00, 0x03, 0xC0, 0x00, 0x0F, + 0x01, 0xE0, 0x3C, 0x07, 0xC0, 0x78, 0x0F, 0x01, 0xE0, 0x1C, 0x03, 0xC0, + 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, + 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, + 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, 0xF0, 0x0F, 0x00, + 0xF8, 0x07, 0xC0, 0x7F, 0xC3, 0xFC, 0x1F, 0xC0, 0xFC, 0x00, 0x0F, 0x00, + 0x00, 0xF0, 0x00, 0x0F, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x78, + 0x00, 0x07, 0x80, 0x00, 0x38, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x0F, + 0x87, 0xC0, 0x7C, 0x3E, 0x03, 0xE1, 0xF0, 0x1F, 0x0F, 0x80, 0xF8, 0x7C, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0xE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, 0x00, 0xFC, 0x00, 0x00, 0x3F, 0x00, + 0x00, 0x07, 0x80, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x78, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x07, 0x80, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x78, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x07, 0x80, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x78, 0x00, + 0x00, 0xFF, 0xC0, 0x03, 0xFF, 0xF0, 0x0F, 0xFF, 0xF8, 0x0F, 0xFF, 0xF8, + 0x1F, 0x80, 0x38, 0x1E, 0x00, 0x08, 0x1E, 0x00, 0x00, 0x1E, 0x00, 0x00, + 0x1F, 0x80, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xFF, 0x00, 0x07, 0xFF, 0xC0, + 0x07, 0xFF, 0xF0, 0x1F, 0x1F, 0xF8, 0x1E, 0x01, 0xFC, 0x3C, 0x00, 0x7C, + 0x78, 0x00, 0x3E, 0x78, 0x00, 0x1E, 0x70, 0x00, 0x1F, 0xF0, 0x00, 0x0F, + 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, + 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF8, 0x00, 0x1F, 0x78, 0x00, 0x1E, + 0x78, 0x00, 0x3E, 0x7C, 0x00, 0x3E, 0x3E, 0x00, 0x7C, 0x3F, 0x81, 0xFC, + 0x1F, 0xFF, 0xF8, 0x0F, 0xFF, 0xF0, 0x03, 0xFF, 0xC0, 0x00, 0xFF, 0x00, + 0x03, 0xFF, 0x01, 0xFF, 0xF8, 0x7F, 0xFF, 0x1F, 0xFF, 0xE7, 0xF0, 0x0C, + 0xF8, 0x00, 0x1E, 0x00, 0x03, 0xC0, 0x00, 0x78, 0x00, 0x0F, 0x00, 0x00, + 0xF0, 0x00, 0x0F, 0x80, 0x00, 0x7F, 0xC0, 0x1F, 0xF8, 0x07, 0xFF, 0x03, + 0xFF, 0xE0, 0x7E, 0x00, 0x1F, 0x00, 0x03, 0xC0, 0x00, 0x78, 0x00, 0x0F, + 0x00, 0x01, 0xE0, 0x00, 0x3E, 0x00, 0x03, 0xF0, 0x03, 0x3F, 0xFF, 0xE7, + 0xFF, 0xFC, 0x3F, 0xFF, 0x80, 0xFF, 0xC0, 0x7F, 0xFF, 0xFB, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFE, 0xFF, 0xFF, 0xF0, 0x00, 0xFF, 0x00, 0x0F, 0xE0, 0x00, + 0xFC, 0x00, 0x1F, 0xC0, 0x01, 0xF8, 0x00, 0x1F, 0x80, 0x01, 0xF8, 0x00, + 0x1F, 0x80, 0x00, 0xF8, 0x00, 0x0F, 0x80, 0x00, 0xF8, 0x00, 0x07, 0x80, + 0x00, 0x7C, 0x00, 0x03, 0xC0, 0x00, 0x1E, 0x00, 0x01, 0xF0, 0x00, 0x0F, + 0x00, 0x00, 0x78, 0x00, 0x03, 0xC0, 0x00, 0x1E, 0x00, 0x00, 0xF0, 0x00, + 0x07, 0x80, 0x00, 0x3C, 0x00, 0x01, 0xF0, 0x00, 0x07, 0x80, 0x00, 0x3E, + 0x00, 0x01, 0xF0, 0x00, 0x07, 0xE0, 0x00, 0x3F, 0xC0, 0x00, 0xFF, 0xFC, + 0x01, 0xFF, 0xF8, 0x07, 0xFF, 0xE0, 0x07, 0xFF, 0x00, 0x00, 0x7C, 0x00, + 0x01, 0xE0, 0x00, 0x0F, 0x00, 0x00, 0x78, 0x00, 0x03, 0xC0, 0x00, 0x3E, + 0x00, 0x07, 0xE0, 0x00, 0x3F, 0x00, 0x01, 0xF0, 0x00, 0x0E, 0x00, 0x00, + 0x7F, 0x03, 0xC7, 0xFF, 0x0F, 0x3F, 0xFE, 0x3D, 0xFF, 0xFC, 0xFF, 0x81, + 0xFB, 0xF8, 0x03, 0xEF, 0xC0, 0x07, 0xBE, 0x00, 0x1F, 0xF8, 0x00, 0x3F, + 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, 0x80, 0x0F, 0x83, 0xC0, 0x07, 0x81, 0xE0, 0x07, 0xC0, 0xF8, 0x03, + 0xC0, 0x3C, 0x03, 0xE0, 0x1F, 0x01, 0xE0, 0x07, 0x80, 0xF0, 0x03, 0xC0, + 0xF8, 0x01, 0xF0, 0x78, 0x00, 0x78, 0x7C, 0x00, 0x3C, 0x3C, 0x00, 0x1F, + 0x3E, 0x00, 0x07, 0x9E, 0x00, 0x03, 0xDF, 0x00, 0x00, 0xF0, 0xF0, 0x00, + 0x3C, 0x78, 0x00, 0x1E, 0x3C, 0x00, 0x0F, 0x1E, 0x00, 0x07, 0x8F, 0x00, + 0x03, 0xC7, 0x80, 0x01, 0xE3, 0xC0, 0x00, 0xF1, 0xE0, 0x00, 0x78, 0xF0, + 0x00, 0x3C, 0x78, 0x00, 0x1E, 0x3C, 0x00, 0x0F, 0x1E, 0x00, 0x07, 0x8F, + 0x00, 0x03, 0xC7, 0x80, 0x01, 0xE3, 0xC0, 0x00, 0xF1, 0xE0, 0x00, 0x78, + 0xF0, 0x00, 0x3C, 0x78, 0x00, 0x1E, 0x3C, 0x00, 0x0F, 0x1F, 0x00, 0x0F, + 0x8F, 0x80, 0x07, 0xC7, 0xE0, 0x07, 0xE3, 0xFC, 0x0F, 0xFB, 0xFF, 0xFF, + 0xFF, 0xF7, 0xFF, 0x9F, 0xF9, 0xFF, 0x8F, 0xFC, 0x3F, 0x03, 0xDE, 0x00, + 0x00, 0x0F, 0x00, 0x00, 0x07, 0x80, 0x00, 0x03, 0xC0, 0x00, 0x01, 0xE0, + 0x00, 0x00, 0xF0, 0x00, 0x00, 0x78, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x1E, + 0x00, 0x00, 0x00, 0xF0, 0x01, 0xE3, 0xE0, 0x03, 0xC7, 0x80, 0x0F, 0x1E, + 0x00, 0x1E, 0x7C, 0x00, 0x78, 0xF0, 0x01, 0xE3, 0xC0, 0x03, 0xCF, 0x80, + 0x0F, 0x1E, 0x00, 0x3C,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0, 0x03, 0xC0, 0x0F, 0x00, 0x1E, 0x00, 0x78, 0x01, + 0xF0, 0x07, 0xFC, 0x0F, 0xF0, 0x1F, 0xC0, 0x1F, 0x3E, 0x1F, 0x01, 0xF0, + 0xF8, 0x0F, 0x87, 0xC0, 0x7C, 0x3E, 0x03, 0xE1, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0xE0, 0x07, 0x8F, 0x00, 0x1E, 0x78, 0x00, 0xF3, 0xC0, 0x03, 0xDE, + 0x00, 0x1E, 0xF0, 0x00, 0xF7, 0x80, 0x03, 0xFC, 0x00, 0x1F, 0xE0, 0x00, + 0xFF, 0x00, 0x07, 0xF8, 0x00, 0x3F, 0xC0, 0x01, 0xFE, 0x00, 0x0F, 0xF0, + 0x00, 0x7F, 0x80, 0x07, 0xFC, 0x00, 0x3D, 0xE0, 0x01, 0xEF, 0x00, 0x1F, + 0x78, 0x00, 0xF3, 0xE0, 0x0F, 0x8F, 0x00, 0xF8, 0x7E, 0x1F, 0xC1, 0xFF, + 0xFC, 0x0F, 0xFF, 0xC0, 0x1F, 0xF8, 0x00, 0x7F, 0x00, 0x00, 0x00, 0x01, + 0xE0, 0x00, 0x03, 0xE0, 0x00, 0x03, 0xC0, 0x00, 0x07, 0x80, 0x00, 0x0F, + 0x00, 0x00, 0x1E, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x78, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x03, 0xFF, + 0xC0, 0x0F, 0xFF, 0xF0, 0x1F, 0xFF, 0xF8, 0x1F, 0x81, 0xF8, 0x3E, 0x00, + 0x7C, 0x7C, 0x00, 0x3E, 0x7C, 0x00, 0x3E, 0x78, 0x00, 0x1E, 0xF8, 0x00, + 0x1F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, + 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, 0x0F, 0xF0, 0x00, + 0x0F, 0xF8, 0x00, 0x1F, 0x78, 0x00, 0x1E, 0x7C, 0x00, 0x3E, 0x7C, 0x00, + 0x3E, 0x3E, 0x00, 0x7C, 0x1F, 0x81, 0xF8, 0x1F, 0xFF, 0xF8, 0x0F, 0xFF, + 0xF0, 0x03, 0xFF, 0xC0, 0x00, 0xFF, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xF8, + 0x00, 0x0F, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, 0x00, 0x78, 0x00, 0x03, + 0x80, 0x00, 0x3C, 0x00, 0x03, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x01, 0xE3, 0xC0, 0x07, 0x9E, 0x00, + 0x3C, 0xF0, 0x00, 0xF7, 0x80, 0x07, 0xBC, 0x00, 0x3D, 0xE0, 0x00, 0xFF, + 0x00, 0x07, 0xF8, 0x00, 0x3F, 0xC0, 0x01, 0xFE, 0x00, 0x0F, 0xF0, 0x00, + 0x7F, 0x80, 0x03, 0xFC, 0x00, 0x1F, 0xE0, 0x01, 0xFF, 0x00, 0x0F, 0x78, + 0x00, 0x7B, 0xC0, 0x07, 0xDE, 0x00, 0x3C, 0xF8, 0x03, 0xE3, 0xC0, 0x3E, + 0x1F, 0x87, 0xF0, 0x7F, 0xFF, 0x03, 0xFF, 0xF0, 0x07, 0xFE, 0x00, 0x1F, + 0xC0, 0x00, 0x00, 0x00, 0x0F, 0x80, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, + 0x1E, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, + 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x01, 0xE0, 0x00, 0x00, 0x03, + 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0xF0, 0x1E, 0x00, + 0x00, 0x78, 0x1E, 0x00, 0x00, 0x78, 0x3C, 0x00, 0x00, 0x3C, 0x3C, 0x00, + 0x00, 0x3C, 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, 0x00, 0x1E, 0x78, 0x00, + 0x00, 0x1E, 0x70, 0x00, 0x00, 0x0E, 0xF0, 0x00, 0x00, 0x0F, 0xF0, 0x03, + 0xC0, 0x0F, 0xF0, 0x03, 0xC0, 0x0F, 0xF0, 0x03, 0xC0, 0x0F, 0xF0, 0x03, + 0xC0, 0x0F, 0xF0, 0x03, 0xC0, 0x0F, 0xF0, 0x03, 0xC0, 0x0F, 0xF0, 0x07, + 0xC0, 0x0F, 0xF8, 0x07, 0xE0, 0x1F, 0x78, 0x07, 0xE0, 0x1E, 0x78, 0x07, + 0xE0, 0x1E, 0x7C, 0x0F, 0xF0, 0x3E, 0x3E, 0x1E, 0xF8, 0x7C, 0x3F, 0xFE, + 0x7F, 0xFC, 0x1F, 0xFC, 0x7F, 0xF8, 0x0F, 0xFC, 0x3F, 0xF0, 0x03, 0xF0, + 0x0F, 0xC0, +}; + +const GFXglyph FreeSans24pt_Win1253Glyphs[] PROGMEM = { +/* 0x01 */ { 0, 43, 48, 60, 8, -39 }, +/* 0x02 */ { 258, 43, 48, 60, 8, -39 }, +/* 0x03 */ { 516, 48, 48, 60, 6, -39 }, +/* 0x04 */ { 804, 57, 48, 60, 1, -39 }, +/* 0x05 */ { 1146, 47, 48, 60, 6, -39 }, +/* 0x06 */ { 1428, 47, 48, 60, 6, -39 }, +/* 0x07 */ { 1710, 0, 0, 0, 0, 0 }, +/* 0x08 */ { 1710, 49, 48, 60, 5, -39 }, +/* 0x09 */ { 2004, 54, 38, 60, 3, -34 }, +/* 0x0A */ { 2261, 0, 0, 0, 0, 0 }, +/* 0x0B */ { 2261, 52, 48, 60, 4, -39 }, +/* 0x0C */ { 2573, 47, 48, 60, 6, -39 }, +/* 0x0D */ { 2855, 0, 0, 0, 0, 0 }, +/* 0x0E */ { 2855, 47, 48, 60, 6, -39 }, +/* 0x0F */ { 3137, 48, 49, 60, 6, -39 }, +/* 0x10 */ { 3431, 46, 48, 60, 7, -39 }, +/* 0x11 */ { 3707, 48, 48, 60, 6, -39 }, +/* 0x12 */ { 3995, 46, 48, 60, 7, -39 }, +/* 0x13 */ { 4271, 48, 46, 60, 6, -38 }, +/* 0x14 */ { 4547, 48, 48, 60, 6, -39 }, +/* 0x15 */ { 4835, 51, 48, 60, 4, -39 }, +/* 0x16 */ { 5141, 37, 47, 60, 11, -38 }, +/* 0x17 */ { 5359, 50, 40, 60, 5, -35 }, +/* 0x18 */ { 5609, 56, 40, 60, 2, -35 }, +/* 0x19 */ { 5889, 48, 48, 60, 6, -39 }, +/* 0x1A */ { 6177, 0, 0, 0, 0, 0 }, +/* 0x1B */ { 6177, 56, 49, 60, 2, -39 }, +/* 0x1C */ { 6520, 48, 48, 60, 6, -39 }, +/* 0x1D */ { 6808, 49, 49, 60, 5, -39 }, +/* 0x1E */ { 7109, 48, 47, 60, 5, -38 }, +/* 0x1F */ { 7391, 34, 48, 60, 13, -39 }, +/* 0x20 */ { 7595, 1, 1, 15, 0, 0 }, +/* 0x21 */ { 7596, 5, 34, 19, 7, -33 }, +/* 0x22 */ { 7618, 13, 13, 22, 4, -33 }, +/* 0x23 */ { 7640, 32, 35, 39, 4, -34 }, +/* 0x24 */ { 7780, 22, 42, 30, 4, -34 }, +/* 0x25 */ { 7896, 39, 36, 45, 3, -34 }, +/* 0x26 */ { 8072, 32, 36, 37, 3, -34 }, +/* 0x27 */ { 8216, 4, 13, 13, 4, -33 }, +/* 0x28 */ { 8223, 11, 42, 18, 4, -35 }, +/* 0x29 */ { 8281, 11, 42, 18, 4, -35 }, +/* 0x2A */ { 8339, 21, 22, 24, 1, -34 }, +/* 0x2B */ { 8397, 30, 30, 39, 5, -29 }, +/* 0x2C */ { 8510, 6, 11, 15, 4, -5 }, +/* 0x2D */ { 8519, 12, 4, 17, 2, -14 }, +/* 0x2E */ { 8525, 4, 6, 15, 6, -5 }, +/* 0x2F */ { 8528, 16, 39, 16, 0, -33 }, +/* 0x30 */ { 8606, 24, 36, 30, 3, -34 }, +/* 0x31 */ { 8714, 20, 34, 30, 5, -33 }, +/* 0x32 */ { 8799, 22, 35, 30, 4, -34 }, +/* 0x33 */ { 8896, 23, 36, 30, 4, -34 }, +/* 0x34 */ { 9000, 25, 34, 30, 2, -33 }, +/* 0x35 */ { 9107, 22, 35, 30, 4, -33 }, +/* 0x36 */ { 9204, 24, 36, 30, 3, -34 }, +/* 0x37 */ { 9312, 22, 34, 30, 4, -33 }, +/* 0x38 */ { 9406, 24, 36, 30, 3, -34 }, +/* 0x39 */ { 9514, 24, 36, 30, 3, -34 }, +/* 0x3A */ { 9622, 5, 24, 16, 6, -23 }, +/* 0x3B */ { 9637, 6, 29, 16, 4, -23 }, +/* 0x3C */ { 9659, 29, 25, 39, 5, -26 }, +/* 0x3D */ { 9750, 29, 14, 39, 5, -21 }, +/* 0x3E */ { 9801, 29, 25, 39, 5, -26 }, +/* 0x3F */ { 9892, 18, 35, 25, 3, -34 }, +/* 0x40 */ { 9971, 41, 41, 47, 3, -32 }, +/* 0x41 */ { 10182, 31, 34, 32, 0, -33 }, +/* 0x42 */ { 10314, 24, 34, 32, 4, -33 }, +/* 0x43 */ { 10416, 28, 36, 33, 3, -34 }, +/* 0x44 */ { 10542, 29, 34, 36, 4, -33 }, +/* 0x45 */ { 10666, 22, 34, 30, 4, -33 }, +/* 0x46 */ { 10760, 20, 34, 27, 4, -33 }, +/* 0x47 */ { 10845, 30, 36, 36, 3, -34 }, +/* 0x48 */ { 10980, 26, 34, 35, 4, -33 }, +/* 0x49 */ { 11091, 4, 34, 14, 4, -33 }, +/* 0x4A */ { 11108, 11, 43, 14, -3, -33 }, +/* 0x4B */ { 11168, 27, 34, 31, 4, -33 }, +/* 0x4C */ { 11283, 21, 34, 26, 4, -33 }, +/* 0x4D */ { 11373, 31, 34, 41, 4, -33 }, +/* 0x4E */ { 11505, 26, 34, 35, 4, -33 }, +/* 0x4F */ { 11616, 32, 36, 37, 3, -34 }, +/* 0x50 */ { 11760, 22, 34, 28, 4, -33 }, +/* 0x51 */ { 11854, 32, 41, 37, 3, -34 }, +/* 0x52 */ { 12018, 27, 34, 33, 4, -33 }, +/* 0x53 */ { 12133, 24, 36, 30, 3, -34 }, +/* 0x54 */ { 12241, 28, 34, 29, 0, -33 }, +/* 0x55 */ { 12360, 26, 35, 34, 5, -33 }, +/* 0x56 */ { 12474, 31, 34, 32, 0, -33 }, +/* 0x57 */ { 12606, 43, 34, 46, 2, -33 }, +/* 0x58 */ { 12789, 29, 34, 31, 1, -33 }, +/* 0x59 */ { 12913, 28, 34, 29, 0, -33 }, +/* 0x5A */ { 13032, 28, 34, 32, 2, -33 }, +/* 0x5B */ { 13151, 10, 42, 18, 4, -35 }, +/* 0x5C */ { 13204, 16, 39, 16, 0, -33 }, +/* 0x5D */ { 13282, 9, 42, 18, 4, -35 }, +/* 0x5E */ { 13330, 29, 13, 39, 5, -33 }, +/* 0x5F */ { 13378, 24, 4, 24, 0, 8 }, +/* 0x60 */ { 13390, 11, 9, 24, 4, -37 }, +/* 0x61 */ { 13403, 22, 28, 29, 3, -26 }, +/* 0x62 */ { 13480, 23, 37, 30, 4, -35 }, +/* 0x63 */ { 13587, 20, 28, 26, 3, -26 }, +/* 0x64 */ { 13657, 23, 37, 30, 3, -35 }, +/* 0x65 */ { 13764, 24, 28, 29, 3, -26 }, +/* 0x66 */ { 13848, 16, 36, 17, 1, -35 }, +/* 0x67 */ { 13920, 23, 37, 30, 3, -26 }, +/* 0x68 */ { 14027, 22, 36, 30, 4, -35 }, +/* 0x69 */ { 14126, 4, 36, 13, 4, -35 }, +/* 0x6A */ { 14144, 9, 46, 13, -1, -35 }, +/* 0x6B */ { 14196, 23, 36, 27, 4, -35 }, +/* 0x6C */ { 14300, 4, 36, 13, 4, -35 }, +/* 0x6D */ { 14318, 38, 27, 46, 4, -26 }, +/* 0x6E */ { 14447, 22, 27, 30, 4, -26 }, +/* 0x6F */ { 14522, 24, 28, 29, 3, -26 }, +/* 0x70 */ { 14606, 23, 37, 30, 4, -26 }, +/* 0x71 */ { 14713, 23, 37, 30, 3, -26 }, +/* 0x72 */ { 14820, 15, 27, 19, 4, -26 }, +/* 0x73 */ { 14871, 19, 28, 24, 3, -26 }, +/* 0x74 */ { 14938, 16, 33, 18, 1, -32 }, +/* 0x75 */ { 15004, 22, 28, 30, 4, -26 }, +/* 0x76 */ { 15081, 25, 26, 28, 1, -25 }, +/* 0x77 */ { 15163, 35, 26, 38, 2, -25 }, +/* 0x78 */ { 15277, 25, 26, 28, 1, -25 }, +/* 0x79 */ { 15359, 25, 36, 28, 1, -25 }, +/* 0x7A */ { 15472, 21, 26, 25, 2, -25 }, +/* 0x7B */ { 15541, 18, 43, 30, 6, -35 }, +/* 0x7C */ { 15638, 4, 47, 16, 6, -35 }, +/* 0x7D */ { 15662, 18, 43, 30, 6, -35 }, +/* 0x7E */ { 15759, 29, 9, 39, 5, -18 }, +/* 0x7F */ { 15792, 0, 0, 0, 0, 0 }, +/* 0x80 */ { 15792, 26, 36, 30, 0, -34 }, +/* 0x81 */ { 15909, 0, 0, 0, 0, 0 }, +/* 0x82 */ { 15909, 6, 11, 15, 4, -5 }, +/* 0x83 */ { 15918, 20, 46, 17, -3, -35 }, +/* 0x84 */ { 16033, 15, 11, 24, 4, -5 }, +/* 0x85 */ { 16054, 36, 6, 47, 5, -5 }, +/* 0x86 */ { 16081, 20, 39, 24, 2, -33 }, +/* 0x87 */ { 16179, 20, 39, 24, 2, -33 }, +/* 0x88 */ { 16277, 0, 0, 0, 0, 0 }, +/* 0x89 */ { 16277, 58, 36, 63, 3, -34 }, +/* 0x8A */ { 16538, 0, 0, 0, 0, 0 }, +/* 0x8B */ { 16538, 11, 21, 19, 4, -23 }, +/* 0x8C */ { 16567, 0, 0, 0, 0, 0 }, +/* 0x8D */ { 16567, 0, 0, 0, 0, 0 }, +/* 0x8E */ { 16567, 0, 0, 0, 0, 0 }, +/* 0x8F */ { 16567, 0, 0, 0, 0, 0 }, +/* 0x90 */ { 16567, 0, 0, 0, 0, 0 }, +/* 0x91 */ { 16567, 6, 11, 15, 4, -33 }, +/* 0x92 */ { 16576, 6, 11, 15, 4, -33 }, +/* 0x93 */ { 16585, 15, 11, 24, 4, -33 }, +/* 0x94 */ { 16606, 15, 11, 24, 4, -33 }, +/* 0x95 */ { 16627, 14, 14, 28, 7, -23 }, +/* 0x96 */ { 16652, 19, 4, 24, 2, -14 }, +/* 0x97 */ { 16662, 42, 4, 47, 2, -14 }, +/* 0x98 */ { 16683, 0, 0, 0, 0, 0 }, +/* 0x99 */ { 16683, 31, 13, 47, 6, -33 }, +/* 0x9A */ { 16734, 0, 0, 0, 0, 0 }, +/* 0x9B */ { 16734, 11, 21, 19, 4, -23 }, +/* 0x9C */ { 16763, 0, 0, 0, 0, 0 }, +/* 0x9D */ { 16763, 0, 0, 0, 0, 0 }, +/* 0x9E */ { 16763, 0, 0, 0, 0, 0 }, +/* 0x9F */ { 16763, 0, 0, 0, 0, 0 }, +/* 0xA0 */ { 16763, 1, 1, 15, 0, 0 }, +/* 0xA1 */ { 16764, 15, 15, 24, 5, -45 }, +/* 0xA2 */ { 16793, 31, 38, 33, 0, -37 }, +/* 0xA3 */ { 16941, 22, 35, 30, 3, -34 }, +/* 0xA4 */ { 17038, 26, 26, 30, 2, -26 }, +/* 0xA5 */ { 17123, 26, 34, 30, 2, -33 }, +/* 0xA6 */ { 17234, 4, 40, 16, 6, -31 }, +/* 0xA7 */ { 17254, 19, 39, 24, 2, -34 }, +/* 0xA8 */ { 17347, 14, 5, 24, 5, -35 }, +/* 0xA9 */ { 17356, 34, 34, 47, 7, -33 }, +/* 0xAA */ { 17501, 0, 0, 0, 0, 0 }, +/* 0xAB */ { 17501, 21, 21, 29, 4, -23 }, +/* 0xAC */ { 17557, 29, 13, 39, 5, -19 }, +/* 0xAD */ { 17605, 12, 4, 17, 2, -14 }, +/* 0xAE */ { 17611, 34, 34, 47, 7, -33 }, +/* 0xAF */ { 17756, 47, 4, 47, 0, -14 }, +/* 0xB0 */ { 17780, 15, 15, 24, 4, -34 }, +/* 0xB1 */ { 17809, 30, 30, 39, 5, -29 }, +/* 0xB2 */ { 17922, 14, 19, 19, 2, -34 }, +/* 0xB3 */ { 17956, 14, 19, 19, 2, -34 }, +/* 0xB4 */ { 17990, 11, 9, 24, 9, -37 }, +/* 0xB5 */ { 18003, 15, 15, 24, 5, -45 }, +/* 0xB6 */ { 18032, 31, 38, 33, 0, -37 }, +/* 0xB7 */ { 18180, 4, 6, 15, 5, -18 }, +/* 0xB8 */ { 18183, 31, 38, 35, 0, -37 }, +/* 0xB9 */ { 18331, 35, 38, 41, 0, -37 }, +/* 0xBA */ { 18498, 13, 38, 19, 0, -37 }, +/* 0xBB */ { 18560, 21, 21, 29, 4, -23 }, +/* 0xBC */ { 18616, 36, 39, 38, 0, -37 }, +/* 0xBD */ { 18792, 39, 36, 46, 4, -34 }, +/* 0xBE */ { 18968, 38, 38, 39, 0, -37 }, +/* 0xBF */ { 19149, 36, 38, 39, 0, -37 }, +/* 0xC0 */ { 19320, 15, 46, 16, 0, -45 }, +/* 0xC1 */ { 19407, 31, 34, 32, 0, -33 }, +/* 0xC2 */ { 19539, 24, 34, 32, 4, -33 }, +/* 0xC3 */ { 19641, 21, 34, 25, 4, -33 }, +/* 0xC4 */ { 19731, 31, 34, 32, 0, -33 }, +/* 0xC5 */ { 19863, 22, 34, 30, 4, -33 }, +/* 0xC6 */ { 19957, 28, 34, 32, 2, -33 }, +/* 0xC7 */ { 20076, 26, 34, 35, 4, -33 }, +/* 0xC8 */ { 20187, 32, 36, 38, 3, -34 }, +/* 0xC9 */ { 20331, 4, 34, 14, 4, -33 }, +/* 0xCA */ { 20348, 27, 34, 31, 4, -33 }, +/* 0xCB */ { 20463, 31, 34, 32, 0, -33 }, +/* 0xCC */ { 20595, 31, 34, 41, 4, -33 }, +/* 0xCD */ { 20727, 26, 34, 35, 4, -33 }, +/* 0xCE */ { 20838, 21, 34, 29, 4, -33 }, +/* 0xCF */ { 20928, 32, 36, 37, 3, -34 }, +/* 0xD0 */ { 21072, 26, 34, 34, 4, -33 }, +/* 0xD1 */ { 21183, 22, 34, 28, 4, -33 }, +/* 0xD2 */ { 21277, 0, 0, 0, 0, 0 }, +/* 0xD3 */ { 21277, 22, 34, 29, 4, -33 }, +/* 0xD4 */ { 21371, 28, 34, 29, 0, -33 }, +/* 0xD5 */ { 21490, 28, 34, 29, 0, -33 }, +/* 0xD6 */ { 21609, 32, 34, 38, 3, -33 }, +/* 0xD7 */ { 21745, 29, 34, 31, 1, -33 }, +/* 0xD8 */ { 21869, 32, 34, 38, 3, -33 }, +/* 0xD9 */ { 22005, 32, 35, 38, 3, -34 }, +/* 0xDA */ { 22145, 14, 44, 14, -1, -43 }, +/* 0xDB */ { 22222, 28, 44, 29, 0, -43 }, +/* 0xDC */ { 22376, 26, 39, 31, 3, -37 }, +/* 0xDD */ { 22503, 19, 39, 25, 3, -37 }, +/* 0xDE */ { 22596, 22, 48, 30, 4, -37 }, +/* 0xDF */ { 22728, 12, 38, 16, 4, -37 }, +/* 0xE0 */ { 22785, 21, 47, 28, 4, -45 }, +/* 0xE1 */ { 22909, 26, 28, 31, 3, -26 }, +/* 0xE2 */ { 23000, 22, 46, 29, 4, -35 }, +/* 0xE3 */ { 23127, 26, 36, 28, 1, -25 }, +/* 0xE4 */ { 23244, 24, 36, 30, 3, -34 }, +/* 0xE5 */ { 23352, 19, 28, 25, 3, -26 }, +/* 0xE6 */ { 23419, 21, 47, 25, 2, -35 }, +/* 0xE7 */ { 23543, 22, 37, 30, 4, -26 }, +/* 0xE8 */ { 23645, 24, 37, 30, 3, -35 }, +/* 0xE9 */ { 23756, 10, 26, 16, 4, -25 }, +/* 0xEA */ { 23789, 22, 26, 27, 4, -25 }, +/* 0xEB */ { 23861, 25, 36, 27, 1, -35 }, +/* 0xEC */ { 23974, 25, 36, 30, 4, -25 }, +/* 0xED */ { 24087, 22, 26, 26, 2, -25 }, +/* 0xEE */ { 24159, 20, 47, 25, 2, -35 }, +/* 0xEF */ { 24277, 24, 28, 29, 3, -26 }, +/* 0xF0 */ { 24361, 25, 27, 28, 2, -25 }, +/* 0xF1 */ { 24446, 24, 37, 31, 4, -26 }, +/* 0xF2 */ { 24557, 20, 38, 28, 3, -26 }, +/* 0xF3 */ { 24652, 26, 27, 30, 3, -25 }, +/* 0xF4 */ { 24740, 24, 26, 28, 2, -25 }, +/* 0xF5 */ { 24818, 21, 26, 28, 4, -24 }, +/* 0xF6 */ { 24887, 26, 37, 32, 3, -26 }, +/* 0xF7 */ { 25008, 24, 36, 26, 1, -25 }, +/* 0xF8 */ { 25116, 26, 36, 32, 3, -25 }, +/* 0xF9 */ { 25233, 32, 26, 38, 3, -24 }, +/* 0xFA */ { 25337, 14, 36, 16, 0, -35 }, +/* 0xFB */ { 25400, 21, 37, 28, 4, -35 }, +/* 0xFC */ { 25498, 24, 39, 29, 3, -37 }, +/* 0xFD */ { 25615, 21, 39, 28, 4, -37 }, +/* 0xFE */ { 25718, 32, 39, 38, 3, -37 }, +/* 0xFF */ { 25874, 0, 0, 0, 0, 0 }, +}; + +const GFXfont FreeSans24pt_Win1253 PROGMEM = { +(uint8_t*)FreeSans24pt_Win1253Bitmaps, +(GFXglyph*)FreeSans24pt_Win1253Glyphs, +0x01, 0xFF, 55 +}; diff --git a/src/graphics/niche/InkHUD/AppletFont.h b/src/graphics/niche/InkHUD/AppletFont.h index 8374c7f61..c97c12c36 100644 --- a/src/graphics/niche/InkHUD/AppletFont.h +++ b/src/graphics/niche/InkHUD/AppletFont.h @@ -88,8 +88,12 @@ class AppletFont // Greek #include "graphics/niche/Fonts/FreeSans12pt_Win1253.h" +#include "graphics/niche/Fonts/FreeSans18pt_Win1253.h" +#include "graphics/niche/Fonts/FreeSans24pt_Win1253.h" #include "graphics/niche/Fonts/FreeSans6pt_Win1253.h" #include "graphics/niche/Fonts/FreeSans9pt_Win1253.h" +#define FREESANS_24PT_WIN1253 InkHUD::AppletFont(FreeSans24pt_Win1253, InkHUD::AppletFont::WINDOWS_1253, -5, 3) +#define FREESANS_18PT_WIN1253 InkHUD::AppletFont(FreeSans18pt_Win1253, InkHUD::AppletFont::WINDOWS_1253, -4, 2) #define FREESANS_12PT_WIN1253 InkHUD::AppletFont(FreeSans12pt_Win1253, InkHUD::AppletFont::WINDOWS_1253, -3, 1) #define FREESANS_9PT_WIN1253 InkHUD::AppletFont(FreeSans9pt_Win1253, InkHUD::AppletFont::WINDOWS_1253, -2, -1) #define FREESANS_6PT_WIN1253 InkHUD::AppletFont(FreeSans6pt_Win1253, InkHUD::AppletFont::WINDOWS_1253, -1, -2) diff --git a/src/input/TouchScreenImpl1.cpp b/src/input/TouchScreenImpl1.cpp index 69dcab04e..14f95b73a 100644 --- a/src/input/TouchScreenImpl1.cpp +++ b/src/input/TouchScreenImpl1.cpp @@ -29,7 +29,8 @@ void TouchScreenImpl1::init() return; #else TouchScreenBase::init(true); - inputBroker->registerSource(this); + if (inputBroker) + inputBroker->registerSource(this); #endif } diff --git a/variants/esp32s3/t5s3_epaper/nicheGraphics.h b/variants/esp32s3/t5s3_epaper/nicheGraphics.h index 699a82de0..18217800b 100644 --- a/variants/esp32s3/t5s3_epaper/nicheGraphics.h +++ b/variants/esp32s3/t5s3_epaper/nicheGraphics.h @@ -6,26 +6,27 @@ NicheGraphics attempts a different approach: Per-device config takes place in this setupNicheGraphics() method (And a small amount in platformio.ini) -This file sets up InkHUD for Heltec VM-E290. -Different NicheGraphics UIs and different hardware variants will each have their own setup procedure. +This file sets up InkHUD for the LilyGo T5-E-Paper-S3-Pro. + +The board uses a 4.7" ED047TC1 parallel e-paper display (960×540, 8-bit parallel interface). +This is driven via the FastEPD library through the NicheGraphics ED047TC1 driver adapter. */ #pragma once #include "configuration.h" -#include "mesh/MeshModule.h" #ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS // InkHUD-specific components // --------------------------- -// #include "graphics/niche/InkHUD/InkHUD.h" -#include "graphics/niche/InkHUD/WindowManager.h" +#include "graphics/niche/InkHUD/InkHUD.h" // Applets #include "graphics/niche/InkHUD/Applets/User/AllMessage/AllMessageApplet.h" #include "graphics/niche/InkHUD/Applets/User/DM/DMApplet.h" +#include "graphics/niche/InkHUD/Applets/User/FavoritesMap/FavoritesMapApplet.h" #include "graphics/niche/InkHUD/Applets/User/Heard/HeardApplet.h" #include "graphics/niche/InkHUD/Applets/User/Positions/PositionsApplet.h" #include "graphics/niche/InkHUD/Applets/User/RecentsList/RecentsListApplet.h" @@ -34,26 +35,20 @@ Different NicheGraphics UIs and different hardware variants will each have their // Shared NicheGraphics components // -------------------------------- #include "graphics/niche/Drivers/Backlight/LatchingBacklight.h" -#include "graphics/niche/Drivers/EInk/DEPG0290BNS800.h" +#include "graphics/niche/Drivers/EInk/ED047TC1.h" #include "graphics/niche/Inputs/TwoButton.h" void setupNicheGraphics() { using namespace NicheGraphics; - // SPI - // ----------------------------- - - // Display is connected to HSPI - SPIClass *hspi = new SPIClass(HSPI); - hspi->begin(PIN_EINK_SCLK, -1, PIN_EINK_MOSI, PIN_EINK_CS); - // E-Ink Driver // ----------------------------- + // The ED047TC1 is a parallel display — no SPI bus setup needed. + // begin() args are part of the EInk interface but are ignored for parallel displays. - // Use E-Ink driver - Drivers::EInk *driver = new Drivers::DEPG0290BNS800; - driver->begin(hspi, PIN_EINK_DC, PIN_EINK_CS, PIN_EINK_BUSY); + Drivers::EInk *driver = new Drivers::ED047TC1; + driver->begin(nullptr, 0, 0, 0); // InkHUD // ---------------------------- @@ -67,57 +62,57 @@ void setupNicheGraphics() // Set how unhealthy additional FAST updates beyond this number are inkhud->setDisplayResilience(7, 1.5); - // Prepare fonts - InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252; - InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252; + // Prepare fonts — use larger sizes to suit the 4.7" screen at ~234 DPI + InkHUD::Applet::fontLarge = FREESANS_24PT_WIN1253; + InkHUD::Applet::fontMedium = FREESANS_18PT_WIN1253; + InkHUD::Applet::fontSmall = FREESANS_12PT_WIN1253; - // Init settings, and customize defaults + // Customize default settings inkhud->persistence->settings.userTiles.maxCount = 2; // How many tiles can the display handle? - inkhud->persistence->settings.rotation = 1; // 90 degrees clockwise + inkhud->persistence->settings.rotation = 3; // 270 degrees clockwise inkhud->persistence->settings.userTiles.count = 1; // One tile only by default, keep things simple for new users - inkhud->persistence->settings.optionalMenuItems.nextTile = false; // Behavior handled by aux button instead - inkhud->persistence->settings.optionalFeatures.batteryIcon = true; // Device definitely has a battery + inkhud->persistence->settings.optionalFeatures.batteryIcon = true; + inkhud->persistence->settings.optionalMenuItems.backlight = true; - // Setup backlight - // Note: AUX button behavior configured further down - Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); - backlight->setPin(PIN_EINK_EN); + // Alignment must cancel rotation for visual-frame touch input: (rotation + alignment) % 4 == 0. + inkhud->persistence->settings.joystick.alignment = (4 - inkhud->persistence->settings.rotation) % 4; // Pick applets // Note: order of applets determines priority of "auto-show" feature - // Optional arguments for defaults: - // - is activated? - // - is autoshown? - // - is foreground on a specific tile (index)? - inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, true, true); // Activated, autoshown - inkhud->addApplet("DMs", new InkHUD::DMApplet); - inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0)); - inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1)); - inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true); // Activated - inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet); + inkhud->addApplet("All Messages", new InkHUD::AllMessageApplet, false, false); // Not Active, not autoshown + inkhud->addApplet("DMs", new InkHUD::DMApplet, true, true); // Activated, Autoshown + inkhud->addApplet("Channel 0", new InkHUD::ThreadedMessageApplet(0), true, true); // Activated, Autoshown + inkhud->addApplet("Channel 1", new InkHUD::ThreadedMessageApplet(1), false, false); // Not Active, not autoshown + inkhud->addApplet("Positions", new InkHUD::PositionsApplet, true, false); // Activated, not autoshown + inkhud->addApplet("Recents List", new InkHUD::RecentsListApplet, true, false); // Activated, not autoshown inkhud->addApplet("Heard", new InkHUD::HeardApplet, true, false, 0); // Activated, not autoshown, default on tile 0 - // inkhud->addApplet("Basic", new InkHUD::BasicExampleApplet); - // inkhud->addApplet("NewMsg", new InkHUD::NewMsgExampleApplet); + inkhud->addApplet("Favorites Map", new InkHUD::FavoritesMapApplet, false, false); // Not Active, not autoshown + + // Backlight + // ---------------------------- + Drivers::LatchingBacklight *backlight = Drivers::LatchingBacklight::getInstance(); + backlight->setPin(BOARD_BL_EN); // GPIO11 on V2 // Start running InkHUD inkhud->begin(); + // Touch navigation requires joystick mode — enforce post-begin so flash cannot override. + inkhud->persistence->settings.joystick.enabled = true; + inkhud->persistence->settings.joystick.aligned = true; + // Buttons // -------------------------- Inputs::TwoButton *buttons = Inputs::TwoButton::getInstance(); // A shared NicheGraphics component - // Setup the main user button (0) + // Setup the main user button (boot button, GPIO 0) buttons->setWiring(0, BUTTON_PIN); - buttons->setHandlerShortPress(0, []() { InkHUD::InkHUD::getInstance()->shortpress(); }); - buttons->setHandlerLongPress(0, []() { InkHUD::InkHUD::getInstance()->longpress(); }); + buttons->setHandlerShortPress(0, [inkhud]() { inkhud->shortpress(); }); + buttons->setHandlerLongPress(0, [inkhud]() { inkhud->longpress(); }); - // Setup the aux button (1) - // Bonus feature of VME290 - buttons->setWiring(1, BUTTON_PIN_SECONDARY); - buttons->setHandlerShortPress(1, []() { InkHUD::InkHUD::getInstance()->nextTile(); }); + // No dedicated aux button on this board buttons->start(); } -#endif \ No newline at end of file +#endif diff --git a/variants/esp32s3/t5s3_epaper/variant.cpp b/variants/esp32s3/t5s3_epaper/variant.cpp index e10d7c347..3bc010ce0 100644 --- a/variants/esp32s3/t5s3_epaper/variant.cpp +++ b/variants/esp32s3/t5s3_epaper/variant.cpp @@ -2,21 +2,123 @@ #ifdef T5_S3_EPAPER_PRO +#include "Observer.h" #include "TouchDrvGT911.hpp" #include "Wire.h" +#include "input/InputBroker.h" #include "input/TouchScreenImpl1.h" +#include "sleep.h" + +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS +#include "graphics/niche/InkHUD/InkHUD.h" +#include "graphics/niche/InkHUD/SystemApplet.h" + +// Bridges touch events from TouchScreenImpl1 directly into InkHUD, +// bypassing the InputBroker (which is excluded in InkHUD builds). +// Routing mirrors the mini-epaper-s3 two-way rocker pattern: +// - Nav left/right: prevApplet/nextApplet when idle, navUp/Down when a system applet has focus (e.g. menu) +// - Nav up/down: navUp/navDown always (menu scroll) +// - Tap: shortpress (cycle applets / confirm in menu) +// - Long press: longpress (open menu / back) +class TouchInkHUDBridge : public Observer +{ + int onNotify(const InputEvent *e) override + { + auto *inkhud = NicheGraphics::InkHUD::InkHUD::getInstance(); + + // Keep alignment in sync with the current rotation so that visual-frame gestures + // always pass through nav functions without remapping: (rotation + alignment) % 4 == 0. + inkhud->persistence->settings.joystick.alignment = (4 - inkhud->persistence->settings.rotation) % 4; + + // Check whether a system applet (e.g. menu) is currently handling input + bool systemHandlingInput = false; + for (NicheGraphics::InkHUD::SystemApplet *sa : inkhud->systemApplets) { + if (sa->handleInput) { + systemHandlingInput = true; + break; + } + } + + switch (e->inputEvent) { + case INPUT_BROKER_USER_PRESS: + inkhud->shortpress(); + break; + case INPUT_BROKER_SELECT: + inkhud->longpress(); + break; + case INPUT_BROKER_LEFT: + if (systemHandlingInput) + inkhud->navUp(); + else + inkhud->prevApplet(); + break; + case INPUT_BROKER_RIGHT: + if (systemHandlingInput) + inkhud->navDown(); + else + inkhud->nextApplet(); + break; + case INPUT_BROKER_UP: + inkhud->navUp(); + break; + case INPUT_BROKER_DOWN: + inkhud->navDown(); + break; + default: + break; + } + return 0; + } +}; + +static TouchInkHUDBridge touchBridge; +#endif // MESHTASTIC_INCLUDE_NICHE_GRAPHICS TouchDrvGT911 touch; +// Commands the GT911 into standby before the Wire bus is torn down. +// notifyDeepSleep fires before Wire.end() in doDeepSleep(), so I2C is still available here. +struct TouchDeepSleepObserver { + int onDeepSleep(void *) + { + touch.sleep(); + return 0; + } + CallbackObserver observer{this, &TouchDeepSleepObserver::onDeepSleep}; +} static touchDeepSleepObserver; + bool readTouch(int16_t *x, int16_t *y) { if (!digitalRead(GT911_PIN_INT)) { int16_t raw_x; int16_t raw_y; if (touch.getPoint(&raw_x, &raw_y)) { - // rotate 90° for landscape - *x = raw_y; - *y = EPD_WIDTH - 1 - raw_x; +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + // Transform raw GT911 axes to visual-frame coordinates for the current display rotation. + // rotation=3 is the physical identity (device's default orientation). + switch (NicheGraphics::InkHUD::InkHUD::getInstance()->persistence->settings.rotation) { + default: + case 3: + *x = raw_x; + *y = raw_y; + break; // identity + case 2: + *x = (EPD_WIDTH - 1) - raw_y; + *y = raw_x; + break; // 90° CW tilt + case 1: + *x = (EPD_HEIGHT - 1) - raw_x; + *y = (EPD_WIDTH - 1) - raw_y; + break; // 180° flip + case 0: + *x = raw_y; + *y = (EPD_HEIGHT - 1) - raw_x; + break; // 90° CCW tilt + } +#else + *x = raw_x; + *y = raw_y; +#endif LOG_DEBUG("touched(%d/%d)", *x, *y); return true; } @@ -31,15 +133,46 @@ void earlyInitVariant() pinMode(SDCARD_CS, OUTPUT); digitalWrite(SDCARD_CS, HIGH); pinMode(BOARD_BL_EN, OUTPUT); + + // Program GT911 touch controller to I2C address 0x14 (GT911_SLAVE_ADDRESS_H) before + // the I2C bus scan runs. GPIO3 (INT) defaults LOW on ESP32-S3 cold boot, which would + // leave the GT911 at 0x5D (GT911_SLAVE_ADDRESS_L) — the same address as the SFA30 + // air quality sensor — causing a false-positive SFA30 detection during the I2C scan. + // + // GT911 datasheet §4.3 "Address Selection": + // Pull INT HIGH before releasing RST → device latches address 0x14 (SLAVE_ADDRESS_H) + // Pull INT LOW before releasing RST → device latches address 0x5D (SLAVE_ADDRESS_L) + // Minimum RST assert time: 100 µs; minimum startup time after RST deassert: 5 ms. + // + // lateInitVariant() calls touch.begin() which repeats this sequence internally while + // also performing full I2C initialisation; the double-reset is harmless. + pinMode(GT911_PIN_RST, OUTPUT); + digitalWrite(GT911_PIN_RST, LOW); + pinMode(GT911_PIN_INT, OUTPUT); + digitalWrite(GT911_PIN_INT, HIGH); // HIGH → latch address 0x14 + delay(1); // > 100 µs + digitalWrite(GT911_PIN_RST, HIGH); + delay(10); // > 5 ms startup + pinMode(GT911_PIN_INT, INPUT); // release INT for interrupt use +} + +void variant_shutdown() +{ + // Ensure frontlight is off during deep sleep + digitalWrite(BOARD_BL_EN, LOW); } // T5-S3-ePaper Pro specific (late-) init void lateInitVariant(void) { touch.setPins(GT911_PIN_RST, GT911_PIN_INT); - if (touch.begin(Wire, GT911_SLAVE_ADDRESS_L, GT911_PIN_SDA, GT911_PIN_SCL)) { + if (touch.begin(Wire, GT911_SLAVE_ADDRESS_H, GT911_PIN_SDA, GT911_PIN_SCL)) { + touchDeepSleepObserver.observer.observe(¬ifyDeepSleep); touchScreenImpl1 = new TouchScreenImpl1(EPD_WIDTH, EPD_HEIGHT, readTouch); touchScreenImpl1->init(); +#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS + touchBridge.observe(touchScreenImpl1); +#endif } else { LOG_ERROR("Failed to find touch controller!"); } diff --git a/variants/esp32s3/t5s3_epaper/variant.h b/variants/esp32s3/t5s3_epaper/variant.h index c2c001373..803b582af 100644 --- a/variants/esp32s3/t5s3_epaper/variant.h +++ b/variants/esp32s3/t5s3_epaper/variant.h @@ -26,9 +26,9 @@ #define GT911_PIN_RST 9 #endif -#define PCF85063_RTC 0x51 +#define PCF8563_RTC 0x51 #define HAS_RTC 1 -#define PCF85063_INT 2 +#define PCF8563_INT 2 #define USE_POWERSAVE #define SLEEP_TIME 120 From 2b5daf24387d7eccdf294d10f83092c98a23fc90 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 21 Apr 2026 20:02:56 -0500 Subject: [PATCH 096/150] T watch pinfix (#10231) * Minor button debugging bits * pin0 is a pin, pin -1 means disabled --- src/input/ButtonThread.cpp | 10 ++++++++-- variants/esp32s3/t-watch-s3/variant.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/input/ButtonThread.cpp b/src/input/ButtonThread.cpp index df8de4905..3b0a46e88 100644 --- a/src/input/ButtonThread.cpp +++ b/src/input/ButtonThread.cpp @@ -143,6 +143,10 @@ int32_t ButtonThread::runOnce() leadUpSequenceActive = false; resetLeadUpSequence(); } +#ifdef INPUT_DEBUG + if (buttonCurrentlyPressed) + LOG_WARN("Button held for %u ms", millis() - buttonPressStartTime); +#endif // Progressive lead-up sound system if (!_suppressLeadUp && buttonCurrentlyPressed && (millis() - buttonPressStartTime) >= BUTTON_LEADUP_MS) { @@ -311,7 +315,8 @@ int32_t ButtonThread::runOnce() void ButtonThread::attachButtonInterrupts() { // Interrupt for user button, during normal use. Improves responsiveness. - attachInterrupt(_pinNum, _intRoutine, CHANGE); + if (_intRoutine != nullptr) + attachInterrupt(_pinNum, _intRoutine, CHANGE); } /* @@ -320,7 +325,8 @@ void ButtonThread::attachButtonInterrupts() */ void ButtonThread::detachButtonInterrupts() { - detachInterrupt(_pinNum); + if (_intRoutine != nullptr) + detachInterrupt(_pinNum); } #ifdef ARCH_ESP32 diff --git a/variants/esp32s3/t-watch-s3/variant.h b/variants/esp32s3/t-watch-s3/variant.h index df275c31d..507d6b7dc 100644 --- a/variants/esp32s3/t-watch-s3/variant.h +++ b/variants/esp32s3/t-watch-s3/variant.h @@ -39,7 +39,7 @@ #define DAC_I2S_BCK 48 #define DAC_I2S_WS 15 #define DAC_I2S_DOUT 46 -#define DAC_I2S_MCLK 0 +#define DAC_I2S_MCLK -1 #define HAS_AXP2101 From fb1de111d71cbe8e191afd54965151d9ff8c6880 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:34:48 -0500 Subject: [PATCH 097/150] Update LovyanGFX to v1.2.20 (#10232) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/esp32/chatter2/platformio.ini | 2 +- variants/esp32/m5stack_core/platformio.ini | 2 +- variants/esp32/wiphone/platformio.ini | 2 +- variants/esp32s3/heltec_v4/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini | 2 +- variants/esp32s3/mesh-tab/platformio.ini | 2 +- variants/esp32s3/picomputer-s3/platformio.ini | 2 +- variants/esp32s3/rak_wismesh_tap_v2/platformio.ini | 2 +- variants/esp32s3/t-deck/platformio.ini | 2 +- variants/esp32s3/t-watch-s3/platformio.ini | 2 +- variants/esp32s3/tlora-pager/platformio.ini | 2 +- variants/esp32s3/tracksenger/platformio.ini | 4 ++-- variants/esp32s3/unphone/platformio.ini | 2 +- variants/native/portduino.ini | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/variants/esp32/chatter2/platformio.ini b/variants/esp32/chatter2/platformio.ini index a14e407a1..bb3824fce 100644 --- a/variants/esp32/chatter2/platformio.ini +++ b/variants/esp32/chatter2/platformio.ini @@ -12,4 +12,4 @@ build_flags = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 diff --git a/variants/esp32/m5stack_core/platformio.ini b/variants/esp32/m5stack_core/platformio.ini index 8fbbae895..bded13c3b 100644 --- a/variants/esp32/m5stack_core/platformio.ini +++ b/variants/esp32/m5stack_core/platformio.ini @@ -35,4 +35,4 @@ lib_ignore = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 diff --git a/variants/esp32/wiphone/platformio.ini b/variants/esp32/wiphone/platformio.ini index fbd77be75..8def28b90 100644 --- a/variants/esp32/wiphone/platformio.ini +++ b/variants/esp32/wiphone/platformio.ini @@ -11,7 +11,7 @@ build_flags = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # renovate: datasource=custom.pio depName=SX1509 IO Expander packageName=sparkfun/library/SX1509 IO Expander sparkfun/SX1509 IO Expander@3.0.6 # renovate: datasource=custom.pio depName=APA102 packageName=pololu/library/APA102 diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 5a5004a45..5306e9b5d 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -131,6 +131,6 @@ build_flags = lib_deps = ${heltec_v4_base.lib_deps} ${device-ui_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # renovate: datasource=git-refs depName=Quency-D_chsc6x packageName=https://github.com/Quency-D/chsc6x gitBranch=master https://github.com/Quency-D/chsc6x/archive/5cbead829d6b432a8d621ed1aafd4eb474fd4f27.zip \ No newline at end of file diff --git a/variants/esp32s3/heltec_wireless_tracker/platformio.ini b/variants/esp32s3/heltec_wireless_tracker/platformio.ini index 33643c541..b096c3a7b 100644 --- a/variants/esp32s3/heltec_wireless_tracker/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker/platformio.ini @@ -24,4 +24,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 diff --git a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini index ab6592afb..2c714be57 100644 --- a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini @@ -22,4 +22,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 diff --git a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini index ebf0118bb..c75b78fa5 100644 --- a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini @@ -21,4 +21,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 diff --git a/variants/esp32s3/mesh-tab/platformio.ini b/variants/esp32s3/mesh-tab/platformio.ini index a153ba9fb..716e94d62 100644 --- a/variants/esp32s3/mesh-tab/platformio.ini +++ b/variants/esp32s3/mesh-tab/platformio.ini @@ -55,7 +55,7 @@ lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 [mesh_tab_xpt2046] extends = mesh_tab_base diff --git a/variants/esp32s3/picomputer-s3/platformio.ini b/variants/esp32s3/picomputer-s3/platformio.ini index 6f218a126..62228799c 100644 --- a/variants/esp32s3/picomputer-s3/platformio.ini +++ b/variants/esp32s3/picomputer-s3/platformio.ini @@ -25,7 +25,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 build_src_filter = ${esp32s3_base.build_src_filter} diff --git a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini index 7847410ae..8f1eb593a 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini +++ b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini @@ -37,7 +37,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 [env:rak_wismesh_tap_v2-tft] extends = env:rak_wismesh_tap_v2 diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index 1b3599464..3e2756612 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -29,7 +29,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM diff --git a/variants/esp32s3/t-watch-s3/platformio.ini b/variants/esp32s3/t-watch-s3/platformio.ini index 352396818..e2539bd6c 100644 --- a/variants/esp32s3/t-watch-s3/platformio.ini +++ b/variants/esp32s3/t-watch-s3/platformio.ini @@ -22,7 +22,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib lewisxhe/SensorLib@0.3.4 # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index 832f9d7d7..a38493905 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -33,7 +33,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM diff --git a/variants/esp32s3/tracksenger/platformio.ini b/variants/esp32s3/tracksenger/platformio.ini index c006cf835..d862392b0 100644 --- a/variants/esp32s3/tracksenger/platformio.ini +++ b/variants/esp32s3/tracksenger/platformio.ini @@ -22,7 +22,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 [env:tracksenger-lcd] custom_meshtastic_hw_model = 48 @@ -48,7 +48,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 [env:tracksenger-oled] custom_meshtastic_hw_model = 48 diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index 3c342e2ac..8903b4b2b 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -37,7 +37,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 # TODO renovate https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic@9.0.0 https://gitlab.com/hamishcunningham/unphonelibrary/-/archive/meshtastic/unphonelibrary-meshtastic.zip diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 87d8431a3..77974c8e5 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -27,7 +27,7 @@ lib_deps = # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.19 + lovyan03/LovyanGFX@1.2.20 ; # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main https://github.com/pine64/libch341-spi-userspace/archive/23c42319a69cffcb65868e3c72e6bed83974a393.zip # renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library From a71084172334ec0a1f8b360ce3bfe7f940b59b77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 11:35:07 -0500 Subject: [PATCH 098/150] Upgrade trunk (#10236) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 91f3c06fc..735c04d3e 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,9 +9,9 @@ plugins: lint: enabled: - checkov@3.2.524 - - renovate@43.136.3 + - renovate@43.139.2 - prettier@3.8.3 - - trufflehog@3.94.3 + - trufflehog@3.95.2 - yamllint@1.38.0 - bandit@1.9.4 - trivy@0.70.0 From d8b11f0b14cf321eaca2c9bd33eb4cba163a2e11 Mon Sep 17 00:00:00 2001 From: Jason P Date: Wed, 22 Apr 2026 11:42:25 -0500 Subject: [PATCH 099/150] Improve options to align to names of UI options (#10240) --- .github/ISSUE_TEMPLATE/Bug Report.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Bug Report.yml b/.github/ISSUE_TEMPLATE/Bug Report.yml index bc77e8c1b..cdf482344 100644 --- a/.github/ISSUE_TEMPLATE/Bug Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug Report.yml @@ -75,11 +75,11 @@ body: - type: checkboxes id: mui attributes: - label: Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)? + label: Is this bug report about any UI (https://meshtastic.org/docs/configuration/device-uis/) component firmware? options: - - label: Meshtastic UI aka MUI colorTFT - - label: InkHUD ePaper - - label: OLED slide UI on any display + - label: Meshtastic UI aka MUI + - label: InkHUD + - label: BaseUI - type: input id: version From 6171ad8c14b634d01b2c6afda3c398d55102aaee Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 22 Apr 2026 19:35:13 -0500 Subject: [PATCH 100/150] Remove duplicate GPIO init block in setup() from bad merge in PR #9378 The T-Deck-Pro V1.1 PR (#9378) had a backwards merge (e7b66281) that pulled 236 commits of master INTO a 1-commit fork branch, then a second merge (8fd0a7f2) duplicated the entire T_DECK/T_DECK_PRO/T_LORA_PAGER/HACKADAY peripheral init block in setup(). Also removes a stray digitalWrite(BLE_LED, LED_STATE_OFF) in the HACKADAY section that was an artifact of the evil merge at e7b66281. --- src/main.cpp | 63 ---------------------------------------------------- 1 file changed, 63 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index e517f94f0..cee18bb75 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -347,69 +347,6 @@ void setup() #endif #endif -#if defined(T_DECK) - // GPIO10 manages all peripheral power supplies - // Turn on peripheral power immediately after MUC starts. - // If some boards are turned on late, ESP32 will reset due to low voltage. - // ESP32-C3(Keyboard) , MAX98357A(Audio Power Amplifier) , - // TF Card , Display backlight(AW9364DNR) , AN48841B(Trackball) , ES7210(Decoder) - pinMode(KB_POWERON, OUTPUT); - digitalWrite(KB_POWERON, HIGH); - // T-Deck has all three SPI peripherals (TFT, SD, LoRa) attached to the same SPI bus - // We need to initialize all CS pins in advance otherwise there will be SPI communication issues - // e.g. when detecting the SD card - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(TFT_CS, OUTPUT); - digitalWrite(TFT_CS, HIGH); - delay(100); -#elif defined(T_DECK_PRO) - pinMode(LORA_EN, OUTPUT); - digitalWrite(LORA_EN, HIGH); - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(PIN_EINK_CS, OUTPUT); - digitalWrite(PIN_EINK_CS, HIGH); -#if PIN_EINK_RES >= 0 - pinMode(PIN_EINK_RES, OUTPUT); - digitalWrite(PIN_EINK_RES, HIGH); -#endif - pinMode(CST328_PIN_RST, OUTPUT); - digitalWrite(CST328_PIN_RST, HIGH); -#elif defined(T_LORA_PAGER) - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(TFT_CS, OUTPUT); - digitalWrite(TFT_CS, HIGH); - pinMode(KB_INT, INPUT_PULLUP); - // io expander - io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); - io.pinMode(EXPANDS_DRV_EN, OUTPUT); - io.digitalWrite(EXPANDS_DRV_EN, HIGH); - io.pinMode(EXPANDS_AMP_EN, OUTPUT); - io.digitalWrite(EXPANDS_AMP_EN, LOW); - io.pinMode(EXPANDS_LORA_EN, OUTPUT); - io.digitalWrite(EXPANDS_LORA_EN, HIGH); - io.pinMode(EXPANDS_GPS_EN, OUTPUT); - io.digitalWrite(EXPANDS_GPS_EN, HIGH); - io.pinMode(EXPANDS_KB_EN, OUTPUT); - io.digitalWrite(EXPANDS_KB_EN, HIGH); - io.pinMode(EXPANDS_SD_EN, OUTPUT); - io.digitalWrite(EXPANDS_SD_EN, HIGH); - io.pinMode(EXPANDS_GPIO_EN, OUTPUT); - io.digitalWrite(EXPANDS_GPIO_EN, HIGH); - io.pinMode(EXPANDS_SD_PULLEN, INPUT); -#elif defined(HACKADAY_COMMUNICATOR) - pinMode(KB_INT, INPUT); - digitalWrite(BLE_LED, LED_STATE_OFF); -#endif - #if defined(T_DECK) // GPIO10 manages all peripheral power supplies // Turn on peripheral power immediately after MUC starts. From 92c0133ef9b7f26c04b03f0d9332700eeca62288 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 22 Apr 2026 21:47:20 -0500 Subject: [PATCH 101/150] Finish evil merge cleanup (#10253) --- src/main.cpp | 68 +--------------------------------------------------- 1 file changed, 1 insertion(+), 67 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index cee18bb75..6f78c0b96 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -340,73 +340,7 @@ void setup() #ifdef BLE_LED pinMode(BLE_LED, OUTPUT); -#ifdef BLE_LED_INVERTED - digitalWrite(BLE_LED, HIGH); -#else - digitalWrite(BLE_LED, LOW); -#endif -#endif - -#if defined(T_DECK) - // GPIO10 manages all peripheral power supplies - // Turn on peripheral power immediately after MUC starts. - // If some boards are turned on late, ESP32 will reset due to low voltage. - // ESP32-C3(Keyboard) , MAX98357A(Audio Power Amplifier) , - // TF Card , Display backlight(AW9364DNR) , AN48841B(Trackball) , ES7210(Decoder) - pinMode(KB_POWERON, OUTPUT); - digitalWrite(KB_POWERON, HIGH); - // T-Deck has all three SPI peripherals (TFT, SD, LoRa) attached to the same SPI bus - // We need to initialize all CS pins in advance otherwise there will be SPI communication issues - // e.g. when detecting the SD card - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(TFT_CS, OUTPUT); - digitalWrite(TFT_CS, HIGH); - delay(100); -#elif defined(T_DECK_PRO) - pinMode(LORA_EN, OUTPUT); - digitalWrite(LORA_EN, HIGH); - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(PIN_EINK_CS, OUTPUT); - digitalWrite(PIN_EINK_CS, HIGH); -#if PIN_EINK_RES >= 0 - pinMode(PIN_EINK_RES, OUTPUT); - digitalWrite(PIN_EINK_RES, HIGH); -#endif - pinMode(CST328_PIN_RST, OUTPUT); - digitalWrite(CST328_PIN_RST, HIGH); -#elif defined(T_LORA_PAGER) - pinMode(LORA_CS, OUTPUT); - digitalWrite(LORA_CS, HIGH); - pinMode(SDCARD_CS, OUTPUT); - digitalWrite(SDCARD_CS, HIGH); - pinMode(TFT_CS, OUTPUT); - digitalWrite(TFT_CS, HIGH); - pinMode(KB_INT, INPUT_PULLUP); - // io expander - io.begin(Wire, XL9555_SLAVE_ADDRESS0, SDA, SCL); - io.pinMode(EXPANDS_DRV_EN, OUTPUT); - io.digitalWrite(EXPANDS_DRV_EN, HIGH); - io.pinMode(EXPANDS_AMP_EN, OUTPUT); - io.digitalWrite(EXPANDS_AMP_EN, LOW); - io.pinMode(EXPANDS_LORA_EN, OUTPUT); - io.digitalWrite(EXPANDS_LORA_EN, HIGH); - io.pinMode(EXPANDS_GPS_EN, OUTPUT); - io.digitalWrite(EXPANDS_GPS_EN, HIGH); - io.pinMode(EXPANDS_KB_EN, OUTPUT); - io.digitalWrite(EXPANDS_KB_EN, HIGH); - io.pinMode(EXPANDS_SD_EN, OUTPUT); - io.digitalWrite(EXPANDS_SD_EN, HIGH); - io.pinMode(EXPANDS_GPIO_EN, OUTPUT); - io.digitalWrite(EXPANDS_GPIO_EN, HIGH); - io.pinMode(EXPANDS_SD_PULLEN, INPUT); -#elif defined(HACKADAY_COMMUNICATOR) - pinMode(KB_INT, INPUT); + digitalWrite(BLE_LED, LED_STATE_OFF); #endif concurrency::hasBeenSetup = true; From 7c27f4e2dff201c41413404a64e2b603c016fed2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Thu, 23 Apr 2026 12:37:05 +0200 Subject: [PATCH 102/150] Revert "Update LovyanGFX to v1.2.20 (#10232)" (#10269) This reverts commit fb1de111d71cbe8e191afd54965151d9ff8c6880. --- variants/esp32/chatter2/platformio.ini | 2 +- variants/esp32/m5stack_core/platformio.ini | 2 +- variants/esp32/wiphone/platformio.ini | 2 +- variants/esp32s3/heltec_v4/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini | 2 +- variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini | 2 +- variants/esp32s3/mesh-tab/platformio.ini | 2 +- variants/esp32s3/picomputer-s3/platformio.ini | 2 +- variants/esp32s3/rak_wismesh_tap_v2/platformio.ini | 2 +- variants/esp32s3/t-deck/platformio.ini | 2 +- variants/esp32s3/t-watch-s3/platformio.ini | 2 +- variants/esp32s3/tlora-pager/platformio.ini | 2 +- variants/esp32s3/tracksenger/platformio.ini | 4 ++-- variants/esp32s3/unphone/platformio.ini | 2 +- variants/native/portduino.ini | 2 +- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/variants/esp32/chatter2/platformio.ini b/variants/esp32/chatter2/platformio.ini index bb3824fce..a14e407a1 100644 --- a/variants/esp32/chatter2/platformio.ini +++ b/variants/esp32/chatter2/platformio.ini @@ -12,4 +12,4 @@ build_flags = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 diff --git a/variants/esp32/m5stack_core/platformio.ini b/variants/esp32/m5stack_core/platformio.ini index bded13c3b..8fbbae895 100644 --- a/variants/esp32/m5stack_core/platformio.ini +++ b/variants/esp32/m5stack_core/platformio.ini @@ -35,4 +35,4 @@ lib_ignore = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 diff --git a/variants/esp32/wiphone/platformio.ini b/variants/esp32/wiphone/platformio.ini index 8def28b90..fbd77be75 100644 --- a/variants/esp32/wiphone/platformio.ini +++ b/variants/esp32/wiphone/platformio.ini @@ -11,7 +11,7 @@ build_flags = lib_deps = ${esp32_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # renovate: datasource=custom.pio depName=SX1509 IO Expander packageName=sparkfun/library/SX1509 IO Expander sparkfun/SX1509 IO Expander@3.0.6 # renovate: datasource=custom.pio depName=APA102 packageName=pololu/library/APA102 diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 5306e9b5d..5a5004a45 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -131,6 +131,6 @@ build_flags = lib_deps = ${heltec_v4_base.lib_deps} ${device-ui_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # renovate: datasource=git-refs depName=Quency-D_chsc6x packageName=https://github.com/Quency-D/chsc6x gitBranch=master https://github.com/Quency-D/chsc6x/archive/5cbead829d6b432a8d621ed1aafd4eb474fd4f27.zip \ No newline at end of file diff --git a/variants/esp32s3/heltec_wireless_tracker/platformio.ini b/variants/esp32s3/heltec_wireless_tracker/platformio.ini index b096c3a7b..33643c541 100644 --- a/variants/esp32s3/heltec_wireless_tracker/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker/platformio.ini @@ -24,4 +24,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 diff --git a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini index 2c714be57..ab6592afb 100644 --- a/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_V1_0/platformio.ini @@ -22,4 +22,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 diff --git a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini index c75b78fa5..ebf0118bb 100644 --- a/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini +++ b/variants/esp32s3/heltec_wireless_tracker_v2/platformio.ini @@ -21,4 +21,4 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 diff --git a/variants/esp32s3/mesh-tab/platformio.ini b/variants/esp32s3/mesh-tab/platformio.ini index 716e94d62..a153ba9fb 100644 --- a/variants/esp32s3/mesh-tab/platformio.ini +++ b/variants/esp32s3/mesh-tab/platformio.ini @@ -55,7 +55,7 @@ lib_deps = ${esp32s3_base.lib_deps} ${device-ui_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 [mesh_tab_xpt2046] extends = mesh_tab_base diff --git a/variants/esp32s3/picomputer-s3/platformio.ini b/variants/esp32s3/picomputer-s3/platformio.ini index 62228799c..6f218a126 100644 --- a/variants/esp32s3/picomputer-s3/platformio.ini +++ b/variants/esp32s3/picomputer-s3/platformio.ini @@ -25,7 +25,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 build_src_filter = ${esp32s3_base.build_src_filter} diff --git a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini index 8f1eb593a..7847410ae 100644 --- a/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini +++ b/variants/esp32s3/rak_wismesh_tap_v2/platformio.ini @@ -37,7 +37,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 [env:rak_wismesh_tap_v2-tft] extends = env:rak_wismesh_tap_v2 diff --git a/variants/esp32s3/t-deck/platformio.ini b/variants/esp32s3/t-deck/platformio.ini index 3e2756612..1b3599464 100644 --- a/variants/esp32s3/t-deck/platformio.ini +++ b/variants/esp32s3/t-deck/platformio.ini @@ -29,7 +29,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM diff --git a/variants/esp32s3/t-watch-s3/platformio.ini b/variants/esp32s3/t-watch-s3/platformio.ini index e2539bd6c..352396818 100644 --- a/variants/esp32s3/t-watch-s3/platformio.ini +++ b/variants/esp32s3/t-watch-s3/platformio.ini @@ -22,7 +22,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # renovate: datasource=custom.pio depName=SensorLib packageName=lewisxhe/library/SensorLib lewisxhe/SensorLib@0.3.4 # renovate: datasource=custom.pio depName=Adafruit DRV2605 packageName=adafruit/library/Adafruit DRV2605 Library diff --git a/variants/esp32s3/tlora-pager/platformio.ini b/variants/esp32s3/tlora-pager/platformio.ini index a38493905..832f9d7d7 100644 --- a/variants/esp32s3/tlora-pager/platformio.ini +++ b/variants/esp32s3/tlora-pager/platformio.ini @@ -33,7 +33,7 @@ build_flags = ${esp32s3_base.build_flags} lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # renovate: datasource=git-refs depName=ESP8266Audio packageName=https://github.com/meshtastic/ESP8266Audio gitBranch=meshtastic-2.0.0-dacfix https://github.com/meshtastic/ESP8266Audio/archive/343024632ee78d6216907b2353fc943a62422d80.zip # renovate: datasource=custom.pio depName=ESP8266SAM packageName=earlephilhower/library/ESP8266SAM diff --git a/variants/esp32s3/tracksenger/platformio.ini b/variants/esp32s3/tracksenger/platformio.ini index d862392b0..c006cf835 100644 --- a/variants/esp32s3/tracksenger/platformio.ini +++ b/variants/esp32s3/tracksenger/platformio.ini @@ -22,7 +22,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 [env:tracksenger-lcd] custom_meshtastic_hw_model = 48 @@ -48,7 +48,7 @@ build_flags = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 [env:tracksenger-oled] custom_meshtastic_hw_model = 48 diff --git a/variants/esp32s3/unphone/platformio.ini b/variants/esp32s3/unphone/platformio.ini index 8903b4b2b..3c342e2ac 100644 --- a/variants/esp32s3/unphone/platformio.ini +++ b/variants/esp32s3/unphone/platformio.ini @@ -37,7 +37,7 @@ build_src_filter = lib_deps = ${esp32s3_base.lib_deps} # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 # TODO renovate https://gitlab.com/hamishcunningham/unphonelibrary#meshtastic@9.0.0 https://gitlab.com/hamishcunningham/unphonelibrary/-/archive/meshtastic/unphonelibrary-meshtastic.zip diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 77974c8e5..87d8431a3 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -27,7 +27,7 @@ lib_deps = # renovate: datasource=custom.pio depName=rweather/Crypto packageName=rweather/library/Crypto rweather/Crypto@0.4.0 # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX - lovyan03/LovyanGFX@1.2.20 + lovyan03/LovyanGFX@1.2.19 ; # renovate: datasource=git-refs depName=libch341-spi-userspace packageName=https://github.com/pine64/libch341-spi-userspace gitBranch=main https://github.com/pine64/libch341-spi-userspace/archive/23c42319a69cffcb65868e3c72e6bed83974a393.zip # renovate: datasource=custom.pio depName=adafruit/Adafruit seesaw Library packageName=adafruit/library/Adafruit seesaw Library From 48747ee43dc63926d09c2c38060da9526ac7a6cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 06:16:23 -0500 Subject: [PATCH 103/150] Upgrade trunk (#10266) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 735c04d3e..ec6239207 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.524 - - renovate@43.139.2 + - renovate@43.139.6 - prettier@3.8.3 - trufflehog@3.95.2 - yamllint@1.38.0 @@ -19,7 +19,7 @@ lint: - ruff@0.15.11 - isort@8.0.1 - markdownlint@0.48.0 - - oxipng@10.1.0 + - oxipng@10.1.1 - svgo@4.0.1 - actionlint@1.7.12 - flake8@7.3.0 From 031f332ec161e0d852216c71896e8bdd41fa1908 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Thu, 23 Apr 2026 13:16:49 -0500 Subject: [PATCH 104/150] We have HardwareRNG, let's use it! (#10274) --- src/platform/nrf52/NRF52Bluetooth.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/platform/nrf52/NRF52Bluetooth.cpp b/src/platform/nrf52/NRF52Bluetooth.cpp index 307e35b0c..52e45cccc 100644 --- a/src/platform/nrf52/NRF52Bluetooth.cpp +++ b/src/platform/nrf52/NRF52Bluetooth.cpp @@ -1,6 +1,7 @@ #include "NRF52Bluetooth.h" #include "BLEDfuSecure.h" #include "BluetoothCommon.h" +#include "HardwareRNG.h" #include "PowerFSM.h" #include "configuration.h" #include "main.h" @@ -272,9 +273,13 @@ void NRF52Bluetooth::setup() Bluefruit.setTxPower(NRF52_BLE_TX_POWER); #endif if (config.bluetooth.mode != meshtastic_Config_BluetoothConfig_PairingMode_NO_PIN) { - configuredPasskey = config.bluetooth.mode == meshtastic_Config_BluetoothConfig_PairingMode_FIXED_PIN - ? config.bluetooth.fixed_pin - : random(100000, 999999); + if (config.bluetooth.mode == meshtastic_Config_BluetoothConfig_PairingMode_FIXED_PIN) { + configuredPasskey = config.bluetooth.fixed_pin; + } else { + uint32_t hwrand = 0; + HardwareRNG::fill(reinterpret_cast(&hwrand), sizeof(hwrand)); + configuredPasskey = hwrand % 900000u + 100000u; + } auto pinString = std::to_string(configuredPasskey); LOG_INFO("Bluetooth pin set to '%i'", configuredPasskey); Bluefruit.Security.setPIN(pinString.c_str()); From 2cc13a1132d94b66a9505e7f07ee2d3e83bd0c95 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 23 Apr 2026 14:19:33 -0500 Subject: [PATCH 105/150] Sane sanitization --- platformio.ini | 1 + src/mesh/TypeConversions.cpp | 5 + src/meshUtils.cpp | 89 ++++++++++++++++ src/meshUtils.h | 4 + src/modules/AdminModule.cpp | 8 ++ test/test_utf8/test_main.cpp | 195 +++++++++++++++++++++++++++++++++++ 6 files changed, 302 insertions(+) create mode 100644 test/test_utf8/test_main.cpp diff --git a/platformio.ini b/platformio.ini index cd22fab6e..a97b813fa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -29,6 +29,7 @@ build_flags = -Wno-missing-field-initializers -DUSE_THREAD_NAMES -DTINYGPS_OPTION_NO_CUSTOM_FIELDS -DPB_ENABLE_MALLOC=1 + -DPB_VALIDATE_UTF8=1 -DRADIOLIB_EXCLUDE_CC1101=1 -DRADIOLIB_EXCLUDE_NRF24=1 -DRADIOLIB_EXCLUDE_RF69=1 diff --git a/src/mesh/TypeConversions.cpp b/src/mesh/TypeConversions.cpp index 201a703e2..3798daf28 100644 --- a/src/mesh/TypeConversions.cpp +++ b/src/mesh/TypeConversions.cpp @@ -1,6 +1,7 @@ #include "TypeConversions.h" #include "mesh/generated/meshtastic/deviceonly.pb.h" #include "mesh/generated/meshtastic/mesh.pb.h" +#include "meshUtils.h" meshtastic_NodeInfo TypeConversions::ConvertToNodeInfo(const meshtastic_NodeInfoLite *lite) { @@ -82,8 +83,10 @@ meshtastic_UserLite TypeConversions::ConvertToUserLite(meshtastic_User user) strncpy(lite.long_name, user.long_name, sizeof(lite.long_name)); lite.long_name[sizeof(lite.long_name) - 1] = '\0'; + sanitizeUtf8(lite.long_name, sizeof(lite.long_name)); strncpy(lite.short_name, user.short_name, sizeof(lite.short_name)); lite.short_name[sizeof(lite.short_name) - 1] = '\0'; + sanitizeUtf8(lite.short_name, sizeof(lite.short_name)); lite.hw_model = user.hw_model; lite.role = user.role; lite.is_licensed = user.is_licensed; @@ -102,8 +105,10 @@ meshtastic_User TypeConversions::ConvertToUser(uint32_t nodeNum, meshtastic_User snprintf(user.id, sizeof(user.id), "!%08x", nodeNum); strncpy(user.long_name, lite.long_name, sizeof(user.long_name)); user.long_name[sizeof(user.long_name) - 1] = '\0'; + sanitizeUtf8(user.long_name, sizeof(user.long_name)); strncpy(user.short_name, lite.short_name, sizeof(user.short_name)); user.short_name[sizeof(user.short_name) - 1] = '\0'; + sanitizeUtf8(user.short_name, sizeof(user.short_name)); user.hw_model = lite.hw_model; user.role = lite.role; user.is_licensed = lite.is_licensed; diff --git a/src/meshUtils.cpp b/src/meshUtils.cpp index 1a4497101..89c548887 100644 --- a/src/meshUtils.cpp +++ b/src/meshUtils.cpp @@ -117,4 +117,93 @@ size_t pb_string_length(const char *str, size_t max_len) } } return len; +} + +bool sanitizeUtf8(char *buf, size_t bufSize) +{ + if (!buf || bufSize == 0) + return false; + + // Ensure null-terminated within buffer + buf[bufSize - 1] = '\0'; + + bool replaced = false; + size_t i = 0; + size_t len = strlen(buf); + + while (i < len) { + uint8_t b = (uint8_t)buf[i]; + + // Determine expected sequence length from lead byte + size_t seqLen; + uint32_t minCodepoint; + if (b <= 0x7F) { + // ASCII — valid single byte + i++; + continue; + } else if ((b & 0xE0) == 0xC0) { + seqLen = 2; + minCodepoint = 0x80; // Reject overlong + } else if ((b & 0xF0) == 0xE0) { + seqLen = 3; + minCodepoint = 0x800; + } else if ((b & 0xF8) == 0xF0) { + seqLen = 4; + minCodepoint = 0x10000; + } else { + // Invalid lead byte (0x80-0xBF or 0xF8+) + buf[i] = '?'; + replaced = true; + i++; + continue; + } + + // Check that we have enough bytes remaining + if (i + seqLen > len) { + // Truncated sequence at end of string — replace remaining bytes + for (size_t j = i; j < len; j++) { + buf[j] = '?'; + } + replaced = true; + break; + } + + // Validate continuation bytes (must be 10xxxxxx) + bool valid = true; + for (size_t j = 1; j < seqLen; j++) { + if (((uint8_t)buf[i + j] & 0xC0) != 0x80) { + valid = false; + break; + } + } + + if (valid) { + // Decode codepoint to check for overlong encodings and surrogates + uint32_t cp = 0; + if (seqLen == 2) + cp = b & 0x1F; + else if (seqLen == 3) + cp = b & 0x0F; + else + cp = b & 0x07; + for (size_t j = 1; j < seqLen; j++) + cp = (cp << 6) | ((uint8_t)buf[i + j] & 0x3F); + + if (cp < minCodepoint || cp > 0x10FFFF || (cp >= 0xD800 && cp <= 0xDFFF)) { + // Overlong encoding, out of Unicode range, or surrogate half + valid = false; + } + } + + if (valid) { + i += seqLen; + } else { + // Replace only the lead byte; continuation bytes will be caught on next iteration + buf[i] = '?'; + replaced = true; + i++; + } + } + + return replaced; } \ No newline at end of file diff --git a/src/meshUtils.h b/src/meshUtils.h index da3a4593b..6a15229fb 100644 --- a/src/meshUtils.h +++ b/src/meshUtils.h @@ -38,6 +38,10 @@ const std::string vformat(const char *const zcFormat, ...); // Get actual string length for nanopb char array fields. size_t pb_string_length(const char *str, size_t max_len); +// Sanitize a fixed-size char buffer in-place by replacing invalid UTF-8 sequences with '?'. +// Ensures the result is null-terminated within bufSize. Returns true if any bytes were replaced. +bool sanitizeUtf8(char *buf, size_t bufSize); + /// Calculate 2^n without calling pow() - used for spreading factor and other calculations inline uint32_t pow_of_2(uint32_t n) { diff --git a/src/modules/AdminModule.cpp b/src/modules/AdminModule.cpp index 8a1843bcb..468e8d91e 100644 --- a/src/modules/AdminModule.cpp +++ b/src/modules/AdminModule.cpp @@ -599,10 +599,14 @@ void AdminModule::handleSetOwner(const meshtastic_User &o) if (*o.long_name) { changed |= strcmp(owner.long_name, o.long_name); strncpy(owner.long_name, o.long_name, sizeof(owner.long_name)); + owner.long_name[sizeof(owner.long_name) - 1] = '\0'; + sanitizeUtf8(owner.long_name, sizeof(owner.long_name)); } if (*o.short_name) { changed |= strcmp(owner.short_name, o.short_name); strncpy(owner.short_name, o.short_name, sizeof(owner.short_name)); + owner.short_name[sizeof(owner.short_name) - 1] = '\0'; + sanitizeUtf8(owner.short_name, sizeof(owner.short_name)); } snprintf(owner.id, sizeof(owner.id), "!%08x", nodeDB->getNodeNum()); @@ -1400,7 +1404,11 @@ void AdminModule::handleSetHamMode(const meshtastic_HamParameters &p) // Set call sign and override lora limitations for licensed use strncpy(owner.long_name, p.call_sign, sizeof(owner.long_name)); + owner.long_name[sizeof(owner.long_name) - 1] = '\0'; + sanitizeUtf8(owner.long_name, sizeof(owner.long_name)); strncpy(owner.short_name, p.short_name, sizeof(owner.short_name)); + owner.short_name[sizeof(owner.short_name) - 1] = '\0'; + sanitizeUtf8(owner.short_name, sizeof(owner.short_name)); owner.is_licensed = true; config.lora.override_duty_cycle = true; config.lora.tx_power = p.tx_power; diff --git a/test/test_utf8/test_main.cpp b/test/test_utf8/test_main.cpp new file mode 100644 index 000000000..7ac64653d --- /dev/null +++ b/test/test_utf8/test_main.cpp @@ -0,0 +1,195 @@ +#include "meshUtils.h" +#include +#include + +void setUp(void) {} +void tearDown(void) {} + +// --- Valid UTF-8 should pass through unchanged --- + +void test_ascii_unchanged() +{ + char buf[32] = "Hello World"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("Hello World", buf); +} + +void test_valid_2byte_unchanged() +{ + // "café" — é is C3 A9 + char buf[16] = "caf\xC3\xA9"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("caf\xC3\xA9", buf); +} + +void test_valid_3byte_unchanged() +{ + // "€" is E2 82 AC + char buf[16] = "\xE2\x82\xAC"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("\xE2\x82\xAC", buf); +} + +void test_valid_4byte_emoji_unchanged() +{ + // 🌙 is F0 9F 8C 99 + char buf[16] = "\xF0\x9F\x8C\x99"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("\xF0\x9F\x8C\x99", buf); +} + +void test_valid_mixed_unchanged() +{ + // "Hi 🌙!" — mix of ASCII and 4-byte + char buf[16] = "Hi \xF0\x9F\x8C\x99!"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("Hi \xF0\x9F\x8C\x99!", buf); +} + +void test_empty_string() +{ + char buf[8] = ""; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("", buf); +} + +// --- Invalid sequences observed in the wild --- + +void test_truncated_4byte_at_end() +{ + // Name with valid emoji 🌙 followed by a truncated 4-byte sequence + ASCII + char buf[32] = "Lunar Tower \xF0\x9F\x8C\x99\xF0\x9F\x97" + "4"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + // The 🌙 should be preserved; F0 9F 97 is an incomplete 4-byte sequence, + // '4' (0x34) is not a valid continuation byte + TEST_ASSERT_EQUAL_STRING("Lunar Tower \xF0\x9F\x8C\x99???4", buf); +} + +void test_lone_lead_bytes_without_continuations() +{ + // Mixed ASCII with stray multibyte lead bytes (E1, F3) lacking proper continuations + char buf[32] = "Mesht\xE1\xF3tic 37e2"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + // E1 expects 2 continuation bytes, but F3 is not a continuation → E1 replaced + // F3 expects 3 continuation bytes, 't','i','c' are not continuations → F3 replaced + TEST_ASSERT_EQUAL_STRING("Mesht??tic 37e2", buf); +} + +// --- Edge cases --- + +void test_bare_continuation_byte() +{ + // 0x80 alone is invalid (continuation byte with no lead) + char buf[8] = "\x80"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("?", buf); +} + +void test_overlong_2byte() +{ + // C0 AF is an overlong encoding of U+002F '/' + char buf[8] = "\xC0\xAF"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + // C0 is a 2-byte lead, AF is valid continuation, but codepoint 0x2F < 0x80 → overlong + // C0 replaced, AF (now bare continuation) also replaced + TEST_ASSERT_EQUAL_STRING("??", buf); +} + +void test_surrogate_half() +{ + // ED A0 80 encodes U+D800 (surrogate half — invalid in UTF-8) + char buf[8] = "\xED\xA0\x80"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("???", buf); +} + +void test_5byte_sequence_rejected() +{ + // F8 80 80 80 80 — 5-byte sequence, not valid UTF-8 + char buf[8] = "\xF8\x80\x80\x80\x80"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + // F8 is invalid lead (>= 0xF8), each 0x80 is bare continuation + TEST_ASSERT_EQUAL_STRING("?????", buf); +} + +void test_truncated_3byte_at_buffer_end() +{ + // Buffer is exactly 4 bytes: E2 82 then forced null at [3] + char buf[4]; + buf[0] = '\xE2'; + buf[1] = '\x82'; + buf[2] = '\0'; // String ends before the 3-byte sequence completes + buf[3] = '\0'; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("??", buf); +} + +void test_null_termination_enforced() +{ + // Fill buffer completely with no null terminator + char buf[5]; + memset(buf, 'A', sizeof(buf)); + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); + // Should be null-terminated and content preserved (all ASCII) + TEST_ASSERT_EQUAL_STRING("AAAA", buf); +} + +void test_null_buffer() +{ + TEST_ASSERT_FALSE(sanitizeUtf8(nullptr, 10)); +} + +void test_zero_size() +{ + char buf[4] = "Hi"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, 0)); + // Buffer should be untouched + TEST_ASSERT_EQUAL_STRING("Hi", buf); +} + +void test_valid_max_codepoint() +{ + // U+10FFFF = F4 8F BF BF (maximum valid Unicode codepoint) + char buf[8] = "\xF4\x8F\xBF\xBF"; + TEST_ASSERT_FALSE(sanitizeUtf8(buf, sizeof(buf))); + TEST_ASSERT_EQUAL_STRING("\xF4\x8F\xBF\xBF", buf); +} + +void test_above_max_codepoint() +{ + // U+110000 = F4 90 80 80 (just above maximum valid Unicode) + char buf[8] = "\xF4\x90\x80\x80"; + TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); +} + +int main(int argc, char **argv) +{ + UNITY_BEGIN(); + + // Valid UTF-8 passthrough + RUN_TEST(test_ascii_unchanged); + RUN_TEST(test_valid_2byte_unchanged); + RUN_TEST(test_valid_3byte_unchanged); + RUN_TEST(test_valid_4byte_emoji_unchanged); + RUN_TEST(test_valid_mixed_unchanged); + RUN_TEST(test_empty_string); + + // Invalid sequences observed in the wild + RUN_TEST(test_truncated_4byte_at_end); + RUN_TEST(test_lone_lead_bytes_without_continuations); + + // Edge cases + RUN_TEST(test_bare_continuation_byte); + RUN_TEST(test_overlong_2byte); + RUN_TEST(test_surrogate_half); + RUN_TEST(test_5byte_sequence_rejected); + RUN_TEST(test_truncated_3byte_at_buffer_end); + RUN_TEST(test_null_termination_enforced); + RUN_TEST(test_null_buffer); + RUN_TEST(test_zero_size); + RUN_TEST(test_valid_max_codepoint); + RUN_TEST(test_above_max_codepoint); + + return UNITY_END(); +} From 56c897e8268eaa391aeeb8c67d584993180aca3c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 23 Apr 2026 14:42:29 -0500 Subject: [PATCH 106/150] Can't LOG when we don't have logging set up yet in the native test suite Co-authored-by: Copilot --- src/mesh/HardwareRNG.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mesh/HardwareRNG.cpp b/src/mesh/HardwareRNG.cpp index b455128ac..58a17d795 100644 --- a/src/mesh/HardwareRNG.cpp +++ b/src/mesh/HardwareRNG.cpp @@ -48,7 +48,9 @@ bool mixWithLoRaEntropy(uint8_t *buffer, size_t length) // and return false so callers know no extra mixing occurred. RadioLibInterface *radio = RadioLibInterface::instance; if (!radio) { +#ifndef PIO_UNIT_TESTING LOG_ERROR("No radio instance available to provide entropy"); +#endif return false; } From 5ea3d143dac713893fe29e2b466f4d46da8f8da0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 19:30:47 -0500 Subject: [PATCH 107/150] Update meshtastic-esp8266-oled-ssd1306 digest to 6bfd1f1 (#10277) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index a97b813fa..102c93a31 100644 --- a/platformio.ini +++ b/platformio.ini @@ -68,7 +68,7 @@ monitor_speed = 115200 monitor_filters = direct lib_deps = # renovate: datasource=git-refs depName=meshtastic-esp8266-oled-ssd1306 packageName=https://github.com/meshtastic/esp8266-oled-ssd1306 gitBranch=master - https://github.com/meshtastic/esp8266-oled-ssd1306/archive/21e484f409cde18d44012caef84c244eb5ca28f3.zip + https://github.com/meshtastic/esp8266-oled-ssd1306/archive/6bfd1f135e1ebe37afd6050bb4b9964cea3fcfda.zip # renovate: datasource=git-refs depName=meshtastic-OneButton packageName=https://github.com/meshtastic/OneButton gitBranch=master https://github.com/meshtastic/OneButton/archive/fa352d668c53f290cfa480a5f79ad422cd828c70.zip # renovate: datasource=git-refs depName=meshtastic-arduino-fsm packageName=https://github.com/meshtastic/arduino-fsm gitBranch=master From 8e653122c774276311bfa0f4915501cda07f01c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 05:40:44 -0500 Subject: [PATCH 108/150] Upgrade trunk (#10284) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index ec6239207..f90f4f4ac 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.524 - - renovate@43.139.6 + - renovate@43.141.0 - prettier@3.8.3 - trufflehog@3.95.2 - yamllint@1.38.0 From 04b819a7b5fcdcabbc73755b2e47659ae0e171c2 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 24 Apr 2026 00:17:33 -0500 Subject: [PATCH 109/150] Remove incorrect LED_STATE_ON definition for t-beam-s3 (#10280) Fixes #9912 and #10170 --- variants/esp32s3/tbeam-s3-core/variant.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/variants/esp32s3/tbeam-s3-core/variant.h b/variants/esp32s3/tbeam-s3-core/variant.h index 9ce4aade9..2637e7f78 100644 --- a/variants/esp32s3/tbeam-s3-core/variant.h +++ b/variants/esp32s3/tbeam-s3-core/variant.h @@ -9,8 +9,6 @@ #define BUTTON_PIN 0 // The middle button GPIO on the T-Beam S3 // #define EXT_NOTIFY_OUT 13 // Default pin to use for Ext Notify Module. -#define LED_STATE_ON 0 // State when LED is lit - // TTGO uses a common pinout for their SX1262 vs RF95 modules - both can be enabled and we will probe at runtime for RF95 and if // not found then probe for SX1262 #define USE_SX1262 @@ -76,4 +74,4 @@ // has 32768 Hz crystal #define HAS_32768HZ 1 -#define USE_SH1106 \ No newline at end of file +#define USE_SH1106 From d47301defc06c610d79d3513c03e2e9ebac95193 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Tue, 14 Apr 2026 14:32:48 -0500 Subject: [PATCH 110/150] Add PortduinoSetOptions to overwrite the realhardware bool (#10157) Co-authored-by: Ben Meadors --- src/platform/portduino/PortduinoGlue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 9e0a1b2a5..660bad0f2 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -650,7 +650,9 @@ void portduinoSetup() if (verboseEnabled && portduino_config.logoutputlevel != level_trace) { portduino_config.logoutputlevel = level_debug; } - + if (portduino_config.lora_spi_dev != "") { + portduinoSetOptions({.realHardware = true}); + } return; } From 439b87b8606055a4d1998d4f36e1398f2858518f Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Wed, 22 Apr 2026 14:27:48 -0500 Subject: [PATCH 111/150] Detach power interrupts for sleep (#10230) * Detach power interrupts for sleep * Gate PMU IRQ behind a found PMU --- src/Power.cpp | 129 ++++++++++++++++++++++++++++++++++++++------------ src/power.h | 18 ++++++- src/sleep.cpp | 11 ++--- 3 files changed, 121 insertions(+), 37 deletions(-) diff --git a/src/Power.cpp b/src/Power.cpp index d82c870ed..ecdda8dd9 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -717,37 +717,17 @@ bool Power::setup() found = true; #endif } -#ifdef EXT_PWR_DETECT - attachInterrupt( - EXT_PWR_DETECT, - []() { - power->setIntervalFromNow(0); - runASAP = true; - }, - CHANGE); -#endif -#ifdef BATTERY_CHARGING_INV - attachInterrupt( - BATTERY_CHARGING_INV, - []() { - power->setIntervalFromNow(0); - runASAP = true; - }, - CHANGE); -#endif -#ifdef EXT_CHRG_DETECT - attachInterrupt( - EXT_CHRG_DETECT, - []() { - power->setIntervalFromNow(0); - runASAP = true; - BaseType_t higherWake = 0; - }, - CHANGE); -#endif + attachPowerInterrupts(); enabled = found; low_voltage_counter = 0; +#ifdef ARCH_ESP32 + // Register callbacks for before and after lightsleep + // Used to detach and reattach interrupts + lsObserver.observe(¬ifyLightSleep); + lsEndObserver.observe(¬ifyLightSleepEnd); +#endif + return found; } @@ -1026,6 +1006,97 @@ int32_t Power::runOnce() return (statusHandler && statusHandler->isInitialized()) ? (1000 * 20) : RUN_SAME; } +#ifdef ARCH_ESP32 + +// Detach our class' interrupts before lightsleep +// Allows sleep.cpp to configure its own interrupts, which wake the device on user-button press +int Power::beforeLightSleep(void *unused) +{ + LOG_WARN("Detaching power interrupts for sleep"); + detachPowerInterrupts(); + return 0; // Indicates success +} + +// Reconfigure our interrupts +// Our class' interrupts were disconnected during sleep, to allow the user button to wake the device from sleep +int Power::afterLightSleep(esp_sleep_wakeup_cause_t cause) +{ + attachPowerInterrupts(); + return 0; // Indicates success +} + +#endif + +/* + * Attach (or re-attach) hardware interrupts for power management + * Public method. Used outside class when waking from MCU sleep + */ +void Power::attachPowerInterrupts() +{ +#ifdef EXT_PWR_DETECT + attachInterrupt( + EXT_PWR_DETECT, + []() { + power->setIntervalFromNow(0); + runASAP = true; + }, + CHANGE); +#endif +#ifdef BATTERY_CHARGING_INV + attachInterrupt( + BATTERY_CHARGING_INV, + []() { + power->setIntervalFromNow(0); + runASAP = true; + }, + CHANGE); +#endif +#ifdef EXT_CHRG_DETECT + attachInterrupt( + EXT_CHRG_DETECT, + []() { + power->setIntervalFromNow(0); + runASAP = true; + BaseType_t higherWake = 0; + }, + CHANGE); +#endif +#ifdef PMU_IRQ + if (PMU) { + attachInterrupt( + PMU_IRQ, + [] { + pmu_irq = true; + power->setIntervalFromNow(0); + runASAP = true; + }, + FALLING); + } +#endif +} + +/* + * Detach the "normal" button interrupts. + * Public method. Used before attaching a "wake-on-button" interrupt for MCU sleep + */ +void Power::detachPowerInterrupts() +{ +#ifdef EXT_PWR_DETECT + detachInterrupt(EXT_PWR_DETECT); +#endif +#ifdef BATTERY_CHARGING_INV + detachInterrupt(BATTERY_CHARGING_INV); +#endif +#ifdef EXT_CHRG_DETECT + detachInterrupt(EXT_CHRG_DETECT); +#endif +#ifdef PMU_IRQ + if (PMU) { + detachInterrupt(PMU_IRQ); + } +#endif +} + /** * Init the power manager chip * @@ -1303,8 +1374,6 @@ bool Power::axpChipInit() } pinMode(PMU_IRQ, INPUT); - attachInterrupt( - PMU_IRQ, [] { pmu_irq = true; }, FALLING); // we do not look for AXPXXX_CHARGING_FINISHED_IRQ & AXPXXX_CHARGING_IRQ // because it occurs repeatedly while there is no battery also it could cause diff --git a/src/power.h b/src/power.h index b129e2b74..d819aeb47 100644 --- a/src/power.h +++ b/src/power.h @@ -81,7 +81,7 @@ extern RAK9154Sensor rak9154Sensor; extern XPowersLibInterface *PMU; #endif -class Power : private concurrency::OSThread +class Power : public concurrency::OSThread { public: @@ -96,6 +96,14 @@ class Power : private concurrency::OSThread void setStatusHandler(meshtastic::PowerStatus *handler) { statusHandler = handler; } const uint16_t OCV[11] = {OCV_ARRAY}; +#ifdef ARCH_ESP32 + int beforeLightSleep(void *unused); + int afterLightSleep(esp_sleep_wakeup_cause_t cause); +#endif + + void attachPowerInterrupts(); + void detachPowerInterrupts(); + protected: meshtastic::PowerStatus *statusHandler; @@ -120,6 +128,14 @@ class Power : private concurrency::OSThread // open circuit voltage lookup table uint8_t low_voltage_counter; uint32_t lastLogTime = 0; + +#ifdef ARCH_ESP32 + // Get notified when lightsleep begins and ends + CallbackObserver lsObserver = CallbackObserver(this, &Power::beforeLightSleep); + CallbackObserver lsEndObserver = + CallbackObserver(this, &Power::afterLightSleep); +#endif + #ifdef DEBUG_HEAP uint32_t lastheap; #endif diff --git a/src/sleep.cpp b/src/sleep.cpp index 9c044eaf7..64bd0c480 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -497,13 +497,12 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); notifyLightSleepEnd.notifyObservers(cause); // Button interrupts are reattached here -#ifdef BUTTON_PIN if (cause == ESP_SLEEP_WAKEUP_GPIO) { - LOG_INFO("Exit light sleep gpio: btn=%d", - !digitalRead(config.device.button_gpio ? config.device.button_gpio : BUTTON_PIN)); - } else -#endif - { + LOG_INFO("Exit light sleep gpio"); + // If we woke because of a GPIO, it's possible power needs to run to handle. + power->setIntervalFromNow(0); + runASAP = true; + } else { LOG_INFO("Exit light sleep cause: %d", cause); } From 55f15076ca5bf1d90b92dd28b65373aeef0a92cf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 06:08:07 -0500 Subject: [PATCH 112/150] Update protobufs (#10295) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/config.pb.h | 40 +++++++++++++++++++---- src/mesh/generated/meshtastic/mesh.pb.h | 2 ++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/protobufs b/protobufs index 4d5b500df..249a80855 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 4d5b500df5af68a4f57d3e19705cc3bb1136358c +Subproject commit 249a80855a2adb76fb0904dac8bf6285d45f330f diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index c82dd5ff5..0e14334d5 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -285,7 +285,18 @@ typedef enum _meshtastic_Config_LoRaConfig_RegionCode { /* Nepal 865MHz */ meshtastic_Config_LoRaConfig_RegionCode_NP_865 = 25, /* Brazil 902MHz */ - meshtastic_Config_LoRaConfig_RegionCode_BR_902 = 26 + meshtastic_Config_LoRaConfig_RegionCode_BR_902 = 26, + /* ITU Region 1 Amateur Radio 2m band (144-146 MHz) */ + meshtastic_Config_LoRaConfig_RegionCode_ITU1_2M = 27, + /* ITU Region 2 / 3 Amateur Radio 2m band (144-148 MHz) */ + meshtastic_Config_LoRaConfig_RegionCode_ITU23_2M = 28, + /* EU 866MHz band (Band no. 47b of 2006/771/EC and subsequent amendments) for Non-specific short-range devices (SRD) */ + meshtastic_Config_LoRaConfig_RegionCode_EU_866 = 29, + /* EU 874MHz and 917MHz bands (Band no. 1 and 4 of 2022/172/EC and subsequent amendments) for Non-specific short-range devices (SRD) */ + meshtastic_Config_LoRaConfig_RegionCode_EU_874 = 30, + meshtastic_Config_LoRaConfig_RegionCode_EU_917 = 31, + /* EU 868MHz band, with narrow presets */ + meshtastic_Config_LoRaConfig_RegionCode_EU_N_868 = 32 } meshtastic_Config_LoRaConfig_RegionCode; /* Standard predefined channel settings @@ -315,7 +326,24 @@ typedef enum _meshtastic_Config_LoRaConfig_ModemPreset { meshtastic_Config_LoRaConfig_ModemPreset_SHORT_TURBO = 8, /* Long Range - Turbo This preset performs similarly to LongFast, but with 500Khz bandwidth. */ - meshtastic_Config_LoRaConfig_ModemPreset_LONG_TURBO = 9 + meshtastic_Config_LoRaConfig_ModemPreset_LONG_TURBO = 9, + /* Lite Fast + Medium range preset optimized for EU 866MHz SRD band with 125kHz bandwidth. + Comparable link budget to MEDIUM_FAST but compliant with Band no. 47b of 2006/771/EC. */ + meshtastic_Config_LoRaConfig_ModemPreset_LITE_FAST = 10, + /* Lite Slow + Medium-to-moderate range preset optimized for EU 866MHz SRD band with 125kHz bandwidth. + Comparable link budget to LONG_FAST but compliant with Band no. 47b of 2006/771/EC. */ + meshtastic_Config_LoRaConfig_ModemPreset_LITE_SLOW = 11, + /* Narrow Fast + Medium-to-moderate range preset optimized for EU 868MHz band with 62.5kHz bandwidth. + Comparable link budget to SHORT_SLOW, but with half the data rate. + Intended to avoid interference with other devices. */ + meshtastic_Config_LoRaConfig_ModemPreset_NARROW_FAST = 12, + /* Narrow Slow + Moderate range preset optimized for EU 868MHz band with 62.5kHz bandwidth. + Comparable link budget and data rate to LONG_FAST. */ + meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW = 13 } meshtastic_Config_LoRaConfig_ModemPreset; typedef enum _meshtastic_Config_LoRaConfig_FEM_LNA_Mode { @@ -702,12 +730,12 @@ extern "C" { #define _meshtastic_Config_DisplayConfig_CompassOrientation_ARRAYSIZE ((meshtastic_Config_DisplayConfig_CompassOrientation)(meshtastic_Config_DisplayConfig_CompassOrientation_DEGREES_270_INVERTED+1)) #define _meshtastic_Config_LoRaConfig_RegionCode_MIN meshtastic_Config_LoRaConfig_RegionCode_UNSET -#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_BR_902 -#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_BR_902+1)) +#define _meshtastic_Config_LoRaConfig_RegionCode_MAX meshtastic_Config_LoRaConfig_RegionCode_EU_N_868 +#define _meshtastic_Config_LoRaConfig_RegionCode_ARRAYSIZE ((meshtastic_Config_LoRaConfig_RegionCode)(meshtastic_Config_LoRaConfig_RegionCode_EU_N_868+1)) #define _meshtastic_Config_LoRaConfig_ModemPreset_MIN meshtastic_Config_LoRaConfig_ModemPreset_LONG_FAST -#define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_LONG_TURBO -#define _meshtastic_Config_LoRaConfig_ModemPreset_ARRAYSIZE ((meshtastic_Config_LoRaConfig_ModemPreset)(meshtastic_Config_LoRaConfig_ModemPreset_LONG_TURBO+1)) +#define _meshtastic_Config_LoRaConfig_ModemPreset_MAX meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW +#define _meshtastic_Config_LoRaConfig_ModemPreset_ARRAYSIZE ((meshtastic_Config_LoRaConfig_ModemPreset)(meshtastic_Config_LoRaConfig_ModemPreset_NARROW_SLOW+1)) #define _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MIN meshtastic_Config_LoRaConfig_FEM_LNA_Mode_DISABLED #define _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MAX meshtastic_Config_LoRaConfig_FEM_LNA_Mode_NOT_PRESENT diff --git a/src/mesh/generated/meshtastic/mesh.pb.h b/src/mesh/generated/meshtastic/mesh.pb.h index d7ff32cb4..f22825030 100644 --- a/src/mesh/generated/meshtastic/mesh.pb.h +++ b/src/mesh/generated/meshtastic/mesh.pb.h @@ -315,6 +315,8 @@ typedef enum _meshtastic_HardwareModel { meshtastic_HardwareModel_THINKNODE_M7 = 129, meshtastic_HardwareModel_THINKNODE_M8 = 130, meshtastic_HardwareModel_THINKNODE_M9 = 131, + /* The Heltec-V4-R8 uses an ESP32S3R8 chip, plus an SX1262. */ + meshtastic_HardwareModel_HELTEC_V4_R8 = 132, /* ------------------------------------------------------------------------------------------------------------------------------------------ Reserved ID For developing private Ports. These will show up in live traffic sparsely, so we can use a high number. Keep it within 8 bits. ------------------------------------------------------------------------------------------------------------------------------------------ */ From 734709105578e65dde4ce884bdabee3b4b613bcc Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 25 Apr 2026 06:10:45 -0500 Subject: [PATCH 113/150] Add script to show unmerged commits from develop to master --- bin/show-unmerged-prs.sh | 118 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100755 bin/show-unmerged-prs.sh diff --git a/bin/show-unmerged-prs.sh b/bin/show-unmerged-prs.sh new file mode 100755 index 000000000..2a76f63d6 --- /dev/null +++ b/bin/show-unmerged-prs.sh @@ -0,0 +1,118 @@ +#!/bin/bash + +# Script to show commits in develop that are not in master +# with their associated PR info and commit hashes +# +# Usage: +# ./show-unmerged-prs.sh # Show all unmerged commits +# ./show-unmerged-prs.sh --bugfix # Show only bugfix-labeled PRs + +set -e + +REPO="firmware" +OWNER="meshtastic" +BASE_BRANCH="master" +HEAD_BRANCH="develop" +LIMIT=100 +FILTER_LABEL="" + +# Parse arguments +for arg in "$@"; do + case $arg in + --bugfix) + FILTER_LABEL="bugfix" + shift + ;; + --feature) + FILTER_LABEL="feature" + shift + ;; + --help) + echo "Usage: $0 [OPTIONS]" + echo "Options:" + echo " --bugfix Show only PRs labeled with 'bugfix'" + echo " --feature Show only PRs labeled with 'feature'" + echo " --help Show this help message" + exit 0 + ;; + esac +done + +if [ -n "$FILTER_LABEL" ]; then + echo "Fetching commits in $HEAD_BRANCH that are not in $BASE_BRANCH (filtered by label: $FILTER_LABEL)..." +else + echo "Fetching commits in $HEAD_BRANCH that are not in $BASE_BRANCH..." +fi +echo "" + +# Check if gh CLI is available +if ! command -v gh &> /dev/null; then + echo "ERROR: GitHub CLI (gh) not found. Please install it first." + echo "Visit: https://cli.github.com/" + exit 1 +fi + +# Get commits in develop that are not in master +# For each commit, try to find associated PR +git fetch origin develop master 2>/dev/null || true + +# Use git to get the list of commits +commits=$(git log --pretty=format:"%H|%s" origin/master..origin/develop | head -n $LIMIT) + +count=0 +displayed=0 +echo "Commits in $HEAD_BRANCH not in $BASE_BRANCH:" +echo "==============================================" +echo "" + +while IFS='|' read -r hash subject; do + ((count++)) + + # Try to find the PR for this commit + # Extract PR number, title, description, and labels + pr_response=$(gh api -X GET "/repos/$OWNER/$REPO/commits/$hash/pulls" \ + -H "Accept: application/vnd.github.v3+json" 2>/dev/null | \ + jq -r '.[0] | "\(.number)|\(.title)|\(.body // "No description")|\(.labels | map(.name) | join(","))"' 2>/dev/null || echo "||||") + + if [ -z "$pr_response" ] || [ "$pr_response" = "||||" ]; then + # If no PR found, skip if filter is active, otherwise show the commit + if [ -z "$FILTER_LABEL" ]; then + ((displayed++)) + echo "[$displayed] Commit: $hash" + echo " Subject: $subject" + echo " PR: Not found in GitHub" + echo "" + fi + else + IFS='|' read -r pr_num pr_title pr_desc pr_labels <<< "$pr_response" + + # Check if filter matches + if [ -n "$FILTER_LABEL" ]; then + # Only show if the label is in the labels list + if ! echo "$pr_labels" | grep -q "$FILTER_LABEL"; then + continue + fi + fi + + ((displayed++)) + echo "[$displayed] PR #$pr_num - $pr_title" + echo " Commit: $hash" + if [ -n "$pr_desc" ] && [ "$pr_desc" != "No description" ]; then + # Truncate description to 200 chars + desc_short="${pr_desc:0:200}" + [ ${#pr_desc} -gt 200 ] && desc_short+="..." + echo " Description: $desc_short" + fi + if [ -n "$pr_labels" ] && [ "$pr_labels" != "" ]; then + echo " Labels: $pr_labels" + fi + echo "" + fi +done <<< "$commits" + +echo "" +if [ -n "$FILTER_LABEL" ]; then + echo "Done. Showing $displayed PRs with label '$FILTER_LABEL' from $displayed commits checked." +else + echo "Done. Showing $displayed commits from $HEAD_BRANCH not in $BASE_BRANCH." +fi From fb678b9337cc1193032998d93a48827b6682f0ed Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 14:44:06 -0500 Subject: [PATCH 114/150] Update platform-native digest to 135b91e (#10300) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/native/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 87d8431a3..b276d2779 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/71ed55bb95feb3c43ebde1ec1e2e17643a424c04.zip + https://github.com/meshtastic/platform-native/archive/135b91e953db0b5f44d278f8ebd5b8d985fc03d8.zip framework = arduino build_src_filter = From 554188e90edc07ffed9b1170d01e38ed7b541447 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 25 Apr 2026 14:49:37 -0500 Subject: [PATCH 115/150] Fix main function to setup and loop for Unity test framework --- test/test_utf8/test_main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test_utf8/test_main.cpp b/test/test_utf8/test_main.cpp index 7ac64653d..5a074e96e 100644 --- a/test/test_utf8/test_main.cpp +++ b/test/test_utf8/test_main.cpp @@ -163,7 +163,7 @@ void test_above_max_codepoint() TEST_ASSERT_TRUE(sanitizeUtf8(buf, sizeof(buf))); } -int main(int argc, char **argv) +void setup() { UNITY_BEGIN(); @@ -191,5 +191,7 @@ int main(int argc, char **argv) RUN_TEST(test_valid_max_codepoint); RUN_TEST(test_above_max_codepoint); - return UNITY_END(); + exit(UNITY_END()); } + +void loop() {} From 7800dc3c8dba00aecb57bf6b2539930bb491bce2 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 25 Apr 2026 15:04:58 -0500 Subject: [PATCH 116/150] Enhance UTF-8 sanitization logic and add delays in test setup for reliable timing --- src/meshUtils.cpp | 4 ++-- test/test_transmit_history/test_main.cpp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/meshUtils.cpp b/src/meshUtils.cpp index 89c548887..f2ee20589 100644 --- a/src/meshUtils.cpp +++ b/src/meshUtils.cpp @@ -124,10 +124,10 @@ bool sanitizeUtf8(char *buf, size_t bufSize) if (!buf || bufSize == 0) return false; - // Ensure null-terminated within buffer + // Ensure null-terminated within buffer; report if we had to enforce it + bool replaced = (buf[bufSize - 1] != '\0'); buf[bufSize - 1] = '\0'; - bool replaced = false; size_t i = 0; size_t len = strlen(buf); diff --git a/test/test_transmit_history/test_main.cpp b/test/test_transmit_history/test_main.cpp index 3bd84b55c..c242aa646 100644 --- a/test/test_transmit_history/test_main.cpp +++ b/test/test_transmit_history/test_main.cpp @@ -303,6 +303,10 @@ void setup() { initializeTestEnvironment(); + // Wait for portduino's millis() clock to start ticking before tests run + testDelay(10); + testDelay(2000); + UNITY_BEGIN(); RUN_TEST(test_setLastSentToMesh_stores_millis); From aec0805a27c8eb47ad037210071462d40419e18b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 25 Apr 2026 15:32:19 -0500 Subject: [PATCH 117/150] Trying another guard approach --- src/mesh/HardwareRNG.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mesh/HardwareRNG.cpp b/src/mesh/HardwareRNG.cpp index 58a17d795..b79b0d012 100644 --- a/src/mesh/HardwareRNG.cpp +++ b/src/mesh/HardwareRNG.cpp @@ -48,9 +48,11 @@ bool mixWithLoRaEntropy(uint8_t *buffer, size_t length) // and return false so callers know no extra mixing occurred. RadioLibInterface *radio = RadioLibInterface::instance; if (!radio) { -#ifndef PIO_UNIT_TESTING - LOG_ERROR("No radio instance available to provide entropy"); -#endif + // This path can run during portduinoSetup() before the console is initialized, + // both for unit-test binaries and the simulator's meshtasticd; LOG_* dereferences `console`. + if (console) { + LOG_ERROR("No radio instance available to provide entropy"); + } return false; } From 4ccdd8009051bc13b1360c8949ed85562a954ca7 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 25 Apr 2026 20:42:14 -0500 Subject: [PATCH 118/150] Add search duration check for exceeding 15 minutes (#10293) * Add search duration check for exceeding 15 minutes Added a condition to check if the search duration exceeds 15 minutes, indicating too long of a search. * trunk * Fix searchedTooLong: move 15-min cap before UINT32_MAX check, cache elapsed, add constexpr Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/b7f74430-9e7e-4a6f-8095-6176c1eee972 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Update src/gps/GPSUpdateScheduling.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove dead UINT32_MAX branch from searchedTooLong Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/6dad5b56-902e-4d0e-90c1-038a9c2df364 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> Co-authored-by: Ben Meadors Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/gps/GPSUpdateScheduling.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gps/GPSUpdateScheduling.cpp b/src/gps/GPSUpdateScheduling.cpp index 5eaf7a8ba..53d6c833f 100644 --- a/src/gps/GPSUpdateScheduling.cpp +++ b/src/gps/GPSUpdateScheduling.cpp @@ -70,20 +70,25 @@ bool GPSUpdateScheduling::isUpdateDue() // Have we been searching for a GPS position for too long? bool GPSUpdateScheduling::searchedTooLong() { + constexpr uint32_t oneMinuteMs = 60UL * 1000UL; + constexpr uint32_t maxSearchClampMs = 15UL * oneMinuteMs; // Hard cap: 15 minutes is always too long + uint32_t elapsed = elapsedSearchMs(); + + // Anything over 15 minutes is too long, regardless of the broadcast interval. + // TODO: Make a smarter algorithm that backs off the search dwell time when not getting a lock. + if (elapsed > maxSearchClampMs) + return true; + uint32_t minimumOrConfiguredSecs = Default::getConfiguredOrMinimumValue(config.position.position_broadcast_secs, default_broadcast_interval_secs); uint32_t maxSearchMs = Default::getConfiguredOrDefaultMs(minimumOrConfiguredSecs, default_broadcast_interval_secs); - // If broadcast interval set to max, no such thing as "too long" - if (maxSearchMs == UINT32_MAX) - return false; // If we've been searching longer than our position broadcast interval: that's too long - else if (elapsedSearchMs() > maxSearchMs) + if (elapsed > maxSearchMs) return true; // Otherwise, not too long yet! - else - return false; + return false; } // Updates the predicted time-to-get-lock, by exponentially smoothing the latest observation From 87f1f9d349759d043d62647a2e44c2f953cc1372 Mon Sep 17 00:00:00 2001 From: nightjoker7 <47129685+nightjoker7@users.noreply.github.com> Date: Sun, 26 Apr 2026 21:02:42 -0500 Subject: [PATCH 119/150] fix(Router): localize p_encrypted to prevent recursive-overwrite leak (#10311) Router::handleReceived stores its allocCopy of the encrypted packet in the class member p_encrypted. callModules() invokes module replies that re-enter the router via MeshService::sendToMesh -> Router::sendLocal, which on a broadcast reply recursively calls handleReceived. The inner call overwrites the outer's p_encrypted without releasing it; on the way out it nulls the member, the outer release(p_encrypted) now releases nullptr, and the original allocation is permanently leaked. ~381 B per recursion. Promote p_encrypted to a function-local so each invocation owns its own copy for its full lifetime. The MQTT-publish null check at the call site (added by PR #9136 as a workaround for this bug) stays in place because allocCopy can still legitimately return nullptr on packetPool exhaustion. Copilot's review of PR #8999 (the original introduction) flagged this exact pattern at merge time: "Storing p_encrypted as a class member can cause issues with recursive or concurrent calls to handleReceived() since each call would overwrite the previous packet pointer." The historical reason for the member (S&F needing to retain the encrypted copy across calls) was satisfied differently by PR #9799 (ServerAPI converted to std::unique_ptr + cleanup on connection close), so the member is no longer load-bearing. Reproduces issues #9632 / #10101 / #8729 (heap leak when MeshMonitor connected; TCP drops on Station G2 / LILYGO ServerAPI dump abort). Hardware A/B on Station G2 under sustained TCP-API retry storm (open :4403, request config, disconnect mid-stream, repeat at ~0.6/s) - 9 min run: | Build | heapFree drift | rebootCount delta | | this patch | -1.5 KB (noise)| 0 | | stock 2.7.13 | -73 KB (8.1KB/min) | +1 (OOM crash) | Co-authored-by: Claude Opus 4.7 Co-authored-by: Ben Meadors --- src/mesh/Router.cpp | 11 +++++++---- src/mesh/Router.h | 3 --- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index b231261b5..eb5fd41ff 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -719,9 +719,13 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) // Also, we should set the time from the ISR and it should have msec level resolution p->rx_time = getValidTime(RTCQualityFromNet); // store the arrival timestamp for the phone - // Store a copy of encrypted packet for MQTT + // Store a copy of the encrypted packet for MQTT. + // Local, not a class member: handleReceived re-enters itself when a module + // reply broadcast goes through MeshService::sendToMesh -> Router::sendLocal, + // and a member would be silently overwritten without release on the inner + // call. Each invocation now owns its own copy (issue #9632, #10101, #8729). DEBUG_HEAP_BEFORE; - p_encrypted = packetPool.allocCopy(*p); + meshtastic_MeshPacket *p_encrypted = packetPool.allocCopy(*p); DEBUG_HEAP_AFTER("Router::handleReceived", p_encrypted); // Take those raw bytes and convert them back into a well structured protobuf we can understand @@ -815,8 +819,7 @@ void Router::handleReceived(meshtastic_MeshPacket *p, RxSource src) #endif } - packetPool.release(p_encrypted); // Release the encrypted packet - p_encrypted = nullptr; + packetPool.release(p_encrypted); // Release the encrypted packet (release() handles nullptr) } void Router::perhapsHandleReceived(meshtastic_MeshPacket *p) diff --git a/src/mesh/Router.h b/src/mesh/Router.h index 0f342d57b..bd4188693 100644 --- a/src/mesh/Router.h +++ b/src/mesh/Router.h @@ -92,9 +92,6 @@ class Router : protected concurrency::OSThread, protected PacketHistory before us */ uint32_t rxDupe = 0, txRelayCanceled = 0; - // pointer to the encrypted packet - meshtastic_MeshPacket *p_encrypted = nullptr; - protected: friend class RoutingModule; From 47a6c4c6a032d4444efc32f9659ab713649cc205 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 06:22:50 -0500 Subject: [PATCH 120/150] Upgrade trunk (#10317) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index f90f4f4ac..178a1cc9e 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,15 +8,15 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.524 - - renovate@43.141.0 + - checkov@3.2.525 + - renovate@43.142.0 - prettier@3.8.3 - trufflehog@3.95.2 - yamllint@1.38.0 - bandit@1.9.4 - trivy@0.70.0 - taplo@0.10.0 - - ruff@0.15.11 + - ruff@0.15.12 - isort@8.0.1 - markdownlint@0.48.0 - oxipng@10.1.1 From 126861fd1635963707b5ed3902f65aa1c1dbe23b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sun, 26 Apr 2026 22:07:07 -0500 Subject: [PATCH 121/150] Native MacOS hello world (#10309) * Native MacOS hello world * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update variants/native/portduino/platformio.ini Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: ensure null-termination in getSerialString() and handle len==0 Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/e5647919-2255-48ad-bcaa-7a2c2fdbf212 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --------- Co-authored-by: Jonathan Bennett Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- bin/build-native.sh | 3 +- src/Power.cpp | 2 + src/RedirectablePrint.h | 2 +- src/input/InputBroker.cpp | 3 ++ src/input/LinuxInput.h | 5 ++- src/input/LinuxInputImpl.h | 3 +- src/mesh/HardwareRNG.cpp | 12 ++++- src/mesh/MeshRadio.h | 27 ++++++++++++ src/mesh/RadioLibInterface.cpp | 2 +- src/mesh/RadioLibInterface.h | 2 +- src/mqtt/MQTT.cpp | 2 +- src/platform/portduino/PortduinoGlue.cpp | 18 +++++--- src/platform/portduino/USBHal.h | 10 +++-- variants/native/portduino.ini | 30 ++++++++----- variants/native/portduino/platformio.ini | 56 ++++++++++++++++++++++++ 15 files changed, 151 insertions(+), 26 deletions(-) diff --git a/bin/build-native.sh b/bin/build-native.sh index f35e46a87..e34b75580 100755 --- a/bin/build-native.sh +++ b/bin/build-native.sh @@ -31,5 +31,6 @@ basename=meshtasticd-$1-$VERSION pio pkg install --environment "$PIO_ENV" || platformioFailed pio run --environment "$PIO_ENV" || platformioFailed -cp "$BUILDDIR/meshtasticd" "$OUTDIR/meshtasticd_linux_$(uname -m)" +os_name=$(uname -s | tr '[:upper:]' '[:lower:]') +cp "$BUILDDIR/meshtasticd" "$OUTDIR/meshtasticd_${os_name}_$(uname -m)" cp bin/native-install.* $OUTDIR/ diff --git a/src/Power.cpp b/src/Power.cpp index ecdda8dd9..1ea3a64c2 100644 --- a/src/Power.cpp +++ b/src/Power.cpp @@ -755,8 +755,10 @@ void Power::reboot() rp2040.reboot(); #elif defined(ARCH_PORTDUINO) deInitApiServer(); +#ifdef __linux__ if (aLinuxInputImpl) aLinuxInputImpl->deInit(); +#endif SPI.end(); Wire.end(); Serial1.end(); diff --git a/src/RedirectablePrint.h b/src/RedirectablePrint.h index c66226171..8535933fc 100644 --- a/src/RedirectablePrint.h +++ b/src/RedirectablePrint.h @@ -1,8 +1,8 @@ #pragma once #include "../freertosinc.h" +#include "Print.h" #include "mesh/generated/meshtastic/mesh.pb.h" -#include #include #include diff --git a/src/input/InputBroker.cpp b/src/input/InputBroker.cpp index b7c9b27a9..393cbc0ec 100644 --- a/src/input/InputBroker.cpp +++ b/src/input/InputBroker.cpp @@ -390,8 +390,11 @@ void InputBroker::Init() seesawRotary = nullptr; } } +#ifdef __linux__ + // Linux evdev keyboard input only — macOS has no . aLinuxInputImpl = new LinuxInputImpl(); aLinuxInputImpl->init(); +#endif } #endif #if !MESHTASTIC_EXCLUDE_INPUTBROKER && HAS_TRACKBALL diff --git a/src/input/LinuxInput.h b/src/input/LinuxInput.h index 43d08493c..673d29b3c 100644 --- a/src/input/LinuxInput.h +++ b/src/input/LinuxInput.h @@ -1,5 +1,8 @@ #pragma once -#if ARCH_PORTDUINO +// Linux evdev keyboard input. Only compiled on Linux portduino targets; +// macOS / non-Linux builds have no or epoll, and the +// headless build doesn't need real keyboards anyway. +#if ARCH_PORTDUINO && defined(__linux__) #include "InputBroker.h" #include "concurrency/OSThread.h" #include diff --git a/src/input/LinuxInputImpl.h b/src/input/LinuxInputImpl.h index e734b0294..716c6619a 100644 --- a/src/input/LinuxInputImpl.h +++ b/src/input/LinuxInputImpl.h @@ -1,4 +1,5 @@ -#ifdef ARCH_PORTDUINO +// Linux evdev impl. Same Linux-only gating as LinuxInput.h. +#if defined(ARCH_PORTDUINO) && defined(__linux__) #pragma once #include "LinuxInput.h" #include "main.h" diff --git a/src/mesh/HardwareRNG.cpp b/src/mesh/HardwareRNG.cpp index b79b0d012..a34a9477c 100644 --- a/src/mesh/HardwareRNG.cpp +++ b/src/mesh/HardwareRNG.cpp @@ -19,8 +19,12 @@ extern Adafruit_nRFCrypto nRFCrypto; #include #elif defined(ARCH_PORTDUINO) #include -#include #include +#ifdef __linux__ +#include // getrandom() +#else +#include // arc4random_buf() on Darwin/BSD +#endif #endif namespace HardwareRNG @@ -119,10 +123,16 @@ bool fill(uint8_t *buffer, size_t length, bool useRadioEntropy) filled = true; #elif defined(ARCH_PORTDUINO) // Prefer the host OS RNG first when running under Portduino. +#ifdef __linux__ ssize_t generated = ::getrandom(buffer, length, 0); if (generated == static_cast(length)) { filled = true; } +#else + // arc4random_buf is available on Darwin/BSD and cannot fail. + ::arc4random_buf(buffer, length); + filled = true; +#endif if (!filled) { fillWithRandomDevice(buffer, length); diff --git a/src/mesh/MeshRadio.h b/src/mesh/MeshRadio.h index 646ca86eb..1b2fd0962 100644 --- a/src/mesh/MeshRadio.h +++ b/src/mesh/MeshRadio.h @@ -6,6 +6,33 @@ #include "configuration.h" #include "detect/LoRaRadioType.h" +// Sentinel marking the end of a modem preset array. Declared `const` rather +// than `constexpr` because the cast from 0xFF to the enum is out-of-range and +// therefore not a valid constant expression on Clang 16+ (Apple Clang on +// macOS). The value is only ever compared at runtime, so static-init is fine. +static const meshtastic_Config_LoRaConfig_ModemPreset MODEM_PRESET_END = + static_cast(0xFF); + +// Region profile: bundles the preset list with regulatory parameters shared across regions +struct RegionProfile { + const meshtastic_Config_LoRaConfig_ModemPreset *presets; // sentinel-terminated; first entry is the default + float spacing; // gaps between radio channels + float padding; // padding at each side of the "operating channel" + bool audioPermitted; + bool licensedOnly; // a region profile for licensed operators only + int8_t textThrottle; // throttle for text - future expansion + int8_t positionThrottle; // throttle for location data - future expansion + int8_t telemetryThrottle; // throttle for telemetry - future expansion + uint8_t overrideSlot; // a per-region override slot for if we need to fix it in place +}; + +extern const RegionProfile PROFILE_STD; +extern const RegionProfile PROFILE_EU868; +extern const RegionProfile PROFILE_UNDEF; +// extern const RegionProfile PROFILE_LITE; +// extern const RegionProfile PROFILE_NARROW; +// extern const RegionProfile PROFILE_HAM; + // Map from old region names to new region enums struct RegionInfo { meshtastic_Config_LoRaConfig_RegionCode code; diff --git a/src/mesh/RadioLibInterface.cpp b/src/mesh/RadioLibInterface.cpp index 7ef707e0d..5121ac433 100644 --- a/src/mesh/RadioLibInterface.cpp +++ b/src/mesh/RadioLibInterface.cpp @@ -109,7 +109,7 @@ bool RadioLibInterface::canSendImmediately() return true; } -bool RadioLibInterface::receiveDetected(uint16_t irq, ulong syncWordHeaderValidFlag, ulong preambleDetectedFlag) +bool RadioLibInterface::receiveDetected(uint16_t irq, unsigned long syncWordHeaderValidFlag, unsigned long preambleDetectedFlag) { bool detected = (irq & (syncWordHeaderValidFlag | preambleDetectedFlag)); // Handle false detections diff --git a/src/mesh/RadioLibInterface.h b/src/mesh/RadioLibInterface.h index 310ca76bb..9ee608214 100644 --- a/src/mesh/RadioLibInterface.h +++ b/src/mesh/RadioLibInterface.h @@ -213,7 +213,7 @@ class RadioLibInterface : public RadioInterface, protected concurrency::Notified protected: uint32_t activeReceiveStart = 0; - bool receiveDetected(uint16_t irq, ulong syncWordHeaderValidFlag, ulong preambleDetectedFlag); + bool receiveDetected(uint16_t irq, unsigned long syncWordHeaderValidFlag, unsigned long preambleDetectedFlag); /** Do any hardware setup needed on entry into send configuration for the radio. * Subclasses can customize, but must also call this base method */ diff --git a/src/mqtt/MQTT.cpp b/src/mqtt/MQTT.cpp index ac022a1ab..902fd1c2b 100644 --- a/src/mqtt/MQTT.cpp +++ b/src/mqtt/MQTT.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include "IPAddress.h" #if defined(ARCH_PORTDUINO) #include #elif !defined(ntohl) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 660bad0f2..6f8077720 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -9,13 +9,10 @@ #include "PortduinoGlue.h" #include "SHA256.h" #include "api/ServerAPI.h" -#include "linux/gpio/LinuxGPIOPin.h" #include "meshUtils.h" #include #include #include -#include -#include #include #include #include @@ -25,6 +22,12 @@ #include #include +#ifdef PORTDUINO_LINUX_HARDWARE +#include "linux/gpio/LinuxGPIOPin.h" +#include +#include +#endif + #ifdef PORTDUINO_LINUX_HARDWARE #include #endif @@ -130,9 +133,9 @@ void getMacAddr(uint8_t *dmac) } } else if (portduino_config.mac_address.length() > 11) { MAC_from_string(portduino_config.mac_address, dmac); - exit; + return; } else { - +#ifdef PORTDUINO_LINUX_HARDWARE struct hci_dev_info di = {0}; di.dev_id = 0; bdaddr_t bdaddr; @@ -152,6 +155,11 @@ void getMacAddr(uint8_t *dmac) dmac[3] = di.bdaddr.b[2]; dmac[4] = di.bdaddr.b[1]; dmac[5] = di.bdaddr.b[0]; +#else + // No BlueZ on non-Linux hosts (e.g. macOS). Leave dmac at its default; + // the caller can override via the --hwid CLI flag or the YAML config. + (void)dmac; +#endif } } diff --git a/src/platform/portduino/USBHal.h b/src/platform/portduino/USBHal.h index 1725763f2..9496b2ccb 100644 --- a/src/platform/portduino/USBHal.h +++ b/src/platform/portduino/USBHal.h @@ -5,6 +5,7 @@ #include "platform/portduino/PortduinoGlue.h" #include #include +#include #include #include #include @@ -34,7 +35,7 @@ class Ch341Hal : public RadioLibHal : RadioLibHal(PI_INPUT, PI_OUTPUT, PI_LOW, PI_HIGH, PI_RISING, PI_FALLING) { if (serial != "") { - strncpy(pinedio.serial_number, serial.c_str(), 8); + std::strncpy(pinedio.serial_number, serial.c_str(), 8); pinedio_set_option(&pinedio, PINEDIO_OPTION_SEARCH_SERIAL, 1); } // LOG_INFO("USB Serial: %s", pinedio.serial_number); @@ -59,8 +60,11 @@ class Ch341Hal : public RadioLibHal void getSerialString(char *_serial, size_t len) { - len = len > 8 ? 8 : len; - strncpy(_serial, pinedio.serial_number, len); + if (len == 0) + return; + size_t bytesCopied = (len - 1) < 8 ? (len - 1) : 8; + std::strncpy(_serial, pinedio.serial_number, bytesCopied); + _serial[bytesCopied] = '\0'; } void getProductString(char *_product_string, size_t len) diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index b276d2779..35c8c6697 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/135b91e953db0b5f44d278f8ebd5b8d985fc03d8.zip + https://github.com/meshtastic/platform-native/archive/4ea5e09ac7d51a593e12ec7c1ebb6cd06745ce53.zip framework = arduino build_src_filter = @@ -37,25 +37,35 @@ lib_deps = # renovate: datasource=github-tags depName=Adafruit_BME680 packageName=adafruit/Adafruit_BME680 https://github.com/adafruit/Adafruit_BME680/archive/refs/tags/2.0.6.zip -build_flags = +; Cross-platform build flags shared between native (Linux) and native-macos builds. +; Anything Linux-only (libbluetooth, libgpiod, libi2c, /sys/class/gpio, +; PORTDUINO_LINUX_HARDWARE, glibc-style _FORTIFY_SOURCE) goes in `build_flags` +; instead. UDP multicast also lives there because the firmware's +; UdpMulticastHandler.h unconditionally `#include ` on non-NRF52 +; targets, which requires the framework's bundled WiFi shim that we +; lib_ignore on macOS. +build_flags_common = ${arduino_base.build_flags} -D ARCH_PORTDUINO -fPIC - -D_FORTIFY_SOURCE=2 - -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 -Isrc/platform/portduino -DRADIOLIB_EEPROM_UNSUPPORTED - -DPORTDUINO_LINUX_HARDWARE - -DHAS_UDP_MULTICAST=1 -lpthread - -lstdc++fs - -lbluetooth - -lgpiod -lyaml-cpp - -li2c -luv -std=gnu17 -std=gnu++17 + +build_flags = + ${portduino_base.build_flags_common} + -DHAS_UDP_MULTICAST=1 + -D_FORTIFY_SOURCE=2 + -fstack-protector-all -Wstack-protector --param ssp-buffer-size=4 + -DPORTDUINO_LINUX_HARDWARE + -lstdc++fs + -lbluetooth + -lgpiod + -li2c lib_ignore = Adafruit NeoPixel Adafruit ST7735 and ST7789 Library diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index 045e3edea..c497d0c17 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -117,3 +117,59 @@ build_flags = -lgcov --coverage -fprofile-abs-path -fsanitize=address ${env:nati test_testing_command = ${platformio.build_dir}/${this.__env__}/meshtasticd -s + +; --------------------------------------------------------------------------- +; Native build for macOS (Darwin / arm64 + x86_64). Headless meshtasticd that +; runs in SimRadio mode (`-s`) or against real LoRa hardware via a CH341 +; USB-SPI bridge. No BlueZ, libgpiod, or Linux I2C — those require Linux. +; +; Prerequisites (Homebrew): +; brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config +; +; The macOS-side patches now live upstream: +; * meshtastic/platform-native — `String.h`-shadow shim, `-Wno-enum-constexpr-conversion`, +; empty-variant-dir guard. Pulled via `portduino_base.platform` zip pin. +; * meshtastic/framework-portduino — LinuxHardwareI2C macOS stubs, AsyncUDP +; SOCK_NONBLOCK fallback, Common.h __APPLE__ guard, WiFiServer.cpp extern-C +; fix, package.json URL refresh. Pulled by platform-native at its pinned commit. +; This env therefore only carries the firmware-side build flags and src filter. +; --------------------------------------------------------------------------- +[env:native-macos] +extends = native_base +; Apple's ld doesn't accept GNU ld's `-Wl,-Map,` syntax (inherited from +; the top-level platformio.ini). Strip it; the linker map isn't useful for +; the macOS dev loop anyway, and Apple ld's equivalent (`-Wl,-map,`) +; uses different argument shape. +build_unflags = -Wl,-Map,"${platformio.build_dir}"/output.map +build_flags = ${portduino_base.build_flags_common} + -I variants/native/portduino + -I/opt/homebrew/include + -I/opt/homebrew/opt/argp-standalone/include + -I/opt/homebrew/opt/yaml-cpp/include + -L/opt/homebrew/lib + -L/opt/homebrew/opt/argp-standalone/lib + -L/opt/homebrew/opt/yaml-cpp/lib + -largp + -DPORTDUINO_DARWIN + ; Headless build — variants/native/portduino/variant.h would otherwise + ; default HAS_SCREEN to 1 and pull in screen-renderer source that uses + ; VLA-with-initializer (a GNU/GCC extension Apple Clang rejects). + ; MESHTASTIC_EXCLUDE_SCREEN gates the optional `screen->setHeading(...)`- + ; style screen-driver hooks scattered through sensor sources. + -DHAS_SCREEN=0 + -DMESHTASTIC_EXCLUDE_SCREEN=1 + !pkg-config --libs openssl --silence-errors || : +; src/input/Linux*.{cpp,h} drive evdev (``) which doesn't exist +; on macOS. graphics/Panel_sdl.* and graphics/TFTDisplay.cpp pull LovyanGFX +; (which we lib_ignore on macOS for the issue). Neither is needed +; for the headless build. +build_src_filter = ${native_base.build_src_filter} + - + - + - + - +; LovyanGFX includes (Linux-only) and is only needed by TFT +; variants — not relevant for the headless macOS build. +lib_ignore = + ${portduino_base.lib_ignore} + LovyanGFX From 4234fe6f8649b0f64fb29ebd7ee8da21fc58ddea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 07:50:01 -0500 Subject: [PATCH 122/150] Update meshtastic/device-ui digest to 7289329 (#10313) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Ben Meadors --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 102c93a31..3f8f77228 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/56e1da4e7d30abcd746a2092a30e422f8cf5fc2b.zip + https://github.com/meshtastic/device-ui/archive/728932970996ec91bdb93cb6dae29c2cb70c66e2.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 048e5187baa717341de22eac6b5f1c107cf8f42c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 07:50:13 -0500 Subject: [PATCH 123/150] Update platform-native digest to 4ea5e09 (#10314) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> From d7db0f5829876e22d7fcf0640566d0f40d87ec24 Mon Sep 17 00:00:00 2001 From: Quency-D <55523105+Quency-D@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:25:19 +0800 Subject: [PATCH 124/150] add heltec-v4-r8 board (#10268) * add heltec-v4-r8 board * Fixed default SPI pin and macro definition errors. * update platformio.ini according device-ui LGFX display definitions Co-authored-by: Copilot * fix commit reference --------- Co-authored-by: Ben Meadors Co-authored-by: mverch67 Co-authored-by: Copilot Co-authored-by: Manuel <71137295+mverch67@users.noreply.github.com> --- boards/heltec_v4_r8.json | 43 ++++++ src/configuration.h | 3 + src/graphics/TFTDisplay.cpp | 19 ++- src/mesh/NodeDB.cpp | 2 +- variants/esp32s3/heltec_v4/platformio.ini | 4 +- variants/esp32s3/heltec_v4_r8/pins_arduino.h | 56 +++++++ variants/esp32s3/heltec_v4_r8/platformio.ini | 145 +++++++++++++++++++ variants/esp32s3/heltec_v4_r8/variant.h | 72 +++++++++ 8 files changed, 338 insertions(+), 6 deletions(-) create mode 100644 boards/heltec_v4_r8.json create mode 100644 variants/esp32s3/heltec_v4_r8/pins_arduino.h create mode 100644 variants/esp32s3/heltec_v4_r8/platformio.ini create mode 100644 variants/esp32s3/heltec_v4_r8/variant.h diff --git a/boards/heltec_v4_r8.json b/boards/heltec_v4_r8.json new file mode 100644 index 000000000..6dd97c84b --- /dev/null +++ b/boards/heltec_v4_r8.json @@ -0,0 +1,43 @@ +{ + "build": { + "arduino": { + "ldscript": "esp32s3_out.ld", + "partitions": "default_16MB.csv", + "memory_type": "qio_opi" + }, + "core": "esp32", + "extra_flags": [ + "-DBOARD_HAS_PSRAM", + "-DARDUINO_USB_CDC_ON_BOOT=1", + "-DARDUINO_USB_MODE=1", + "-DARDUINO_RUNNING_CORE=1", + "-DARDUINO_EVENT_RUNNING_CORE=1" + ], + "f_cpu": "240000000L", + "f_flash": "80000000L", + "flash_mode": "qio", + "psram_type": "opi", + "hwids": [["0x303A", "0x1001"]], + "mcu": "esp32s3", + "variant": "heltec_v4_r8" + }, + "connectivity": ["wifi", "bluetooth", "lora"], + "debug": { + "default_tool": "esp-builtin", + "onboard_tools": ["esp-builtin"], + "openocd_target": "esp32s3.cfg" + }, + "frameworks": ["arduino", "espidf"], + "name": "heltec_wifi_lora_32 v4 r8 (16 MB FLASH, 8 MB PSRAM)", + "upload": { + "flash_size": "16MB", + "maximum_ram_size": 327680, + "maximum_size": 16777216, + "use_1200bps_touch": true, + "wait_for_upload_port": true, + "require_upload_port": true, + "speed": 921600 + }, + "url": "https://heltec.org/", + "vendor": "heltec" +} diff --git a/src/configuration.h b/src/configuration.h index 0ce28ed28..2c084174d 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -157,6 +157,9 @@ along with this program. If not, see . #elif defined(HELTEC_MESH_NODE_T096) #define NUM_PA_POINTS 22 #define TX_GAIN_LORA 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 13, 13, 13, 12, 11, 10, 9, 8, 7 +#elif defined(HELTEC_V4_R8) +#define NUM_PA_POINTS 22 +#define TX_GAIN_LORA 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 12, 12, 11, 11, 10, 9, 8, 7 #else // If a board enables USE_KCT8103L_PA but does not match a known variant and has // not already provided a PA curve, fail at compile time to avoid unsafe defaults. diff --git a/src/graphics/TFTDisplay.cpp b/src/graphics/TFTDisplay.cpp index 005ead292..b69d79483 100644 --- a/src/graphics/TFTDisplay.cpp +++ b/src/graphics/TFTDisplay.cpp @@ -428,7 +428,7 @@ static LGFX *tft = nullptr; #elif defined(ST7789_CS) #include // Graphics and font library for ST7735 driver chip -#ifdef HELTEC_V4_TFT +#if defined(HELTEC_V4_TFT) || defined(HELTEC_V4_R8_TFT) #include "chsc6x.h" #include "lgfx/v1/Touch.hpp" namespace lgfx @@ -450,7 +450,11 @@ class TOUCH_CHSC6X : public ITouch bool init(void) override { if (chsc6xTouch == nullptr) { +#if (TOUCH_I2C_PORT == 1) chsc6xTouch = new chsc6x(&Wire1, TOUCH_SDA_PIN, TOUCH_SCL_PIN, TOUCH_INT_PIN, TOUCH_RST_PIN); +#else + chsc6xTouch = new chsc6x(&Wire, TOUCH_SDA_PIN, TOUCH_SCL_PIN, TOUCH_INT_PIN, TOUCH_RST_PIN); +#endif } chsc6xTouch->chsc6x_init(); return true; @@ -487,7 +491,7 @@ class LGFX : public lgfx::LGFX_Device #if HAS_TOUCHSCREEN #if defined(T_WATCH_S3) || defined(ELECROW) lgfx::Touch_FT5x06 _touch_instance; -#elif defined(HELTEC_V4_TFT) +#elif defined(HELTEC_V4_TFT) || defined(HELTEC_V4_R8_TFT) lgfx::TOUCH_CHSC6X _touch_instance; #else lgfx::Touch_GT911 _touch_instance; @@ -506,7 +510,11 @@ class LGFX : public lgfx::LGFX_Device cfg.freq_write = SPI_FREQUENCY; // SPI clock for transmission (up to 80MHz, rounded to the value obtained by dividing // 80MHz by an integer) cfg.freq_read = SPI_READ_FREQUENCY; // SPI clock when receiving - cfg.spi_3wire = false; +#ifdef SPI_3_WIRE + cfg.spi_3wire = SPI_3_WIRE; +#else + cfg.spi_3wire = true; // Set to true if reception is done on the MOSI pin +#endif cfg.use_lock = true; // Set to true to use transaction locking cfg.dma_channel = SPI_DMA_CH_AUTO; // SPI_DMA_CH_AUTO; // Set DMA channel to use (0=not use DMA / 1=1ch / 2=ch / // SPI_DMA_CH_AUTO=auto setting) @@ -556,8 +564,11 @@ class LGFX : public lgfx::LGFX_Device cfg.rgb_order = false; // Set to true if the panel's red and blue are swapped cfg.dlen_16bit = false; // Set to true for panels that transmit data length in 16-bit units with 16-bit parallel or SPI +#if defined(HAS_SDCARD) cfg.bus_shared = true; // If the bus is shared with the SD card, set to true (bus control with drawJpgFile etc.) - +#else + cfg.bus_shared = false; +#endif // Set the following only when the display is shifted with a driver with a variable number of pixels, such as the // ST7735 or ILI9163. // cfg.memory_width = TFT_WIDTH; // Maximum width supported by the driver IC diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 33500830d..4b79882bd 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -688,7 +688,7 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) strncpy(config.network.ntp_server, "meshtastic.pool.ntp.org", 32); #if (defined(T_DECK) || defined(T_WATCH_S3) || defined(UNPHONE) || defined(PICOMPUTER_S3) || defined(SENSECAP_INDICATOR) || \ - defined(ELECROW_PANEL) || defined(HELTEC_V4_TFT)) && \ + defined(ELECROW_PANEL) || defined(HELTEC_V4_TFT) || defined(HELTEC_V4_R8_TFT)) && \ HAS_TFT // switch BT off by default; use TFT programming mode or hotkey to enable config.bluetooth.enabled = false; diff --git a/variants/esp32s3/heltec_v4/platformio.ini b/variants/esp32s3/heltec_v4/platformio.ini index 5a5004a45..103cac941 100644 --- a/variants/esp32s3/heltec_v4/platformio.ini +++ b/variants/esp32s3/heltec_v4/platformio.ini @@ -89,8 +89,10 @@ build_flags = -D VIEW_240x320 -D DISPLAY_SET_RESOLUTION -D DISPLAY_SIZE=240x320 ; portrait mode + -D LGFX_SPI_3WIRE=true -D LGFX_PIN_SCK=17 -D LGFX_PIN_MOSI=33 + -D LGFX_PIN_MISO=-1 -D LGFX_PIN_DC=16 -D LGFX_PIN_CS=15 -D LGFX_PIN_BL=21 @@ -123,7 +125,7 @@ build_flags = -D SCREEN_TRANSITION_FRAMERATE=5 -D BRIGHTNESS_DEFAULT=130 ; Medium Low Brightness -D HAS_TOUCHSCREEN=1 - -D TOUCH_I2C_PORT=0 + -D TOUCH_I2C_PORT=1 -D TOUCH_SLAVE_ADDRESS=0x2E -D SCREEN_TOUCH_INT=TOUCH_INT_PIN -D SCREEN_TOUCH_RST=TOUCH_RST_PIN diff --git a/variants/esp32s3/heltec_v4_r8/pins_arduino.h b/variants/esp32s3/heltec_v4_r8/pins_arduino.h new file mode 100644 index 000000000..631f07513 --- /dev/null +++ b/variants/esp32s3/heltec_v4_r8/pins_arduino.h @@ -0,0 +1,56 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define USB_VID 0x303a +#define USB_PID 0x1001 + +static const uint8_t TX = 43; +static const uint8_t RX = 44; + +static const uint8_t SDA = 17; +static const uint8_t SCL = 18; + +static const uint8_t SS = 8; +static const uint8_t MOSI = 10; +static const uint8_t MISO = 11; +static const uint8_t SCK = 9; + +static const uint8_t A0 = 1; +static const uint8_t A1 = 2; +static const uint8_t A2 = 3; +static const uint8_t A3 = 4; +static const uint8_t A4 = 5; +static const uint8_t A5 = 6; +static const uint8_t A6 = 7; +static const uint8_t A7 = 8; +static const uint8_t A8 = 9; +static const uint8_t A9 = 10; +static const uint8_t A10 = 11; +static const uint8_t A11 = 12; +static const uint8_t A12 = 13; +static const uint8_t A13 = 14; +static const uint8_t A14 = 15; +static const uint8_t A15 = 16; +static const uint8_t A16 = 17; +static const uint8_t A17 = 18; +static const uint8_t A18 = 19; +static const uint8_t A19 = 20; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T3 = 3; +static const uint8_t T4 = 4; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +#endif /* Pins_Arduino_h */ \ No newline at end of file diff --git a/variants/esp32s3/heltec_v4_r8/platformio.ini b/variants/esp32s3/heltec_v4_r8/platformio.ini new file mode 100644 index 000000000..747cc8c49 --- /dev/null +++ b/variants/esp32s3/heltec_v4_r8/platformio.ini @@ -0,0 +1,145 @@ +[heltec_v4_r8_base] +extends = esp32s3_base +board = heltec_v4_r8 +board_check = true +board_build.partitions = default_16MB.csv +build_flags = + ${esp32s3_base.build_flags} + -D HELTEC_V4_R8 + -D HAS_LORA_FEM=1 + -D BOARD_HAS_PSRAM + -I variants/esp32s3/heltec_v4_r8 + -ULED_BUILTIN + +[env:heltec-v4-r8-oled] +custom_meshtastic_hw_model = 132 +custom_meshtastic_hw_model_slug = HELTEC_V4_R8 +custom_meshtastic_architecture = esp32-s3 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = Heltec V4 R8 +custom_meshtastic_images = heltec_v4_r8.svg +custom_meshtastic_tags = Heltec +custom_meshtastic_requires_dfu = true +custom_meshtastic_partition_scheme = 16MB + +extends = heltec_v4_r8_base +build_flags = + ${heltec_v4_r8_base.build_flags} + -D HELTEC_V4_R8_OLED + -D USE_SSD1306 ; Heltec_v4_R8 has an SSD1315 display (compatible with SSD1306 driver) + -D LED_POWER=46 + -D RESET_OLED=21 + -D I2C_SDA=17 + -D I2C_SCL=18 + +[env:heltec-v4-r8-tft] +custom_meshtastic_hw_model = 132 +custom_meshtastic_hw_model_slug = HELTEC_V4_R8 +custom_meshtastic_architecture = esp32-s3 +custom_meshtastic_actively_supported = true +custom_meshtastic_support_level = 1 +custom_meshtastic_display_name = Heltec V4 R8 TFT +custom_meshtastic_images = heltec_v4_r8_tft.svg +custom_meshtastic_tags = Heltec +custom_meshtastic_requires_dfu = true +custom_meshtastic_partition_scheme = 16MB + +extends = heltec_v4_r8_base +build_flags = + ${heltec_v4_r8_base.build_flags} ;-Os + -D HELTEC_V4_R8_TFT + -D I2C_SDA=17 + -D I2C_SCL=18 + -D PIN_BUTTON2=46 + -D ALT_BUTTON_PIN=PIN_BUTTON2 + -D ALT_BUTTON_ACTIVE_LOW=false + -D PIN_BUZZER=4 + -D USE_PIN_BUZZER=PIN_BUZZER + -D CONFIG_ARDUHAL_LOG_COLORS + -D RADIOLIB_DEBUG_SPI=0 + -D RADIOLIB_DEBUG_PROTOCOL=0 + -D RADIOLIB_DEBUG_BASIC=0 + -D RADIOLIB_VERBOSE_ASSERT=0 + -D RADIOLIB_SPI_PARANOID=0 + -D CONFIG_DISABLE_HAL_LOCKS=1 + -D INPUTDRIVER_BUTTON_TYPE=0 + -D HAS_SCREEN=1 + -D HAS_TFT=1 + -D RAM_SIZE=5120 + -D LV_LVGL_H_INCLUDE_SIMPLE + -D LV_CONF_INCLUDE_SIMPLE + -D LV_COMP_CONF_INCLUDE_SIMPLE + -D LV_USE_SYSMON=0 + -D LV_USE_PROFILER=0 + -D LV_USE_PERF_MONITOR=0 + -D LV_USE_MEM_MONITOR=0 + -D LV_USE_LOG=0 + -D LV_BUILD_TEST=0 + -D USE_LOG_DEBUG + -D LOG_DEBUG_INC=\"DebugConfiguration.h\" + -D USE_PACKET_API + -D LGFX_DRIVER=LGFX_HELTEC_V4_TFT + -D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_HELTEC_V4_TFT.h\" + -D VIEW_240x320 + -D DISPLAY_SET_RESOLUTION + -D DISPLAY_SIZE=240x320 ; portrait mode + -D LGFX_SPI_3WIRE=false + -D LGFX_PIN_SCK=16 + -D LGFX_PIN_MOSI=15 + -D LGFX_PIN_MISO=45 + -D LGFX_PIN_DC=48 + -D LGFX_PIN_CS=47 + -D LGFX_PIN_BL=44 + -D LGFX_PIN_RST=21 + -D CUSTOM_TOUCH_DRIVER + -D TOUCH_SDA_PIN=I2C_SDA + -D TOUCH_SCL_PIN=I2C_SCL + -D TOUCH_INT_PIN=-1 + -D TOUCH_RST_PIN=-1 +;base UI + -D TFT_CS=LGFX_PIN_CS + -D ST7789_CS=TFT_CS + -D ST7789_RS=LGFX_PIN_DC + -D ST7789_SDA=LGFX_PIN_MOSI + -D ST7789_SCK=LGFX_PIN_SCK + -D ST7789_RESET=LGFX_PIN_RST + -D ST7789_MISO=LGFX_PIN_MISO + -D ST7789_BUSY=-1 + -D ST7789_BL=LGFX_PIN_BL + -D ST7789_SPI_HOST=SPI3_HOST + -D TFT_BL=ST7789_BL + -D SPI_FREQUENCY=75000000 + -D SPI_READ_FREQUENCY=SPI_FREQUENCY + -D SPI_3_WIRE=false + -D TFT_HEIGHT=320 + -D TFT_WIDTH=240 + -D TFT_OFFSET_X=0 + -D TFT_OFFSET_Y=0 + -D TFT_OFFSET_ROTATION=0 + -D SCREEN_ROTATE + -D SCREEN_TRANSITION_FRAMERATE=5 + -D BRIGHTNESS_DEFAULT=130 ; Medium Low Brightness + -D HAS_TOUCHSCREEN=1 + -D TOUCH_I2C_PORT=0 + -D TOUCH_SLAVE_ADDRESS=0x2E + -D SCREEN_TOUCH_INT=TOUCH_INT_PIN + -D SCREEN_TOUCH_RST=TOUCH_RST_PIN + +; Have SPI interface SD card slot + -D HAS_SDCARD + -D SDCARD_USE_SPI1 + -D SDCARD_USER_SPI_BEGIN + -D SPI_MOSI=LGFX_PIN_MOSI + -D SPI_SCK=LGFX_PIN_SCK + -D SPI_MISO=LGFX_PIN_MISO + -D SPI_CS=3 + -D SDCARD_CS=SPI_CS + -D SD_SPI_FREQUENCY=SPI_FREQUENCY + +lib_deps = ${heltec_v4_r8_base.lib_deps} + ${device-ui_base.lib_deps} + # renovate: datasource=custom.pio depName=LovyanGFX packageName=lovyan03/library/LovyanGFX + lovyan03/LovyanGFX@1.2.19 + # renovate: datasource=git-refs depName=Quency-D_chsc6x packageName=https://github.com/Quency-D/chsc6x gitBranch=master + https://github.com/Quency-D/chsc6x/archive/3b2b6cebf3177b3e2c33d06e07909b0b10159516.zip \ No newline at end of file diff --git a/variants/esp32s3/heltec_v4_r8/variant.h b/variants/esp32s3/heltec_v4_r8/variant.h new file mode 100644 index 000000000..1f638f24c --- /dev/null +++ b/variants/esp32s3/heltec_v4_r8/variant.h @@ -0,0 +1,72 @@ +#define VEXT_ENABLE 40 // active low, powers the oled display and the lora antenna boost +#define VEXT_ON_VALUE LOW +#define BUTTON_PIN 0 + +#define BATTERY_PIN 1 // A battery voltage measurement pin, voltage divider connected here to measure battery voltage +#define ADC_CHANNEL ADC1_GPIO1_CHANNEL +#define ADC_ATTENUATION ADC_ATTEN_DB_2_5 // lower dB for high resistance voltage divider +#define ADC_MULTIPLIER 4.9 * 1.035 + +#define USE_SX1262 +#define LORA_DIO0 -1 // a No connect on the SX1262 module +#define LORA_RESET 12 +#define LORA_DIO1 14 // SX1262 IRQ +#define LORA_DIO2 13 // SX1262 BUSY +#define LORA_DIO3 // Not connected on PCB, but internally on the TTGO SX1262, if DIO3 is high the TCXO is enabled + +#define LORA_SCK 9 +#define LORA_MISO 11 +#define LORA_MOSI 10 +#define LORA_CS 8 + +#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 + +// Enable Traffic Management Module for Heltec V4 +#ifndef HAS_TRAFFIC_MANAGEMENT +#define HAS_TRAFFIC_MANAGEMENT 1 +#endif +#ifndef TRAFFIC_MANAGEMENT_CACHE_SIZE +#define TRAFFIC_MANAGEMENT_CACHE_SIZE 2048 +#endif + +// ---- KCT8103L RF FRONT END CONFIGURATION ---- +// The Heltec V4.3 uses a KCT8103L FEM chip with integrated PA and LNA +// RF path: SX1262 -> Pi attenuator -> KCT8103L PA -> Antenna +// Control logic (from KCT8103L datasheet): +// Transmit PA: CSD=1, CTX=1, CPS=1 +// Receive LNA: CSD=1, CTX=0, CPS=X (21dB gain, 1.9dB NF) +// Receive bypass: CSD=1, CTX=1, CPS=0 +// Shutdown: CSD=0, CTX=X, CPS=X +// Pin mapping: +// CPS (pin 5) -> SX1262 DIO2: TX/RX path select (automatic via SX126X_DIO2_AS_RF_SWITCH) +// CSD (pin 4) -> GPIO2: Chip enable (HIGH=on, LOW=shutdown) +// CTX (pin 6) -> GPIO5: Switch between Receive LNA Mode and Receive Bypass Mode. (HIGH=RX bypass, LOW=RX LNA) +// VCC0/VCC1 -> Vfem via U3 LDO, controlled by GPIO7 +// KCT8103L FEM: TX/RX path switching is handled by DIO2 -> CPS pin (via SX126X_DIO2_AS_RF_SWITCH) + +#define USE_KCT8103L_PA +#define LORA_PA_POWER 7 // VFEM_Ctrl - KCT8103L LDO power enable +#define LORA_KCT8103L_PA_CSD 2 // CSD - KCT8103L chip enable (HIGH=on) +#define LORA_KCT8103L_PA_CTX 5 // CTX - Switch between Receive LNA Mode and Receive Bypass Mode. (HIGH=RX bypass, LOW=RX LNA) + +#if HAS_TFT +#define USE_TFTDISPLAY 1 +#endif +/* + * GPS pins + */ +#define GPS_L76K +#define PIN_GPS_EN (42) +#define GPS_EN_ACTIVE LOW +#define PERIPHERAL_WARMUP_MS 1000 // Make sure I2C QuickLink has stable power before continuing +#define PIN_GPS_PPS (41) +// Seems to be missing on this new board +#define GPS_TX_PIN (38) // This is for bits going TOWARDS the CPU +#define GPS_RX_PIN (39) // This is for bits going TOWARDS the GPS +#define GPS_THREAD_INTERVAL 50 From c0425d74448d06019f0d4bfc0a27cedeeb2f5a84 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 27 Apr 2026 14:33:19 -0400 Subject: [PATCH 125/150] Actions: Build MacOS binary (#10319) Preliminary CI for the MacOS builds Co-authored-by: Copilot --- .github/workflows/build_macos_bin.yml | 51 +++++++++++++++++++++++++++ .github/workflows/main_matrix.yml | 15 ++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/build_macos_bin.yml diff --git a/.github/workflows/build_macos_bin.yml b/.github/workflows/build_macos_bin.yml new file mode 100644 index 000000000..cde2dd816 --- /dev/null +++ b/.github/workflows/build_macos_bin.yml @@ -0,0 +1,51 @@ +name: Build MacOS Binary + +on: + workflow_call: + inputs: + macos_ver: + required: false + default: "26" # ARM64 + type: string + +permissions: + contents: read + +jobs: + build-MacOS: + runs-on: macos-${{ inputs.macos_ver }} + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + submodules: recursive + + - name: Install deps + shell: bash + run: | + brew update + brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config + + - name: Get release version string + run: | + echo "long=$(./bin/buildinfo.py long)" >> $GITHUB_OUTPUT + id: version + + - name: Build for MacOS + run: | + platformio run -e native-macos + env: + PKG_VERSION: ${{ steps.version.outputs.long }} + # Errors in this step should not fail the entire workflow while MacOS support is in development. + continue-on-error: true + + - name: List output files + run: ls -lah .pio/build/native-macos/ + + - name: Store binaries as an artifact + uses: actions/upload-artifact@v7 + with: + name: firmware-macos-${{ inputs.macos_ver }}-${{ steps.version.outputs.long }} + overwrite: true + path: | + .pio/build/native-macos/meshtasticd diff --git a/.github/workflows/main_matrix.yml b/.github/workflows/main_matrix.yml index 88395600a..3505d950e 100644 --- a/.github/workflows/main_matrix.yml +++ b/.github/workflows/main_matrix.yml @@ -116,6 +116,20 @@ jobs: build_location: local secrets: inherit + MacOS: + strategy: + fail-fast: false + matrix: + macos_ver: + - "26" # ARM64 + # - '26-intel' # x86_64 + - "15" # ARM64 + # - '15-intel' # x86_64 + uses: ./.github/workflows/build_macos_bin.yml + with: + macos_ver: ${{ matrix.macos_ver }} + # secrets: inherit + package-pio-deps-native-tft: if: ${{ github.repository == 'meshtastic/firmware' && github.event_name == 'workflow_dispatch' }} uses: ./.github/workflows/package_pio_deps.yml @@ -286,6 +300,7 @@ jobs: - gather-artifacts - build-debian-src - package-pio-deps-native-tft + # - MacOS steps: - name: Checkout uses: actions/checkout@v6 From 9c72767c0133361131f27ca039455a81ec8d4a1e Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 28 Apr 2026 08:31:08 -0500 Subject: [PATCH 126/150] macOS: enable CH341 LoRa-hardware path (fix serial truncation, document setup) (#10320) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * macOS: enable CH341 LoRa-hardware path — fix serial truncation, document setup Verified on Apple Silicon with a CH341A USB-SPI bridge (VID 0x1A86, PID 0x5512) wired to an SX1262 (Meshstick variant) that the existing `pine64/libch341-spi-userspace` lib_dep works on macOS as-is — Apple's bundled CH34x driver only matches the CH340 *UART* variant (PID 0x7523), so the CH341A's interface 0 is left unclaimed and libusb opens / configures / claims it directly via IOUSBHostInterface. End-to-end test: meshtasticd boots, libusb claim succeeds, SX1262 init returns 0, TCP API serves the meshtastic CLI's --info / --sendtext flow. Two changes: 1. **`PortduinoGlue.cpp:497`**: pass `sizeof(serial)` (= 9) instead of the literal `8` to `Ch341Hal::getSerialString()`. The function in `USBHal.h:61-68` treats `len` as buffer size and reserves one slot for the null terminator (`bytesCopied = (len - 1) < 8 ? (len - 1) : 8`), so passing 8 produced a 7-char serial — which then broke the `strlen(serial) == 8` check at line 502, skipping the auto-MAC derivation from serial + product string. On Linux this was masked by the BlueZ HCI MAC fallback in `getMacAddr()` at lines 139-157, but on macOS that fallback is `__linux__`-guarded so the serial path is mandatory and the truncation left `mac_address` empty, causing the daemon to exit with `*** Blank MAC Address not allowed!`. 2. **`variants/native/portduino/platformio.ini`**: expand the `[env:native-macos]` comment block with a "Real LoRa hardware on macOS" section. Documents: - Why no upstream library change is needed (Apple kext targets CH340/UART, not CH341A/SPI; libusb's `#ifdef __linux__` skip is correct for macOS in this case). - How to point `meshtasticd` at an existing platform-agnostic `bin/config.d/lora-*.yaml` for CH341 hardware. - The auto-MAC-derivation contract (now working with this fix). - `ioreg` and `LIBUSB_DEBUG=4` diagnostic recipes for the failure mode where a third-party WCH `CH34xVCPDriver` *would* claim interface 0 (`kmutil unload -b ` workaround). No upstream library forks, no PR chain, no additional lib_deps — the existing `pine64/libch341-spi-userspace` + libusb-1.0 stack does the right thing on macOS already. Co-Authored-By: Claude Opus 4.7 (1M context) * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/platform/portduino/PortduinoGlue.cpp | 11 ++++++-- variants/native/portduino/platformio.ini | 33 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index 6f8077720..fbaa3c98c 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -490,10 +490,17 @@ void portduinoSetup() exit(EXIT_FAILURE); } char serial[9] = {0}; - ch341Hal->getSerialString(serial, 8); + // Pass the full buffer size (9 = 8 chars + null) to getSerialString, + // not 8. The function treats `len` as buffer size and reserves one + // slot for the null terminator, so passing 8 produced a 7-char serial + // and broke the `strlen(serial) == 8` check below — masked on Linux + // by the BlueZ HCI MAC fallback in getMacAddr(), but on macOS (where + // the BlueZ path is __linux__-guarded) it left mac_address empty and + // meshtasticd refused to start. + ch341Hal->getSerialString(serial, sizeof(serial)); std::cout << "CH341 Serial " << serial << std::endl; char product_string[96] = {0}; - ch341Hal->getProductString(product_string, 95); + ch341Hal->getProductString(product_string, sizeof(product_string)); std::cout << "CH341 Product " << product_string << std::endl; if (strlen(serial) == 8 && portduino_config.mac_address.length() < 12) { std::cout << "Deriving MAC address from Serial and Product String" << std::endl; diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index c497d0c17..e493da77b 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -133,6 +133,39 @@ test_testing_command = ; SOCK_NONBLOCK fallback, Common.h __APPLE__ guard, WiFiServer.cpp extern-C ; fix, package.json URL refresh. Pulled by platform-native at its pinned commit. ; This env therefore only carries the firmware-side build flags and src filter. +; +; Real LoRa hardware on macOS: +; The same lib_dep `pine64/libch341-spi-userspace` used on Linux works on +; macOS as-is — its `libusb_detach_kernel_driver()` call is `__linux__`- +; guarded, but on macOS the kernel doesn't bind a driver to a CH341A SPI +; bridge (PID 0x5512; bDeviceClass=0xff vendor-specific) by default, so +; no detach is needed. Apple's bundled CH34x driver targets the CH340 +; *UART* variant (PID 0x7523) — different product. libusb opens the device +; and claims interface 0 directly via IOUSBHostInterface. +; +; To use, point `meshtasticd` at any of the existing `bin/config.d/lora-*.yaml` +; files that specify `spidev: ch341` — they're platform-agnostic. Example: +; pio run -e native-macos +; mkdir -p ~/.meshtasticd && cp bin/config-dist.yaml ~/.meshtasticd/config.yaml +; # Edit ~/.meshtasticd/config.yaml: ConfigDirectory: ./config.d/ +; mkdir ~/.meshtasticd/config.d && cp bin/config.d/lora-meshstick-1262.yaml ~/.meshtasticd/config.d/ +; cd ~/.meshtasticd && /path/to/firmware/.pio/build/native-macos/meshtasticd +; +; The MAC address auto-derives from the CH341's USB serial + product string +; (PortduinoGlue.cpp ~497-518); on Linux a BlueZ HCI socket is the fallback +; when that path isn't taken, but BlueZ is `__linux__`-guarded so the +; serial-derivation path is mandatory on macOS. Override with +; `MACAddress: AA:BB:CC:DD:EE:FF` in config.yaml's `General:` section if +; the device's serial isn't 8 hex chars. +; +; Diagnosing CH341 issues on macOS: +; ioreg -p IOUSB -l -w 0 | grep -B2 -A30 0x5512 +; Children should be `IOUSBHostInterface`. If a vendor driver class +; (e.g. `com.wch.CH34xVCPDriver` from a third-party WCH installer) +; claims interface 0, libusb will fail with LIBUSB_ERROR_BUSY. +; Workaround: `sudo kmutil unload -b `. +; LIBUSB_DEBUG=4 .pio/build/native-macos/meshtasticd +; Verbose libusb trace — useful when claim_interface fails. ; --------------------------------------------------------------------------- [env:native-macos] extends = native_base From 8d8ff21e7c4b0735fe72cc537021516932651e8c Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Tue, 28 Apr 2026 19:03:50 -0500 Subject: [PATCH 127/150] Add clamping logic for milliseconds conversion and unit tests (#10326) * Add clamping logic for milliseconds conversion and unit tests * Simplify comments in secondsToMsClamped function Removed detailed comments about seconds to milliseconds conversion. --- src/mesh/Default.cpp | 26 +++++++++----- test/test_default/test_main.cpp | 61 +++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 8 deletions(-) diff --git a/src/mesh/Default.cpp b/src/mesh/Default.cpp index 3ecd766f1..7a2d9e410 100644 --- a/src/mesh/Default.cpp +++ b/src/mesh/Default.cpp @@ -2,18 +2,21 @@ #include "meshUtils.h" +// Convert seconds to ms, clamping at INT32_MAX (~24.86 days) +static inline uint32_t secondsToMsClamped(uint32_t secs) +{ + constexpr uint32_t MAX_MS = static_cast(INT32_MAX); + return (secs > MAX_MS / 1000U) ? MAX_MS : secs * 1000U; +} + uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval, uint32_t defaultInterval) { - if (configuredInterval > 0) - return configuredInterval * 1000; - return defaultInterval * 1000; + return secondsToMsClamped(configuredInterval > 0 ? configuredInterval : defaultInterval); } uint32_t Default::getConfiguredOrDefaultMs(uint32_t configuredInterval) { - if (configuredInterval > 0) - return configuredInterval * 1000; - return default_broadcast_interval_secs * 1000; + return secondsToMsClamped(configuredInterval > 0 ? configuredInterval : default_broadcast_interval_secs); } uint32_t Default::getConfiguredOrDefault(uint32_t configured, uint32_t defaultValue) @@ -47,7 +50,14 @@ uint32_t Default::getConfiguredOrDefaultMsScaled(uint32_t configured, uint32_t d meshtastic_Config_DeviceConfig_Role_TAK_TRACKER)) return getConfiguredOrDefaultMs(configured, defaultValue); - return getConfiguredOrDefaultMs(configured, defaultValue) * congestionScalingCoefficient(numOnlineNodes); + // Saturate at INT32_MAX to match secondsToMsClamped: float→uint32_t when + // out of range is UB, and the result is consumed as an int32_t downstream. + constexpr uint32_t MAX_MS = static_cast(INT32_MAX); + uint32_t base = getConfiguredOrDefaultMs(configured, defaultValue); + float coef = congestionScalingCoefficient(numOnlineNodes); + if (static_cast(base) * static_cast(coef) >= static_cast(MAX_MS)) + return MAX_MS; + return base * coef; } uint32_t Default::getConfiguredOrMinimumValue(uint32_t configured, uint32_t minValue) @@ -66,4 +76,4 @@ uint8_t Default::getConfiguredOrDefaultHopLimit(uint8_t configured) #else return (configured >= HOP_MAX) ? HOP_MAX : config.lora.hop_limit; #endif -} \ No newline at end of file +} diff --git a/test/test_default/test_main.cpp b/test/test_default/test_main.cpp index 9da367897..4202d7b8d 100644 --- a/test/test_default/test_main.cpp +++ b/test/test_default/test_main.cpp @@ -127,6 +127,60 @@ void test_client_uses_public_channel_minimums() TEST_ASSERT_EQUAL_UINT32(60 * 60, position); } +// --- Saturation/clamp tests for getConfiguredOrDefaultMs[Scaled] --- +// These guard the INT32_MAX clamp added to avoid uint32 wrap of secs*1000 and +// to keep results safe to cast to int32_t for OSThread runOnce returns. + +void test_ms_below_threshold() +{ + // Ordinary value passes through unchanged. + TEST_ASSERT_EQUAL_UINT32(60000U, Default::getConfiguredOrDefaultMs(60, 0)); +} + +void test_ms_at_threshold() +{ + // INT32_MAX / 1000 = 2,147,483 — largest secs that does not clamp. + TEST_ASSERT_EQUAL_UINT32(2147483000U, Default::getConfiguredOrDefaultMs(2147483U, 0)); +} + +void test_ms_just_above_threshold() +{ + // One second over the boundary must saturate, not wrap. + TEST_ASSERT_EQUAL_UINT32(static_cast(INT32_MAX), Default::getConfiguredOrDefaultMs(2147484U, 0)); +} + +void test_ms_uint32_max() +{ + // default_sds_secs == UINT32_MAX on non-routers must not wrap. + TEST_ASSERT_EQUAL_UINT32(static_cast(INT32_MAX), Default::getConfiguredOrDefaultMs(UINT32_MAX, 0)); +} + +void test_ms_default_clamps() +{ + // Clamp also applies when the default-arg path is taken (configured == 0). + TEST_ASSERT_EQUAL_UINT32(static_cast(INT32_MAX), Default::getConfiguredOrDefaultMs(0, UINT32_MAX)); +} + +void test_ms_result_is_int32_safe() +{ + // Regression guard for runOnce returns: cast to int32_t must not go negative. + int32_t result = static_cast(Default::getConfiguredOrDefaultMs(UINT32_MAX, 0)); + TEST_ASSERT_GREATER_OR_EQUAL_INT32(0, result); +} + +void test_scaled_overflow_saturates() +{ + // long_fast (SF11/BW250) with a 24h base and heavy congestion overflows + // the uint32 result without the double-precision guard. Must saturate. + config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT; + config.lora.use_preset = false; + config.lora.spread_factor = 11; + config.lora.bandwidth = 250; + + uint32_t res = Default::getConfiguredOrDefaultMsScaled(0, ONE_DAY, 1000); + TEST_ASSERT_EQUAL_UINT32(static_cast(INT32_MAX), res); +} + void setup() { // Small delay to match other test mains @@ -140,6 +194,13 @@ void setup() RUN_TEST(test_router_uses_router_minimums); RUN_TEST(test_router_late_uses_router_minimums); RUN_TEST(test_client_uses_public_channel_minimums); + RUN_TEST(test_ms_below_threshold); + RUN_TEST(test_ms_at_threshold); + RUN_TEST(test_ms_just_above_threshold); + RUN_TEST(test_ms_uint32_max); + RUN_TEST(test_ms_default_clamps); + RUN_TEST(test_ms_result_is_int32_safe); + RUN_TEST(test_scaled_overflow_saturates); exit(UNITY_END()); } From 11df30a85fd7860535c8bd45728849efeb649ceb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:04:16 -0500 Subject: [PATCH 128/150] Upgrade trunk (#10324) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 178a1cc9e..41bb110a9 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.525 - - renovate@43.142.0 + - renovate@43.147.0 - prettier@3.8.3 - trufflehog@3.95.2 - yamllint@1.38.0 From c0e52e6e1c2a5e5aaa960de853f5f9f917084ec5 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 19:10:17 -0500 Subject: [PATCH 129/150] Update meshtastic/device-ui digest to 1ddcc9d (#10328) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 3f8f77228..9348d97d9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/728932970996ec91bdb93cb6dae29c2cb70c66e2.zip + https://github.com/meshtastic/device-ui/archive/1ddcc9da2e60c013d6fc515fb73fb63fac75f9fd.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 22a9346fe03a8c049bf6a9a2377a8b39d6b63bf9 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 29 Apr 2026 12:16:25 -0400 Subject: [PATCH 130/150] Debian: Correctly fail upon failure (#10341) Fake success is BS! We should fail when we fail. Fixes issues with Debian sourcedebs silently failing to build ocassionally (due to github 502s, etc). --- debian/ci_pack_sdeb.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/ci_pack_sdeb.sh b/debian/ci_pack_sdeb.sh index 7b2418ff6..d35aeef24 100755 --- a/debian/ci_pack_sdeb.sh +++ b/debian/ci_pack_sdeb.sh @@ -1,4 +1,5 @@ #!/usr/bin/bash +set -e export DEBEMAIL="jbennett@incomsystems.biz" export PLATFORMIO_LIBDEPS_DIR=pio/libdeps export PLATFORMIO_PACKAGES_DIR=pio/packages From 9ec63b5eb2c236457ce307c896e98f00837a82c3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 12:55:48 -0500 Subject: [PATCH 131/150] Upgrade trunk (#10336) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 41bb110a9..77ee7ecc3 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -9,7 +9,7 @@ plugins: lint: enabled: - checkov@3.2.525 - - renovate@43.147.0 + - renovate@43.150.0 - prettier@3.8.3 - trufflehog@3.95.2 - yamllint@1.38.0 From 7be5426f343e40272146086830a8686f0f144a58 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 29 Apr 2026 14:00:01 -0400 Subject: [PATCH 132/150] Do not FACTORY_INSTALL on ARCH_PORTDUINO (#10343) --- src/mesh/NodeDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 4b79882bd..b526bc869 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1205,7 +1205,7 @@ void NodeDB::loadFromDisk() spiLock->unlock(); #endif #ifdef FSCom -#ifdef FACTORY_INSTALL +#if defined(FACTORY_INSTALL) && !defined(ARCH_PORTDUINO) spiLock->lock(); if (!FSCom.exists("/prefs/" xstr(BUILD_EPOCH))) { LOG_WARN("Factory Install Reset!"); From 089af764ec04f715fa3bc60d0fb6e6a30ed4fcb8 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 29 Apr 2026 16:41:21 -0500 Subject: [PATCH 133/150] Replace FSCom.format() with FSCom.rmDir() for directory cleanup in NodeDB::loadFromDisk() --- src/mesh/NodeDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index b526bc869..a0212794f 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1209,7 +1209,7 @@ void NodeDB::loadFromDisk() spiLock->lock(); if (!FSCom.exists("/prefs/" xstr(BUILD_EPOCH))) { LOG_WARN("Factory Install Reset!"); - FSCom.format(); + FSCom.rmDir("/prefs"); FSCom.mkdir("/prefs"); File f2 = FSCom.open("/prefs/" xstr(BUILD_EPOCH), FILE_O_WRITE); if (f2) { From 195f42af826634acf3120252c64e8255de03c7c4 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 29 Apr 2026 16:57:21 -0500 Subject: [PATCH 134/150] Doesn't FSCom --- src/mesh/NodeDB.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index a0212794f..6d13952e5 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1209,7 +1209,7 @@ void NodeDB::loadFromDisk() spiLock->lock(); if (!FSCom.exists("/prefs/" xstr(BUILD_EPOCH))) { LOG_WARN("Factory Install Reset!"); - FSCom.rmDir("/prefs"); + rmDir("/prefs"); FSCom.mkdir("/prefs"); File f2 = FSCom.open("/prefs/" xstr(BUILD_EPOCH), FILE_O_WRITE); if (f2) { From ad23c42fcc9531509f8cf674b738a3b7b193ec07 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 19:09:21 -0500 Subject: [PATCH 135/150] Update meshtastic/device-ui digest to 4bf593a (#10346) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 9348d97d9..71c362a79 100644 --- a/platformio.ini +++ b/platformio.ini @@ -126,7 +126,7 @@ lib_deps = [device-ui_base] lib_deps = # renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master - https://github.com/meshtastic/device-ui/archive/1ddcc9da2e60c013d6fc515fb73fb63fac75f9fd.zip + https://github.com/meshtastic/device-ui/archive/4bf593a82100b911ff816dddf7158ffdee2114cd.zip ; Common libs for environmental measurements in telemetry module [environmental_base] From 478444eb02836fd5c6ae0e5887840994c9679289 Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 29 Apr 2026 20:31:59 -0400 Subject: [PATCH 136/150] Docker-Alpine: Align version between build/main stages (#10347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FROM python:3.14-alpine3.23 AS builder FROM alpine:3.23 the alpine version needs to match in both stages 😅 --- alpine.Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 75c9aa594..40a4990bb 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -3,7 +3,8 @@ # trunk-ignore-all(hadolint/DL3018): Do not pin apk package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -FROM python:3.14-alpine3.22 AS builder +# Ensure the Alpine version is updated in both stages of the container! +FROM python:3.14-alpine3.23 AS builder ARG PIO_ENV=native ENV PIP_ROOT_USER_ACTION=ignore @@ -60,4 +61,4 @@ EXPOSE 4403 CMD [ "sh", "-cx", "meshtasticd --fsdir=/var/lib/meshtasticd" ] -HEALTHCHECK NONE \ No newline at end of file +HEALTHCHECK NONE From 3a87fc82c088b5ab4d06958af762bbd755676f17 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Wed, 29 Apr 2026 19:54:05 -0500 Subject: [PATCH 137/150] Add documentation for macOS support in Copilot and Agent instructions --- .github/copilot-instructions.md | 4 +++- AGENTS.md | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 2d7457102..29d5f6b00 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -13,6 +13,7 @@ Meshtastic is an open-source LoRa mesh networking project for long-range, low-po - **RP2040/RP2350** - Raspberry Pi Pico variants - **STM32WL** - STM32 with integrated LoRa - **Linux/Portduino** - Native Linux builds (Raspberry Pi, etc.) +- **macOS native** - Headless `meshtasticd` on Apple Silicon / x86_64; see `variants/native/portduino/platformio.ini` for Homebrew prereqs + CH341 LoRa setup ### Supported Radio Chips @@ -369,7 +370,7 @@ To reduce avoidable agent mistakes, assume these tools are available (or install - **Required CLI basics**: `bash`, `git`, `find`, `grep`, `sed`, `awk`, `xargs` - **Strongly recommended**: `rg` (ripgrep) for fast file/text search, `jq` for JSON processing - **Build/test tools**: `python3`, `pip`, virtualenv (`python3 -m venv`), `platformio` (`pio`) -- **Containerized native testing**: `docker` (especially important on macOS / non-Linux hosts) +- **Containerized native testing**: `docker` (fallback for non-Linux hosts; macOS can also build natively via `pio run -e native-macos`) Fallback expectations for agents: @@ -388,6 +389,7 @@ Build commands: pio run -e tbeam # Build specific target pio run -e tbeam -t upload # Build and upload pio run -e native # Build native/Linux version +pio run -e native-macos # Build headless macOS meshtasticd (Homebrew prereqs in variants/native/portduino/platformio.ini) ``` ### Build Manifest diff --git a/AGENTS.md b/AGENTS.md index 8f3474640..ca6794322 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,17 +10,18 @@ This file (`AGENTS.md`) is a short pointer + quick reference for agents that don ## Quick command reference -| Action | Command | -| -------------------------------- | ----------------------------------------------------------------------------------- | -| Build a firmware variant | `pio run -e ` (e.g. `pio run -e rak4631`, `pio run -e heltec-v3`) | -| Clean + rebuild | `pio run -e -t clean && pio run -e ` | -| Flash a device | `pio run -e -t upload --upload-port ` (or use the `pio_flash` MCP tool) | -| Run firmware unit tests (native) | `pio test -e native` | -| Run MCP hardware tests | `./mcp-server/run-tests.sh` | -| Live TUI test runner | `mcp-server/.venv/bin/meshtastic-mcp-test-tui` | -| Format before commit | `trunk fmt` | -| Regenerate protobuf bindings | `bin/regen-protos.sh` | -| Generate CI matrix | `./bin/generate_ci_matrix.py all [--level pr]` | +| Action | Command | +| -------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| Build a firmware variant | `pio run -e ` (e.g. `pio run -e rak4631`, `pio run -e heltec-v3`) | +| Build native macOS host binary | `pio run -e native-macos` (Homebrew prereqs + CH341 LoRa setup in `variants/native/portduino/platformio.ini`) | +| Clean + rebuild | `pio run -e -t clean && pio run -e ` | +| Flash a device | `pio run -e -t upload --upload-port ` (or use the `pio_flash` MCP tool) | +| Run firmware unit tests (native) | `pio test -e native` | +| Run MCP hardware tests | `./mcp-server/run-tests.sh` | +| Live TUI test runner | `mcp-server/.venv/bin/meshtastic-mcp-test-tui` | +| Format before commit | `trunk fmt` | +| Regenerate protobuf bindings | `bin/regen-protos.sh` | +| Generate CI matrix | `./bin/generate_ci_matrix.py all [--level pr]` | ## MCP server (device + test automation) @@ -121,6 +122,7 @@ Sequence these; don't parallelize on the same port. - **Device fully wedged (no DFU)?** `mcp__meshtastic__uhubctl_cycle(role="nrf52", confirm=True)` hard-power-cycles it via USB hub PPPS. Needs `uhubctl` installed (`brew install uhubctl` / `apt install uhubctl`); on Linux without udev rules, permission errors fail fast, so use `sudo uhubctl` yourself or configure udev access. - **Port busy?** `lsof ` to find the holder. Usually a stale `pio device monitor` or zombie `meshtastic_mcp` process. Kill it. - **Multiple MCP servers running?** `ps aux | grep meshtastic_mcp` — zombies hold ports. Kill all but the one your host spawned. +- **macOS: `LIBUSB_ERROR_BUSY` on a CH341 LoRa adapter?** A third-party WCH `CH34xVCPDriver` is claiming interface 0. Find the bundle ID with `ioreg -p IOUSB -l -w 0 | grep -B2 -A30 0x5512`, then `sudo kmutil unload -b `. Apple's bundled CH34x kext targets the CH340 UART (PID 0x7523), not the SPI bridge — it's never the culprit. ## Environment variables (test harness) From 24d64a0013b62abdac05c471f58ffec025c8396f Mon Sep 17 00:00:00 2001 From: Austin Date: Wed, 29 Apr 2026 22:04:49 -0400 Subject: [PATCH 138/150] Docker: Build for riscv64 (#10345) Upstream support has been added in Debian and Alpine. Only build as part of `docker_manifest` (Beta/Alpha/Daily) releases, because these will take a **while** thanks to qemu. Co-authored-by: Copilot --- .github/workflows/docker_build.yml | 4 +++- .github/workflows/docker_manifest.yml | 22 ++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index d9b23a7e8..8a3ef0e6c 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -73,7 +73,9 @@ jobs: - name: Sanitize platform string id: sanitize_platform # Replace slashes with underscores - run: echo "cleaned_platform=${{ inputs.platform }}" | sed 's/\//_/g' >> $GITHUB_OUTPUT + env: + plat: ${{ inputs.platform }} + run: echo "cleaned_platform=${plat}" | sed 's/\//_/g' >> $GITHUB_OUTPUT - name: Docker login if: ${{ inputs.push }} diff --git a/.github/workflows/docker_manifest.yml b/.github/workflows/docker_manifest.yml index b2fd12599..4bfdfe37e 100644 --- a/.github/workflows/docker_manifest.yml +++ b/.github/workflows/docker_manifest.yml @@ -43,6 +43,15 @@ jobs: push: true secrets: inherit + docker-debian-riscv64: + uses: ./.github/workflows/docker_build.yml + with: + distro: debian + platform: linux/riscv64 + runs-on: ubuntu-24.04-arm + push: true + secrets: inherit + docker-alpine-amd64: uses: ./.github/workflows/docker_build.yml with: @@ -70,16 +79,27 @@ jobs: push: true secrets: inherit + docker-alpine-riscv64: + uses: ./.github/workflows/docker_build.yml + with: + distro: alpine + platform: linux/riscv64 + runs-on: ubuntu-24.04-arm + push: true + secrets: inherit + docker-manifest: needs: # Debian - docker-debian-amd64 - docker-debian-arm64 - docker-debian-armv7 + - docker-debian-riscv64 # Alpine - docker-alpine-amd64 - docker-alpine-arm64 - docker-alpine-armv7 + - docker-alpine-riscv64 runs-on: ubuntu-24.04 steps: - name: Checkout code @@ -162,6 +182,7 @@ jobs: meshtastic/meshtasticd@${{ needs.docker-debian-amd64.outputs.digest }} meshtastic/meshtasticd@${{ needs.docker-debian-arm64.outputs.digest }} meshtastic/meshtasticd@${{ needs.docker-debian-armv7.outputs.digest }} + meshtastic/meshtasticd@${{ needs.docker-debian-riscv64.outputs.digest }} - name: Docker meta (Alpine) id: meta_alpine @@ -182,3 +203,4 @@ jobs: meshtastic/meshtasticd@${{ needs.docker-alpine-amd64.outputs.digest }} meshtastic/meshtasticd@${{ needs.docker-alpine-arm64.outputs.digest }} meshtastic/meshtasticd@${{ needs.docker-alpine-armv7.outputs.digest }} + meshtastic/meshtasticd@${{ needs.docker-alpine-riscv64.outputs.digest }} From 83adfd417a080503afb092067c5004068a094072 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 06:39:52 -0500 Subject: [PATCH 139/150] Upgrade trunk (#10354) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 77ee7ecc3..1913c6604 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -4,7 +4,7 @@ cli: plugins: sources: - id: trunk - ref: v1.7.6 + ref: v1.8.0 uri: https://github.com/trunk-io/plugins lint: enabled: @@ -36,7 +36,7 @@ lint: - bin/** runtimes: enabled: - - python@3.10.8 + - python@3.14.4 - go@1.21.0 - node@22.16.0 actions: From 173ac58ed70ab7dc74fad11686a59246de79ef06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:45:20 -0500 Subject: [PATCH 140/150] Update protobufs (#10357) Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --- protobufs | 2 +- src/mesh/generated/meshtastic/apponly.pb.h | 2 +- src/mesh/generated/meshtastic/config.pb.h | 12 +- src/mesh/generated/meshtastic/deviceonly.pb.h | 2 +- src/mesh/generated/meshtastic/localonly.pb.h | 2 +- .../generated/meshtastic/serial_hal.pb.cpp | 19 +++ src/mesh/generated/meshtastic/serial_hal.pb.h | 135 ++++++++++++++++++ 7 files changed, 166 insertions(+), 8 deletions(-) create mode 100644 src/mesh/generated/meshtastic/serial_hal.pb.cpp create mode 100644 src/mesh/generated/meshtastic/serial_hal.pb.h diff --git a/protobufs b/protobufs index 249a80855..1d6f1a71f 160000 --- a/protobufs +++ b/protobufs @@ -1 +1 @@ -Subproject commit 249a80855a2adb76fb0904dac8bf6285d45f330f +Subproject commit 1d6f1a71ff329fa52ad8bb7899951e96f8280a1f diff --git a/src/mesh/generated/meshtastic/apponly.pb.h b/src/mesh/generated/meshtastic/apponly.pb.h index ce766878b..88cbcb5e6 100644 --- a/src/mesh/generated/meshtastic/apponly.pb.h +++ b/src/mesh/generated/meshtastic/apponly.pb.h @@ -55,7 +55,7 @@ extern const pb_msgdesc_t meshtastic_ChannelSet_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_APPONLY_PB_H_MAX_SIZE meshtastic_ChannelSet_size -#define meshtastic_ChannelSet_size 682 +#define meshtastic_ChannelSet_size 685 #ifdef __cplusplus } /* extern "C" */ diff --git a/src/mesh/generated/meshtastic/config.pb.h b/src/mesh/generated/meshtastic/config.pb.h index 0e14334d5..d614a6438 100644 --- a/src/mesh/generated/meshtastic/config.pb.h +++ b/src/mesh/generated/meshtastic/config.pb.h @@ -618,6 +618,8 @@ typedef struct _meshtastic_Config_LoRaConfig { bool config_ok_to_mqtt; /* Set where LORA FEM is enabled, disabled, or not present */ meshtastic_Config_LoRaConfig_FEM_LNA_Mode fem_lna_mode; + /* Don't use radiolib to initialize the radio, instead listen for a serialHal connection */ + bool serial_hal_only; } meshtastic_Config_LoRaConfig; typedef struct _meshtastic_Config_BluetoothConfig { @@ -779,7 +781,7 @@ extern "C" { #define meshtastic_Config_NetworkConfig_init_default {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_default, "", 0, 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_default {0, 0, 0, 0} #define meshtastic_Config_DisplayConfig_init_default {0, _meshtastic_Config_DisplayConfig_DeprecatedGpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0, 0, 0} -#define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MIN} +#define meshtastic_Config_LoRaConfig_init_default {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MIN, 0} #define meshtastic_Config_BluetoothConfig_init_default {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} #define meshtastic_Config_SecurityConfig_init_default {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0} #define meshtastic_Config_SessionkeyConfig_init_default {0} @@ -790,7 +792,7 @@ extern "C" { #define meshtastic_Config_NetworkConfig_init_zero {0, "", "", "", 0, _meshtastic_Config_NetworkConfig_AddressMode_MIN, false, meshtastic_Config_NetworkConfig_IpV4Config_init_zero, "", 0, 0} #define meshtastic_Config_NetworkConfig_IpV4Config_init_zero {0, 0, 0, 0} #define meshtastic_Config_DisplayConfig_init_zero {0, _meshtastic_Config_DisplayConfig_DeprecatedGpsCoordinateFormat_MIN, 0, 0, 0, _meshtastic_Config_DisplayConfig_DisplayUnits_MIN, _meshtastic_Config_DisplayConfig_OledType_MIN, _meshtastic_Config_DisplayConfig_DisplayMode_MIN, 0, 0, _meshtastic_Config_DisplayConfig_CompassOrientation_MIN, 0, 0, 0} -#define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MIN} +#define meshtastic_Config_LoRaConfig_init_zero {0, _meshtastic_Config_LoRaConfig_ModemPreset_MIN, 0, 0, 0, 0, _meshtastic_Config_LoRaConfig_RegionCode_MIN, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, 0, 0, _meshtastic_Config_LoRaConfig_FEM_LNA_Mode_MIN, 0} #define meshtastic_Config_BluetoothConfig_init_zero {0, _meshtastic_Config_BluetoothConfig_PairingMode_MIN, 0} #define meshtastic_Config_SecurityConfig_init_zero {{0, {0}}, {0, {0}}, 0, {{0, {0}}, {0, {0}}, {0, {0}}}, 0, 0, 0, 0} #define meshtastic_Config_SessionkeyConfig_init_zero {0} @@ -877,6 +879,7 @@ extern "C" { #define meshtastic_Config_LoRaConfig_ignore_mqtt_tag 104 #define meshtastic_Config_LoRaConfig_config_ok_to_mqtt_tag 105 #define meshtastic_Config_LoRaConfig_fem_lna_mode_tag 106 +#define meshtastic_Config_LoRaConfig_serial_hal_only_tag 107 #define meshtastic_Config_BluetoothConfig_enabled_tag 1 #define meshtastic_Config_BluetoothConfig_mode_tag 2 #define meshtastic_Config_BluetoothConfig_fixed_pin_tag 3 @@ -1029,7 +1032,8 @@ X(a, STATIC, SINGULAR, BOOL, pa_fan_disabled, 15) \ X(a, STATIC, REPEATED, UINT32, ignore_incoming, 103) \ X(a, STATIC, SINGULAR, BOOL, ignore_mqtt, 104) \ X(a, STATIC, SINGULAR, BOOL, config_ok_to_mqtt, 105) \ -X(a, STATIC, SINGULAR, UENUM, fem_lna_mode, 106) +X(a, STATIC, SINGULAR, UENUM, fem_lna_mode, 106) \ +X(a, STATIC, SINGULAR, BOOL, serial_hal_only, 107) #define meshtastic_Config_LoRaConfig_CALLBACK NULL #define meshtastic_Config_LoRaConfig_DEFAULT NULL @@ -1086,7 +1090,7 @@ extern const pb_msgdesc_t meshtastic_Config_SessionkeyConfig_msg; #define meshtastic_Config_BluetoothConfig_size 10 #define meshtastic_Config_DeviceConfig_size 100 #define meshtastic_Config_DisplayConfig_size 36 -#define meshtastic_Config_LoRaConfig_size 88 +#define meshtastic_Config_LoRaConfig_size 91 #define meshtastic_Config_NetworkConfig_IpV4Config_size 20 #define meshtastic_Config_NetworkConfig_size 204 #define meshtastic_Config_PositionConfig_size 62 diff --git a/src/mesh/generated/meshtastic/deviceonly.pb.h b/src/mesh/generated/meshtastic/deviceonly.pb.h index 1d6cd32f9..6d03dc643 100644 --- a/src/mesh/generated/meshtastic/deviceonly.pb.h +++ b/src/mesh/generated/meshtastic/deviceonly.pb.h @@ -361,7 +361,7 @@ extern const pb_msgdesc_t meshtastic_BackupPreferences_msg; /* Maximum encoded size of messages (where known) */ /* meshtastic_NodeDatabase_size depends on runtime parameters */ #define MESHTASTIC_MESHTASTIC_DEVICEONLY_PB_H_MAX_SIZE meshtastic_BackupPreferences_size -#define meshtastic_BackupPreferences_size 2429 +#define meshtastic_BackupPreferences_size 2432 #define meshtastic_ChannelFile_size 718 #define meshtastic_DeviceState_size 1737 #define meshtastic_NodeInfoLite_size 196 diff --git a/src/mesh/generated/meshtastic/localonly.pb.h b/src/mesh/generated/meshtastic/localonly.pb.h index 8425c122a..27f5ad7bf 100644 --- a/src/mesh/generated/meshtastic/localonly.pb.h +++ b/src/mesh/generated/meshtastic/localonly.pb.h @@ -205,7 +205,7 @@ extern const pb_msgdesc_t meshtastic_LocalModuleConfig_msg; /* Maximum encoded size of messages (where known) */ #define MESHTASTIC_MESHTASTIC_LOCALONLY_PB_H_MAX_SIZE meshtastic_LocalModuleConfig_size -#define meshtastic_LocalConfig_size 754 +#define meshtastic_LocalConfig_size 757 #define meshtastic_LocalModuleConfig_size 820 #ifdef __cplusplus diff --git a/src/mesh/generated/meshtastic/serial_hal.pb.cpp b/src/mesh/generated/meshtastic/serial_hal.pb.cpp new file mode 100644 index 000000000..183bc48f6 --- /dev/null +++ b/src/mesh/generated/meshtastic/serial_hal.pb.cpp @@ -0,0 +1,19 @@ +/* Automatically generated nanopb constant definitions */ +/* Generated by nanopb-0.4.9.1 */ + +#include "meshtastic/serial_hal.pb.h" +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +PB_BIND(meshtastic_SerialHalCommand, meshtastic_SerialHalCommand, 2) + + +PB_BIND(meshtastic_SerialHalResponse, meshtastic_SerialHalResponse, 2) + + + + + + + diff --git a/src/mesh/generated/meshtastic/serial_hal.pb.h b/src/mesh/generated/meshtastic/serial_hal.pb.h new file mode 100644 index 000000000..5dfcdf1ca --- /dev/null +++ b/src/mesh/generated/meshtastic/serial_hal.pb.h @@ -0,0 +1,135 @@ +/* Automatically generated nanopb header */ +/* Generated by nanopb-0.4.9.1 */ + +#ifndef PB_MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_INCLUDED +#define PB_MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_INCLUDED +#include + +#if PB_PROTO_HEADER_VERSION != 40 +#error Regenerate this file with the current version of nanopb generator. +#endif + +/* Enum definitions */ +typedef enum _meshtastic_SerialHalCommand_Type { + meshtastic_SerialHalCommand_Type_UNSET = 0, + meshtastic_SerialHalCommand_Type_PIN_MODE = 1, + meshtastic_SerialHalCommand_Type_DIGITAL_WRITE = 2, + meshtastic_SerialHalCommand_Type_DIGITAL_READ = 3, + meshtastic_SerialHalCommand_Type_ATTACH_INTERRUPT = 4, + meshtastic_SerialHalCommand_Type_DETACH_INTERRUPT = 5, + meshtastic_SerialHalCommand_Type_SPI_TRANSFER = 6, + meshtastic_SerialHalCommand_Type_NOOP = 7 +} meshtastic_SerialHalCommand_Type; + +typedef enum _meshtastic_SerialHalResponse_Result { + meshtastic_SerialHalResponse_Result_OK = 0, + meshtastic_SerialHalResponse_Result_ERROR = 1, + meshtastic_SerialHalResponse_Result_BAD_REQUEST = 2, + meshtastic_SerialHalResponse_Result_UNSUPPORTED = 3 +} meshtastic_SerialHalResponse_Result; + +/* Struct definitions */ +typedef PB_BYTES_ARRAY_T(512) meshtastic_SerialHalCommand_data_t; +typedef struct _meshtastic_SerialHalCommand { + /* Host-assigned request id. Replies echo this id back in + SerialHalResponse.transaction_id. */ + uint32_t transaction_id; + meshtastic_SerialHalCommand_Type type; + uint32_t pin; + uint32_t value; + uint32_t mode; + meshtastic_SerialHalCommand_data_t data; +} meshtastic_SerialHalCommand; + +typedef PB_BYTES_ARRAY_T(512) meshtastic_SerialHalResponse_data_t; +typedef struct _meshtastic_SerialHalResponse { + /* Matches the originating SerialHalCommand.transaction_id for normal + request/response traffic. + + A value of 0 indicates an unsolicited interrupt notification generated by + the device. In that case, the host should interpret value as the GPIO pin + that triggered. */ + uint32_t transaction_id; + meshtastic_SerialHalResponse_Result result; + /* Used by DIGITAL_READ replies and interrupt notifications. For interrupt + notifications (transaction_id == 0), this carries the pin number. */ + uint32_t value; + meshtastic_SerialHalResponse_data_t data; + char error[80]; +} meshtastic_SerialHalResponse; + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Helper constants for enums */ +#define _meshtastic_SerialHalCommand_Type_MIN meshtastic_SerialHalCommand_Type_UNSET +#define _meshtastic_SerialHalCommand_Type_MAX meshtastic_SerialHalCommand_Type_NOOP +#define _meshtastic_SerialHalCommand_Type_ARRAYSIZE ((meshtastic_SerialHalCommand_Type)(meshtastic_SerialHalCommand_Type_NOOP+1)) + +#define _meshtastic_SerialHalResponse_Result_MIN meshtastic_SerialHalResponse_Result_OK +#define _meshtastic_SerialHalResponse_Result_MAX meshtastic_SerialHalResponse_Result_UNSUPPORTED +#define _meshtastic_SerialHalResponse_Result_ARRAYSIZE ((meshtastic_SerialHalResponse_Result)(meshtastic_SerialHalResponse_Result_UNSUPPORTED+1)) + +#define meshtastic_SerialHalCommand_type_ENUMTYPE meshtastic_SerialHalCommand_Type + +#define meshtastic_SerialHalResponse_result_ENUMTYPE meshtastic_SerialHalResponse_Result + + +/* Initializer values for message structs */ +#define meshtastic_SerialHalCommand_init_default {0, _meshtastic_SerialHalCommand_Type_MIN, 0, 0, 0, {0, {0}}} +#define meshtastic_SerialHalResponse_init_default {0, _meshtastic_SerialHalResponse_Result_MIN, 0, {0, {0}}, ""} +#define meshtastic_SerialHalCommand_init_zero {0, _meshtastic_SerialHalCommand_Type_MIN, 0, 0, 0, {0, {0}}} +#define meshtastic_SerialHalResponse_init_zero {0, _meshtastic_SerialHalResponse_Result_MIN, 0, {0, {0}}, ""} + +/* Field tags (for use in manual encoding/decoding) */ +#define meshtastic_SerialHalCommand_transaction_id_tag 1 +#define meshtastic_SerialHalCommand_type_tag 2 +#define meshtastic_SerialHalCommand_pin_tag 3 +#define meshtastic_SerialHalCommand_value_tag 4 +#define meshtastic_SerialHalCommand_mode_tag 5 +#define meshtastic_SerialHalCommand_data_tag 6 +#define meshtastic_SerialHalResponse_transaction_id_tag 1 +#define meshtastic_SerialHalResponse_result_tag 2 +#define meshtastic_SerialHalResponse_value_tag 3 +#define meshtastic_SerialHalResponse_data_tag 4 +#define meshtastic_SerialHalResponse_error_tag 5 + +/* Struct field encoding specification for nanopb */ +#define meshtastic_SerialHalCommand_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, transaction_id, 1) \ +X(a, STATIC, SINGULAR, UENUM, type, 2) \ +X(a, STATIC, SINGULAR, UINT32, pin, 3) \ +X(a, STATIC, SINGULAR, UINT32, value, 4) \ +X(a, STATIC, SINGULAR, UINT32, mode, 5) \ +X(a, STATIC, SINGULAR, BYTES, data, 6) +#define meshtastic_SerialHalCommand_CALLBACK NULL +#define meshtastic_SerialHalCommand_DEFAULT NULL + +#define meshtastic_SerialHalResponse_FIELDLIST(X, a) \ +X(a, STATIC, SINGULAR, UINT32, transaction_id, 1) \ +X(a, STATIC, SINGULAR, UENUM, result, 2) \ +X(a, STATIC, SINGULAR, UINT32, value, 3) \ +X(a, STATIC, SINGULAR, BYTES, data, 4) \ +X(a, STATIC, SINGULAR, STRING, error, 5) +#define meshtastic_SerialHalResponse_CALLBACK NULL +#define meshtastic_SerialHalResponse_DEFAULT NULL + +extern const pb_msgdesc_t meshtastic_SerialHalCommand_msg; +extern const pb_msgdesc_t meshtastic_SerialHalResponse_msg; + +/* Defines for backwards compatibility with code written before nanopb-0.4.0 */ +#define meshtastic_SerialHalCommand_fields &meshtastic_SerialHalCommand_msg +#define meshtastic_SerialHalResponse_fields &meshtastic_SerialHalResponse_msg + +/* Maximum encoded size of messages (where known) */ +#define MESHTASTIC_MESHTASTIC_SERIAL_HAL_PB_H_MAX_SIZE meshtastic_SerialHalResponse_size +#define meshtastic_SerialHalCommand_size 541 +#define meshtastic_SerialHalResponse_size 610 + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif From 21cef8c2e5d46c31022e3ecedba6a58d84e73045 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 30 Apr 2026 13:51:29 -0500 Subject: [PATCH 141/150] Add TCP support for Meshtastic MCP interface / tests and update docs (#10355) * Add TCP support for Meshtastic MCP interface / tests and update docs * Address TCP endpoint validation and error handling in connection * TCP connection handling and device listing logic * Fix docstring formatting in normalize_tcp_endpoint function --- .github/copilot-instructions.md | 2 + AGENTS.md | 27 +- mcp-server/README.md | 76 +++- mcp-server/src/meshtastic_mcp/connection.py | 169 +++++++- mcp-server/src/meshtastic_mcp/devices.py | 66 ++- mcp-server/src/meshtastic_mcp/flash.py | 19 +- mcp-server/src/meshtastic_mcp/hw_tools.py | 7 +- .../src/meshtastic_mcp/serial_session.py | 4 + mcp-server/tests/unit/test_connection_tcp.py | 383 ++++++++++++++++++ 9 files changed, 714 insertions(+), 39 deletions(-) create mode 100644 mcp-server/tests/unit/test_connection_tcp.py diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 29d5f6b00..fe9af4359 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -575,6 +575,8 @@ Grouped by purpose. Full argument shapes in `mcp-server/README.md`; a few high-v `confirm=True` is a tool-level gate on top of whatever permission prompt your MCP host shows. **Don't bypass it** by asking the host to auto-approve — it exists specifically because MCP hosts sometimes remember "always allow this tool" and that's dangerous for `factory_reset`, `erase_and_flash`, `uhubctl_power(action='off')`, and `uhubctl_cycle`. +**TCP / native-host nodes.** Setting `MESHTASTIC_MCP_TCP_HOST=` makes `list_devices` surface a `meshtasticd` daemon (e.g. the `native-macos` build) as a synthetic `tcp://host:port` entry, and `connect()` routes through `meshtastic.tcp_interface.TCPInterface` instead of `SerialInterface`. Every read/write/admin tool that flows through `connect()` works against the daemon transparently. USB-only tools (`pio_flash`, `erase_and_flash`, `update_flash`, `touch_1200bps`, `serial_open`, `esptool_*`, `nrfutil_*`, `picotool_*`) raise a clear `ConnectionError` when handed a `tcp://` port; `pio_flash` against a `native*` env raises a `FlashError` (no upload step — use `build` and run the binary directly). The pytest harness still assumes USB-attached devices per role; TCP-aware fixtures are deferred. See `mcp-server/README.md` § "TCP / native-host nodes". + ### Hardware test suite (`mcp-server/run-tests.sh`) The wrapper auto-detects connected devices (VID → role map: `0x239A` → `nrf52`, `0x303A`/`0x10C4` → `esp32s3`), maps each role to a PlatformIO env (`nrf52` → `rak4631`, `esp32s3` → `heltec-v3`, overridable via `MESHTASTIC_MCP_ENV_`), then invokes pytest. Zero pre-flight config needed from the operator. diff --git a/AGENTS.md b/AGENTS.md index ca6794322..cdccda1f4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -126,16 +126,17 @@ Sequence these; don't parallelize on the same port. ## Environment variables (test harness) -| Var | Purpose | -| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| `MESHTASTIC_MCP_ENV_` | Override PlatformIO env for a role (e.g. `MESHTASTIC_MCP_ENV_NRF52=rak4631-dap`). Default map: `nrf52→rak4631`, `esp32s3→heltec-v3`. | -| `MESHTASTIC_MCP_SEED` | PSK seed for the session test profile. Defaults to `mcp--`. | -| `MESHTASTIC_MCP_FLASH_LOG` | File path to tee pio/esptool/nrfutil/picotool output. `run-tests.sh` sets this to `tests/flash.log` so the TUI can stream live flash progress. | -| `MESHTASTIC_UHUBCTL_BIN` | Absolute path to `uhubctl` binary. Default: PATH lookup. | -| `MESHTASTIC_UHUBCTL_LOCATION_` | Pin a role to a specific uhubctl hub location (e.g. `1-1.3`). Wins over VID auto-detection — use when multiple devices share a VID. | -| `MESHTASTIC_UHUBCTL_PORT_` | Pin a role to a specific hub port number. Required alongside `LOCATION_`. | -| `MESHTASTIC_UI_CAMERA_BACKEND` | Camera backend for UI tier + `capture_screen` tool: `opencv` / `ffmpeg` / `null` / `auto` (default). | -| `MESHTASTIC_UI_CAMERA_DEVICE` | Generic camera device (index or path). Used by the UI tier when no per-role var is set. | -| `MESHTASTIC_UI_CAMERA_DEVICE_` | Per-role camera pinning (e.g. `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=0` for the OLED-bearing heltec-v3). | -| `MESHTASTIC_UI_OCR_BACKEND` | OCR engine selection: `easyocr` / `pytesseract` / `null` / `auto` (default). | -| `MESHTASTIC_UI_TUI_CAMERA` | Set to `1` to mount the live camera-feed panel in `meshtastic-mcp-test-tui`. | +| Var | Purpose | +| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `MESHTASTIC_MCP_ENV_` | Override PlatformIO env for a role (e.g. `MESHTASTIC_MCP_ENV_NRF52=rak4631-dap`). Default map: `nrf52→rak4631`, `esp32s3→heltec-v3`. | +| `MESHTASTIC_MCP_SEED` | PSK seed for the session test profile. Defaults to `mcp--`. | +| `MESHTASTIC_MCP_FLASH_LOG` | File path to tee pio/esptool/nrfutil/picotool output. `run-tests.sh` sets this to `tests/flash.log` so the TUI can stream live flash progress. | +| `MESHTASTIC_MCP_TCP_HOST` | `host` or `host:port` of a `meshtasticd` daemon (e.g. the `native-macos` build). Surfaces it in `list_devices` as `tcp://host:port` so `connect()`-based tools target it transparently. Default port 4403. | +| `MESHTASTIC_UHUBCTL_BIN` | Absolute path to `uhubctl` binary. Default: PATH lookup. | +| `MESHTASTIC_UHUBCTL_LOCATION_` | Pin a role to a specific uhubctl hub location (e.g. `1-1.3`). Wins over VID auto-detection — use when multiple devices share a VID. | +| `MESHTASTIC_UHUBCTL_PORT_` | Pin a role to a specific hub port number. Required alongside `LOCATION_`. | +| `MESHTASTIC_UI_CAMERA_BACKEND` | Camera backend for UI tier + `capture_screen` tool: `opencv` / `ffmpeg` / `null` / `auto` (default). | +| `MESHTASTIC_UI_CAMERA_DEVICE` | Generic camera device (index or path). Used by the UI tier when no per-role var is set. | +| `MESHTASTIC_UI_CAMERA_DEVICE_` | Per-role camera pinning (e.g. `MESHTASTIC_UI_CAMERA_DEVICE_ESP32S3=0` for the OLED-bearing heltec-v3). | +| `MESHTASTIC_UI_OCR_BACKEND` | OCR engine selection: `easyocr` / `pytesseract` / `null` / `auto` (default). | +| `MESHTASTIC_UI_TUI_CAMERA` | Set to `1` to mount the live camera-feed panel in `meshtastic-mcp-test-tui`. | diff --git a/mcp-server/README.md b/mcp-server/README.md index 7a36a6fac..22ce77fbc 100644 --- a/mcp-server/README.md +++ b/mcp-server/README.md @@ -166,15 +166,73 @@ rather than auto-`sudo`'ing mid-run. ## Environment variables -| Var | Default | Purpose | -| -------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------- | -| `MESHTASTIC_FIRMWARE_ROOT` | walks up from cwd for `platformio.ini` | Pin the firmware repo | -| `MESHTASTIC_PIO_BIN` | `~/.platformio/penv/bin/pio` → `$PATH` `pio` → `platformio` | Override `pio` location | -| `MESHTASTIC_ESPTOOL_BIN` | `/.venv/bin/esptool` → `$PATH` | Override esptool | -| `MESHTASTIC_NRFUTIL_BIN` | `$PATH` | Override nrfutil | -| `MESHTASTIC_PICOTOOL_BIN` | `$PATH` | Override picotool | -| `MESHTASTIC_MCP_SEED` | `mcp--` | PSK seed for test-harness session (CI override) | -| `MESHTASTIC_MCP_FLASH_LOG` | `/tests/flash.log` | Tee target for pio/esptool/nrfutil subprocess output (TUI tails it) | +| Var | Default | Purpose | +| -------------------------- | ----------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `MESHTASTIC_FIRMWARE_ROOT` | walks up from cwd for `platformio.ini` | Pin the firmware repo | +| `MESHTASTIC_PIO_BIN` | `~/.platformio/penv/bin/pio` → `$PATH` `pio` → `platformio` | Override `pio` location | +| `MESHTASTIC_ESPTOOL_BIN` | `/.venv/bin/esptool` → `$PATH` | Override esptool | +| `MESHTASTIC_NRFUTIL_BIN` | `$PATH` | Override nrfutil | +| `MESHTASTIC_PICOTOOL_BIN` | `$PATH` | Override picotool | +| `MESHTASTIC_MCP_SEED` | `mcp--` | PSK seed for test-harness session (CI override) | +| `MESHTASTIC_MCP_FLASH_LOG` | `/tests/flash.log` | Tee target for pio/esptool/nrfutil subprocess output (TUI tails it) | +| `MESHTASTIC_MCP_TCP_HOST` | unset | `host` or `host:port` of a `meshtasticd` daemon to surface as a TCP device (see "TCP / native-host nodes" below) | + +## TCP / native-host nodes + +The `native-macos` and `native` PlatformIO envs build a headless `meshtasticd` +binary that runs on the host (Apple Silicon / Intel macOS, or Linux Portduino). +The daemon exposes the meshtastic TCP API on port `4403` rather than a USB +serial endpoint — point the MCP server at it via `MESHTASTIC_MCP_TCP_HOST`: + +```bash +# 1. Build + run a daemon on this host (see variants/native/portduino/platformio.ini +# for full Homebrew prereqs and CH341 LoRa-adapter setup). +pio run -e native-macos +~/.meshtasticd/meshtasticd + +# 2. Point the MCP server at it. +export MESHTASTIC_MCP_TCP_HOST=localhost # or host:port, default port 4403 +``` + +**First-run gotcha — MAC address.** `meshtasticd` derives its MAC from the +USB adapter's serial-number / product strings. Many cheap CH341 dongles +(MeshStick included — VID 0x1A86 / PID 0x5512) ship with `iSerialNumber=0` +and `iProduct=0`, so the daemon aborts on boot with `*** Blank MAC Address +not allowed!`. Set the MAC explicitly in `config.yaml`: + +```yaml +# Under General: +MACAddress: 02:CA:FE:BA:BE:01 +``` + +Use a locally-administered address (first byte's second-LSB set, e.g. +`02:*` / `06:*` / `0A:*` / `0E:*`) to avoid colliding with a real OUI. + +There is also a `--hwid AA:BB:CC:DD:EE:FF` CLI flag visible in +`meshtasticd --help`, but it is **currently broken** in +`MAC_from_string()` (`src/platform/portduino/PortduinoGlue.cpp`): the +function strips colons from its parameter but then reads bytes from the +global `portduino_config.mac_address`, so `--hwid` is silently overridden +when `MACAddress:` is also set, and crashes the daemon (uncaught +`std::invalid_argument: stoi: no conversion`) when it isn't. Use the YAML +form until that's fixed upstream. + +`list_devices` will surface the daemon as `tcp://localhost:4403` with +`likely_meshtastic=True`, so `device_info`, `list_nodes`, `get_config`, +`set_config`, `set_owner`, `send_text`, `userprefs_*`, and the admin RPCs +auto-select it when no `port` is passed. Pass `port="tcp://other-host:9999"` +explicitly to target a different daemon. + +**Tools that don't apply to a TCP/native node** (no USB hardware to operate +on) raise a clear `ConnectionError` rather than failing mysteriously: +`pio_flash`, `erase_and_flash`, `update_flash`, `touch_1200bps`, +`serial_open` (use info/admin tools directly), and the vendor escape hatches +`esptool_*`, `nrfutil_*`, `picotool_*`. `pio_flash` against a `native*` env +similarly raises — there's no upload step; use `build` and run the binary +directly. + +The pytest harness in `tests/` still assumes USB-attached devices per role — +TCP-aware fixtures are not part of this surface yet. ## Hardware Test Suite diff --git a/mcp-server/src/meshtastic_mcp/connection.py b/mcp-server/src/meshtastic_mcp/connection.py index 17a7e2c89..7dbf847b9 100644 --- a/mcp-server/src/meshtastic_mcp/connection.py +++ b/mcp-server/src/meshtastic_mcp/connection.py @@ -1,4 +1,4 @@ -"""Context manager for meshtastic.SerialInterface connections. +"""Context manager for meshtastic interface connections (serial + TCP). Every info/admin tool goes through `connect(port)` so we have a single place that: @@ -6,8 +6,16 @@ that: - fails fast if a serial_session is already holding the port, - guarantees `.close()` is called, even on exception. -The `SerialInterface` blocks on construction waiting for the node database; -that's fine for v1 since every tool is a short-lived request. +Two transports: + - Serial: USB-attached firmware on `/dev/cu.*` / `/dev/ttyUSB*` / `COM*`. + - TCP: a `meshtasticd` daemon (e.g. the native macOS / Linux Portduino + headless build) addressed as `tcp://host[:port]` (default port 4403). + Surfaced by `devices.list_devices()` when `MESHTASTIC_MCP_TCP_HOST` is + set, so `resolve_port(None)` auto-selects it like a USB candidate. + +Both `SerialInterface` and `TCPInterface` block on construction waiting for +the node database; that's fine for v1 since every tool is a short-lived +request. """ from __future__ import annotations @@ -17,20 +25,107 @@ from typing import Iterator from . import devices, registry +DEFAULT_TCP_PORT = 4403 +TCP_SCHEME = "tcp://" +TCP_HOST_ENV = "MESHTASTIC_MCP_TCP_HOST" + class ConnectionError(RuntimeError): pass +def is_tcp_port(port: str | None) -> bool: + return bool(port) and port.startswith(TCP_SCHEME) + + +def parse_tcp_port(port: str) -> tuple[str, int]: + """Parse `tcp://host[:port]` → (host, port). Defaults to 4403. + + Validates host shape (non-empty, no path separators) and port range + (1..65535). Raises `ConnectionError` on malformed input — never lets + a raw `ValueError` bubble up to a tool surface. + """ + if not port.startswith(TCP_SCHEME): + raise ConnectionError( + f"Invalid TCP endpoint {port!r}: expected '{TCP_SCHEME}host[:port]'." + ) + rest = port[len(TCP_SCHEME) :] + if ":" in rest: + host, port_str = rest.rsplit(":", 1) + try: + tcp_port = int(port_str) + except ValueError as e: + raise ConnectionError( + f"Invalid TCP endpoint {port!r}: port {port_str!r} is not an integer." + ) from e + else: + host, tcp_port = rest, DEFAULT_TCP_PORT + if not host: + raise ConnectionError(f"Invalid TCP endpoint {port!r}: empty host.") + if any(c in host for c in ("/", "\\")): + raise ConnectionError( + f"Invalid TCP endpoint {port!r}: host {host!r} contains a path " + "separator. TCP hostnames cannot contain '/' or '\\' — did you " + "pass a serial port path or a Windows drive path by mistake?" + ) + if not (1 <= tcp_port <= 65535): + raise ConnectionError( + f"Invalid TCP endpoint {port!r}: port {tcp_port} out of range " + "(must be 1..65535)." + ) + return host, tcp_port + + +def normalize_tcp_endpoint(endpoint: str) -> str: + r"""Normalize `host`, `host:port`, or `tcp://host[:port]` → canonical + `tcp://host:port` form. One place that owns the lock-key shape. + + Defers all validation to `parse_tcp_port`, so path-like inputs + (`/dev/cu.foo`, `C:\Windows\…`), empty hosts, non-integer ports, + and out-of-range ports raise `ConnectionError` here too. + """ + if endpoint.startswith(TCP_SCHEME): + canonical = endpoint + elif ":" in endpoint: + canonical = f"{TCP_SCHEME}{endpoint}" + else: + canonical = f"{TCP_SCHEME}{endpoint}:{DEFAULT_TCP_PORT}" + host, port = parse_tcp_port(canonical) + return f"{TCP_SCHEME}{host}:{port}" + + +def reject_if_tcp(port: str | None, tool_name: str) -> None: + """Raise if `port` is a TCP endpoint — for tools that need real USB + hardware (flash, bootloader, vendor escape hatches, serial monitor). + + Only checks the explicit arg; auto-selection via env var is the caller's + responsibility to handle if it matters. + """ + if is_tcp_port(port): + raise ConnectionError( + f"{tool_name} is not applicable to TCP/native nodes ({port}). " + "This tool requires USB-attached hardware." + ) + + def resolve_port(port: str | None) -> str: - """Pick a port: explicit > sole likely_meshtastic candidate > error.""" + """Pick a port: explicit > sole likely_meshtastic candidate > error. + + A `tcp://` string passes through (after canonicalization). When `port` + is None and no USB candidates are present, `MESHTASTIC_MCP_TCP_HOST` + is consulted via `devices.list_devices()`. + """ if port: + if is_tcp_port(port): + return normalize_tcp_endpoint(port) return port candidates = [d for d in devices.list_devices() if d["likely_meshtastic"]] if not candidates: raise ConnectionError( - "No Meshtastic devices detected. Plug one in or pass `port` explicitly. " - "Run `list_devices` with include_unknown=True to see all serial ports." + "No Meshtastic devices detected. Plug one in, set " + f"{TCP_HOST_ENV}= for a meshtasticd daemon, " + "or pass `port` explicitly. Run `list_devices` with " + "include_unknown=True to see all serial ports." ) if len(candidates) > 1: ports = ", ".join(c["port"] for c in candidates) @@ -43,17 +138,62 @@ def resolve_port(port: str | None) -> str: @contextmanager def connect(port: str | None = None, timeout_s: float = 8.0) -> Iterator: - """Open a `meshtastic.SerialInterface` and always close it. + """Open a meshtastic interface (serial or TCP) and always close it. - Raises `ConnectionError` immediately if another serial session holds the - port (a `pio device monitor` in `serial_sessions/`, for instance). + For serial: raises `ConnectionError` immediately if another serial + session holds the port (a `pio device monitor` in `serial_sessions/`). + For TCP: no exclusive-access requirement, so the serial-session check + is skipped — but the `port_lock` still serializes parallel `connect()` + calls to the same daemon endpoint. + + `timeout_s` is plumbed through to both `SerialInterface(timeout=...)` + and `TCPInterface(timeout=...)`. The meshtastic library uses the value + as the reply-wait deadline for `localNode.waitForConfig()` during + construction and for any subsequent admin RPC. `int()`-converted at + the boundary because the upstream API expects whole seconds. """ + resolved = resolve_port(port) + timeout = int(timeout_s) + + if is_tcp_port(resolved): + from meshtastic.tcp_interface import ( + TCPInterface, # type: ignore[import-untyped] + ) + + host, tcp_port = parse_tcp_port(resolved) + lock = registry.port_lock(resolved) + if not lock.acquire(blocking=False): + raise ConnectionError( + f"TCP endpoint {resolved} is busy — another device operation " + "is in flight. Retry shortly." + ) + + iface = None + try: + iface = TCPInterface( + hostname=host, + portNumber=tcp_port, + connectNow=True, + noProto=False, + timeout=timeout, + ) + yield iface + finally: + if iface is not None: + try: + iface.close() + except Exception: + pass + try: + lock.release() + except RuntimeError: + pass + return + from meshtastic.serial_interface import ( SerialInterface, # type: ignore[import-untyped] ) - resolved = resolve_port(port) - active = registry.active_session_for_port(resolved) if active is not None: raise ConnectionError( @@ -70,7 +210,12 @@ def connect(port: str | None = None, timeout_s: float = 8.0) -> Iterator: iface = None try: - iface = SerialInterface(devPath=resolved, connectNow=True, noProto=False) + iface = SerialInterface( + devPath=resolved, + connectNow=True, + noProto=False, + timeout=timeout, + ) yield iface finally: if iface is not None: diff --git a/mcp-server/src/meshtastic_mcp/devices.py b/mcp-server/src/meshtastic_mcp/devices.py index c4805c1ab..976e893a0 100644 --- a/mcp-server/src/meshtastic_mcp/devices.py +++ b/mcp-server/src/meshtastic_mcp/devices.py @@ -1,13 +1,18 @@ -"""USB/serial device discovery. +"""USB/serial + TCP device discovery. Combines the canonical `meshtastic.util.findPorts()` allowlist/blocklist with the richer metadata (`serial.tools.list_ports.comports()`) so callers see VID/PID, descriptions, and manufacturer strings alongside the "is this likely a Meshtastic device" signal. + +If `MESHTASTIC_MCP_TCP_HOST=` is set, a synthetic entry for the +`meshtasticd` daemon at that endpoint is prepended to the result, so +`resolve_port(None)` auto-selects it like a USB candidate. """ from __future__ import annotations +import os from typing import Any from serial.tools import list_ports @@ -19,6 +24,45 @@ def _to_hex(value: int | None) -> str | None: return f"0x{value:04x}" +def _tcp_endpoint_from_env() -> dict[str, Any] | None: + """Synthesize a TCP device entry from MESHTASTIC_MCP_TCP_HOST, if set. + + If the env var is malformed (non-integer port, path-like host, etc.), + return an entry with `likely_meshtastic=False` and the parser error in + the description, rather than raising — `list_devices` is the diagnostic + tool a user reaches for when their env var isn't working, so it must + not crash on misconfiguration. + """ + host = os.environ.get("MESHTASTIC_MCP_TCP_HOST") + if not host: + return None + # Lazy import to avoid a circular dependency (connection imports devices). + from . import connection + + try: + port = connection.normalize_tcp_endpoint(host) + description = "meshtasticd (TCP)" + likely = True + except connection.ConnectionError as e: + # Surface the raw env-var value plus the parser's reason so the + # user can see exactly what they set and why it was rejected. + # Don't double the scheme if the user already prefixed `tcp://`. + port = host if host.startswith(connection.TCP_SCHEME) else f"tcp://{host}" + description = f"meshtasticd (TCP) — invalid MESHTASTIC_MCP_TCP_HOST: {e}" + likely = False + return { + "port": port, + "vid": None, + "pid": None, + "description": description, + "manufacturer": None, + "product": None, + "serial_number": None, + "likely_meshtastic": likely, + "blacklisted": False, + } + + def list_devices(include_unknown: bool = False) -> list[dict[str, Any]]: """Return enriched info for serial ports, flagging Meshtastic candidates. @@ -70,6 +114,22 @@ def list_devices(include_unknown: bool = False) -> list[dict[str, Any]]: } ) - # Stable ordering: likely_meshtastic first, then by port path - results.sort(key=lambda r: (not r["likely_meshtastic"], r["port"])) + # Append the TCP endpoint (if env var set) and sort everything together. + tcp_entry = _tcp_endpoint_from_env() + if tcp_entry is not None: + results.append(tcp_entry) + + # Stable ordering: likely_meshtastic first; within rank, TCP wins over + # USB (explicit env-var configuration takes precedence over USB + # enumeration); then by port path. A misconfigured TCP entry has + # likely_meshtastic=False and lands among the other ignored entries — + # it does NOT pre-empt real USB devices at the top of the list. + results.sort( + key=lambda r: ( + not r["likely_meshtastic"], + not r["port"].startswith("tcp://"), + r["port"], + ) + ) + return results diff --git a/mcp-server/src/meshtastic_mcp/flash.py b/mcp-server/src/meshtastic_mcp/flash.py index 2c41a7c21..e11197d5f 100644 --- a/mcp-server/src/meshtastic_mcp/flash.py +++ b/mcp-server/src/meshtastic_mcp/flash.py @@ -17,7 +17,7 @@ from typing import Any import serial -from . import boards, config, devices, pio, userprefs +from . import boards, config, connection, devices, pio, userprefs # Meshtastic variants use both `esp32s3` and `esp32-s3` style names across # variants/*/platformio.ini (no consistency enforced). Accept both spellings. @@ -46,6 +46,18 @@ def _require_confirm(confirm: bool, operation: str) -> None: ) +def _reject_native_env(env: str, operation: str) -> None: + """`native*` envs build a host executable, not firmware — there's no + upload step. The user wants `build` (or just runs the binary directly). + """ + if env.startswith("native"): + raise FlashError( + f"{operation} is not applicable for env {env!r}: native envs " + "produce a host executable, not flashable firmware. Use `build` " + "instead, then run the resulting binary directly." + ) + + def _artifacts_for(env: str) -> list[Path]: build_dir = config.firmware_root() / ".pio" / "build" / env if not build_dir.is_dir(): @@ -141,6 +153,8 @@ def flash( that pio performs will pick up the injected values. """ _require_confirm(confirm, "flash") + _reject_native_env(env, "flash") + connection.reject_if_tcp(port, "flash") with userprefs.temporary_overrides(userprefs_overrides) as effective: result = pio.run( ["run", "-e", env, "-t", "upload", "--upload-port", port], @@ -200,6 +214,7 @@ def erase_and_flash( in that case) since a cached factory.bin would not reflect the new prefs. """ _require_confirm(confirm, "erase_and_flash") + connection.reject_if_tcp(port, "erase_and_flash") _check_esp32_env(env) if userprefs_overrides and skip_build: @@ -257,6 +272,7 @@ def update_flash( overrides are provided we always force a rebuild. """ _require_confirm(confirm, "update_flash") + connection.reject_if_tcp(port, "update_flash") _check_esp32_env(env) if userprefs_overrides and skip_build: @@ -391,6 +407,7 @@ def touch_1200bps( Returns `{ok, former_port, new_port, new_port_vid_pid, attempts}`. """ + connection.reject_if_tcp(port, "touch_1200bps") before_list = devices.list_devices(include_unknown=True) before_ports = {d["port"] for d in before_list} diff --git a/mcp-server/src/meshtastic_mcp/hw_tools.py b/mcp-server/src/meshtastic_mcp/hw_tools.py index 4275539ba..1835f4ef1 100644 --- a/mcp-server/src/meshtastic_mcp/hw_tools.py +++ b/mcp-server/src/meshtastic_mcp/hw_tools.py @@ -16,7 +16,7 @@ import subprocess from pathlib import Path from typing import Any, Sequence -from . import config, pio +from . import config, connection, pio _TIMEOUT_SHORT = 30 _TIMEOUT_LONG = 600 @@ -102,6 +102,7 @@ def _parse_esptool_chip_info(stdout: str) -> dict[str, Any]: def esptool_chip_info(port: str) -> dict[str, Any]: + connection.reject_if_tcp(port, "esptool_chip_info") binary = config.esptool_bin() # `chip_id` prints chip + mac + crystal + features. `flash_id` adds flash. combined = _run(binary, ["--port", port, "flash_id"], timeout=_TIMEOUT_SHORT) @@ -116,6 +117,7 @@ def esptool_chip_info(port: str) -> dict[str, Any]: def esptool_erase_flash(port: str, confirm: bool = False) -> dict[str, Any]: """Full-chip erase. Leaves the device unbootable until reflashed.""" _require_confirm(confirm, "esptool_erase_flash") + connection.reject_if_tcp(port, "esptool_erase_flash") binary = config.esptool_bin() # esptool v5 uses `erase-flash`, older uses `erase_flash`. Try the new name # first; if it fails with unknown command, retry old. @@ -134,6 +136,7 @@ def esptool_raw( """Raw esptool passthrough. Destructive subcommands require confirm=True.""" if not args: raise ToolError("args must not be empty") + connection.reject_if_tcp(port, "esptool_raw") # Find the first non-flag arg (the subcommand). subcommand = next((a for a in args if not a.startswith("-")), None) if subcommand and subcommand.replace("-", "_") in { @@ -156,6 +159,7 @@ NRFUTIL_DESTRUCTIVE = {"dfu", "settings"} def nrfutil_dfu(port: str, package_path: str, confirm: bool = False) -> dict[str, Any]: _require_confirm(confirm, "nrfutil_dfu") + connection.reject_if_tcp(port, "nrfutil_dfu") pkg = Path(package_path).expanduser() if not pkg.is_file(): raise ToolError(f"Package not found: {pkg}") @@ -213,6 +217,7 @@ def _parse_picotool_info(stdout: str) -> dict[str, Any]: def picotool_info(port: str | None = None) -> dict[str, Any]: """Read device info from a Pico in BOOTSEL mode. `port` is informational only — picotool auto-detects.""" + connection.reject_if_tcp(port, "picotool_info") binary = config.picotool_bin() res = _run(binary, ["info", "-a"], timeout=_TIMEOUT_SHORT) if res["exit_code"] != 0: diff --git a/mcp-server/src/meshtastic_mcp/serial_session.py b/mcp-server/src/meshtastic_mcp/serial_session.py index b9c71d1d0..43537323f 100644 --- a/mcp-server/src/meshtastic_mcp/serial_session.py +++ b/mcp-server/src/meshtastic_mcp/serial_session.py @@ -71,6 +71,10 @@ def open_session( If `env` is supplied, pio resolves baud and filters from platformio.ini. Otherwise uses the supplied `baud` and `filters` (default `['direct']`). """ + # Lazy import to avoid circular: registry imports serial_session. + from . import connection + + connection.reject_if_tcp(port, "serial_open") args = ["device", "monitor", "--port", port, "--no-reconnect"] effective_filters: list[str] effective_baud: int = baud diff --git a/mcp-server/tests/unit/test_connection_tcp.py b/mcp-server/tests/unit/test_connection_tcp.py new file mode 100644 index 000000000..54b7e9b47 --- /dev/null +++ b/mcp-server/tests/unit/test_connection_tcp.py @@ -0,0 +1,383 @@ +"""TCP transport plumbing in connection.py + devices.py. + +Pure-Python tests — no real device or daemon required. Mocks `TCPInterface` +when exercising `connect()`. +""" + +from __future__ import annotations + +from unittest.mock import patch + +import pytest +from meshtastic_mcp import connection, devices + +# ---------- helpers -------------------------------------------------------- + + +class TestIsTcpPort: + def test_tcp_scheme(self) -> None: + assert connection.is_tcp_port("tcp://localhost") is True + assert connection.is_tcp_port("tcp://localhost:4403") is True + assert connection.is_tcp_port("tcp://192.168.1.50:9999") is True + + def test_serial_paths(self) -> None: + assert connection.is_tcp_port("/dev/cu.usbmodem1234") is False + assert connection.is_tcp_port("/dev/ttyUSB0") is False + assert connection.is_tcp_port("COM3") is False + + def test_empty_or_none(self) -> None: + assert connection.is_tcp_port(None) is False + assert connection.is_tcp_port("") is False + + +class TestParseTcpPort: + def test_default_port(self) -> None: + assert connection.parse_tcp_port("tcp://localhost") == ("localhost", 4403) + + def test_explicit_port(self) -> None: + assert connection.parse_tcp_port("tcp://localhost:9999") == ( + "localhost", + 9999, + ) + + def test_ip_with_port(self) -> None: + assert connection.parse_tcp_port("tcp://192.168.1.50:4403") == ( + "192.168.1.50", + 4403, + ) + + +class TestNormalizeTcpEndpoint: + def test_bare_host(self) -> None: + assert connection.normalize_tcp_endpoint("localhost") == "tcp://localhost:4403" + + def test_host_port(self) -> None: + assert ( + connection.normalize_tcp_endpoint("localhost:5000") + == "tcp://localhost:5000" + ) + + def test_full_url(self) -> None: + assert ( + connection.normalize_tcp_endpoint("tcp://1.2.3.4") == "tcp://1.2.3.4:4403" + ) + assert ( + connection.normalize_tcp_endpoint("tcp://1.2.3.4:9999") + == "tcp://1.2.3.4:9999" + ) + + def test_idempotent(self) -> None: + once = connection.normalize_tcp_endpoint("localhost:4403") + twice = connection.normalize_tcp_endpoint(once) + assert once == twice == "tcp://localhost:4403" + + def test_path_like_endpoint_rejected(self) -> None: + # Serial port paths and Windows drive paths are common config typos + # (someone passes a serial path to MESHTASTIC_MCP_TCP_HOST). Reject + # rather than producing a nonsense `tcp:///dev/cu.foo:4403` URL. + with pytest.raises(connection.ConnectionError, match="path separator"): + connection.normalize_tcp_endpoint("/dev/cu.foo") + with pytest.raises(connection.ConnectionError): + connection.normalize_tcp_endpoint("tcp:///dev/cu.foo:4403") + with pytest.raises(connection.ConnectionError): + connection.normalize_tcp_endpoint(r"C:\Windows\System32") + + def test_non_integer_port_rejected(self) -> None: + with pytest.raises(connection.ConnectionError, match="not an integer"): + connection.normalize_tcp_endpoint("tcp://host:notaport") + with pytest.raises(connection.ConnectionError, match="not an integer"): + connection.normalize_tcp_endpoint("host:notaport") + + def test_empty_host_rejected(self) -> None: + with pytest.raises(connection.ConnectionError, match="empty host"): + connection.normalize_tcp_endpoint("tcp://:4403") + + def test_port_out_of_range_rejected(self) -> None: + with pytest.raises(connection.ConnectionError, match="out of range"): + connection.normalize_tcp_endpoint("tcp://host:0") + with pytest.raises(connection.ConnectionError, match="out of range"): + connection.normalize_tcp_endpoint("tcp://host:65536") + with pytest.raises(connection.ConnectionError, match="out of range"): + connection.normalize_tcp_endpoint("host:99999") + + +class TestParseTcpPortValidation: + def test_missing_scheme_rejected(self) -> None: + # parse_tcp_port is a low-level helper that requires the scheme. + # Misuse should fail loudly rather than silently mis-parsing. + with pytest.raises(connection.ConnectionError, match="expected"): + connection.parse_tcp_port("localhost:4403") + + def test_negative_port_rejected(self) -> None: + with pytest.raises(connection.ConnectionError, match="out of range"): + connection.parse_tcp_port("tcp://host:-1") + + +# ---------- reject_if_tcp -------------------------------------------------- + + +class TestRejectIfTcp: + def test_rejects_tcp(self) -> None: + with pytest.raises(connection.ConnectionError, match="not applicable"): + connection.reject_if_tcp("tcp://localhost", "esptool_chip_info") + + def test_passes_through_serial(self) -> None: + connection.reject_if_tcp("/dev/cu.usbmodem1", "esptool_chip_info") # no raise + + def test_passes_through_none(self) -> None: + # None means "auto-detect"; not the explicit-arg case we guard. + connection.reject_if_tcp(None, "esptool_chip_info") # no raise + + +# ---------- resolve_port --------------------------------------------------- + + +class TestResolvePort: + def test_explicit_serial_passthrough(self) -> None: + assert connection.resolve_port("/dev/cu.usbmodem999") == "/dev/cu.usbmodem999" + + def test_explicit_tcp_normalized(self) -> None: + assert connection.resolve_port("tcp://localhost") == "tcp://localhost:4403" + + def test_no_port_no_devices_errors(self, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + with patch.object(devices, "list_devices", return_value=[]): + with pytest.raises( + connection.ConnectionError, match="No Meshtastic devices" + ): + connection.resolve_port(None) + + def test_no_port_one_candidate_selected( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + fake = [{"port": "/dev/cu.usbmodem1", "likely_meshtastic": True}] + with patch.object(devices, "list_devices", return_value=fake): + assert connection.resolve_port(None) == "/dev/cu.usbmodem1" + + def test_no_port_multiple_candidates_errors( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + fake = [ + {"port": "/dev/cu.usbmodem1", "likely_meshtastic": True}, + {"port": "/dev/cu.usbmodem2", "likely_meshtastic": True}, + ] + with patch.object(devices, "list_devices", return_value=fake): + with pytest.raises(connection.ConnectionError, match="Multiple"): + connection.resolve_port(None) + + def test_env_var_surfaces_tcp_via_devices( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "localhost") + # Don't patch list_devices — let the real env-var path run, but stub + # the USB enumeration to keep the test hermetic. + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + assert connection.resolve_port(None) == "tcp://localhost:4403" + + +# ---------- devices.list_devices TCP entry -------------------------------- + + +class TestDevicesTcpEntry: + def test_no_env_var_no_tcp_entry(self, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + ds = devices.list_devices() + assert all(not d["port"].startswith("tcp://") for d in ds) + + def test_env_var_adds_tcp_entry(self, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "myhost:9999") + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + ds = devices.list_devices() + tcp = [d for d in ds if d["port"].startswith("tcp://")] + assert len(tcp) == 1 + assert tcp[0]["port"] == "tcp://myhost:9999" + assert tcp[0]["likely_meshtastic"] is True + assert tcp[0]["description"] == "meshtasticd (TCP)" + + def test_tcp_entry_first_in_results(self, monkeypatch: pytest.MonkeyPatch) -> None: + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "localhost") + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + ds = devices.list_devices() + assert ds, "expected at least the TCP entry" + assert ds[0]["port"].startswith("tcp://") + + def test_invalid_env_var_does_not_break_list_devices( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + # `list_devices` is the diagnostic tool reached for when an env var + # isn't working — it must not throw on misconfiguration. + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "host:notaport") + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + ds = devices.list_devices(include_unknown=True) + tcp = [d for d in ds if "TCP" in (d["description"] or "")] + assert len(tcp) == 1 + assert tcp[0]["likely_meshtastic"] is False + assert "invalid MESHTASTIC_MCP_TCP_HOST" in tcp[0]["description"] + assert "not an integer" in tcp[0]["description"] + + def test_invalid_env_var_excluded_from_resolve_port_autodetect( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + # `likely_meshtastic=False` keeps the bad TCP entry out of the + # auto-select path — `resolve_port(None)` should still report + # "no Meshtastic devices" rather than picking a broken endpoint. + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "host:notaport") + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + with pytest.raises(connection.ConnectionError, match="No Meshtastic"): + connection.resolve_port(None) + + def test_invalid_env_var_does_not_double_tcp_scheme( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + # If a user mistakenly sets `MESHTASTIC_MCP_TCP_HOST=tcp://host:bad`, + # the diagnostic entry must surface the raw value as-is rather than + # producing `tcp://tcp://host:bad`. + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "tcp://host:notaport") + with patch("meshtastic_mcp.devices.list_ports.comports", return_value=[]): + ds = devices.list_devices(include_unknown=True) + tcp = [d for d in ds if "TCP" in (d["description"] or "")] + assert len(tcp) == 1 + assert tcp[0]["port"] == "tcp://host:notaport" + assert "tcp://tcp://" not in tcp[0]["port"] + + def test_invalid_env_var_does_not_pre_empt_real_usb_devices( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + # Sort ordering: a misconfigured TCP env var must NOT take position 0 + # ahead of real USB candidates. Position 0 is reserved for the highest + # rank (likely_meshtastic=True), with TCP-before-USB as a tiebreaker + # within rank. + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "host:notaport") + + # Stub a USB Meshtastic candidate (Espressif VID, port present in + # findPorts). + class FakeInfo: + def __init__(self, device: str, vid: int, pid: int) -> None: + self.device = device + self.vid = vid + self.pid = pid + self.description = "Heltec V3" + self.manufacturer = "Espressif" + self.product = "USB JTAG/serial" + self.serial_number = "abc" + + fake_port = FakeInfo("/dev/cu.usbmodem4201", 0x303A, 0x1001) + with patch( + "meshtastic_mcp.devices.list_ports.comports", return_value=[fake_port] + ), patch( + "meshtastic.util.findPorts", + return_value=["/dev/cu.usbmodem4201"], + ): + ds = devices.list_devices(include_unknown=True) + + assert ds, "expected at least the USB + TCP entries" + # Real USB candidate must be at position 0 — it's likely_meshtastic. + assert ds[0]["port"] == "/dev/cu.usbmodem4201" + assert ds[0]["likely_meshtastic"] is True + # The malformed TCP entry exists but lands among the unlikely entries. + tcp = [d for d in ds if "TCP" in (d["description"] or "")] + assert len(tcp) == 1 + assert tcp[0]["likely_meshtastic"] is False + assert ds.index(tcp[0]) > 0 + + def test_likely_tcp_entry_wins_tiebreak_over_usb( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + # Conversely, a *valid* TCP env var should sort ahead of USB + # candidates of equal likely_meshtastic rank — explicit env-var + # configuration is a precedence signal. + monkeypatch.setenv("MESHTASTIC_MCP_TCP_HOST", "localhost:4403") + + class FakeInfo: + def __init__(self, device: str, vid: int, pid: int) -> None: + self.device = device + self.vid = vid + self.pid = pid + self.description = "Heltec V3" + self.manufacturer = "Espressif" + self.product = "USB JTAG/serial" + self.serial_number = "abc" + + fake_port = FakeInfo("/dev/cu.usbmodem4201", 0x303A, 0x1001) + with patch( + "meshtastic_mcp.devices.list_ports.comports", return_value=[fake_port] + ), patch( + "meshtastic.util.findPorts", + return_value=["/dev/cu.usbmodem4201"], + ): + ds = devices.list_devices() + + assert ds[0]["port"] == "tcp://localhost:4403" + assert ds[0]["likely_meshtastic"] is True + + +# ---------- connect() routing --------------------------------------------- + + +class TestConnectRoutesTcp: + def test_connect_uses_tcp_interface_for_tcp_port( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Verify the TCP branch instantiates `TCPInterface(hostname, portNumber)` + and never touches `SerialInterface`.""" + # Make sure the env var doesn't leak in and confuse resolve_port. + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + + with patch("meshtastic.tcp_interface.TCPInterface") as mock_tcp, patch( + "meshtastic.serial_interface.SerialInterface" + ) as mock_serial: + mock_tcp.return_value.close.return_value = None + with connection.connect(port="tcp://example.com:1234", timeout_s=12.0): + pass + + mock_tcp.assert_called_once_with( + hostname="example.com", + portNumber=1234, + connectNow=True, + noProto=False, + timeout=12, + ) + mock_serial.assert_not_called() + + def test_connect_plumbs_timeout_to_serial_interface( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + """Verify the serial branch also propagates `timeout_s` so callers + passing a custom timeout to `device_info` / `list_nodes` / etc. don't + silently get the library default.""" + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + + with patch("meshtastic.serial_interface.SerialInterface") as mock_serial, patch( + "meshtastic.tcp_interface.TCPInterface" + ) as mock_tcp: + mock_serial.return_value.close.return_value = None + with connection.connect(port="/dev/cu.fake", timeout_s=20.0): + pass + + mock_serial.assert_called_once_with( + devPath="/dev/cu.fake", + connectNow=True, + noProto=False, + timeout=20, + ) + mock_tcp.assert_not_called() + + def test_connect_releases_lock_on_tcp_failure( + self, monkeypatch: pytest.MonkeyPatch + ) -> None: + monkeypatch.delenv("MESHTASTIC_MCP_TCP_HOST", raising=False) + with patch("meshtastic.tcp_interface.TCPInterface") as mock_tcp: + mock_tcp.side_effect = RuntimeError("boom") + with pytest.raises(RuntimeError, match="boom"): + with connection.connect(port="tcp://locktest:4403"): + pass + + # Lock should be released — a second connect attempt must not fail + # with "busy". + with patch("meshtastic.tcp_interface.TCPInterface") as mock_tcp: + mock_tcp.return_value.close.return_value = None + with connection.connect(port="tcp://locktest:4403"): + pass From 7066abbb86739be7e3a907fb40ed2bd4744f637b Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Thu, 30 Apr 2026 13:52:42 -0500 Subject: [PATCH 142/150] Fix MAC_from_string to use input parameter instead of global config for MAC address parsing (#10356) * Fix MAC_from_string to use input parameter instead of global config for MAC address parsing * Enhance MAC_from_string validation and error handling * Add missing include for in PortduinoGlue.cpp --- src/platform/portduino/PortduinoGlue.cpp | 33 ++-- test/test_mac_from_string/test_main.cpp | 195 +++++++++++++++++++++++ 2 files changed, 219 insertions(+), 9 deletions(-) create mode 100644 test/test_mac_from_string/test_main.cpp diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index fbaa3c98c..eeb56240d 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -1052,17 +1053,31 @@ static bool ends_with(std::string_view str, std::string_view suffix) bool MAC_from_string(std::string mac_str, uint8_t *dmac) { mac_str.erase(std::remove(mac_str.begin(), mac_str.end(), ':'), mac_str.end()); - if (mac_str.length() == 12) { - dmac[0] = std::stoi(portduino_config.mac_address.substr(0, 2), nullptr, 16); - dmac[1] = std::stoi(portduino_config.mac_address.substr(2, 2), nullptr, 16); - dmac[2] = std::stoi(portduino_config.mac_address.substr(4, 2), nullptr, 16); - dmac[3] = std::stoi(portduino_config.mac_address.substr(6, 2), nullptr, 16); - dmac[4] = std::stoi(portduino_config.mac_address.substr(8, 2), nullptr, 16); - dmac[5] = std::stoi(portduino_config.mac_address.substr(10, 2), nullptr, 16); - return true; - } else { + if (mac_str.length() != 12) { return false; } + // Validate every character is a hex digit before parsing. std::stoi + // would otherwise skip leading whitespace and silently truncate at the + // first non-digit, which is too lenient for a MAC address. + for (char c : mac_str) { + if (!isxdigit(static_cast(c))) { + return false; + } + } + // Parse into a temporary so dmac is not partially modified if a later + // byte fails. At least one caller in getMacAddr() ignores the bool + // return, so leaving stale bytes in dmac on failure would silently + // produce a wrong MAC. + uint8_t tmp[6]; + try { + for (int i = 0; i < 6; i++) { + tmp[i] = static_cast(std::stoi(mac_str.substr(i * 2, 2), nullptr, 16)); + } + } catch (const std::exception &) { + return false; + } + memcpy(dmac, tmp, 6); + return true; } std::string exec(const char *cmd) diff --git a/test/test_mac_from_string/test_main.cpp b/test/test_mac_from_string/test_main.cpp new file mode 100644 index 000000000..c9d2289cc --- /dev/null +++ b/test/test_mac_from_string/test_main.cpp @@ -0,0 +1,195 @@ +// Unit tests for MAC_from_string in src/platform/portduino/PortduinoGlue.cpp. +// +// Regression coverage for when the function stripped colons from +// its mac_str parameter but then read bytes from the global +// portduino_config.mac_address. Symptoms: --hwid silently ignored when +// MACAddress: was also set, and SIGABRT (stoi: no conversion) when --hwid +// was used without MACAddress: in config.yaml. +#include "Arduino.h" +#include "TestUtil.h" +#include +#include +#include +#include + +// Forward-declare instead of including PortduinoGlue.h to avoid pulling in +// LR11x0Interface, USBHal, mesh.pb.h, yaml-cpp, and the full portduino_config +// struct just to test a self-contained string parser. The symbol is defined +// in PortduinoGlue.cpp and resolved at link time. +bool MAC_from_string(std::string mac_str, uint8_t *dmac); + +void setUp(void) {} +void tearDown(void) {} + +// --- Happy-path parsing --- + +void test_colon_separated_uppercase() +{ + uint8_t dmac[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("AA:BB:CC:DD:EE:FF", dmac)); + TEST_ASSERT_EQUAL_HEX8(0xAA, dmac[0]); + TEST_ASSERT_EQUAL_HEX8(0xBB, dmac[1]); + TEST_ASSERT_EQUAL_HEX8(0xCC, dmac[2]); + TEST_ASSERT_EQUAL_HEX8(0xDD, dmac[3]); + TEST_ASSERT_EQUAL_HEX8(0xEE, dmac[4]); + TEST_ASSERT_EQUAL_HEX8(0xFF, dmac[5]); +} + +void test_colon_separated_lowercase() +{ + uint8_t dmac[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("02:ca:fe:ba:be:01", dmac)); + TEST_ASSERT_EQUAL_HEX8(0x02, dmac[0]); + TEST_ASSERT_EQUAL_HEX8(0xCA, dmac[1]); + TEST_ASSERT_EQUAL_HEX8(0xFE, dmac[2]); + TEST_ASSERT_EQUAL_HEX8(0xBA, dmac[3]); + TEST_ASSERT_EQUAL_HEX8(0xBE, dmac[4]); + TEST_ASSERT_EQUAL_HEX8(0x01, dmac[5]); +} + +void test_no_colons_packed_hex() +{ + // The CLI form produced by some tools — 12 hex chars, no separators. + uint8_t dmac[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("AABBCCDDEEFF", dmac)); + TEST_ASSERT_EQUAL_HEX8(0xAA, dmac[0]); + TEST_ASSERT_EQUAL_HEX8(0xFF, dmac[5]); +} + +void test_two_distinct_inputs_yield_distinct_outputs() +{ + // Direct regression for the original bug: parsing two different MAC + // strings in succession must produce two different byte sequences. + // Pre-fix, both calls would have produced identical bytes derived from + // the (untouched) global portduino_config.mac_address. + uint8_t a[6] = {0}; + uint8_t b[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("AA:BB:CC:DD:EE:FF", a)); + TEST_ASSERT_TRUE(MAC_from_string("02:CA:FE:BA:BE:01", b)); + TEST_ASSERT_NOT_EQUAL(0, std::memcmp(a, b, 6)); + TEST_ASSERT_EQUAL_HEX8(0xAA, a[0]); + TEST_ASSERT_EQUAL_HEX8(0x02, b[0]); +} + +void test_does_not_read_external_state() +{ + // The function must derive every byte from its parameter, not from any + // global. Provide a unique MAC and verify all six bytes match the input + // exactly — leaves no room for the function to be smuggling bytes from + // elsewhere. + uint8_t dmac[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("12:34:56:78:9A:BC", dmac)); + const uint8_t expected[6] = {0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC}; + TEST_ASSERT_EQUAL_HEX8_ARRAY(expected, dmac, 6); +} + +// --- Rejected inputs --- +// Pre-fix, the empty/short cases either crashed (stoi exception on substr("") +// of the empty global) or silently filled dmac with stale bytes. Post-fix, +// the length guard rejects them cleanly with `false` and dmac is unchanged. + +void test_empty_string_returns_false() +{ + uint8_t dmac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x11}; + uint8_t before[6]; + std::memcpy(before, dmac, 6); + TEST_ASSERT_FALSE(MAC_from_string("", dmac)); + // dmac must be untouched on failure. + TEST_ASSERT_EQUAL_HEX8_ARRAY(before, dmac, 6); +} + +void test_too_short_returns_false() +{ + uint8_t dmac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x11}; + uint8_t before[6]; + std::memcpy(before, dmac, 6); + TEST_ASSERT_FALSE(MAC_from_string("AA:BB:CC", dmac)); + TEST_ASSERT_EQUAL_HEX8_ARRAY(before, dmac, 6); +} + +void test_too_long_returns_false() +{ + uint8_t dmac[6] = {0}; + // 14 hex chars after colon-strip > 12. + TEST_ASSERT_FALSE(MAC_from_string("AA:BB:CC:DD:EE:FF:00", dmac)); +} + +void test_only_colons_returns_false() +{ + uint8_t dmac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x11}; + uint8_t before[6]; + std::memcpy(before, dmac, 6); + TEST_ASSERT_FALSE(MAC_from_string(":::::", dmac)); + TEST_ASSERT_EQUAL_HEX8_ARRAY(before, dmac, 6); +} + +void test_extra_colons_still_parses() +{ + // Colon stripping happens before length check, so an unconventional + // grouping that totals 12 hex chars after stripping is still accepted. + uint8_t dmac[6] = {0}; + TEST_ASSERT_TRUE(MAC_from_string("AABB:CCDD:EEFF", dmac)); + TEST_ASSERT_EQUAL_HEX8(0xAA, dmac[0]); + TEST_ASSERT_EQUAL_HEX8(0xFF, dmac[5]); +} + +void test_non_hex_input_returns_false() +{ + // 12 chars of non-hex would have made std::stoi throw before the + // try/catch wrapper was added, killing the daemon. Now must return false + // and leave dmac untouched. + uint8_t dmac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x11}; + uint8_t before[6]; + std::memcpy(before, dmac, 6); + TEST_ASSERT_FALSE(MAC_from_string("ZZ:ZZ:ZZ:ZZ:ZZ:ZZ", dmac)); + TEST_ASSERT_EQUAL_HEX8_ARRAY(before, dmac, 6); +} + +void test_partial_hex_failure_preserves_dmac() +{ + // First five bytes are valid hex; the sixth ("ZZ") is not. Without the + // temp-buffer staging, dmac would be partially overwritten with the five + // good bytes plus stale data in slot 5 — silently producing a wrong MAC + // since the only caller that uses this in getMacAddr() ignores the bool + // return value. + uint8_t dmac[6] = {0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x11}; + uint8_t before[6]; + std::memcpy(before, dmac, 6); + TEST_ASSERT_FALSE(MAC_from_string("AA:BB:CC:DD:EE:ZZ", dmac)); + TEST_ASSERT_EQUAL_HEX8_ARRAY(before, dmac, 6); +} + +void test_embedded_non_hex_returns_false() +{ + // std::stoi tolerates leading whitespace and a "0x" prefix, so a stray + // space inside a 2-char window like " F" would silently parse as 0xF. + // The per-character isxdigit() pre-check rejects these. The 14-char + // "0xAABBCCDDEEFF" is also rejected by the length check. + uint8_t dmac[6] = {0}; + TEST_ASSERT_FALSE(MAC_from_string("AA:BB:CC:DD:EE: F", dmac)); + TEST_ASSERT_FALSE(MAC_from_string("0xAABBCCDDEEFF", dmac)); +} + +// --- Unity lifecycle --- + +void setup() +{ + initializeTestEnvironment(); + UNITY_BEGIN(); + RUN_TEST(test_colon_separated_uppercase); + RUN_TEST(test_colon_separated_lowercase); + RUN_TEST(test_no_colons_packed_hex); + RUN_TEST(test_two_distinct_inputs_yield_distinct_outputs); + RUN_TEST(test_does_not_read_external_state); + RUN_TEST(test_empty_string_returns_false); + RUN_TEST(test_too_short_returns_false); + RUN_TEST(test_too_long_returns_false); + RUN_TEST(test_only_colons_returns_false); + RUN_TEST(test_extra_colons_still_parses); + RUN_TEST(test_non_hex_input_returns_false); + RUN_TEST(test_partial_hex_failure_preserves_dmac); + RUN_TEST(test_embedded_non_hex_returns_false); + exit(UNITY_END()); +} + +void loop() {} From 4ee959810795e94b6046c0bc4854f5ec6a859927 Mon Sep 17 00:00:00 2001 From: Austin Date: Thu, 30 Apr 2026 16:22:11 -0400 Subject: [PATCH 143/150] Docker: Install grpcio-tools from distro (#10358) Use distro provided Python at build time (instead of the `python` images from dockerhub) and install `grpcio-tools` using the distro provided packages. This should speed up build times, ESPECIALLY on riscv64 (where prebuilt `grpcio-tools` wheels are not provided on pip). Co-authored-by: Copilot --- Dockerfile | 4 +++- alpine.Dockerfile | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e00d81658..ba013cb15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,15 +3,17 @@ # trunk-ignore-all(hadolint/DL3008): Do not pin apt package versions # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions -FROM python:3.14-slim-trixie AS builder +FROM debian:trixie AS builder ARG PIO_ENV=native ENV DEBIAN_FRONTEND=noninteractive ENV TZ=Etc/UTC # Install Dependencies ENV PIP_ROOT_USER_ACTION=ignore +ENV PIP_BREAK_SYSTEM_PACKAGES=1 RUN apt-get update && apt-get install --no-install-recommends -y \ curl wget g++ zip git ca-certificates pkg-config \ + python3-pip python3-grpc-tools \ libgpiod-dev libyaml-cpp-dev libbluetooth-dev libi2c-dev libuv1-dev \ libusb-1.0-0-dev libulfius-dev liborcania-dev libssl-dev \ libx11-dev libinput-dev libxkbcommon-x11-dev libsqlite3-dev libsdl2-dev \ diff --git a/alpine.Dockerfile b/alpine.Dockerfile index 40a4990bb..6d1b999e2 100644 --- a/alpine.Dockerfile +++ b/alpine.Dockerfile @@ -4,12 +4,18 @@ # trunk-ignore-all(hadolint/DL3013): Do not pin pip package versions # Ensure the Alpine version is updated in both stages of the container! -FROM python:3.14-alpine3.23 AS builder +FROM alpine:3.23 AS builder ARG PIO_ENV=native -ENV PIP_ROOT_USER_ACTION=ignore +# Enable Alpine community repository (for 'py3-grpcio-tools') +RUN echo "https://dl-cdn.alpinelinux.org/alpine/v$(cut -d. -f1,2 /etc/alpine-release)/community" >> /etc/apk/repositories + +# Install Dependencies +ENV PIP_ROOT_USER_ACTION=ignore +ENV PIP_BREAK_SYSTEM_PACKAGES=1 RUN apk --no-cache add \ bash g++ libstdc++-dev linux-headers zip git ca-certificates libbsd-dev \ + py3-pip py3-grpcio-tools \ libgpiod-dev yaml-cpp-dev bluez-dev \ libusb-dev i2c-tools-dev libuv-dev openssl-dev pkgconf argp-standalone \ libx11-dev libinput-dev libxkbcommon-dev sqlite-dev sdl2-dev \ From 90744ee0b767b354b7194f05b570ad4ca154f25d Mon Sep 17 00:00:00 2001 From: Jason P Date: Fri, 1 May 2026 08:46:53 -0500 Subject: [PATCH 144/150] Update PhoneAPI.cpp to reduce chattiness (#10367) --- src/mesh/PhoneAPI.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesh/PhoneAPI.cpp b/src/mesh/PhoneAPI.cpp index 2a3a2a26c..9ff27d33e 100644 --- a/src/mesh/PhoneAPI.cpp +++ b/src/mesh/PhoneAPI.cpp @@ -512,11 +512,6 @@ size_t PhoneAPI::getFromRadio(uint8_t *buf) // LOG_INFO("nodeinfo: num=0x%x, lastseen=%u, id=%s, name=%s", nodeInfoForPhone.num, nodeInfoForPhone.last_heard, // nodeInfoForPhone.user.id, nodeInfoForPhone.user.long_name); - // Occasional progress logging. (readIndex==2 will be true for the first non-us node) - if (readIndex == 2 || readIndex % 20 == 0) { - LOG_DEBUG("nodeinfo: %d/%d", readIndex, nodeDB->getNumMeshNodes()); - } - fromRadioScratch.which_payload_variant = meshtastic_FromRadio_node_info_tag; fromRadioScratch.node_info = infoToSend; prefetchNodeInfos(); @@ -647,9 +642,11 @@ void PhoneAPI::releaseQueueStatusPhonePacket() void PhoneAPI::prefetchNodeInfos() { bool added = false; + bool wasEmpty = false; // Keep the queue topped up so BLE reads stay responsive even if DB fetches take a moment. { concurrency::LockGuard guard(&nodeInfoMutex); + wasEmpty = nodeInfoQueue.empty(); while (nodeInfoQueue.size() < kNodePrefetchDepth) { auto nextNode = nodeDB->readNextMeshNode(readIndex); if (!nextNode) @@ -663,11 +660,15 @@ void PhoneAPI::prefetchNodeInfos() info.via_mqtt = isUs ? false : info.via_mqtt; info.is_favorite = info.is_favorite || isUs; nodeInfoQueue.push_back(info); + // Log progress here (at fetch time) so readIndex is accurate and each value logs only once. + if (readIndex == 2 || readIndex % 20 == 0) { + LOG_DEBUG("nodeinfo: %d/%d", readIndex, nodeDB->getNumMeshNodes()); + } added = true; } } - if (added) + if (added && wasEmpty) onNowHasData(0); } From 55f40ecdfdd3d41a5a19d7ed4c787efbca86fedb Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Fri, 1 May 2026 08:56:49 -0500 Subject: [PATCH 145/150] Add ulfius webserver support to macos native target (#10366) * Add ulfius webserver support to macos native target * fix: update PiWebServer docs for macOS and add explicit cstring include Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/3ce82582-23e0-4afe-b22f-b24f81721488 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fix: add --cflags to openssl@3 pkg-config and fix apt package name Agent-Logs-Url: https://github.com/meshtastic/firmware/sessions/1a6c59aa-4393-4134-8cee-61eeee0e9127 Co-authored-by: thebentern <9000580+thebentern@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/mesh/raspihttp/PiWebServer.cpp | 35 +++++++++++++++------ src/mesh/raspihttp/PiWebServer.h | 6 +++- src/platform/portduino/PortduinoGlue.cpp | 40 ++++++++++++++++++++++-- variants/native/portduino/platformio.ini | 38 +++++++++++++++++++++- 4 files changed, 105 insertions(+), 14 deletions(-) diff --git a/src/mesh/raspihttp/PiWebServer.cpp b/src/mesh/raspihttp/PiWebServer.cpp index 3e9dbe8c2..5485f8eb2 100644 --- a/src/mesh/raspihttp/PiWebServer.cpp +++ b/src/mesh/raspihttp/PiWebServer.cpp @@ -1,22 +1,34 @@ /* -Adds a WebServer and WebService callbacks to meshtastic as Linux Version. The WebServer & Webservices -runs in a real linux thread beside the portdunio threading emulation. It replaces the complete ESP32 -Webserver libs including generation of SSL certifcicates, because the use ESP specific details in -the lib that can't be emulated. +Adds a WebServer and WebService callbacks to meshtastic via the Portduino/native target (Linux and +macOS). The WebServer & Webservices run in a real host thread beside the Portduino threading +emulation. It replaces the complete ESP32 Webserver libs including generation of SSL certificates, +because those libs use ESP-specific details that can't be emulated. The WebServices adapt to the two major phoneapi functions "handleAPIv1FromRadio,handleAPIv1ToRadio" -The WebServer just adds basaic support to deliver WebContent, so it can be used to -deliver the WebGui definded by the WebClient Project. +The WebServer just adds basic support to deliver WebContent, so it can be used to +deliver the WebGui defined by the WebClient Project. Steps to get it running: -1.) Add these Linux Libs to the compile and target machine: + +Linux (apt): +1.) Add these libs to the compile and target machine: sudo apt update && \ - apt -y install openssl libssl-dev libopenssl libsdl2-dev \ + apt -y install openssl libssl-dev libsdl2-dev \ libulfius-dev liborcania-dev +macOS (Homebrew): +1.) Install prerequisites via Homebrew: + + brew install ulfius openssl@3 + + The PlatformIO env (native-macos) picks up compiler/linker flags via + `pkg-config`. In particular, OpenSSL needs `pkg-config --cflags --libs openssl@3` + so both the Homebrew include path and linker flags are provided; ulfius and its + dependencies (liborcania, libyder) are also resolved via `pkg-config`. + 2.) Configure the root directory of the web Content in the config.yaml file. - The followinng tags should be included and set at your needs + The following tags should be included and set at your needs Example entry in the config.yaml Webserver: @@ -34,7 +46,10 @@ Author: Marc Philipp Hammermann mail: marchammermann@googlemail.com */ -#ifdef PORTDUINO_LINUX_HARDWARE +// Mirrors the guard in PiWebServer.h — see comment there. macOS Homebrew +// provides ulfius + deps; Linux pulls them via apt. Either way, this +// translation unit only compiles when the headers are present. +#ifdef ARCH_PORTDUINO #if __has_include() #include "PiWebServer.h" #include "NodeDB.h" diff --git a/src/mesh/raspihttp/PiWebServer.h b/src/mesh/raspihttp/PiWebServer.h index 74b094f8c..24b7de4b1 100644 --- a/src/mesh/raspihttp/PiWebServer.h +++ b/src/mesh/raspihttp/PiWebServer.h @@ -1,5 +1,9 @@ #pragma once -#ifdef PORTDUINO_LINUX_HARDWARE +// Portduino webserver is built whenever the ulfius headers are reachable, +// not only on Linux. macOS users can `brew install ulfius` to enable it; +// without ulfius the entire body is skipped and main.cpp's matching +// __has_include guard avoids referencing the type. +#ifdef ARCH_PORTDUINO #if __has_include() #include "PhoneAPI.h" #include "ulfius-cfg.h" diff --git a/src/platform/portduino/PortduinoGlue.cpp b/src/platform/portduino/PortduinoGlue.cpp index eeb56240d..1f59e78b5 100644 --- a/src/platform/portduino/PortduinoGlue.cpp +++ b/src/platform/portduino/PortduinoGlue.cpp @@ -33,6 +33,16 @@ #include #endif +#ifdef __APPLE__ +// Used by getMacAddr()'s macOS fallback to read the en0 link-layer address. +// `getifaddrs()` is the BSD-portable way; `` provides the +// `sockaddr_dl` cast and the `LLADDR()` macro that points at the 6-byte MAC. +#include // strcmp, memcpy +#include +#include +#include +#endif + #include "platform/portduino/USBHal.h" portduino_config_struct portduino_config; @@ -156,9 +166,35 @@ void getMacAddr(uint8_t *dmac) dmac[3] = di.bdaddr.b[2]; dmac[4] = di.bdaddr.b[1]; dmac[5] = di.bdaddr.b[0]; +#elif defined(__APPLE__) + // No BlueZ on macOS, but we can fall back to the host's primary + // network interface MAC. `en0` is Wi-Fi on every shipping Mac + // (Ethernet, when present, is en1 or higher), which gives the user + // the same kind of stable, host-derived identifier that the BlueZ + // path provides on Linux. If en0 isn't found or has no MAC, dmac is + // left untouched and the caller's "Blank MAC Address not allowed!" + // check will still fire — preserving existing behavior for users + // who deliberately rely on --hwid or YAML override. + struct ifaddrs *ifap = nullptr; + if (getifaddrs(&ifap) == 0) { + for (struct ifaddrs *p = ifap; p != nullptr; p = p->ifa_next) { + if (p->ifa_addr == nullptr || p->ifa_addr->sa_family != AF_LINK) { + continue; + } + if (strcmp(p->ifa_name, "en0") != 0) { + continue; + } + auto *sdl = reinterpret_cast(p->ifa_addr); + if (sdl->sdl_alen == 6) { + memcpy(dmac, LLADDR(sdl), 6); + break; + } + } + freeifaddrs(ifap); + } #else - // No BlueZ on non-Linux hosts (e.g. macOS). Leave dmac at its default; - // the caller can override via the --hwid CLI flag or the YAML config. + // No platform-specific MAC source; leave dmac at its default. Caller + // can override via the --hwid CLI flag or the YAML config. (void)dmac; #endif } diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index e493da77b..0a47e7283 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -125,6 +125,8 @@ test_testing_command = ; ; Prerequisites (Homebrew): ; brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config +; # Optional: enable the HTTP API (PiWebServer) on macOS: +; brew install ulfius ; ; The macOS-side patches now live upstream: ; * meshtastic/platform-native — `String.h`-shadow shim, `-Wno-enum-constexpr-conversion`, @@ -191,7 +193,16 @@ build_flags = ${portduino_base.build_flags_common} ; style screen-driver hooks scattered through sensor sources. -DHAS_SCREEN=0 -DMESHTASTIC_EXCLUDE_SCREEN=1 - !pkg-config --libs openssl --silence-errors || : + ; openssl@3 is the keg-only Homebrew formula; --cflags is required so the + ; compiler finds in the Homebrew prefix (not just the linker). + !pkg-config --cflags --libs openssl@3 --silence-errors || : + ; PiWebServer (src/mesh/raspihttp/PiWebServer.cpp) auto-engages when ulfius + ; headers are reachable via `#if __has_include()`. The `|| :` + ; tail keeps the build green when the user hasn't run `brew install ulfius` + ; — they just don't get the HTTP API in that case. + !pkg-config --cflags --libs libulfius --silence-errors || : + !pkg-config --cflags --libs liborcania --silence-errors || : + !pkg-config --cflags --libs libyder --silence-errors || : ; src/input/Linux*.{cpp,h} drive evdev (``) which doesn't exist ; on macOS. graphics/Panel_sdl.* and graphics/TFTDisplay.cpp pull LovyanGFX ; (which we lib_ignore on macOS for the issue). Neither is needed @@ -206,3 +217,28 @@ build_src_filter = ${native_base.build_src_filter} lib_ignore = ${portduino_base.lib_ignore} LovyanGFX + +; --------------------------------------------------------------------------- +; Same as [env:native-macos] but built with AddressSanitizer for catching +; use-after-free, leaks, and OOB access during local development. Headless +; (no SDL/X11/libinput) so it stays cheap to build. Mirrors the shape of +; [env:native-tft-debug] but without the TFT/X11 dependencies. +; +; pio run -e native-macos-debug +; .pio/build/native-macos-debug/meshtasticd -s +; +; ASan runtime tuning (set in the shell before launching): +; ASAN_OPTIONS=detect_leaks=1:halt_on_error=0:abort_on_error=1 +; MallocStackLogging=1 # macOS: nicer stack traces in malloc reports +; --------------------------------------------------------------------------- +[env:native-macos-debug] +extends = native_base +build_type = debug +build_unflags = ${env:native-macos.build_unflags} +build_flags = ${env:native-macos.build_flags} + -O0 + -g + -fsanitize=address + -fno-omit-frame-pointer +build_src_filter = ${env:native-macos.build_src_filter} +lib_ignore = ${env:native-macos.lib_ignore} From c0fcf807c068dbbdbfd2005b28cb23f8990e71b6 Mon Sep 17 00:00:00 2001 From: Austin Date: Fri, 1 May 2026 10:42:17 -0400 Subject: [PATCH 146/150] MacOS: Correct pkg-config name `openssl` for ulfius. (#10369) --- .github/workflows/build_macos_bin.yml | 2 +- variants/native/portduino/platformio.ini | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_macos_bin.yml b/.github/workflows/build_macos_bin.yml index cde2dd816..d0e89d7da 100644 --- a/.github/workflows/build_macos_bin.yml +++ b/.github/workflows/build_macos_bin.yml @@ -24,7 +24,7 @@ jobs: shell: bash run: | brew update - brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config + brew install platformio yaml-cpp libuv openssl@3 libusb argp-standalone pkg-config ulfius - name: Get release version string run: | diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index 0a47e7283..6d1bd02f3 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -195,14 +195,12 @@ build_flags = ${portduino_base.build_flags_common} -DMESHTASTIC_EXCLUDE_SCREEN=1 ; openssl@3 is the keg-only Homebrew formula; --cflags is required so the ; compiler finds in the Homebrew prefix (not just the linker). - !pkg-config --cflags --libs openssl@3 --silence-errors || : + !pkg-config --cflags --libs openssl --silence-errors || : ; PiWebServer (src/mesh/raspihttp/PiWebServer.cpp) auto-engages when ulfius ; headers are reachable via `#if __has_include()`. The `|| :` ; tail keeps the build green when the user hasn't run `brew install ulfius` ; — they just don't get the HTTP API in that case. !pkg-config --cflags --libs libulfius --silence-errors || : - !pkg-config --cflags --libs liborcania --silence-errors || : - !pkg-config --cflags --libs libyder --silence-errors || : ; src/input/Linux*.{cpp,h} drive evdev (``) which doesn't exist ; on macOS. graphics/Panel_sdl.* and graphics/TFTDisplay.cpp pull LovyanGFX ; (which we lib_ignore on macOS for the issue). Neither is needed From 0240a00d0934e021dea8fab56630a67b41676284 Mon Sep 17 00:00:00 2001 From: Austin Lane Date: Fri, 1 May 2026 10:55:32 -0400 Subject: [PATCH 147/150] MacOS: Re-Add Orcania/Yder --- variants/native/portduino/platformio.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/variants/native/portduino/platformio.ini b/variants/native/portduino/platformio.ini index 6d1bd02f3..d334a1901 100644 --- a/variants/native/portduino/platformio.ini +++ b/variants/native/portduino/platformio.ini @@ -200,6 +200,8 @@ build_flags = ${portduino_base.build_flags_common} ; headers are reachable via `#if __has_include()`. The `|| :` ; tail keeps the build green when the user hasn't run `brew install ulfius` ; — they just don't get the HTTP API in that case. + !pkg-config --cflags --libs liborcania --silence-errors || : + !pkg-config --cflags --libs libyder --silence-errors || : !pkg-config --cflags --libs libulfius --silence-errors || : ; src/input/Linux*.{cpp,h} drive evdev (``) which doesn't exist ; on macOS. graphics/Panel_sdl.* and graphics/TFTDisplay.cpp pull LovyanGFX From 7cb071c780d7cb4290d7b39ac1a399dc62437901 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 18:25:08 -0400 Subject: [PATCH 148/150] Update platform-native digest to cab4b21 (#10372) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- variants/native/portduino.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variants/native/portduino.ini b/variants/native/portduino.ini index 35c8c6697..6ff3d0686 100644 --- a/variants/native/portduino.ini +++ b/variants/native/portduino.ini @@ -2,7 +2,7 @@ [portduino_base] platform = # renovate: datasource=git-refs depName=platform-native packageName=https://github.com/meshtastic/platform-native gitBranch=develop - https://github.com/meshtastic/platform-native/archive/4ea5e09ac7d51a593e12ec7c1ebb6cd06745ce53.zip + https://github.com/meshtastic/platform-native/archive/cab4b21d902973e43c938dab3cf4844ba02547ec.zip framework = arduino build_src_filter = From 2d761f645349d7bf9a6a4f22e20569330b1d0a88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 May 2026 07:23:49 -0500 Subject: [PATCH 149/150] Upgrade trunk (#10364) Co-authored-by: vidplace7 <1779290+vidplace7@users.noreply.github.com> --- .trunk/trunk.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 1913c6604..d2ccc60a4 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -8,7 +8,7 @@ plugins: uri: https://github.com/trunk-io/plugins lint: enabled: - - checkov@3.2.525 + - checkov@3.2.526 - renovate@43.150.0 - prettier@3.8.3 - trufflehog@3.95.2 From 41f53177a12f3370059477ab41fd8ba3f1c17722 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 2 May 2026 08:25:24 -0500 Subject: [PATCH 150/150] Use OBS instead of launchpad (#10375) --- .github/workflows/build_debian_src.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_debian_src.yml b/.github/workflows/build_debian_src.yml index d1bcd8898..8d2076b11 100644 --- a/.github/workflows/build_debian_src.yml +++ b/.github/workflows/build_debian_src.yml @@ -32,10 +32,15 @@ jobs: shell: bash working-directory: meshtasticd run: | + # Build-tools (notably platformio) come from the Meshtastic project + # on the OpenSUSE Build Service: + # https://build.opensuse.org/project/show/network:Meshtastic:build-tools + echo 'deb http://download.opensuse.org/repositories/network:/Meshtastic:/build-tools/xUbuntu_24.04/ /' \ + | sudo tee /etc/apt/sources.list.d/network:Meshtastic:build-tools.list + curl -fsSL https://download.opensuse.org/repositories/network:Meshtastic:build-tools/xUbuntu_24.04/Release.key \ + | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/network_Meshtastic_build-tools.gpg >/dev/null sudo apt-get update -y --fix-missing - sudo apt-get install -y software-properties-common build-essential devscripts equivs - sudo add-apt-repository ppa:meshtastic/build-tools -y - sudo apt-get update -y --fix-missing + sudo apt-get install -y build-essential devscripts equivs sudo mk-build-deps --install --remove --tool='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes' debian/control - name: Import GPG key