Skip to content

Commit fc030d2

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents 4a534f0 + 1fe9a41 commit fc030d2

File tree

8 files changed

+61
-17
lines changed

8 files changed

+61
-17
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
node-version: 24
5353

5454
- name: Setup pnpm
55-
uses: pnpm/action-setup@v4
55+
uses: pnpm/action-setup@v5
5656
with:
5757
version: latest
5858

.trunk/trunk.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ plugins:
88
uri: https://github.com/trunk-io/plugins
99
lint:
1010
enabled:
11-
- checkov@3.2.508
12-
- renovate@43.76.3
11+
- checkov@3.2.510
12+
- renovate@43.78.0
1313
- prettier@3.8.1
1414
- trufflehog@3.93.8
1515
- yamllint@1.38.0

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ lib_deps =
126126
[device-ui_base]
127127
lib_deps =
128128
# renovate: datasource=git-refs depName=meshtastic/device-ui packageName=https://github.com/meshtastic/device-ui gitBranch=master
129-
https://github.com/meshtastic/device-ui/archive/622b034d8791153de9d16a473723cb8625d35839.zip
129+
https://github.com/meshtastic/device-ui/archive/f36d2a953524e372b78c5b4147ec55f38716964e.zip
130130

131131
; Common libs for environmental measurements in telemetry module
132132
[environmental_base]

src/mesh/Default.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
#define TEN_SECONDS_MS 10 * 1000
1414
#define MAX_INTERVAL INT32_MAX // FIXME: INT32_MAX to avoid overflow issues with Apple clients but should be UINT32_MAX
1515

16-
#define min_default_telemetry_interval_secs 30 * 60
16+
#define min_default_telemetry_interval_secs IF_ROUTER(ONE_DAY / 2, 30 * 60)
1717
#define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60)
1818
#define default_telemetry_broadcast_interval_secs IF_ROUTER(ONE_DAY / 2, 60 * 60)
1919
#define default_broadcast_interval_secs IF_ROUTER(ONE_DAY / 2, 60 * 60)
2020
#define default_broadcast_smart_minimum_interval_secs 5 * 60
21-
#define min_default_broadcast_interval_secs 60 * 60
21+
#define min_default_broadcast_interval_secs IF_ROUTER(ONE_DAY / 2, 60 * 60)
2222
#define min_default_broadcast_smart_minimum_interval_secs 5 * 60
2323
#define default_wait_bluetooth_secs IF_ROUTER(1, 60)
2424
#define default_sds_secs IF_ROUTER(ONE_DAY, UINT32_MAX) // Default to forever super deep sleep

src/mesh/NodeDB.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,9 @@ NodeDB::NodeDB()
322322
// config.network.enabled_protocols = meshtastic_Config_NetworkConfig_ProtocolFlags_UDP_BROADCAST;
323323

324324
// If we are setup to broadcast on any default channel slot (with default frequency slot semantics),
325-
// ensure that the telemetry intervals are coerced to the minimum value of 30 minutes or more.
325+
// ensure that the telemetry intervals are coerced to the role-aware minimum value.
326326
if (channels.hasDefaultChannel()) {
327-
LOG_DEBUG("Coerce telemetry to min of 30 minutes on defaults");
327+
LOG_DEBUG("Coerce telemetry to role-aware minimum on defaults");
328328
moduleConfig.telemetry.device_update_interval = Default::getConfiguredOrMinimumValue(
329329
moduleConfig.telemetry.device_update_interval, min_default_telemetry_interval_secs);
330330
moduleConfig.telemetry.environment_update_interval = Default::getConfiguredOrMinimumValue(
@@ -347,7 +347,7 @@ NodeDB::NodeDB()
347347
}
348348
}
349349
if (positionUsesDefaultChannel) {
350-
LOG_DEBUG("Coerce position broadcasts to min of 1 hour and smart broadcast min of 5 minutes on defaults");
350+
LOG_DEBUG("Coerce position broadcasts to role-aware minimum and smart broadcast min of 5 minutes on defaults");
351351
config.position.position_broadcast_secs =
352352
Default::getConfiguredOrMinimumValue(config.position.position_broadcast_secs, min_default_broadcast_interval_secs);
353353
config.position.broadcast_smart_minimum_interval_secs = Default::getConfiguredOrMinimumValue(

src/modules/NodeInfoModule.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ bool NodeInfoModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
3030

3131
auto p = *pptr;
3232

33-
if (mp.decoded.want_response) {
33+
// Suppress replies to senders we've replied to recently (12H window)
34+
if (mp.decoded.want_response && !isFromUs(&mp)) {
3435
const NodeNum sender = getFrom(&mp);
3536
const uint32_t now = mp.rx_time ? mp.rx_time : getTime();
3637
auto it = lastNodeInfoSeen.find(sender);
@@ -119,7 +120,13 @@ void NodeInfoModule::sendOurNodeInfo(NodeNum dest, bool wantReplies, uint8_t cha
119120

120121
meshtastic_MeshPacket *NodeInfoModule::allocReply()
121122
{
122-
if (suppressReplyForCurrentRequest) {
123+
// Only apply suppression when actually replying to someone else's request, not for periodic broadcasts.
124+
const bool isReplyingToExternalRequest = currentRequest &&
125+
currentRequest->which_payload_variant == meshtastic_MeshPacket_decoded_tag &&
126+
currentRequest->decoded.portnum == meshtastic_PortNum_NODEINFO_APP &&
127+
currentRequest->decoded.want_response && !isFromUs(currentRequest);
128+
129+
if (suppressReplyForCurrentRequest && isReplyingToExternalRequest) {
123130
LOG_DEBUG("Skip send NodeInfo since we heard the requester <12h ago");
124131
ignoreRequest = true;
125132
suppressReplyForCurrentRequest = false;

test/test_default/test_main.cpp

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ static uint32_t computeExpectedMs(uint32_t defaultSeconds, uint32_t numOnlineNod
1010
{
1111
uint32_t baseMs = Default::getConfiguredOrDefaultMs(0, defaultSeconds);
1212

13-
// Routers don't scale
14-
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER) {
13+
// Routers (including ROUTER_LATE) don't scale
14+
if (config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER ||
15+
config.device.role == meshtastic_Config_DeviceConfig_Role_ROUTER_LATE) {
1516
return baseMs;
1617
}
1718

@@ -93,6 +94,39 @@ void test_client_medium_fast_preset_scaling()
9394
TEST_ASSERT_INT_WITHIN(1, expected, res);
9495
}
9596

97+
void test_router_uses_router_minimums()
98+
{
99+
config.device.role = meshtastic_Config_DeviceConfig_Role_ROUTER;
100+
101+
uint32_t telemetry = Default::getConfiguredOrMinimumValue(60, min_default_telemetry_interval_secs);
102+
uint32_t position = Default::getConfiguredOrMinimumValue(60, min_default_broadcast_interval_secs);
103+
104+
TEST_ASSERT_EQUAL_UINT32(ONE_DAY / 2, telemetry);
105+
TEST_ASSERT_EQUAL_UINT32(ONE_DAY / 2, position);
106+
}
107+
108+
void test_router_late_uses_router_minimums()
109+
{
110+
config.device.role = meshtastic_Config_DeviceConfig_Role_ROUTER_LATE;
111+
112+
uint32_t telemetry = Default::getConfiguredOrMinimumValue(60, min_default_telemetry_interval_secs);
113+
uint32_t position = Default::getConfiguredOrMinimumValue(60, min_default_broadcast_interval_secs);
114+
115+
TEST_ASSERT_EQUAL_UINT32(ONE_DAY / 2, telemetry);
116+
TEST_ASSERT_EQUAL_UINT32(ONE_DAY / 2, position);
117+
}
118+
119+
void test_client_uses_public_channel_minimums()
120+
{
121+
config.device.role = meshtastic_Config_DeviceConfig_Role_CLIENT;
122+
123+
uint32_t telemetry = Default::getConfiguredOrMinimumValue(60, min_default_telemetry_interval_secs);
124+
uint32_t position = Default::getConfiguredOrMinimumValue(60, min_default_broadcast_interval_secs);
125+
126+
TEST_ASSERT_EQUAL_UINT32(30 * 60, telemetry);
127+
TEST_ASSERT_EQUAL_UINT32(60 * 60, position);
128+
}
129+
96130
void setup()
97131
{
98132
// Small delay to match other test mains
@@ -103,6 +137,9 @@ void setup()
103137
RUN_TEST(test_client_below_threshold);
104138
RUN_TEST(test_client_default_preset_scaling);
105139
RUN_TEST(test_client_medium_fast_preset_scaling);
140+
RUN_TEST(test_router_uses_router_minimums);
141+
RUN_TEST(test_router_late_uses_router_minimums);
142+
RUN_TEST(test_client_uses_public_channel_minimums);
106143
exit(UNITY_END());
107144
}
108145

variants/esp32s3/heltec_v4/platformio.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ build_flags =
6868
-D INPUTDRIVER_BUTTON_TYPE=0
6969
-D HAS_SCREEN=1
7070
-D HAS_TFT=1
71-
-D RAM_SIZE=1560
71+
-D RAM_SIZE=1860
7272
-D LV_LVGL_H_INCLUDE_SIMPLE
7373
-D LV_CONF_INCLUDE_SIMPLE
7474
-D LV_COMP_CONF_INCLUDE_SIMPLE
@@ -83,9 +83,9 @@ build_flags =
8383
-D USE_PACKET_API
8484
-D LGFX_DRIVER=LGFX_HELTEC_V4_TFT
8585
-D GFX_DRIVER_INC=\"graphics/LGFX/LGFX_HELTEC_V4_TFT.h\"
86-
-D VIEW_320x240
87-
-D MAP_FULL_REDRAW
88-
-D DISPLAY_SIZE=320x240 ; landscape mode
86+
-D VIEW_240x320
87+
-D DISPLAY_SET_RESOLUTION
88+
-D DISPLAY_SIZE=240x320 ; portrait mode
8989
-D LGFX_PIN_SCK=17
9090
-D LGFX_PIN_MOSI=33
9191
-D LGFX_PIN_DC=16

0 commit comments

Comments
 (0)