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

Confusing notifications shown during upload with Serial Monitor open #620

Open
3 tasks done
per1234 opened this issue Nov 18, 2021 · 0 comments
Open
3 tasks done
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

@per1234
Copy link
Contributor

per1234 commented Nov 18, 2021

Describe the problem

When connection to a port is lost while it was open in Serial Monitor, Arduino IDE 2.x attempts to reconnect and displays warning notifications when that fails:

image

This is a reasonable behavior when the port is disconnected from Serial Monitor unexpectedly. However, there is also a common case where disconnection of the port is expected: during uploads. These warnings are occasionally displayed during that process, which can cause unnecessary confusion or annoyance to the users.

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. The IDE handles the condition of Serial Monitor being open when an upload is started automagically like so:

  1. Disconnect port from Serial Monitor
  2. Complete upload process
  3. Reconnect port in Serial Monitor

🐛 It seems that the third step is sometimes attempted while the upload is still in progress, resulting in these unhelpful notifications:

image

To reproduce

  1. Connect a MKR or Nano 33 IoT board to your computer.
  2. Open the port of the board in Serial Monitor.
  3. Upload to the board.
  4. Wait for the upload to finish, watching the notifications that are displayed at the bottom right corner of the Arduino IDE window.
    If the only notification is "Done uploading", repeat from step (3) until you see the unhelpful additional notifications during the upload.

Expected behavior

Warning notifications should only be displayed if there is a problem that needs to be brought to the user's attention.

Serial Monitor should not attempt any reconnects until the upload process has finished.

Arduino IDE version

2.0.0-beta.12-nightly.20211115

Operating system

Windows

Operating system version

10

Additional context

Originally reported at #271 (comment):

There are a series of pop-up toasts that pop up when you upload a changed sketch while the serial monitor is open warning that the port's not available, etc. These are distracting, and not useful if you're handling the closing of the port, the upload, and the re-opening in the background. They should be kept in the error log, not in pop-up toasts.


The issue is intermittent for me. It occurs approximately once in five uploads.


I was not able to reproduce the issue with Leonardo, Mega, or Nano 33 BLE.


I have never encountered the issue when Serial Monitor was not open.

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
@per1234 per1234 added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project topic: serial monitor Related to the Serial Monitor labels Nov 18, 2021
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