From cf7f0f9d0895602df3453a4f5cfea843f4e09744 Mon Sep 17 00:00:00 2001 From: dfsx1 <60702962+dfsx1@users.noreply.github.com> Date: Sun, 23 Mar 2025 10:49:06 +0000 Subject: [PATCH 1/7] Fix NodeInfo exploit overwriting publicKey in NodeDB (#6372) Co-authored-by: dfsx1 --- src/mesh/NodeDB.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index a9130c3a9..666276f83 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -1437,13 +1437,14 @@ bool NodeDB::updateUser(uint32_t nodeId, meshtastic_User &p, uint8_t channelInde #if !(MESHTASTIC_EXCLUDE_PKI) if (p.public_key.size > 0) { printBytes("Incoming Pubkey: ", p.public_key.bytes, 32); - if (info->user.public_key.size > 0) { // if we have a key for this user already, don't overwrite with a new one - LOG_INFO("Public Key set for node, not updating!"); - // we copy the key into the incoming packet, to prevent overwrite - memcpy(p.public_key.bytes, info->user.public_key.bytes, 32); - } else { - LOG_INFO("Update Node Pubkey!"); - } + } + if (info->user.public_key.size > 0) { // if we have a key for this user already, don't overwrite with a new one + LOG_INFO("Public Key set for node, not updating!"); + // we copy the key into the incoming packet, to prevent overwrite + p.public_key.size = 32; + memcpy(p.public_key.bytes, info->user.public_key.bytes, 32); + } else if (p.public_key.size > 0) { + LOG_INFO("Update Node Pubkey!"); } #endif From 1ee800e9011e54abf6a9546947c6b34244e96766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Sun, 23 Mar 2025 12:33:26 +0100 Subject: [PATCH 2/7] add MUI/inkHUD to bug report template (#6376) --- .github/ISSUE_TEMPLATE/Bug Report.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/ISSUE_TEMPLATE/Bug Report.yml b/.github/ISSUE_TEMPLATE/Bug Report.yml index f638b9018..bc77e8c1b 100644 --- a/.github/ISSUE_TEMPLATE/Bug Report.yml +++ b/.github/ISSUE_TEMPLATE/Bug Report.yml @@ -72,6 +72,15 @@ body: validations: required: true + - type: checkboxes + id: mui + attributes: + label: Is this bug report about any UI component firmware like InkHUD or Meshtatic UI (MUI)? + options: + - label: Meshtastic UI aka MUI colorTFT + - label: InkHUD ePaper + - label: OLED slide UI on any display + - type: input id: version attributes: From daa4186d654ff13c354ad55fdd326fa8832a1410 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sun, 23 Mar 2025 23:32:55 +0800 Subject: [PATCH 3/7] [esp32] Define BUTTON_PIN (-1) by default, fixes #6213 (#6371) Signed-off-by: Andrew Yong --- src/configuration.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/configuration.h b/src/configuration.h index fd4a5b196..1a4dbbcc3 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -110,6 +110,11 @@ along with this program. If not, see . // Define if screen should be mirrored left to right // #define SCREEN_MIRROR +// Define BUTTON_PIN to ensure button setup is always done +#ifndef BUTTON_PIN +#define BUTTON_PIN (-1) +#endif + // I2C Keyboards (M5Stack, RAK14004, T-Deck) #define CARDKB_ADDR 0x5F #define TDECK_KB_ADDR 0x55 From e722a97987031fc0affd715b55957b6f62b787f7 Mon Sep 17 00:00:00 2001 From: Chloe Bethel Date: Mon, 24 Mar 2025 22:26:59 +0000 Subject: [PATCH 4/7] Don't use assert() in MeshService to guard queueing packets (#6388) --- src/mesh/MeshService.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/mesh/MeshService.cpp b/src/mesh/MeshService.cpp index f293559ad..297c7b2ed 100644 --- a/src/mesh/MeshService.cpp +++ b/src/mesh/MeshService.cpp @@ -309,7 +309,10 @@ void MeshService::sendToPhone(meshtastic_MeshPacket *p) } } - assert(toPhoneQueue.enqueue(p, 0)); + if (toPhoneQueue.enqueue(p, 0) == false) { + LOG_CRIT("Failed to queue a packet into toPhoneQueue!"); + abort(); + } fromNum++; } @@ -323,7 +326,10 @@ void MeshService::sendMqttMessageToClientProxy(meshtastic_MqttClientProxyMessage releaseMqttClientProxyMessageToPool(d); } - assert(toPhoneMqttProxyQueue.enqueue(m, 0)); + if (toPhoneMqttProxyQueue.enqueue(m, 0) == false) { + LOG_CRIT("Failed to queue a packet into toPhoneMqttProxyQueue!"); + abort(); + } fromNum++; } @@ -337,7 +343,10 @@ void MeshService::sendClientNotification(meshtastic_ClientNotification *n) releaseClientNotificationToPool(d); } - assert(toPhoneClientNotificationQueue.enqueue(n, 0)); + if (toPhoneClientNotificationQueue.enqueue(n, 0) == false) { + LOG_CRIT("Failed to queue a notification into toPhoneClientNotificationQueue!"); + abort(); + } fromNum++; } From e9d8a3d7f95fa3a4e27514321a1c942d04239b72 Mon Sep 17 00:00:00 2001 From: Manuel <71137295+mverch67@users.noreply.github.com> Date: Tue, 25 Mar 2025 01:30:17 +0100 Subject: [PATCH 5/7] MUI: increase stack, cache and drawbuffer (#6389) * increase stack, cache and drawbuffer * bump device-ui lib * T-Deck map: switch to full redraw --- platformio.ini | 2 +- src/graphics/tftSetup.cpp | 2 +- variants/portduino/platformio.ini | 3 ++- variants/t-deck/platformio.ini | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index 7f71d2f58..3de5b715f 100644 --- a/platformio.ini +++ b/platformio.ini @@ -94,7 +94,7 @@ lib_deps = [device-ui_base] lib_deps = - https://github.com/meshtastic/device-ui.git#74e739ed4532ca10393df9fc89ae5a22f0bab2b1 + https://github.com/meshtastic/device-ui.git#7a6ffba3c86901b0e3234b6c056aa803b4cd8854 ; Common libs for environmental measurements in telemetry module ; (not included in native / portduino) diff --git a/src/graphics/tftSetup.cpp b/src/graphics/tftSetup.cpp index c31659c62..cacb02694 100644 --- a/src/graphics/tftSetup.cpp +++ b/src/graphics/tftSetup.cpp @@ -119,7 +119,7 @@ void tftSetup(void) #ifdef ARCH_ESP32 tftSleepObserver.observe(¬ifyLightSleep); endSleepObserver.observe(¬ifyLightSleepEnd); - xTaskCreatePinnedToCore(tft_task_handler, "tft", 8192, NULL, 1, NULL, 0); + xTaskCreatePinnedToCore(tft_task_handler, "tft", 10240, NULL, 1, NULL, 0); #endif } diff --git a/variants/portduino/platformio.ini b/variants/portduino/platformio.ini index 9bf3313ce..7a3392eb4 100644 --- a/variants/portduino/platformio.ini +++ b/variants/portduino/platformio.ini @@ -27,6 +27,7 @@ build_flags = ${native_base.build_flags} -Os -lX11 -linput -lxkbcommon -ffunctio -D USE_X11=1 -D HAS_TFT=1 -D HAS_SCREEN=0 + -D LV_CACHE_DEF_SIZE=6291456 -D LV_BUILD_TEST=0 -D LV_USE_LIBINPUT=1 -D LV_LVGL_H_INCLUDE_SIMPLE @@ -56,7 +57,7 @@ build_flags = ${native_base.build_flags} -O0 -fsanitize=address -lX11 -linput -l -D USE_X11=1 -D HAS_TFT=1 -D HAS_SCREEN=0 -; -D CALIBRATE_TOUCH=0 + -D LV_CACHE_DEF_SIZE=6291456 -D LV_BUILD_TEST=0 -D LV_USE_LOG=1 -D LV_USE_SYSMON=1 diff --git a/variants/t-deck/platformio.ini b/variants/t-deck/platformio.ini index 4671a5a9b..14fbee6cf 100644 --- a/variants/t-deck/platformio.ini +++ b/variants/t-deck/platformio.ini @@ -42,7 +42,7 @@ build_flags = -D HAS_SCREEN=0 -D HAS_TFT=1 -D USE_I2S_BUZZER - -D RAM_SIZE=4096 + -D RAM_SIZE=5120 -D LV_LVGL_H_INCLUDE_SIMPLE -D LV_CONF_INCLUDE_SIMPLE -D LV_COMP_CONF_INCLUDE_SIMPLE @@ -66,6 +66,7 @@ build_flags = -D VIEW_320x240 ; -D USE_DOUBLE_BUFFER -D USE_PACKET_API + -D MAP_FULL_REDRAW lib_deps = ${env:t-deck.lib_deps} From 3afe84c4f4ca3e01faff4e503eae887173c989a4 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Tue, 25 Mar 2025 01:30:47 +0100 Subject: [PATCH 6/7] linux-native: allow multiple processes to all bind to the same multicast 2tuple (#6391) * cleanup UdpMulticastThread.h preprocessor rules a tiny bit * bump platform-native to allow for multiple multicast listeners on the same machine --------- Co-authored-by: Ben Meadors --- arch/portduino/portduino.ini | 2 +- src/mesh/udp/UdpMulticastThread.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/portduino/portduino.ini b/arch/portduino/portduino.ini index 734a4f91e..55234914f 100644 --- a/arch/portduino/portduino.ini +++ b/arch/portduino/portduino.ini @@ -1,6 +1,6 @@ ; The Portduino based 'native' environment. Currently supported on Linux targets with real LoRa hardware (or simulated). [portduino_base] -platform = https://github.com/meshtastic/platform-native.git#df71ed0040e9aad767a002829330965b78fc452a +platform = https://github.com/meshtastic/platform-native.git#e82ba1a19b6cd1dc55cbde29b33ea8dd0640014f framework = arduino build_src_filter = diff --git a/src/mesh/udp/UdpMulticastThread.h b/src/mesh/udp/UdpMulticastThread.h index 7067cced9..88824dc4d 100644 --- a/src/mesh/udp/UdpMulticastThread.h +++ b/src/mesh/udp/UdpMulticastThread.h @@ -23,7 +23,7 @@ class UdpMulticastThread : public concurrency::OSThread void start() { if (udp.listenMulticast(udpIpAddress, UDP_MULTICAST_DEFAUL_PORT, 64)) { -#if !defined(ARCH_PORTDUINO) +#ifndef ARCH_PORTDUINO // FIXME(PORTDUINO): arduino lacks IPAddress::toString() LOG_DEBUG("UDP Listening on IP: %s", WiFi.localIP().toString().c_str()); #else @@ -59,7 +59,7 @@ class UdpMulticastThread : public concurrency::OSThread if (!mp || !udp) { return false; } -#if !defined(ARCH_PORTDUINO) +#ifndef ARCH_PORTDUINO if (WiFi.status() != WL_CONNECTED) { return false; } From 0ddb507055d15b25941e672f54c88819d5050cb1 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 24 Mar 2025 20:38:47 -0400 Subject: [PATCH 7/7] userPrefs: Add WiFi SSID/PW, and UDP multicast configs (#6387) --- src/mesh/NodeDB.cpp | 16 ++++++++++++++++ userPrefs.jsonc | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 666276f83..0269c1dfc 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -628,6 +628,22 @@ void NodeDB::installDefaultConfig(bool preserveKey = false) meshtastic_Config_PositionConfig_PositionFlags_SPEED | meshtastic_Config_PositionConfig_PositionFlags_HEADING | meshtastic_Config_PositionConfig_PositionFlags_DOP | meshtastic_Config_PositionConfig_PositionFlags_SATINVIEW); +#ifdef USERPREFS_NETWORK_ENABLED_PROTOCOLS + config.network.enabled_protocols = USERPREFS_NETWORK_ENABLED_PROTOCOLS; +#endif + +#ifdef USERPREFS_NETWORK_WIFI_ENABLED + config.network.wifi_enabled = USERPREFS_NETWORK_WIFI_ENABLED; +#endif + +#ifdef USERPREFS_NETWORK_WIFI_SSID + strncpy(config.network.wifi_ssid, USERPREFS_NETWORK_WIFI_SSID, sizeof(config.network.wifi_ssid)); +#endif + +#ifdef USERPREFS_NETWORK_WIFI_PSK + strncpy(config.network.wifi_psk, USERPREFS_NETWORK_WIFI_PSK, sizeof(config.network.wifi_psk)); +#endif + #ifdef DISPLAY_FLIP_SCREEN config.display.flip_screen = true; #endif diff --git a/userPrefs.jsonc b/userPrefs.jsonc index 6a3fdbb55..d522ad272 100644 --- a/userPrefs.jsonc +++ b/userPrefs.jsonc @@ -40,5 +40,9 @@ // "USERPREFS_OEM_IMAGE_WIDTH": "50", // "USERPREFS_OEM_IMAGE_HEIGHT": "28", // "USERPREFS_OEM_IMAGE_DATA": "{ 0x00, 0x00, 0xF0, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x03, 0x00, 0x00, 0x00, 0xC0, 0x07, 0x80, 0x0F, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x18, 0xFF, 0xFF, 0x61, 0x00, 0x00, 0x00, 0x0C, 0xFF, 0xFF, 0xC7, 0x00, 0x00, 0x00, 0x0C, 0xFF, 0xFF, 0xC7, 0x00, 0x00, 0x00, 0x18, 0xFF, 0xFF, 0x67, 0x00, 0x00, 0x00, 0x18, 0x1F, 0xF0, 0x67, 0x00, 0x00, 0x00, 0x30, 0x1F, 0xF8, 0x33, 0x00, 0x00, 0x00, 0x30, 0x00, 0xFC, 0x31, 0x00, 0x00, 0x00, 0x60, 0x00, 0xFE, 0x18, 0x00, 0x00, 0x00, 0x60, 0x00, 0x7E, 0x18, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x3F, 0x0C, 0x00, 0x00, 0x00, 0xC0, 0x80, 0x1F, 0x0C, 0x00, 0x00, 0x00, 0x80, 0x81, 0x1F, 0x06, 0x00, 0x00, 0x00, 0x80, 0xC1, 0x0F, 0x06, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0xC3, 0x0F, 0x03, 0x00, 0x00, 0x00, 0x00, 0xE6, 0x8F, 0x01, 0x00, 0x00, 0x00, 0x00, 0xEE, 0xC7, 0x01, 0x00, 0x00, 0x00, 0x00, 0x0C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x00}", + // "USERPREFS_NETWORK_ENABLED_PROTOCOLS": "1", // Enable UDP mesh + // "USERPREFS_NETWORK_WIFI_ENABLED": "true", + // "USERPREFS_NETWORK_WIFI_SSID": "wifi_ssid", + // "USERPREFS_NETWORK_WIFI_PSK": "wifi_psk", "USERPREFS_TZ_STRING": "tzplaceholder " }