Updated RNode TCP read timeouts

This commit is contained in:
Mark Qvist 2025-11-19 14:37:47 +01:00
parent fcdcf1a2a8
commit 237c3160eb
2 changed files with 4 additions and 4 deletions

View file

@ -759,7 +759,7 @@ class RNodeInterface(Interface):
RNS.log(f"BLE connection {self.port} to RNode now open") RNS.log(f"BLE connection {self.port} to RNode now open")
if self.tcp != None and self.tcp.connected: if self.tcp != None and self.tcp.connected:
self.timeout = 1000 self.timeout = 1500
RNS.log(f"TCP connection tcp://{self.tcp_host} to RNode now open") RNS.log(f"TCP connection tcp://{self.tcp_host} to RNode now open")
RNS.log("Configuring RNode interface...", RNS.LOG_VERBOSE) RNS.log("Configuring RNode interface...", RNS.LOG_VERBOSE)
@ -1479,7 +1479,7 @@ class RNodeInterface(Interface):
if got == 0: if got == 0:
time_since_last = int(time.time()*1000) - last_read_ms time_since_last = int(time.time()*1000) - last_read_ms
if len(data_buffer) > 0 and time_since_last > self.timeout: if len(data_buffer) > 0 and time_since_last > self.timeout:
RNS.log(f"{self} serial read timeout in command {command} after {RNS.prettytime(self.timeout/1000.0)}", RNS.LOG_WARNING) RNS.log(f"{self} device read timeout in command {command} after {RNS.prettytime(self.timeout/1000.0)}", RNS.LOG_WARNING)
data_buffer = b"" data_buffer = b""
in_frame = False in_frame = False
command = KISS.CMD_UNKNOWN command = KISS.CMD_UNKNOWN

View file

@ -393,7 +393,7 @@ class RNodeInterface(Interface):
time.sleep(1) time.sleep(1)
if self.use_tcp: if self.use_tcp:
self.timeout = 1000 self.timeout = 1500
RNS.log(f"Opening TCP connection for {self}...") RNS.log(f"Opening TCP connection for {self}...")
if self.tcp != None and self.tcp.running == False: if self.tcp != None and self.tcp.running == False:
self.tcp.close() self.tcp.close()
@ -1111,7 +1111,7 @@ class RNodeInterface(Interface):
else: else:
time_since_last = int(time.time()*1000) - last_read_ms time_since_last = int(time.time()*1000) - last_read_ms
if len(data_buffer) > 0 and time_since_last > self.timeout: if len(data_buffer) > 0 and time_since_last > self.timeout:
RNS.log(str(self)+" serial read timeout in command "+str(command), RNS.LOG_WARNING) RNS.log(f"{self} device read timeout in command {command} after {RNS.prettytime(self.timeout/1000.0)}", RNS.LOG_WARNING)
data_buffer = b"" data_buffer = b""
in_frame = False in_frame = False
command = KISS.CMD_UNKNOWN command = KISS.CMD_UNKNOWN