Description
Describe the problem
The Arduino IDE uses the serial ports of Arduino boards in two different ways:
- Uploading sketches
- Communication via Serial Monitor
The port can not be used for both of these things simultaneously. Rather than imposing the inconvenience of juggling the port usage on the user the Arduino IDE is intended to handle the condition of Serial Monitor being open when an upload is started automatically like so:
- Close port in Serial Monitor
- Complete upload process
- Reopen port in Serial Monitor
🐛 Uploading fails when the Serial Monitor is open, indicating the port handling is not working correctly.
To reproduce
- Connect an Arduino board to your computer.
- Select the appropriate board and port in the Arduino IDE.
- Open Serial Monitor in the Arduino IDE.
- Select Sketch > Upload from the Arduino IDE menus.
🐛 The upload fails with an error like:
Failed uploading: uploading error: exit status 1avrdude: ser_open(): can't open device "\\.\COM61": Access is denied.
Expected behavior
Having Serial Monitor open does not interfere with uploading.
Arduino IDE version
2.0.0-rc9.1
Operating system
Windows
Operating system version
10
Additional context
I bisected the introduction of the issue to e156dcc / #1260
Originally reported tangentially at #581 (comment)
It may be the same issue as reported at #1277, but there is currently insufficient information there to be able to say.
UPDATE: per #1277 (comment), #1277 does not have Serial Monitor as a required condition, which indicates these are two separate issues.
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