Upload fails if port is open in Serial Monitor of another window #586
Labels
conclusion: resolved
Issue was resolved
criticality: medium
Of moderate impact
topic: code
Related to content of the project itself
topic: documentation
Related to documentation for the project
topic: serial monitor
Related to the Serial Monitor
type: imperfection
Perceived defect in any part of project
Describe the bug
It is not uncommon for a user to have multiple windows open with the same port selected in each. If the Serial Monitor is open in one of those windows, uploads from the other window will fail.
To Reproduce
🙁 Note that the upload has failed with an error something like "
avrdude: ser_open(): can't open device "\\.\COM7": Access is denied.
"Expected behavior
Handle sharing port usage between windows automagically.
OR
More effectively communicate the cause of the upload failure and the required action to the user.
OR
Clearly document the cause of the upload failure and the required action (#271).
I would recommend taking the approach of "so you have x problem, here is the solution ..." rather than "here is how to upload/use Serial Monitor properly ...". The reason is that the user is much more likely to go searching for a specific solution once they have the problem than to proactively study the documentation in advance of doing an upload.
With this approach, the appropriate location for the documentation would be the Help Center. The classic Arduino IDE points the user there in the event of a failed upload.
The article should be titled with the unique components of the various common error messages that occur when attempting to upload to an open port. It should also take into account that there are multiple possible causes of this error.
Desktop
Date: 2021-10-28T03:03:25.353Z
CLI Version: 0.19.1 alpha [718bbbf2]
Additional context
Originally reported at #271 (comment)
Comparison to classic Arduino IDE
This is not usually a problem in the classic Arduino IDE because all windows share the same Serial Monitor and are able to juggle the control of the port between the upload process and Serial Monitor automagically.
The exception is when the user has opened multiple instances of the Arduino IDE, in which case it behaves the same as Arduino IDE 2.x in that each instance has its own Serial Monitor and can not control the Serial Monitor of the other instance. However, this multiple instance usage is not very common, and more often employed by advanced users who are easily able to identify the cause of the upload failure that results from these conditions.
The text was updated successfully, but these errors were encountered: