Using 1MB MP image? What specific package for uasyncio is correct?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Using 1MB MP image? What specific package for uasyncio is correct?

Post by Jibun no kage » Sun Aug 21, 2022 6:58 pm

Using 1MB MP image? What specific package for uasyncio is correct? I have tried via thonny to load the 20 odd variants of uasyncio, and none of them work, few that look might be compatible, all throw back mpy version errors. This entire package thing is really frustrating. Never even get to the point of a memory error which at least would be progress.

Moreover, I have tried 15 separate times to generate firmware images, and never successful. For example...

Pico port compile fails to 'see' the pico SDK even when the path is updated/correct. Missing header files, and since the configure and source files use relative paths, not absolute paths, it is almost impossible to figure out what is wrong where.

ESP8266 port compile refuses to work with any version of the xtensa SDK I have found and there are many versions.

There is no complete documentation for any port, but the Unix port which is completely useless as an example of how to compile a firmware image, because it is so simplistic, it does not require any addition SDK that does not already exist it the master git clone.

Oh, and the docker example on github, is so old it is broken. I installed docker, but the setup scripts don't work with the latest docker configuration/version.

Unless someone has current, detailed documentation, I can't see being able to figure out what modules are compatible with what, never mind creating my own firmware image. Guess it is time to got back to RTOS or even rust. Really frustrating.

User avatar
scruss
Posts: 360
Joined: Sat Aug 12, 2017 2:27 pm
Location: Toronto, Canada
Contact:

Re: Using 1MB MP image? What specific package for uasyncio is correct?

Post by scruss » Sun Aug 21, 2022 7:15 pm

There's no room on the 1 MB image for uasyncio. The 1 MB image is a legacy thing: everyone doing useful things has moved onto bigger boards.

I know why you're messing with it, but you'll probably have to work this one out yourself, since it's futile effort for everyone else

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: Using 1MB MP image? What specific package for uasyncio is correct?

Post by Jibun no kage » Sun Aug 21, 2022 7:24 pm

Right, I know it will not fit... that is why I want create my own firmware. If I could generate a custom 1MB image, there is a ton of stuff in the stable/nightly build that just is useless for my purpose.

That said, when you do try to follow the available documentation, say for upip... this is an example of what I am talking about, that has nothing to do with the 1MB issue...

>>> theInterface.isconnected()
True
>>> upip.install('uasyncio')
Installing to: /lib/
Warning: micropython.org SSL certificate is not validated
Installing uasyncio 3.0 from https://micropython.org/pi/uasyncio/uasyncio-3.0.tar.gz
>>> import uasyncio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: incompatible .mpy file

Even when I use the documented method package installs fail. Unless they are already integrated to the firmware image. upip worked, no errors or warnings, nothing to tell you the install failed. Because the install did not fail per se. But the result is still useless. So the standalone package is orphaned? Neither stable image nor the nightly build work with the upip example above. But if uasyncio is exists in the firmware image as compiled, the mpy version is consistent, of course only then it works.

Which begs the question... "Plus any modules on the filesystem" which is reported via help('modules'). Even on a 4MB ESP8266 I see the uasyncio add issue, unless it is already in the given firmware image I happen to load initially.

Let me ask the firmware build question a different way? Where is the documentation used to create the nightly builds? Surely someone that set up the automated builds, has the complete, step-by-step process to compile a given port correctly, THAT IS CURRENT INFORMATION, including everything documented in detail. Right? I built enterprise deployment solutions for 100,000s of virtual machines on a global scale, so I know documentation exists, because if something crashed or had to be rebuilt from scratch for disaster recovery, it exists. So I know somewhere somehow someone has accurate current information. How do I get a look behind the curtain?

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: Using 1MB MP image? What specific package for uasyncio is correct?

Post by Jibun no kage » Mon Aug 22, 2022 12:52 am

Once I found, or got a direction on where the current information for Pico firmware builds, I did get a default generic pico firmware built. Now just need to customize the modules/manifest and I should have pico done for my project. All part of the learning curve. Time tackle the beast, ESP8266 firmware.

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

Re: Using 1MB MP image? What specific package for uasyncio is correct?

Post by jimmo » Mon Aug 22, 2022 1:33 am

Jibun no kage wrote:
Sun Aug 21, 2022 7:24 pm
That said, when you do try to follow the available documentation, say for upip... this is an example of what I am talking about, that has nothing to do with the 1MB issue...
There's a long history here but the summary is that (u)asyncio used to be an optional library provided in micropython-lib (and therefore installable via upip etc).

The latest asyncio (v3) is much more integrated with the firmware (e.g. parts of it are implemented in C). So it's typically provided by compiling into the firmware.

Furthermore, the process that builds packages for micropython-lib is currently being re-designed, along with a new upip. https://github.com/micropython/micropython-lib/pull/506

The goal (I hope soonish) is that asyncio v3 will move to micropython lib, replacing the old version there and will be installable via upip (using the Python fallback for the C parts).
Jibun no kage wrote:
Sun Aug 21, 2022 7:24 pm
Let me ask the firmware build question a different way? Where is the documentation used to create the nightly builds? Surely someone that set up the automated builds, has the complete, step-by-step process to compile a given port correctly, THAT IS CURRENT INFORMATION, including everything documented in detail.
The continuous integration is here: https://github.com/micropython/micropyt ... /workflows & https://github.com/micropython/micropyt ... ools/ci.sh
The firmware builds for the downloads page is here: https://github.com/micropython/micropyt ... /autobuild

Jibun no kage
Posts: 144
Joined: Mon Jul 25, 2022 9:45 pm

Re: Using 1MB MP image? What specific package for uasyncio is correct?

Post by Jibun no kage » Mon Aug 22, 2022 4:55 pm

Man, thanks for the links! Every bit helps me get this all understood.

Post Reply