Skip to content

Commit 43a6e28

Browse files
committed
Fixed bluetooth read timeouts on Android in environments with hight 2.4G noise
1 parent 237a45b commit 43a6e28

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

RNS/Interfaces/Android/RNodeInterface.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,11 @@ def configure_device(self):
602602
raise IOError("Invalid device firmware")
603603

604604
if self.serial != None and self.port != None:
605+
self.timeout = 200
605606
RNS.log("Serial port "+self.port+" is now open")
607+
606608
if self.bt_manager != None and self.bt_manager.connected:
609+
self.timeout = 1500
607610
RNS.log("Bluetooth connection to RNode now open")
608611

609612
RNS.log("Configuring RNode interface...", RNS.LOG_VERBOSE)
@@ -1170,7 +1173,7 @@ def readLoop(self):
11701173
if got == 0:
11711174
time_since_last = int(time.time()*1000) - last_read_ms
11721175
if len(data_buffer) > 0 and time_since_last > self.timeout:
1173-
RNS.log(str(self)+" serial read timeout", RNS.LOG_WARNING)
1176+
RNS.log(str(self)+" serial read timeout in command "+str(command), RNS.LOG_WARNING)
11741177
data_buffer = b""
11751178
in_frame = False
11761179
command = KISS.CMD_UNKNOWN

RNS/Interfaces/RNodeInterface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ def readLoop(self):
799799
else:
800800
time_since_last = int(time.time()*1000) - last_read_ms
801801
if len(data_buffer) > 0 and time_since_last > self.timeout:
802-
RNS.log(str(self)+" serial read timeout", RNS.LOG_WARNING)
802+
RNS.log(str(self)+" serial read timeout in command "+str(command), RNS.LOG_WARNING)
803803
data_buffer = b""
804804
in_frame = False
805805
command = KISS.CMD_UNKNOWN

0 commit comments

Comments
 (0)