When I call readline() on the streamreader it never returns, even though lines of text are being sent to the UART.
When I call read() I can read the bytes individually.
Example:
This code hangs
Code: Select all
async def _run(self):
self._sreader = asyncio.StreamReader(self.uart)
while True:
res = await self._sreader.readline()
Code: Select all
async def _run(self):
self._sreader = asyncio.StreamReader(self.uart)
while True:
await asyncio.sleep_ms(50)
ava = self.uart.any()
res = await self._sreader.read(ava)
self.rx_buffer += res.decode('utf8')