If the menu function "Open file" is used, the new file exactly covers the old one. If the serial monitor is open in the old sketch - which is now invisible - no upload is possible! It took me some time to find this.
Interesting! I am still using 1.8.13, and New opens a much smaller box.
I wonder if that is adjustable under Preferences, or manually in the Preferences.txt file?
I'm talking about Arduino 2.0 IDE!
Yes it is, but he is talking about 2.0, but it is possible in 1.8
The classic Arduino IDE 1.8.x can do better. It doesn't cover a previous sketch. You can see very clearly that 2 (or more) sketches are now open.
August 30, 2021, 10:00am
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
There is now a dedicated formal issue report for use by the developers to track the need to mitigate this issue:
02:16PM - 31 Oct 21 UTC
05:55AM - 08 Jun 22 UTC
topic: serial monitor
## Describe the bug
It is not uncommon for a user to have multiple windows op
… en 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
1. Connect any Arduino board to your computer.
1. Select the board and port in the Arduino IDE menus.
1. Open Serial Monitor (e.g., **Tools > Serial Monitor**).
1. Select **File > New** from the Arduino IDE menus.
1. Select **Sketch > Upload** from the Arduino IDE menus.
🙁 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.
More effectively communicate the cause of the upload failure and the required action to the user.
Clearly document the cause of the upload failure and the required action (https://github.com/arduino/arduino-ide/issues/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](https://support.arduino.cc/hc/en-us/sections/360003198300). The [classic Arduino IDE points the user there](https://github.com/arduino/Arduino/blob/1.8.16/arduino-core/src/cc/arduino/packages/Uploader.java#L179) 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.
- OS: Windows 10
- Version: 2.0.0-beta.12-nightly.20211028
CLI Version: 0.19.1 alpha [718bbbf2]
## Additional context
Originally reported at https://github.com/arduino/arduino-ide/issues/271#issue-840803269
### 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.