Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected board+port selection change when board is disconnected #2143

Closed
3 tasks done
per1234 opened this issue Jul 17, 2023 · 0 comments · Fixed by #2165
Closed
3 tasks done

Unexpected board+port selection change when board is disconnected #2143

per1234 opened this issue Jul 17, 2023 · 0 comments · Fixed by #2165
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Jul 17, 2023

Describe the problem

The port that is currently selected in Arduino IDE may become no longer discoverable under normal operation for any of a number of reasons, including:

  • The user disconnected the board from their computer.
  • The user reset or power cycled the board.
  • The user uploaded a sketch to the board that disables the port.

Arduino IDE automatically switches to a different board and port selection when the currently selected port is no longer discoverable under the following conditions:

  • The user selected a different port at some time.
  • That previously selected port is identified as an Arduino board.
  • The previously selected port was selected using the "board selector" menu.

🐛 The automatic board+port switch might be unnoticed or unwanted by the user, which could result in any of the following:

  • Confusing compilation results due to compiling for a different board than was intended
  • Uploading to a different board than the user intended
  • User having to fight with the IDE to retain their intended board selection

To reproduce

Equipment

  • Any device that produces a port that is identified as an Arduino board. Any official Arduino board other than the classic Nano can be used.
    This will be referred to as "board A" from here on.
  • Any device that produces a port that can be made no longer discoverable.
    This will be referred to as "board B" from here on.

Demo

  1. Connect "board A" to your computer if it is not already.
  2. Select the board+port of "board A" from the dropdown "board selector" menu in the Arduino IDE toolbar.
    ❗You must use the board selector instead of the Tools > Port menu for this step.
  3. Connect "board B" to your computer if it is not already.
  4. Select the board of "board B" from the Tools > Board menu.
    It doesn't matter what you select from the menu, or even if you perform this step at all. It is included in the instructions in order to reflect the typical user journey.
  5. Select the port of "board B" from the Tools > Port menu.
    ❗You must use the Tools > Port menu instead of the board selector menu for this step.
  6. Disconnect "board B" from your computer.

🐛 The board+port selection unexpectedly reverts to that of "board A".

Expected behavior

The board selection made by the user is retained even after the currently selected port becomes no longer discoverable.

No port is selected in Arduino IDE after the currently selected port becomes no longer discoverable, but that port selection is restored if the port becomes discoverable again later. *

* NOTE: there is special handling of the selected port becoming no longer discoverable during an upload operation. The expectation above is about when the selected port becomes no longer discoverable during operational modes of the IDE other than the upload operation.

Arduino IDE version

f6a4325

Operating system

  • Windows
  • Linux
  • macOS

Operating system version

  • Windows 11
  • Ubuntu 22.04
  • macOS Ventura

Additional context

Related: #1319

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Jul 17, 2023
@kittaakos kittaakos self-assigned this Jul 17, 2023
@per1234 per1234 linked a pull request Aug 17, 2023 that will close this issue
4 tasks
kittaakos pushed a commit that referenced this issue Aug 17, 2023
Closes #43
Closes #82
Closes #1319
Closes #1366
Closes #2143
Closes #2158

Signed-off-by: Akos Kitta <[email protected]>
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants