From a1648da6ada6e74759c6db4c88d52cb9f84d7c40 Mon Sep 17 00:00:00 2001 From: marcel Date: Tue, 1 Feb 2022 20:15:09 +0100 Subject: [PATCH] Seems not to crash anymore... --- KissHelper.py | 4 ++-- LoraAprsKissTnc.py | 3 +++ RPi-LoRa-KISS-TNC.ini | 2 +- TCPServer.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/KissHelper.py b/KissHelper.py index 7b767c4..b6b210c 100644 --- a/KissHelper.py +++ b/KissHelper.py @@ -65,9 +65,9 @@ def encode_address(s, final): encoded_ssid |= 0b10000000 # SSID should now be one or two postions long and contain a number (idealy between 0 and 15). - if len(ssid) is 1 and ssid[0] > 47 and ssid[0] < 58: + if len(ssid) == 1 and ssid[0] > 47 and ssid[0] < 58: encoded_ssid |= (int(ssid) << 1) | 0b01100000 | (0b00000001 if final else 0) - elif len(ssid) is 2 and ssid[0] > 47 and ssid[0] < 58 and ssid[1] > 47 and ssid[2] < 58: + elif len(ssid) == 2 and ssid[0] > 47 and ssid[0] < 58 and ssid[1] > 47 and ssid[1] < 58: encoded_ssid |= (int(ssid) << 1) | 0b01100000 | (0b00000001 if final else 0) else: return None diff --git a/LoraAprsKissTnc.py b/LoraAprsKissTnc.py index b3770dd..ff7cafb 100644 --- a/LoraAprsKissTnc.py +++ b/LoraAprsKissTnc.py @@ -44,6 +44,9 @@ class LoraAprsKissTnc(LoRa): super(LoraAprsKissTnc, self).__init__(verbose) self.queue = queue + + if appendSignalReport == 'False': + appendSignalReport = False self.appendSignalReport = appendSignalReport self.set_mode(MODE.SLEEP) diff --git a/RPi-LoRa-KISS-TNC.ini b/RPi-LoRa-KISS-TNC.ini index d4e6c6e..e8e05dd 100644 --- a/RPi-LoRa-KISS-TNC.ini +++ b/RPi-LoRa-KISS-TNC.ini @@ -21,7 +21,7 @@ bandwidth=BW125 # CR4_7 # CR4_8 codingrate=CR4_5 -appendSignalReport=True +appendSignalReport=False paSelect = 1 MaxoutputPower = 15 outputPower = 15 diff --git a/TCPServer.py b/TCPServer.py index 19d4e0d..84e7eac 100644 --- a/TCPServer.py +++ b/TCPServer.py @@ -60,7 +60,7 @@ class KissServer(Thread): encoded_data = KissHelper.encode_kiss(data) except Exception as e: print("KISS encoding went wrong (exception while parsing)") - # traceback.print_tb(e.__traceback__) + traceback.print_tb(e.__traceback__) encoded_data = None if encoded_data != None: