diff --git a/KissHelper.py b/KissHelper.py index 2510322..c09213c 100644 --- a/KissHelper.py +++ b/KissHelper.py @@ -25,6 +25,11 @@ # https://thomask.sdf.org/blog/2018/12/15/sending-raw-ax25-python.html # # TODO: remove escapes on decoding +# +# Changes by PE1RXF +# +# 2022-01-23: - in encode_address() added correct handling of has_been_repeated flag '*' +# import struct @@ -44,7 +49,16 @@ def encode_address(s, final): if len(call) < 6: call = call + b" "*(6 - len(call)) # pad with spaces encoded_call = [x << 1 for x in call[0:6]] - encoded_ssid = (int(ssid) << 1) | 0b01100000 | (0b00000001 if final else 0) + + encoded_ssid = 0b00000000 + # If ssid ends with *, the message has been repeated, so we have to set the 'has_been_repeated' flag and remove the * from the ssid + if ssid[-1] == 42: + # print("Message has been repeated") + ssid = ssid[:-1] + encoded_ssid |= 0b10000000 + + encoded_ssid |= (int(ssid) << 1) | 0b01100000 | (0b00000001 if final else 0) + return encoded_call + [encoded_ssid] diff --git a/TCPServer.py b/TCPServer.py index 84e7eac..19d4e0d 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: diff --git a/config.py b/config.py index 45e877a..4851ed7 100644 --- a/config.py +++ b/config.py @@ -20,5 +20,5 @@ AXUDP_LOCAL_PORT = 20000 # USE_AXUDP Switch from KISS to AXUDP if True # APPEND_SIGNAL_REPORT adds signal report to text of APRS-Message for debug purpose # this will change the original message and could cause loops -USE_AXUDP = True -APPEND_SIGNAL_REPORT = True \ No newline at end of file +USE_AXUDP = False +APPEND_SIGNAL_REPORT = False diff --git a/pySX127x/SX127x/board_config.py b/pySX127x/SX127x/board_config.py index 14dae8e..089452d 100755 --- a/pySX127x/SX127x/board_config.py +++ b/pySX127x/SX127x/board_config.py @@ -33,7 +33,7 @@ class BOARD: This is the Raspberry Pi board with one LED and a modtronix inAir9B. """ # Note that the BCOM numbering for the GPIOs is used. - DIO0 = 22 # RaspPi GPIO 22 + DIO0 = 5 # RaspPi GPIO 5 DIO1 = 23 # RaspPi GPIO 23 DIO2 = 24 # RaspPi GPIO 24 DIO3 = 25 # RaspPi GPIO 25