-
Notifications
You must be signed in to change notification settings - Fork 16
Use CircuitPython socket support #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes please. I believe this would allow a non blocking tcp/udp socket to be opened. |
I've tried to fix this with limited success in these functions
|
However, the |
You could pass in the SocketPool. |
I've taken a few cracks at this and it's really not so simple as that unfortunately. There are a few issues but the biggest thing is that esp-idf's examples around connecting and using non-blocking sockets also depend on having a file descriptor to use with select (see here: https://github.com/espressif/esp-idf/blob/master/examples/protocols/sockets/non_blocking/main/non_blocking_socket_example.c) other issues, like the strange connection behavior I see with non-blocking sockets on my Qualia S3 with CircuitPython 9.2.1, can be worked around, but this piece is pretty fundamental to this particular problem. SocketPool Sockets' underlying file descriptor need to be exposed via a EDITED: Addendum: after further testing I've determined that my issues with non-blocking TCP sockets only occur with CircuitPython >= 9.1.0 so for now I'm sticking with 9.0.5. I'll try to chase that issue down and slowly work my way back to this one |
I am running on an Metro M4 Aitlift Lite. I was having a problem where trying to connect to a host which was offline would cause everything else to hang and crash the esp firmware (version 1.7.7). The application is running a control loop where keeping the Delta T jitter as low as possible was a goal. I have implemented a refactor of adafruit_miniqtt and everything underneath (connection managers, esp32_spi ...) to work in a asyncio environment. Other tasks will continue to run even while esp is trying connect. More testing is required but it is currently working for my application. Not sure how to make it available because it affects more than MQTT. The crash of the esp firmware is also fixed. |
Change
asyncio.open_connection()
andasynico.start_server()
to use CircuitPython's socket support.The text was updated successfully, but these errors were encountered: