decding eror

This commit is contained in:
Matthew Frost 2023-11-01 17:45:12 +01:00
parent afcb5e5828
commit 51c70d2f88

View file

@ -125,6 +125,7 @@ def serial_router():
data = ser.readline()
try:
data = data.decode('utf-8')
try:
if '=' in data:
prefix, value = data.split('=')
prefix = prefix.strip()
@ -144,6 +145,8 @@ def serial_router():
except UnicodeDecodeError:
hex_data = binascii.hexlify(data).decode('utf-8')
print(f"Received non-UTF-8 data: {hex_data}")
except:
print("Error decoding serial data")
def start_thread(thread_function):
thread = threading.Thread(target=thread_function)