The UART does seem to work with poll.
Code: Select all
>>> from machine import UART
>>> uart = UART(1, 115200)
>>>
>>> import select
>>> po = select.poll()
>>> po.register(uart, select.POLLIN)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: stream operation not supported
Code: Select all
>>> uart.any()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'UART' object has no attribute 'any'
Code: Select all
>>> import socket
>>> import select
>>>
>>> server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>> server.bind(('0.0.0.0', 8000))
>>> server.listen(0)
>>>
>>> client, addr = server.accept()
>>> print("connection from ", addr)
connection from ('192.168.0.124', 55362)
>>>
>>> client.settimeout(0)
>>>
>>> po = select.poll()
>>> po.register(client, select.POLLIN)
>>>
>>> events = po.poll()
Code: Select all
MicroPython v1.10-282-g6a9b3cb-dirty on 2019-09-17; WinnerMicro module with W600