Repository navigation
A switched-off board that answered before isn't called busy - #200
Merged
Merged
Conversation
…ides when the TCP connect times out
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.
Fixes #199.
A board that had answered before (one saved in
wifiBoards, or one that logged in earlier in the session) was called busy on any silence, so a board that's switched off got "The board is busy in a loop that never yields; use serial, or reset it." after the 5 s connect timeout.A busy board still answers ping (lwIP runs on its own task); one that's off doesn't. Now, when the TCP connect itself times out, ping decides even for a board that answered before. Silence after the connect (no password prompt, no login reply, no WebSocket upgrade reply) still means busy without asking ping, since the board is plainly up.
Tested: the Wi-Fi and WebREPL tests, with the old "answered before is busy without ping" test split into the after-connect case (still busy, no ping) and the timed-out case (ping decides, both ways). By hand under Windows Python 3,
Session().connect("ws://<an empty address>", known=True)said busy before and now says "no answer from ... Is the board on this network at that address?".