diff --git a/meshtastic/mesh_interface.py b/meshtastic/mesh_interface.py index 57545c6..8e2d145 100644 --- a/meshtastic/mesh_interface.py +++ b/meshtastic/mesh_interface.py @@ -892,8 +892,10 @@ class MeshInterface: # pylint: disable=R0902 else: our_exit("Warning: No myInfo found.") # A simple hex style nodeid - we can parse this without needing the DB - elif destinationId.startswith("!"): - nodeNum = int(destinationId[1:], 16) + elif isinstance(destinationId, str) and len(destinationId) > 8: + # assuming some form of node id string such as !1234578 or 0x12345678 + # always grab the last 8 items of the hexadecimal id str and parse to integer + nodeNum = int(destinationId[-8:], 16) else: if self.nodes: node = self.nodes.get(destinationId)