uasyncio.task missing in 1M build

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
sloathog
Posts: 9
Joined: Tue Mar 10, 2020 10:30 pm

uasyncio.task missing in 1M build

Post by sloathog » Thu Aug 18, 2022 10:20 am

Hi,

Issue I have is based on the two errors below:
1st Error:
ImportError: no module named 'uasyncio'
2nd Error:
ImportError: no module named 'uasyncio.task'
I'm trying to make a custom build on 1.19.1 to freeze my modules for a 1M board.
1st error:
I noticed the uasyncio is not included at all, which I resolved by copying the GENERIC/manifest.py to GENERIC_1M/manifest.py
This includes the line:
include("$(MPY_DIR)/extmod/uasyncio/manifest.py")
Now I can import uasyncio, but I get an error trying to import uasyncio.task
$(MPY_DIR)/extmod/uasyncio/manifest.py" has a comment at the top:
# This list of frozen files doesn't include task.py because that's provided by the C module.
My hack was to add "uasyncio/task.py" to the list in extmod/uasyncio/manifest.py, and it appears to work.

My question is:
why does the GENERIC build work without the hack (it uses the c compiled version), but the 1M build doesn't seem to pull in the C module and I need to add task.py to the manifest.

What am I missing on the config of the GENERIC_1M board....

sloathog
Posts: 9
Joined: Tue Mar 10, 2020 10:30 pm

Re: uasyncio.task missing in 1M build

Post by sloathog » Thu Aug 18, 2022 10:24 am

I think I found my own answer, will give it a try and let you know.

Code: Select all

diff GENERIC/mpconfigboard.h GENERIC_1M/mpconfigboard.h
< #define MICROPY_PY_FSTRINGS             (1)
19d17
< #define MICROPY_PY_UASYNCIO             (1)
Need to add #define MICROPY_PY_UASYNCIO (1) to GENERIC_1M/mpconfigboard.h

User avatar
jimmo
Posts: 2754
Joined: Tue Aug 08, 2017 1:57 am
Location: Sydney, Australia
Contact:

Re: uasyncio.task missing in 1M build

Post by jimmo » Thu Aug 18, 2022 12:00 pm

sloathog wrote:
Thu Aug 18, 2022 10:24 am
I think I found my own answer, will give it a try and let you know.
Yes that is exactly the answer.

Post Reply