I've been evaluating RC3 pretty extensively in the last couple of days as I'm filming a video about it, and I have noticed that quite often I get a warning on the Serial Monitor or Serial Plotter that says my board is "disconnected", even though it obviously isn't (if it were truly "disconnected" then it shouldn't be reading data from my microcontroller!).
On the Serial Plotter, this warning is disabling the Stop/Run button, so I can't demonstrate how to stop the plot.
On the Arduino Insider demo video , Ubi de Feo illustrates an example of doing this, but because my plotter thinks it is "disconnected" I can't repeat his example.
I couldn't find this bug in GitHub, but I might have missed it. Can someone please confirm that his is indeed a known bug and perhaps point me to the entry on GitHub.
Thanks!
Hi @DroneBotWorkshop . Thanks so much for your report!
I have also encountered this problem. I reported it in passing in this issue:
opened 04:15PM - 28 Dec 21 UTC
closed 05:31PM - 08 Jun 22 UTC
conclusion: resolved
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
The Arduino IDE uses the serial ports of Arduino boards i… n two different ways:
- Uploading sketches
- Communication via Serial Monitor
The port can not be used for both of these things simultaneously. The IDE handles the condition of Serial Monitor being open when an upload is started automagically like so:
1. Close port in Serial Monitor
1. Complete upload process
1. Reopen port in Serial Monitor
:bug: This works as expected in the first IDE window you open, but it no longer works in subsequent windows.
***NOTE***: although similar, this is different from https://github.com/arduino/arduino-ide/issues/586 because it occurs even when the port is not open in a Serial Monitor/Serial Plotter of another IDE window.
## To Reproduce
1. Connect an Arduino board to your computer.
1. Select the appropriate board and port.
1. Select **Tools > Serial Monitor** from the Arduino IDE menus to open Serial Monitor.
1. Select **Sketch > Upload** from the Arduino IDE menus.
:slightly_smiling_face: Upload succeeds as expected.
1. Select **Tools > Serial Monitor** from the Arduino IDE menus to close Serial Monitor.
This is necessary to avoid https://github.com/arduino/arduino-ide/issues/586
1. Select **File > New** from the Arduino IDE menus.
1. Select **Tools > Serial Monitor** from the Arduino IDE menus in the new window.
:bug: Note that there is an unexpected banner in Serial Monitor:
> Not connected. Select a board and a port to connect automatically.
1. Select **Sketch > Upload** from the Arduino IDE menus.
:bug: Upload fails with an error something like "avrdude: ser_open(): can't open device "\\.\COM7": Access is denied."
## Expected behavior
Upload with Serial Monitor open in the same IDE window to always be handled automagically.
## Desktop
- OS: Windows 10
- Version: 2.0.0-rc3
Date: 2021-12-22T15:46:56.004Z
CLI Version: 0.20.2 [13783819]
## Additional context
It is not necessary to leave the original window open to reproduce the bug. It occurs even if that window is closed.
---
I bisected the issue to https://github.com/arduino/arduino-ide/commit/767b09d2f10cab78b07754039ebb749d55b45d8d (it does not occur at https://github.com/arduino/arduino-ide/commit/88397931c5b704516e881959f6e7ce106094d14d).
---
Originally reported at https://forum.arduino.cc/t/upload-failed-when-serial-monitor-is-open/940255
However, in hindsight I should have opened a dedicated report at that time, which I have now done:
opened 03:32AM - 16 Jan 22 UTC
closed 01:25PM - 08 Jun 22 UTC
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
The Serial Monitor and Serial Plotter communicate to the … user when the currently selected port is not connected (e.g., the user unplugged their Arduino board).
:bug: The Serial Monitor and Serial Plotter of all except the first Arduino IDE window of the session with a given port selected give this indication even when the port is indeed connected to the computer.
## To Reproduce
### Preparation
Upload a sketch to your Arduino board that sends plottable serial output:
```cpp
void setup() {
Serial.begin(9600);
}
void loop() {
Serial.println(random(100));
delay(500);
}
```
The bug will occur regardless of which sketch is on the board. This sketch is only intended to make the behavior easier to observe.
### Observe baseline working state
This procedure is not required to reproduce the bug. It is only intended to prove that the issue does not occur in the first window of the session.
1. Open the "**Serial Monitor**" view (**Tools > Serial Monitor**).
:slightly_smiling_face: Notice that no disconnected indicators are shown, as expected.

1. Open the "**Serial Plotter**" window (**Tools > Serial Plotter**).
:slightly_smiling_face: Notice that no disconnected indicators are shown, as expected.

1. Close the "**Serial Monitor**" view (**X** icon).
This is not mandatory to reproduce the bug. It is done so that Serial Monitor will not be open in the first window of the next session, which might give the impression that is a required condition to reproduce the bug.
1. Select **File > Quit** from the Arduino IDE menus.
This is not mandatory to reproduce the bug. It is done so that it is clear that none of the operations performed during this procedure are required conditions to reproduce the bug.
### Observe bug
1. Start the Arduino IDE.
1. If not already selected, select your board and port from the board/port selector dropdown.
1. Select **File > New** from the Arduino IDE menus.
This loads the second window of the current IDE session.
1. Open the "**Serial Monitor**" view (**Tools > Serial Monitor**).
1. Select "**9600 baud**" from the "**Serial Monitor**" view's baud rate menu.
:slightly_smiling_face: Notice that random numbers are periodically printed to the Serial Monitor view's output field, as expected.
:bug: Notice that there is an unexpected banner in Serial Monitor:
> Not connected. Select a board and a port to connect automatically.

1. Open the "**Serial Plotter**" window (**Tools > Serial Plotter**).
:slightly_smiling_face: Notice that random numbers are periodically plotted in the Serial Plotter, as expected.
:bug: Notice that the Serial Plotter window title has the "**(disconnected)** suffix.
:bug: Notice that a "**Board disconnected**" notification is shown in the Serial Plotter window.
:bug: Notice that some Serial Plotter UI elements are disabled.

## Expected behavior
Serial Monitor and Serial Plotter of subsequent IDE windows to connect to the selected port.
## Desktop
- OS: Windows 10
- Version: 2.0.0-rc3-snapshot.35e5da5
Date: 2022-01-13T17:15:54.562Z
CLI Version: 0.20.2 [13783819]
## Additional context
---
I believe this issue, https://github.com/arduino/arduino-ide/issues/752, and https://github.com/arduino/arduino-ide/issues/726 to all be different symptoms of the same bug. I decided to open a separate issue for each distinct symptom because users affected by one symptom will not associate it with the report for another symptom, making the bug more difficult to support and track.
---
I bisected the related issue https://github.com/arduino/arduino-ide/issues/726 to https://github.com/arduino/arduino-ide/commit/767b09d2f10cab78b07754039ebb749d55b45d8d (it does not occur at https://github.com/arduino/arduino-ide/commit/88397931c5b704516e881959f6e7ce106094d14d).
---
Originally reported by @hpssjellis at:
https://github.com/hpssjellis/my-examples-for-the-arduino-portentaH7/tree/master/ide2.0#:~:text=why%20does%20it%20say%20it%20is%20not%20connected
and by @DroneBotWorkshop at:
https://forum.arduino.cc/t/rc3-serial-plotter-monitor-show-disconnected-when-they-are-not/947524
My experience is that this bug only affects subsequent windows with the same port selected. This means the workaround can be to only use the first window of the session for that port:
Select File > Quit from the Arduino IDE window.
Start the Arduino IDE.
Now only use the Serial Monitor and Serial Plotter from that window for the port that was selected.
I have also been able to sometimes fix it by closing the previous window and then selecting the board/port again, or by switching to another available port and then back to the one I want. Unfortunately I also found that this doesn't help in some cases so I think the first window workaround is the most reliable.
1 Like
Thank you, that was very helpful.
It does indeed seem to work if it is the first window instance. I will use that in my video and let my viewers know about the bug and workaround.
system
Closed
July 15, 2022, 10:15am
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.