Compare commits

...

4 Commits

Author SHA1 Message Date
Ben Meadors
1163855ce4 Merge branch 'develop' into big-mesh 2026-01-19 11:21:39 -06:00
Ben Meadors
c96ebf15fd Merge remote-tracking branch 'origin/master' into develop 2026-01-19 07:57:36 -06:00
Jonathan Bennett
65ba235360 Remove shorterTimeout check for NodeInfo sending
Shout out to @Xaositek for catching this one
2026-01-18 21:41:15 -06:00
Jonathan Bennett
4a5640b53d Slow down NodeInfo responses when on a "big" mesh 2026-01-18 16:10:34 -06:00

View File

@@ -129,13 +129,18 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
LOG_DEBUG("Skip send NodeInfo > 40%% ch. util");
return NULL;
}
uint32_t timeout_min = 5;
bool bigMesh = nodeStatus->getNumOnline() >= 100 || nodeStatus->getNumOnline() >= MAX_NUM_NODES / 2;
if (shorterTimeout) {
timeout_min = 1;
}
if (bigMesh) {
timeout_min *= 10;
}
// If we sent our NodeInfo less than 5 min. ago, don't send it again as it may be still underway.
if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 5 * 60 * 1000)) {
LOG_DEBUG("Skip send NodeInfo since we sent it <5min ago");
ignoreRequest = true; // Mark it as ignored for MeshModule
return NULL;
} else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) {
LOG_DEBUG("Skip send NodeInfo since we sent it <60s ago");
if (lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, timeout_min * 60 * 1000)) {
LOG_DEBUG("Skip send NodeInfo since we sent it <%umin ago", timeout_min);
ignoreRequest = true; // Mark it as ignored for MeshModule
return NULL;
} else {
@@ -203,4 +208,4 @@ int32_t NodeInfoModule::runOnce()
sendOurNodeInfo(NODENUM_BROADCAST, requestReplies); // Send our info (don't request replies)
}
return Default::getConfiguredOrDefaultMs(config.device.node_info_broadcast_secs, default_node_info_broadcast_secs);
}
}