Skip to content

Upload fails when Serial Monitor is open #1278

Closed
@per1234

Description

@per1234

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:

  1. Close port in Serial Monitor
  2. Complete upload process
  3. Reopen port in Serial Monitor

🐛 Uploading fails when the Serial Monitor is open, indicating the port handling is not working correctly.

To reproduce

  1. Connect an Arduino board to your computer.
  2. Select the appropriate board and port in the Arduino IDE.
  3. Open Serial Monitor in the Arduino IDE.
  4. 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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions