Hi everyone
I am working on digital hourglass project. I tried to run the serial monitor however I am getting this message 'not connected. Select a board and a port to connect automatically'. As you see in the pic port and the board already selected. Why I am getting this message. FYI: Circuit don't work as well.
Is your Arduino UNO really on COM8, or is that another serial device?
@muhac80 , your topic has been moved to the section of the forum dedicated to IDE2.0
I get the same message, it lasts until the program starts to send serial messages. I would put your code aside and run an example of serial output.
Also read about millis, what I could read of your code its highly unlikely that
if (time = 1000) will ever be true. And it should be if (time == 1000)
The
delay (1000)
will stop the program for 1000 ms. During that time the millis will continue to count if the code does not get run the millisecond that temp = 1000 then that "if" statement will NEVER be true.
Hi @muhac80 . Thanks for taking the time to give the Arduino IDE 2.0.0 release candidate a try!
As @JohnRob mentioned already, this "Not connected. Select a board and a port to connect automatically. " message is normal and expected under certain conditions. Most notably, that will be while uploading a sketch to your board, since the IDE must disconnect the Serial Monitor from the port so that it can be used by the upload tool.
Unfortunately, there is a bug in the Arduino IDE that also causes this message to occur when the IDE would be expected to connect to the board if it was working correctly. That bug is tracked by the Arduino IDE developers here:
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
You will probably find that the Serial Monitor is still able to display output from the board despite the claim that it is not connected. However, you will find that if you try to send data from Serial Monitor to your board it does not work, which is tracked here:
opened 03:06AM - 16 Jan 22 UTC
closed 01:45PM - 08 Jun 22 UTC
topic: code
type: imperfection
topic: serial monitor
## Describe the bug
The Serial Monitor and Serial Plotter have an input field… the user can use to send data over the selected port.
:bug: In all except the first Arduino IDE window of the session with a given port selected:
- Data sent via the Serial Monitor's "**Message**" field is not received by the Arduino board.
- The Serial Plotter's "**Type Message**" field is disabled due to the plotter being in a "disconnected" state.
## To Reproduce
### Preparation
Upload a sketch to your Arduino board that echos serial input as well as autonomously sending serial output:
```cpp
unsigned long previousMillis;
void setup() {
Serial.begin(9600);
}
void loop() {
if (Serial.available() > 0) {
while (Serial.available() > 0) {
Serial.write(Serial.read());
}
Serial.println();
} else if (millis() - previousMillis >= 1000) {
previousMillis = millis();
Serial.println(random(100));
}
}
```
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**).
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.
1. Type `4242` into the the "**Serial Monitor**" view's "**Message**" field.
1. Press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> to send the text over the serial port.
:slightly_smiling_face: Notice that the sent text `4242` is printed to the Serial Monitor view's output field, as expected.

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.
1. Type `4242` into the the "**Serial Plotter**" window's "**Type Message**" field.
1. Click the <kbd>Send</kbd> button to send the text over the serial port.
:slightly_smiling_face: Notice that the sent value `4242` is plotted in the Serial Plotter, 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. Type `4242` into the the "**Serial Monitor**" view's "**Message**" field.
1. Press <kbd>Ctrl</kbd>+<kbd>Enter</kbd> to send the text over the serial port.
:bug: Notice that the sent text `4242` is not printed to the Serial Monitor view's output field.
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 Serial Plotter's "**Type message**" field and some other UI elements are disabled.

## Expected behavior
Serial Monitor and Serial Plotter of subsequent IDE windows for a given port selection to allow sending data.
## 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 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).
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.
Until these bugs have been fixed, the workaround is to make sure you only ever use the Serial Monitor in one Arduino IDE window per session. If you run into the bug in subsequent windows, you will need to restart the Arduino IDE by exiting (e.g., File > Quit ) and then starting the Arduino IDE once again, after which the Serial Monitor should not be affected by this bug in the first window you open it from.
Good call. Thank you.
Rebooting my laptop fixed the serial monitor issue. Thanks everyone.