From d9057c0aafe28507f3bea8c0c2ec073f93db0ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Sat, 29 Nov 2025 15:40:33 +0100 Subject: [PATCH 1/2] Fix traceroute timeout for case of 0-hops It was not waiting any time. --- meshtastic/mesh_interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 7052bc5fd..18b97b7ad 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -670,7 +670,7 @@ def sendTraceRoute( hopLimit=hopLimit, ) # extend timeout based on number of nodes, limit by configured hopLimit - waitFactor = min(len(self.nodes) - 1 if self.nodes else 0, hopLimit) + waitFactor = min(len(self.nodes) - 1 if self.nodes else 0, hopLimit+1) self.waitForTraceRoute(waitFactor) def onResponseTraceRoute(self, p: dict): From 7129a9f963d7ffcf37e9f67f4b0368ca55d9e859 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 2 Mar 2026 10:01:27 -0700 Subject: [PATCH 2/2] Update meshtastic/mesh_interface.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- meshtastic/mesh_interface.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 18b97b7ad..17eb9424e 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -670,7 +670,8 @@ def sendTraceRoute( hopLimit=hopLimit, ) # extend timeout based on number of nodes, limit by configured hopLimit - waitFactor = min(len(self.nodes) - 1 if self.nodes else 0, hopLimit+1) + nodes_based_factor = (len(self.nodes) - 1) if self.nodes else (hopLimit + 1) + waitFactor = max(1, min(nodes_based_factor, hopLimit + 1)) self.waitForTraceRoute(waitFactor) def onResponseTraceRoute(self, p: dict):