From 99944465102f6317de389d61a8e592802df0606a Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Sun, 17 Aug 2025 20:24:09 -0700 Subject: [PATCH] better MQTT handler --- mesh_bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mesh_bot.py b/mesh_bot.py index 1adeac1..226b17d 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -1162,6 +1162,7 @@ def onReceive(packet, interface): if 'decoded' in packet and packet['decoded']['portnum'] == 'TEXT_MESSAGE_APP': message_bytes = packet['decoded']['payload'] message_string = message_bytes.decode('utf-8') + via_mqtt = packet['decoded'].get('viaMqtt', False) # check if the packet is from us if message_from_id in [myNodeNum1, myNodeNum2, myNodeNum3, myNodeNum4, myNodeNum5, myNodeNum6, myNodeNum7, myNodeNum8, myNodeNum9]: @@ -1207,7 +1208,7 @@ def onReceive(packet, interface): if hop_start == hop_limit: hop = "Direct" hop_count = 0 - elif hop_start == 0 and hop_limit > 0: + elif hop_start == 0 and hop_limit > 0 or via_mqtt: hop = "MQTT" hop_count = 0 else: