-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
#1032 failing upload flag for monitor mgr #1040
#1032 failing upload flag for monitor mgr #1040
Conversation
arduino-ide-extension/src/browser/contributions/upload-sketch.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: Resolved by 5260a07 / arduino/arduino-cli#1771
Same procedure and symptoms as reported on the issue: upload to the "1200 bps touch" boards (I tested with MKR Zero, Leonardo, Micro) fails on Windows with Serial Monitor open. Uploading works just fine with Serial Monitor closed.
An update on my previous report: After further experimentation I discovered that I was able to get a successful upload with the Serial Monitor open after plugging my Arduino board into specific USB ports of my computer. I also discovered that the upload error would occur even on my other computer when the board was connected to an otherwise usable USB port through a specific USB hub (but not when using other hubs). So it seems the ability to reproduce the error I reported is dependent on specific hardware configurations of how the board is connected to the PC. This seems to be a different situation from #1032, which I have found to occur consistently on my Windows machines even when using the USB connection configuration that produces a successful upload when using the test build from this PR. |
cc12bc0
to
209ac69
Compare
…ub.com/arduino/arduino-ide into 1032-uploads-failing-with-monitor-open
This reverts commit 2d5dff2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: fixed by c892ce3 or a7c8806
Describe the problem
Using the build from 6e264a6, uploading to a native USB board with Serial Monitor open causes Serial Monitor to go into a permanently disconnected state:
To reproduce
- Connect a native USB board (e.g., Leonardo) to your computer.
- Select the board and port.
- Open the "Serial Monitor" View.
- Click the "Upload" button.
- Wait for the upload to finish successfully.
- Select the "Serial Monitor" View.
🐛 The Serial Monitor is not connected to the board's port:
Not connected. Select a board and a port to connect automatically.
Arduino IDE version
2.0.0-rc7-snapshot-6e9c8af (the build from 6e264a6)
Operating system
Windows, Linux
Operating system version
Windows 10, Ubuntu 20.04
Additional context
After it gets into this state, the Serial Monitor remains this way even after closing and reopening the view, unplugging/replugging the board, attempting to use the monitor with another board and port. The only way to recover it is by opening an new Arduino IDE window or restarting the Arduino IDE.
The issue does not occur when using a board with a dedicated USB chip (e.g., Uno, Mega).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Describe the problem
When uploading to a native USB board with Serial Monitor open, the "Serial Monitor" view takes visibility from the "Output" view twice during the upload:
🐛 Users who want to monitor the upload process via the "Output" view will find it inconvenient to lose sight of it in the middle of the process, and then have to select the view once more after every upload.
To reproduce
- Connect a native USB board (e.g., Leonardo) to your computer.
- Select the board and port in the Arduino IDE.
- Open the "Serial Monitor" view.
- Select the "Output" view.
- Click the "Upload" button.
🐛 The view visible in the bottom panel is switched multiple times, as follows:
- "Output" view
- "Serial Monitor" view
- "Output" view
- "Serial Monitor" view
Note that the view that is visible after the process finishes does not match the user's selected focus.
Expected behavior
The "Output" view retains visibility throughout and after the upload process.
Arduino IDE version
2.0.0-rc7-snapshot-b1c06fa (The build from a7c8806)
Operating system
Windows 10
I am not able to reproduce the issue on my Linux machine.
Hi @per1234 with regards to the panels changing focus, this is a known issue from the original feature PR, and actually something I was looking to improve today, though I'm not sure if it's in the scope of this PR (as it's not related to the upload failing...what do you think?). Essentially whenever a user unplugs and plugs a board back in we reset (close and reopen) the serial monitor & plotter. Windows changes ports during upload with USB native, which looks to the IDE like a user unplugging and then plugging back in a board, hence a reset is triggered. In this case it'd definitely be a nicer UX to maintain focus on the output during upload. This is not so complicated as we know when we're uploading. However, when the upload finishes in this scenario Windows often switches back the port, again this seems like a user plugging in a board so the focus goes to the monitor. As this happens after upload we don't have a reliable way of knowing if the "port change" was due to the upload finishing, or a user plugging in a board. In short we can maintain focus during upload but switching back to the monitor afterwards may be unavoidable in some cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disclaimer: approving this PR as we need to address issues users are experiencing quickly. A new refactor is due before stable release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is working perfectly for me now.
Thanks Dave!
Motivation
Users have reported that with some boards our core upload functionality breaks if attempted with a Serial Monitor open.
Change description
Ensures that when we upload to a board that has an open Serial Monitor, we pause the related serial monitor process. We also prevent new monitor services from starting during upload, and use a "queue & reconcile later" mechanism to deal with start attempts during upload.
Additional Important Info
During investigation we found that changes were also needed in the arduino-cli in order to ensure correct flow of events during upload with a Serial Monitor open. CLI PR.
Reviewer checklist