diff --git a/mesh_bot.py b/mesh_bot.py index 212e894..a47442d 100755 --- a/mesh_bot.py +++ b/mesh_bot.py @@ -902,7 +902,7 @@ def onDisconnect(interface): elif interface2_enabled and interface2_type == 'ble': retry_int2 = True -numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr = [0,0], [0,0], [0,0], [0,0] +numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr = ([-1, -1],) * 4 def onReceive(packet, interface): # Priocess the incoming packet, handles the responses to the packet with auto_response() # Sends the packet to the correct handler for processing @@ -956,7 +956,8 @@ def onReceive(packet, interface): if telemetry_packet.get('localStats'): localStats = telemetry_packet['localStats'] if localStats.get('numPacketsTx') and localStats.get('numPacketsRx') != 0: - #print(f"numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}") + if numPacketsRx != 0: + print(f"numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}") # Assign the values and include rxNode numPacketsTx = (localStats['numPacketsTx'], rxNode) numPacketsRx = (localStats['numPacketsRx'], rxNode) diff --git a/modules/system.py b/modules/system.py index dd3f765..70bf97c 100644 --- a/modules/system.py +++ b/modules/system.py @@ -700,7 +700,7 @@ def getNodeTelemetry(nodeID=0, rxNode=1): # packet telemetry if numPacketsRx != 0: - print(f"sys numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}") + print(f"set new value numPacketsTx, numPacketsRx, numPacketsTxErr, numPacketsRxErr: {numPacketsTx}, {numPacketsRx}, {numPacketsTxErr}, {numPacketsRxErr}") if numPacketsTx[1] == 1: dataResponse += f"Telemetry:{rxNode} numPacketsTx:{numPacketsTx[0]} numPacketsRx:{numPacketsRx[0]} numPacketsTxErr:{numPacketsTxErr[0]} numPacketsRxErr:{numPacketsRxErr[0]}" elif numPacketsTx[1] == 2: