From b385001db2cb840e1d854b7de1f962cedd631d8b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Mon, 9 Dec 2024 16:10:22 -0800 Subject: [PATCH] hopDebug --- mesh_bot.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mesh_bot.py b/mesh_bot.py index 4bc7afb..898f212 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -17,6 +17,7 @@ restrictedResponse = "🤖only available in a Direct Message📵" # "" for none cmdHistory = [] # list to hold the last commands seenNodes = [] # list to hold the last seen nodes DEBUGpacket = False # Debug print the packet rx +DEBUGhops = False # Debug print hope info and bad hop count packets def auto_response(message, snr, rssi, hop, pkiStatus, message_from_id, channel_number, deviceID, isDM): global cmdHistory @@ -943,8 +944,12 @@ def onReceive(packet, interface): hop_start = packet.get('hopStart', 0) else: hop_start = 0 - - #logger.debug(f"System: Packet HopDebugger: hop_away:{hop_away} hop_limit:{hop_limit} hop_start:{hop_start}") + + if DEBUGhops: + logger.debug(f"System: Packet HopDebugger: hop_away:{hop_away} hop_limit:{hop_limit} hop_start:{hop_start}") + if hop_away == 0 and hop_limit == 0 and hop_start == 0: + logger.debug(f"System: Packet HopDebugger: No hop count found in PACKET {packet} END PACKET") + if hop_start == hop_limit: hop = "Direct" hop_count = 0