Change timeout

This commit is contained in:
2022-06-12 15:36:20 +02:00
parent 35dde0d9bc
commit b0dd4fa9ac

View File

@@ -13,17 +13,13 @@ class SerialDevice:
def send_command(self, command: str) -> str:
with Serial(self.serial_port, self.baudrate, timeout=1) as s:
with Serial(self.serial_port, self.baudrate, timeout=3) as s:
if self.verbose:
print(self.prefix, "send:", command)
s.write(command.encode())
response_raw = None
count = 0
while count < 10 and not (response_raw := s.readline()):
pass
response_raw = s.readline()
if response_raw:
response = response_raw.decode().strip()