Search found 13 matches

by kenjican
Fri Mar 25, 2022 3:05 am
Forum: ESP32 boards
Topic: OTA encrypted flash,OSError: [Errno 95] EOPNOTSUPP: ESP_ERR_NOT_SUPPORTED
Replies: 0
Views: 9187

OTA encrypted flash,OSError: [Errno 95] EOPNOTSUPP: ESP_ERR_NOT_SUPPORTED

To OTA non-encrypted flash is OK. But encrypted partition is not. I found the problem is that if ota partition encrypted ,Partition.readblocks and Partition.writeblocked are not allowed.It throws error message like this : [Errno 95] EOPNOTSUPP: ESP_ERR_NOT_SUPPORTED That is to say encripted flash OT...
by kenjican
Fri Feb 04, 2022 3:50 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

Thanks for the advice. Yes, to import is a resource-saving solution.Much better than copy :D
by kenjican
Wed Feb 02, 2022 3:18 pm
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

Sorry, I might misunderstood your question.
The code I modified are from these two places:
1: urequests: https://github.com/micropython/micropyt ... /urequests
2: asyncio : https://github.com/micropython/micropyt ... d/uasyncio
by kenjican
Tue Feb 01, 2022 2:11 pm
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

em.. To modify urequests.py would be easier,just because aysncio is build-in. I have no idea how to modify build-in modules.
If asyncio module has requests function, it would be great. I think people need it.
by kenjican
Tue Feb 01, 2022 1:10 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

Thanks for great advices. I modified urequests with uasyncio.stream . It seems working.
I put the code in urequests_ff
by kenjican
Sun Jan 30, 2022 5:35 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

@curt Thanks for advises. But TCP and SSL is a must. @marcidy await sWriter.drain() works. But I found that asyncio.open_connection doesn't support "ssl=True" parameter I try to make ssl sokcet: sWriter = ussl.wrap_socket(sWriter.s,server_hostname=ip) It shows : OSError: (-29312, 'MBEDTLS_ERR_SSL_CO...
by kenjican
Sat Jan 29, 2022 2:29 pm
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

Let's make a asyncio socket awaitable, see this https://docs.python.org/3/library/asyncio-stream.html in python docs First step: mock a tcp server: netcat -lk -p 8888 , we could see if ESP32 send message Second step: chekc if socket established: watch 'ss -tp| grep 100.235' 192.168.100.235 is IP of ...
by kenjican
Sat Jan 29, 2022 8:46 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

I'm running 1.18 on ESP32 Wrover. As I know, threads run in turns. So,,,blocking should reasonable.

Now, I'm trying uayncio.open_connection, it would return awaitable socket. Therefor, We should modify urequests.py to make sockets awaitable.
by kenjican
Sat Jan 29, 2022 5:30 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

I've tried both.
1: _thread. It is blocking also. I think urequests is block in the new thread.
2: asyncio. I test it in REPL, it throws out message: "coroutine expected"
Now, I'm trying to mod urequests . My idea is to make s.read() awaitble...
by kenjican
Fri Jan 28, 2022 5:18 am
Forum: ESP32 boards
Topic: how to make urequests asynchronous?
Replies: 18
Views: 22178

Re: how to make urequests asynchronous?

My expectation is fire and forget. Response is not necessary. Post method of urequests module doesn't have timeout option. Async is also a good alternative.

Could you please show me how to modify urequests.py ?