diff --git a/library/lcd/lcd_comm.py b/library/lcd/lcd_comm.py index b15f42d7..7336b46f 100644 --- a/library/lcd/lcd_comm.py +++ b/library/lcd/lcd_comm.py @@ -20,6 +20,7 @@ import queue import sys import threading +import time from abc import ABC, abstractmethod from enum import IntEnum from typing import Tuple @@ -124,6 +125,7 @@ def WriteLine(self, line: bytes): logger.error( "SerialException: Failed to send serial data to device. Closing and reopening COM port before retrying once.") self.closeSerial() + time.sleep(1) self.openSerial() self.lcd_serial.write(line) @@ -140,6 +142,7 @@ def ReadData(self, readSize: int): logger.error( "SerialException: Failed to read serial data from device. Closing and reopening COM port before retrying once.") self.closeSerial() + time.sleep(1) self.openSerial() return self.lcd_serial.read(readSize)