Compare commits

..

3 Commits

Author SHA1 Message Date
Ben Meadors
a429df4cda Update src/modules/NodeInfoModule.cpp
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-19 18:21:04 -06:00
Ben Meadors
67f9f74509 Shorter timeout still needed for pubkey unkown and ad-hoc send 2026-01-19 18:11:28 -06:00
Ben Meadors
733eb3a961 Implement graduated scaling for NodeInfo send timeout based on active mesh size 2026-01-19 17:11:54 -06:00
3 changed files with 10 additions and 6 deletions

View File

@@ -2,6 +2,7 @@
#include "Default.h"
#include "MeshService.h"
#include "NodeDB.h"
#include "NodeStatus.h"
#include "RTC.h"
#include "Router.h"
#include "configuration.h"
@@ -129,14 +130,17 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
LOG_DEBUG("Skip send NodeInfo > 40%% ch. util");
return NULL;
}
// 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");
// Use graduated scaling based on active mesh size (10 minute base, scales with congestion coefficient)
uint32_t timeoutMs = Default::getConfiguredOrDefaultMsScaled(0, 10 * 60, nodeStatus->getNumOnline());
if (!shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, timeoutMs)) {
LOG_DEBUG("Skip send NodeInfo since we sent it <%us ago", timeoutMs / 1000);
ignoreRequest = true; // Mark it as ignored for MeshModule
return NULL;
} else if (shorterTimeout && lastSentToMesh && Throttle::isWithinTimespanMs(lastSentToMesh, 60 * 1000)) {
// For interactive/urgent requests (e.g., user-triggered or implicit requests), use a shorter 60s timeout
LOG_DEBUG("Skip send NodeInfo since we sent it <60s ago");
ignoreRequest = true; // Mark it as ignored for MeshModule
ignoreRequest = true;
return NULL;
} else {
ignoreRequest = false; // Don't ignore requests anymore

View File

@@ -16,7 +16,7 @@ lib_deps =
# renovate: datasource=git-refs depName=NMIoT-meshsolar packageName=https://github.com/NMIoT/meshsolar gitBranch=main
https://github.com/NMIoT/meshsolar/archive/dfc5330dad443982e6cdd37a61d33fc7252f468b.zip
# renovate: datasource=custom.pio depName=ArduinoJson packageName=bblanchon/library/ArduinoJson
bblanchon/ArduinoJson@7.4.2
bblanchon/ArduinoJson@6.21.5
[env:heltec-mesh-solar]
custom_meshtastic_hw_model = 108

View File

@@ -36,7 +36,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=ArduinoJson packageName=bblanchon/library/ArduinoJson
bblanchon/ArduinoJson@7.4.2
bblanchon/ArduinoJson@6.21.5
; If not set we will default to uploading over serial (first it forces bootloader entry by talking 1200bps to cdcacm)
; Note: as of 6/2013 the serial/bootloader based programming takes approximately 30 seconds
;upload_protocol = jlink