uasyncio - asyncio-like cooperative multitasking framework for uPy
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
To save others spending time to figure this out - uasyncio 2.0 requires the @pfalcon build of firmware. The version (1.7.1 of uasyncio.core) in @Damien's library works with his build. The version on PyPI is uasyncio 2.0.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
I am confused. Do we have a micropython fork?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
My above statement has been overtaken by events: the official MicroPython firmware now supports uasyncio V2.0 (and earlier versions).
To answer your question there is a fork of MicroPython and the library maintained by Paul Sokolovsky (@pfalcon). Amongst other things he is developing the uasyncio library, so future changes to uasyncio may occur which initially require his firmware.
The situation was explained by @Damien here.
To answer your question there is a fork of MicroPython and the library maintained by Paul Sokolovsky (@pfalcon). Amongst other things he is developing the uasyncio library, so future changes to uasyncio may occur which initially require his firmware.
The situation was explained by @Damien here.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
uasyncio V2.0
I have now tested this fairly thoroughly. It's an impressive upgrade in terms of task switching performance and there seems to be no downside. The only API change is to the initial call to get_event_loop() which needs adapting to set the queue sizes if an application runs more than 16 concurrent coroutines.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
The latest release of uasyncio, 2.2, requires a patch https://github.com/micropython/micropython/pull/4217 which was submitted to upstream at the beginning of October and isn't merged still. The situation with the maintenance of upstream MicroPython is discussed in more detail here: viewtopic.php?f=2&t=4358&start=30#p32315 .
Until (if) the patch is merged upstream, it's available in my fork of MicroPython, Pycopy: viewtopic.php?f=15&t=5699 , together with many other new features and optimizations. Figuring out the situation with this patch is also on critical path to other developments/optimizations in uasyncio, which I have in my tree for a year now. Among alternatives of: a) get discouraged and cease work on MicroPython and uasyncio; b) continue indecisive waiting; c) continue development, I choose the latter variant. Interested parties are welcome to join with this effort, non-interested may use the older version or develop something on their own.
Until (if) the patch is merged upstream, it's available in my fork of MicroPython, Pycopy: viewtopic.php?f=15&t=5699 , together with many other new features and optimizations. Figuring out the situation with this patch is also on critical path to other developments/optimizations in uasyncio, which I have in my tree for a year now. Among alternatives of: a) get discouraged and cease work on MicroPython and uasyncio; b) continue indecisive waiting; c) continue development, I choose the latter variant. Interested parties are welcome to join with this effort, non-interested may use the older version or develop something on their own.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
@pfalcon The following statement is to save others from some reading.
The discussion around PR4217 indicates that Damien does not intend to implement it. This implies that your latest uasyncio version, and future versions, will require your MicroPython fork.
The discussion around PR4217 indicates that Damien does not intend to implement it. This implies that your latest uasyncio version, and future versions, will require your MicroPython fork.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
I read you post about your micropython-lib repo being compatible to every fork and that you want to keep it that way and that every fork has to take care about not doing changes that break compatibility. And I really like that. You even claim that in your message signatures "MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib"
Therefore I find it quite counterproductive to publish uasyncio version 2.2 to pypi (where everyone usually downloads packages from with upip) and your own repo as it is not compatible to any firmware than your own because you made changes breaking compatibility to every other fork.
I find that behaviour to be quite hypocritical. Your standard library is not so standard anymore if you break compatibility intentionally.
Therefore I find it quite counterproductive to publish uasyncio version 2.2 to pypi (where everyone usually downloads packages from with upip) and your own repo as it is not compatible to any firmware than your own because you made changes breaking compatibility to every other fork.
I find that behaviour to be quite hypocritical. Your standard library is not so standard anymore if you break compatibility intentionally.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
@pfalcon I implore you to reconsider this decision and make the default upip install of micropython-asyncio work with mainline MicroPython. As someone who introduces a lot of beginners to MicroPython I know first-hand how much confusion this caused last time and how much consternation it's sure to create again.
Your ongoing development of uasyncio - which I, and many others are very grateful for! - could continue but perhaps by installing, say micropython-asyncio-dev. This would allow you to continue development while not breaking mainline and allow you to build your case to integrate the changes by showing what may be possible.
Would this be possible?
Your ongoing development of uasyncio - which I, and many others are very grateful for! - could continue but perhaps by installing, say micropython-asyncio-dev. This would allow you to continue development while not breaking mainline and allow you to build your case to integrate the changes by showing what may be possible.
Would this be possible?
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
mattyt, are you sure you knock on the right door? Did you read the post above at all? Did you read the links in it? There's a patch which needs to be merged to "make the default upip install of micropython-asyncio work with mainline MicroPython". You should implore to the maintainer of the mainline. And heck, the mainline has fallen into subpar maintenance, as discussed by the links above. I'm doing all what I can to continue development and improve the situation with the mainline too (raising questions, offering help with the maintenance, submitting patches). What are you doing to improve the situation?make the default upip install of micropython-asyncio work with mainline MicroPython
Last edited by pfalcon on Wed Dec 26, 2018 11:40 pm, edited 1 time in total.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: uasyncio - asyncio-like cooperative multitasking framework for uPy
Otherwise, the concerns sounded here are exactly those which were discussed and answered in the thread linked above, viewtopic.php?f=2&t=4358&start=30#p32315 . Which shows again that there're some avid "Bob is writer, not reader"'s out there.
So, disregard "advices" like:
So, disregard "advices" like:
Stay wary of people giving them. Read the stuff, make your choices. Here's one quote from the thread linked above, as a sneak preview:to save others from some reading
1. micropython-lib's has got a new motto: "MicroPython standard library for all ports, forks, and variants". As you know, motto can't convey all the complexity of real-world situations. The fine print is "for any variant which wants to be compatible". If Loboris doesn't want his fork to be compatible - it won't be compatible. If Adafruit brags a desire to remove standard MicroPython APIs from their fork - it won't be compatible. If George Robotics wants their variant to be not compatible - it will be such. I can't control 3rd parties.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/