← index #8867Issue #402
Related · medium · value 0.615
QUERY · ISSUE

esp32 - uart - uasyncio streamreader, always receive b"" from RS485

openby stragaopened 2022-07-05updated 2022-11-15
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

closedby gtomassiopened 2020-10-28updated 2020-10-28

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:

  1. Open a UART connection using the stream reader 'streamReader = asyncio.StreamReader(uart)'
  2. Close the stream reader
  3. Not sure if this is required, but open a new stream reader on the same UART again
1 comment
gtomassi · 2020-10-28

Moving to https://github.com/micropython/micropython/issues/6576

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied