We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e60869b commit fce08abCopy full SHA for fce08ab
code/shproto/dispatcher.py
@@ -81,11 +81,14 @@ def start(sn=None):
81
READ_BUFFER = max(nano.in_waiting, READ_BUFFER)
82
83
try:
84
- rx_byte_arr = nano.read(size=READ_BUFFER)
+ with threading.Lock():
85
+ rx_byte_arr = nano.read(size=READ_BUFFER)
86
+ time.sleep(0.01)
87
except serial.SerialException as e:
88
if "device disconnected" in str(e):
- logger.error("Device disconnected. Attempting to reconnect...")
- # Add reconnection logic or gracefully terminate
89
+ logger.error("Device disconnected. Attempting to reconnect...\n")
90
91
92
else:
93
logger.error(f"SerialException: {e}")
94
break
0 commit comments