QUERY · ISSUE
esp32 - uart - uasyncio streamreader, always receive b"" from RS485
bugextmod
after commit for uasyncio streamreader, data read from rs485 always b"". If reverse back, start works like before.
https://github.com/micropython/micropython/commit/db7682e02d3ffd3338f20effc9ad4735a48bf774
for example.
self.ac_uart = UART(2, baudrate=9600, tx=14, rx=15)
self.ac_swriter = asyncio.StreamWriter(self.ac_uart, {})
self.ac_sreader = asyncio.StreamReader(self.ac_uart)
while True:
data = await self.ac_sreader.read(-1)
log.info(f" RAW: {data}")
CANDIDATE · ISSUE
Uasyncio Uart Stream Close Bug
When calling aclose (maps to Stream.wait_closed) on the new implementation of Stream, something goes awry in the stream read process and begins raising exceptions.
After calling aclose the following stack trace is seen:
File "uasyncio/stream.py", line 30, in read
File "uasyncio/core.py", line 94, in queue_read
File "uasyncio/core.py", line 82, in _enqueue
Steps to reproduce:
- Open a UART connection using the stream reader 'streamReader = asyncio.StreamReader(uart)'
- Close the stream reader
- Not sure if this is required, but open a new stream reader on the same UART again
Moving to https://github.com/micropython/micropython/issues/6576