Skip to content

LED staying on with asyncio #16016

Discussion options

You must be logged in to vote

The only thing I can imagine is there was some odd cruft between runs using the picocom approach? I wasn't doing a soft-reset between runs.

This seems the most likely cause: each time you run without reset you are creating a new event/task pair and there may be some code path where the old tasks persist (eg. if they did hit the timeout, then they may remain active as tasks, not 100% sure of the implementation internals here) and so are run by the event loop the next time you start it up alongside your new code.

This is a difference between Micropython and Python - Python Asyncio requires you to keep a reference to a Task while it is running and only uses weakrefs to the Tasks internally.

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@peterhinch
Comment options

Comment options

You must be logged in to vote
1 reply
@GitHubsSilverBullet
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@corranwebster
Comment options

Answer selected by SandyWalsh
@SandyWalsh
Comment options

@peterhinch
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants