From 6ff13eb95c63b46669cd1350db8a3acc564ce521 Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:23:24 +0300 Subject: [PATCH 1/8] mesh_interface: sendText: add hopLimit --- meshtastic/mesh_interface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 4ec9b80..1458835 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -415,6 +415,7 @@ class MeshInterface: # pylint: disable=R0902 channelIndex: int = 0, portNum: portnums_pb2.PortNum.ValueType = portnums_pb2.PortNum.TEXT_MESSAGE_APP, replyId: Optional[int]=None, + hopLimit: Optional[int]=None, ): """Send a utf8 string to some other node, if the node has a display it will also be shown on the device. @@ -432,6 +433,7 @@ class MeshInterface: # pylint: disable=R0902 portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list replyId -- the ID of the message that this packet is a response to + hopLimit -- hop limit to use Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. @@ -445,7 +447,8 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, - replyId=replyId + replyId=replyId, + hopLimit=hopLimit ) From efa841b08c07d4bac427051e087cf4a8085343ed Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:26:02 +0300 Subject: [PATCH 2/8] mesh_interface: sendAlert: add hopLimit --- meshtastic/mesh_interface.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 1458835..0ae955e 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -458,6 +458,7 @@ class MeshInterface: # pylint: disable=R0902 destinationId: Union[int, str] = BROADCAST_ADDR, onResponse: Optional[Callable[[dict], Any]] = None, channelIndex: int = 0, + hopLimit: Optional[int]=None, ): """Send an alert text to some other node. This is similar to a text message, but carries a higher priority and is capable of generating special notifications @@ -465,6 +466,7 @@ class MeshInterface: # pylint: disable=R0902 Arguments: text {string} -- The text of the alert to send + hopLimit -- hop limit to use Keyword Arguments: destinationId {nodeId or nodeNum} -- where to send this @@ -482,7 +484,8 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=False, onResponse=onResponse, channelIndex=channelIndex, - priority=mesh_pb2.MeshPacket.Priority.ALERT + priority=mesh_pb2.MeshPacket.Priority.ALERT, + hopLimit=hopLimit ) def sendMqttClientProxyMessage(self, topic: str, data: bytes): From e5efa94264f98c8359fc6e55883dfd59090c8e1f Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:28:56 +0300 Subject: [PATCH 3/8] mesh_interface: sendPosition: add hopLimit --- meshtastic/mesh_interface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 0ae955e..b8f6082 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -587,6 +587,7 @@ class MeshInterface: # pylint: disable=R0902 wantAck: bool = False, wantResponse: bool = False, channelIndex: int = 0, + hopLimit: Optional[int]=None, ): """ Send a position packet to some other node (normally a broadcast) @@ -623,6 +624,7 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + hopLimit=hopLimit, ) if wantResponse: self.waitForPosition() From 63b940defb3ffa1c5de0c03672cf253790483a56 Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:30:18 +0300 Subject: [PATCH 4/8] mesh_interface: sendTelemetry: add hopLimit --- meshtastic/mesh_interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index b8f6082..6b2725a 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -730,7 +730,8 @@ class MeshInterface: # pylint: disable=R0902 destinationId: Union[int, str] = BROADCAST_ADDR, wantResponse: bool = False, channelIndex: int = 0, - telemetryType: str = "device_metrics" + telemetryType: str = "device_metrics", + hopLimit: Optional[int]=None ): """Send telemetry and optionally ask for a response""" r = telemetry_pb2.Telemetry() @@ -777,6 +778,7 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + hopLimit=hopLimit, ) if wantResponse: self.waitForTelemetry() From eef8a37703d33128ce379ad0097aefa9f4567d68 Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:30:50 +0300 Subject: [PATCH 5/8] mesh_interface: sendWaypoint: add hopLimit --- meshtastic/mesh_interface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 6b2725a..47a5c45 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -847,6 +847,7 @@ class MeshInterface: # pylint: disable=R0902 wantAck: bool = True, wantResponse: bool = False, channelIndex: int = 0, + hopLimit: Optional[int]=None, ): # pylint: disable=R0913 """ Send a waypoint packet to some other node (normally a broadcast) @@ -886,6 +887,7 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + hopLimit=hopLimit, ) if wantResponse: self.waitForWaypoint() From 38a13f300fcf56ade6fa146a70987321df8b182d Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:32:29 +0300 Subject: [PATCH 6/8] mesh_interface: deleteWaypoint: add hopLimit --- meshtastic/mesh_interface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 47a5c45..1ae4b55 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -900,6 +900,7 @@ class MeshInterface: # pylint: disable=R0902 wantAck: bool = True, wantResponse: bool = False, channelIndex: int = 0, + hopLimit: Optional[int]=None, ): """ Send a waypoint deletion packet to some other node (normally a broadcast) @@ -926,6 +927,7 @@ class MeshInterface: # pylint: disable=R0902 wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + hopLimit=hopLimit, ) if wantResponse: self.waitForWaypoint() From 9af5f2283748035a29abbd52c0d6aa3efe584213 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 2 Mar 2026 10:10:52 -0700 Subject: [PATCH 7/8] Apply trailing comma suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- meshtastic/mesh_interface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 1ae4b55..e0b6e43 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -448,7 +448,7 @@ class MeshInterface: # pylint: disable=R0902 onResponse=onResponse, channelIndex=channelIndex, replyId=replyId, - hopLimit=hopLimit + hopLimit=hopLimit, ) @@ -485,7 +485,7 @@ class MeshInterface: # pylint: disable=R0902 onResponse=onResponse, channelIndex=channelIndex, priority=mesh_pb2.MeshPacket.Priority.ALERT, - hopLimit=hopLimit + hopLimit=hopLimit, ) def sendMqttClientProxyMessage(self, topic: str, data: bytes): @@ -731,7 +731,7 @@ class MeshInterface: # pylint: disable=R0902 wantResponse: bool = False, channelIndex: int = 0, telemetryType: str = "device_metrics", - hopLimit: Optional[int]=None + hopLimit: Optional[int]=None, ): """Send telemetry and optionally ask for a response""" r = telemetry_pb2.Telemetry() From c7ee644ad228459c067629a82e33193ab156877f Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 2 Mar 2026 10:15:14 -0700 Subject: [PATCH 8/8] update hopLimit docs to be in correct sections/include types --- meshtastic/mesh_interface.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index e0b6e43..a41f926 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -433,7 +433,7 @@ class MeshInterface: # pylint: disable=R0902 portNum -- the application portnum (similar to IP port numbers) of the destination, see portnums.proto for a list replyId -- the ID of the message that this packet is a response to - hopLimit -- hop limit to use + hopLimit {int} -- hop limit to use Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks. @@ -466,11 +466,11 @@ class MeshInterface: # pylint: disable=R0902 Arguments: text {string} -- The text of the alert to send - hopLimit -- hop limit to use Keyword Arguments: destinationId {nodeId or nodeNum} -- where to send this message (default: {BROADCAST_ADDR}) + hopLimit {int} -- hop limit to use Returns the sent packet. The id field will be populated in this packet and can be used to track future message acks/naks.