Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UNO is reset on IDE startup and shutdown if port is open in Serial Monitor #1546

Open
RalphBacon opened this issue Oct 7, 2022 · 4 comments
Assignees
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project

Comments

@RalphBacon
Copy link

Using Arduino IDE 2.0.0 the USB-attached Arduino UNO clone is reset upon starting up, or shutting down the IDE.

Might be related to issue arduino/Arduino#11824.

Running Windows 11, Arduino IDE 2.0.0

@per1234 per1234 transferred this issue from arduino/Arduino Oct 7, 2022
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Oct 7, 2022
@per1234
Copy link
Contributor

per1234 commented Oct 7, 2022

Thanks for your report @RalphBacon.

As far as the reset on start up is concerned. It is expected that the board will restart on initialization of the Serial Monitor. Unlike Arduino IDE 1.x, Arduino IDE 2.x remembers whether you had Serial Monitor open in the IDE window of a given sketch and restores that state the next time you open the sketch, which will be done automatically if the sketch was open the last time you closed the IDE. So in this case the reset on startup is expected as the Serial Monitor initializes when the IDE window opens with Serial Monitor.

However, the reset on shut down is not expected to me. We had a similar report at #1420, which unfortunately I have not been able to reproduce. In that case, the reporter associated the problem with the Arduino IDE Serial Monitor. I'm wondering whether this might also be a required condition in your case.

We can check that by seeing whether the reset still occurs even if Serial Monitor (and Serial Plotter while we're at it) was never used during the IDE session. Please try this and then comment here to report the results:

  1. Start the Arduino IDE if it is not already running.
  2. If multiple IDE windows are open, close all except one.
  3. If the Serial Monitor tab is present in the panel at the bottom of the IDE, click the X button on its tab to close it.
  4. Select File > Quit from the Arduino IDE menus.
  5. Wait for the Arduino IDE start up to finish.
  6. Select the board and port for the Uno from the Arduino IDE menus if it is not already selected.
  7. Select File > Quit from the Arduino IDE menus.

Did the board reset on start up?

Did the board reset on shut down?

@per1234 per1234 self-assigned this Oct 7, 2022
@per1234 per1234 added the status: waiting for information More information must be provided before work can proceed label Oct 7, 2022
@RalphBacon
Copy link
Author

Thanks for the quick reply.

I can confirm that turning the Serial Monitor off ensures the UNO board is not reset either at start up or shutdown. 😊

However, I do not support the assertation that "... it is expected the board will restart on initialisation of the Serial Monitor". 😲

If the creators of the Arduino IDE prefer this behaviour, I would expect this to be a user-selectable option to determine whether the initial state of the DTR/RTS line states should be on or off at start up. I often run sketches for several hours (if not days) for testing. I would not expect that board to be arbitrarily reset the next time I happened to open the IDE (with the Serial Monitor open). I'm sure you can see the unfriendly behaviour here!

Perhaps this can be considered as an (urgent) feature suggestion?

@per1234
Copy link
Contributor

per1234 commented Oct 7, 2022

Thanks for your feedback. The problem of unexpected resets on IDE startup will be resolved as part of the planned Serial Monitor rework that moves it to a separate window (as in Arduino IDE 1.x and similar to Serial Plotter in both IDE series): #289 (comment)

I would still be interested in investigating the reset on shut down, as this is not expected.

Please try this and then comment here to report the results:

  1. Start the Arduino IDE if it is not already running.
  2. Select the board and port for the Uno from the Arduino IDE menus if it is not already selected.
  3. If the Serial Monitor tab is not already present in the panel at the bottom of the Arduino IDE, select Tools > Serial Monitor to open it.
  4. Click the X button on the Serial Monitor tab at the bottom of the Arduino IDE window.
  5. Select File > Quit from the Arduino IDE menus.

Did the board reset on shut down?

@RalphBacon
Copy link
Author

I followed your instructions exactly.

When I click the X on the Serial Monitor tab it closes. If I then close the IDE the UNO does NOT reset. It only resets if the Serial Monitor tab is open on shutdown.

I hope this helps you resolve the issue.

Good to hear that the overall behaviour of the Serial Monitor is being reassessed generally!

I shall pass on the caveat regarding the unexpected board resets to my viewers but, that notwithstanding, encourage them to download and use it in preference to any V1.x version. It is a huge step forward for C++ uses of all levels.

@per1234 per1234 removed the status: waiting for information More information must be provided before work can proceed label Oct 11, 2022
@per1234 per1234 changed the title Serial port performs a reset to attached UNO on startup and shutdown of IDE 2.0.0 UNO is reset on IDE startup and shutdown if port is open in Serial Monitor Sep 28, 2023
@per1234 per1234 added the topic: serial monitor Related to the Serial Monitor label Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: serial monitor Related to the Serial Monitor type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants