Skip to content

Commit 06aeda0

Browse files
committed
Fix receive long slave response by waiting longer
1 parent 547d0a8 commit 06aeda0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

umodbus/serial.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,16 @@ def _exit_read(self, response: bytearray) -> bool:
166166

167167
def _uart_read(self) -> bytearray:
168168
"""
169-
Read up to 40 bytes from UART
169+
Read incoming slave response from UART
170170
171171
:returns: Read content
172172
:rtype: bytearray
173173
"""
174174
response = bytearray()
175175

176-
for x in range(1, 40):
176+
# TODO: use some kind of hint or user-configurable delay
177+
# to determine this loop counter
178+
for x in range(1, 120):
177179
if self._uart.any():
178180
# WiPy only
179181
# response.extend(self._uart.readall())

0 commit comments

Comments
 (0)