pulkin / micropython

MicroPython implementation on Ai-Thinker GPRS module A9 (RDA8955)
https://micropython.org
MIT License
103 stars 30 forks source link

axTLS wrap_socket() blocks execution after some loops #61

Open arlucio opened 4 years ago

arlucio commented 4 years ago

I did some tests sending data to a https cloud database using wrap_socket() and it always hangs and completely block execution after some loops. Sometimes after 20, 100, or 200 but it sometime always hangs on wrap_socket() and stays like this until the watchdog resets. As wrap_socket() on axTLS is blocking, there is no much choice on what to do in this case.

Would be great if we could port mbedtls or wolfssl to this port. Mbedtls is already used on esp32 and stm32 ports, but I believe esp32 uses an specific IDF implementation, and just stm32 uses a more generic one.

Wolfssl was not ported yet to micropython but would probably be the best, as it has a dtls implementation (not available in any micropython port yet) and seems like they are working to provide HTTP3/QUIC support, which seems perfect for IoT.

I will probably be working on this sometime in the near future, but any help would be great.

pulkin commented 4 years ago

I see. I am a little bit more cautious about putting another SSL lib here: I would not spend time on this in the current stage. There is no guarantee that if you face some random crash such as #36 with another lib you will ever be able to debug it. Because there are no debugging tools.

Given that, I would appreciate someone to work on more basic things such as making gdb working here. It seems to be working with examples but not with mpy firmware: and I do not know why.

Kmiz07 commented 3 years ago

Could you cite an example that is working with ssl connection? I'm testing the examples and they give me an error "OSError: [Errno 5] EIO" in the line where I execute 'wrap_socket' Thanks.