Repository navigation
pb-service: say at once that firmware 4.0 cannot take a paste - #15
Merged
Merged
Conversation
Pasting into the REPL of a hub on Pybricks 4.0 waited 10 s and then said the hub was not reading its input. 4.0 sized its stdin buffer at 21 bytes, or 64 on hubs with USB, while reporting a write size of up to 512, so a write bigger than the buffer was refused for good. It is a firmware bug, fixed in 4.1.0b3 (pybricks-micropython a363d48f5f, discussions/2788). It is not worked around: Pybricks Code writes at the reported size too. Instead, on 4.0 a refused write bigger than the hub's buffer is reported at once as HUB_BUSY, saying to update the firmware first, since pb repl shows it in a status line cut to the terminal's width. A smaller write refused on 4.0 still means nothing is reading. The betas between 4.0 and the fix are not told apart. Measured on a Prime hub on 4.0.1: 63 bytes are taken at the prompt and 64 refused for good. A paste now fails in 0.2 s with the remedy, where it took 10 s to fail with the wrong one. The fake hub now reports firmware 4.1.3, as it has no small buffer. The hardware paste test skips on 4.0, and the hardware tests say when they skip because several hubs are on rather than none.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pasting into the REPL of a hub on Pybricks 4.0 waited 10 s and then said
the hub was not reading its input. 4.0 sized its stdin buffer at 21
bytes, or 64 on hubs with USB, while reporting a write size of up to
512, so a write bigger than the buffer was refused for good. It is a
firmware bug, fixed in 4.1.0b3 (pybricks-micropython a363d48f5f,
discussions/2788).
It is not worked around: Pybricks Code writes at the reported size too.
Instead, on 4.0 a refused write bigger than the hub's buffer is reported
at once as HUB_BUSY, saying to update the firmware first, since pb repl
shows it in a status line cut to the terminal's width. A smaller write
refused on 4.0 still means nothing is reading. The betas between 4.0 and
the fix are not told apart.
Measured on a Prime hub on 4.0.1: 63 bytes are taken at the prompt and
64 refused for good. A paste now fails in 0.2 s with the remedy, where
it took 10 s to fail with the wrong one.
The fake hub now reports firmware 4.1.3, as it has no small buffer.
The hardware paste test skips on 4.0, and the hardware tests say when
they skip because several hubs are on rather than none.