Page 1 of 1

Does MicroPython support asyncio on ESP32?

Posted: Sun Oct 06, 2019 4:13 pm
by liudr
I'm considering porting the azure python sdk (preview) to ESP32 but the first thing I saw in the code was this asyncio module that supports concurrency. Is this currently supported in MicroPython for ESP32? How well is it support, if I may ask? Thanks.

Re: Does MicroPython support asyncio on ESP32?

Posted: Sun Oct 06, 2019 4:58 pm
by pythoncoder
The MicroPython implementation is uasyncio and it works well on ESP32. There is information about it here including a tutorial.
tl;dr It can be installed using upip.

Re: Does MicroPython support asyncio on ESP32?

Posted: Sun Oct 06, 2019 5:31 pm
by liudr
pythoncoder wrote:
Sun Oct 06, 2019 4:58 pm
The MicroPython implementation is uasyncio and it works well on ESP32. There is information about it here including a tutorial.
tl;dr It can be installed using upip.
Thanks pythoncoder, as always. I've not used MP for a while. I would humbly ask for a pointer to use upip.py. Do I just place it in my dev board , import it and call upip.install('uasyncio')?

Re: Does MicroPython support asyncio on ESP32?

Posted: Sun Oct 06, 2019 5:38 pm
by pythoncoder
The magic words, as you'd find in the tutorial I referenced, are

Code: Select all

import upip
upip.install('micropython-uasyncio')
If the import fails because upip isn't already installed you need to copy upip.py and upip_utarfile.py from the MicroPython tools directory to your target.