From 6ff13eb95c63b46669cd1350db8a3acc564ce521 Mon Sep 17 00:00:00 2001 From: Vasiliy Doylov Date: Tue, 23 Sep 2025 16:23:24 +0300 Subject: [PATCH 1/6] 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 4ec9b80d..14588351 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -415,6 +415,7 @@ def sendText( 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 @@ def sendText( 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 @@ def sendText( 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/6] 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 14588351..0ae955e2 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -458,6 +458,7 @@ def sendAlert( 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 @@ def sendAlert( 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 @@ def sendAlert( 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/6] 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 0ae955e2..b8f6082d 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -587,6 +587,7 @@ def sendPosition( 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 @@ def sendPosition( 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/6] 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 b8f6082d..6b2725aa 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -730,7 +730,8 @@ def sendTelemetry( 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 @@ def sendTelemetry( 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/6] 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 6b2725aa..47a5c45d 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -847,6 +847,7 @@ def sendWaypoint( 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 @@ def sendWaypoint( 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/6] 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 47a5c45d..1ae4b554 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -900,6 +900,7 @@ def deleteWaypoint( 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 @@ def deleteWaypoint( wantResponse=wantResponse, onResponse=onResponse, channelIndex=channelIndex, + hopLimit=hopLimit, ) if wantResponse: self.waitForWaypoint()