Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

micropython/aiorepl: Use blocking reads for raw_repl.#1005

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@andrewleech
Copy link
Contributor

raw repl mode is generally used as a command channel where all stdio traffic is related directly to the raw commands and responses sent.

For this to work in aiorepl we need to ensure background tasks don't sent/receive anything on stdio else the command channel will be corrupted.

The simplest way to achieve this is to make the raw commands blocking rather than asyncio, assuming the user wont leave the device in raw mode for too long at any one time.

Carglglz reacted with thumbs up emoji
@andrewleech
Copy link
ContributorAuthor

@dpgeorge I tested this with just raw paste in blocking, reverting the rest of raw repl to async. On an application with active log messages (~1 per second)mpremote cp commands still failed. On the same device with raw repl blocking as per this PR the file transfers work immediately.

sys.stdout.write("\x08\x08")
elifc==CHAR_CTRL_A:
awaitraw_repl(s,g)
awaitraw_repl(g)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Leaves as an argument, but pass insys.stdin.

Raw REPL mode is generally used as a command channel where all stdiotraffic is related directly to the raw commands and responses sent.For this to work in aiorepl we need to ensure background tasks don't sent/receive anything on stdio else the command channel will be corrupted.The simplest way to achieve this is to make the raw commands blocking andatomic rather than asyncio, assuming the user wont leave the device in rawmode for too long at any one time.Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
@dpgeorgedpgeorge merged commitaad2e48 intomicropython:masterJun 3, 2025
4 checks passed
@andrewleechandrewleech deleted the aiorepl_raw_blocking branchJune 25, 2025 22:36
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dpgeorgedpgeorgedpgeorge approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@andrewleech@dpgeorge@pi-anl

[8]ページ先頭

©2009-2025 Movatter.jp