QUERY · ISSUE
network: status codes/constants not unified across ports
bug
Working with latest builds (20230422-unstable-v1.19.1-1019) of micropython I found some discrepancies:
ESP32 generic does not have STAT_CONNECT_FAIL in network module.
I noticed that status code value for connecting is 1 in rp2w and 1001 in ESP32.
If we should use constants from documentation then they should be implemented in all ports (please).
Some examples use codes (which is bad) that means they do not work correctly over ports
CANDIDATE · ISSUE
Pyboard D network module station interface: please implement STAT_CONNECTING
port-stm32
When calling the station interface connect method there is a need to verify whether the connection succeeded. On ESP8266 and ESP32 this can be done with
while s.status() == network.STAT_CONNECTING: # Break out on fail or success.
await asyncio.sleep(1)
if s.isconnected():
#
Currently the only way seems to be to poll s.isconnected() with an arbitrary timeout.