From 948846e0f1f176ad830eb2d322d0b87fda72a415 Mon Sep 17 00:00:00 2001 From: Ian McEwen Date: Tue, 16 Apr 2024 15:13:53 -0700 Subject: [PATCH] Send the position the node already thinks it's at when --no-time is absent, rather than an empty position --- meshtastic/__main__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meshtastic/__main__.py b/meshtastic/__main__.py index 2d9e91e..c98bc2a 100644 --- a/meshtastic/__main__.py +++ b/meshtastic/__main__.py @@ -277,7 +277,12 @@ def onConnected(interface): interface.localNode.writeConfig("position") elif not args.no_time: # We normally provide a current time to the mesh when we connect - interface.sendPosition() + if interface.localNode.nodeNum in interface.nodesByNum and "position" in interface.nodesByNum[interface.localNode.nodeNum]: + # send the same position the node already knows, just to update time + position = interface.nodesByNum[interface.localNode.nodeNum]["position"] + interface.sendPosition(position.get("latitude", 0.0), position.get("longitude", 0.0), position.get("altitude", 0.0)) + else: + interface.sendPosition() if args.set_owner: closeNow = True