From d03c78518d693a8e65bc7e24f68a2759766cccb7 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 25 Mar 2024 19:54:53 -0700 Subject: [PATCH 1/2] Add missing portnums to the dict for automatic decoding as protocol buffers/text --- meshtastic/__init__.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index d5b9dd27..0cdca2fd 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -84,8 +84,11 @@ def onConnection(interface, topic=pub.AUTO_TOPIC): # called when we (re)connect channel_pb2, config_pb2, mesh_pb2, + mqtt_pb2, + paxcount_pb2, portnums_pb2, remote_hardware_pb2, + storeforward_pb2, telemetry_pb2, util, ) @@ -190,6 +193,13 @@ def _receiveInfoUpdate(iface, asDict): portnums_pb2.PortNum.TEXT_MESSAGE_APP: KnownProtocol( "text", onReceive=_onTextReceive ), + portnums_pb2.PortNum.RANGE_TEST_APP: KnownProtocol( + "rangetest", onReceive=_onTextReceive + ), + portnums_pb2.PortNum.DETECTION_SENSOR_APP: KnownProtocol( + "rangetest", onReceive=_onTextReceive + ), + portnums_pb2.PortNum.POSITION_APP: KnownProtocol( "position", mesh_pb2.Position, _onPositionReceive ), @@ -208,4 +218,9 @@ def _receiveInfoUpdate(iface, asDict): portnums_pb2.PortNum.TRACEROUTE_APP: KnownProtocol( "traceroute", mesh_pb2.RouteDiscovery ), + portnums_pb2.PortNum.WAYPOINT_APP: KnownProtocol("waypoint", mesh_pb2.Waypoint), + portnums_pb2.PortNum.PAXCOUNTER_APP: KnownProtocol("paxcounter", paxcount_pb2.Paxcount), + portnums_pb2.PortNum.STORE_FORWARD_APP: KnownProtocol("storeforward", storeforward_pb2.StoreAndForward), + portnums_pb2.PortNum.NEIGHBORINFO_APP: KnownProtocol("neighborinfo", mesh_pb2.NeighborInfo), + portnums_pb2.PortNum.MAP_REPORT_APP: KnownProtocol("mapreport", mqtt_pb2.MapReport), } From f3f6a6327db54eb8e5634a54ca7b0ce2f900cdc6 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Mon, 25 Mar 2024 22:36:33 -0700 Subject: [PATCH 2/2] fixing copypaste error --- meshtastic/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshtastic/__init__.py b/meshtastic/__init__.py index 0cdca2fd..f74e84a9 100644 --- a/meshtastic/__init__.py +++ b/meshtastic/__init__.py @@ -197,7 +197,7 @@ def _receiveInfoUpdate(iface, asDict): "rangetest", onReceive=_onTextReceive ), portnums_pb2.PortNum.DETECTION_SENSOR_APP: KnownProtocol( - "rangetest", onReceive=_onTextReceive + "detectionsensor", onReceive=_onTextReceive ), portnums_pb2.PortNum.POSITION_APP: KnownProtocol(