-
-
Notifications
You must be signed in to change notification settings - Fork 7
Description
We want to build a firmware with the asyncio module from micropython included.
To that end we created a symlink from bricks/_common/modules/uasyncio to ../../../micropython/extmod/uasyncio and adjusted manifest.py by adding include("./modules/uasyncio"). We used this approach because the autodetection in manifest.py does not work for files in directories and and the directive ("$(MPY_DIR)/extmod/uasyncio") from the original micropython seems not to work. It says MPY_DIR is not set.
When we compile the firmware we can see the following in the log:
Including foo as a module.
MPY uasyncio/__init__.py
MPY uasyncio/core.py
MPY uasyncio/event.py
MPY uasyncio/funcs.py
MPY uasyncio/lock.py
MPY uasyncio/stream.py
MPY foo.py
GEN build/frozen_content.c
so far so goo. foo.py ist just for testing to see if that works.
Now, when running the firmware using foo works:
>>> import foo
>>> print(foo.PI)
3.14
however, when trying to import (u)asyncio we get an ImportError.
>>> import asyncio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'asyncio'
>>> import uasyncio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: no module named 'uasyncio'
What do we need to do to build asyncio (or for that matter any other micropython library) into the firmware?