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

Port left open after closing Serial Plotter #1423

Open
3 tasks done
per1234 opened this issue Sep 12, 2022 · 1 comment · May be fixed by #1702
Open
3 tasks done

Port left open after closing Serial Plotter #1423

per1234 opened this issue Sep 12, 2022 · 1 comment · May be fixed by #1702
Assignees
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@per1234
Copy link
Contributor

per1234 commented Sep 12, 2022

Describe the problem

If one process has a serial port open, another can not access it. Arduino IDE is designed to automatically manage access to ports by the various operations and components that use them:

  • Uploading sketches
  • Serial Monitor
  • Serial Plotter
  • Updating radio module firmware
  • Uploading SSL certificates to radio module

The user may also use the port from an external application during sketch development in Arduino IDE. They will be responsible for managing the access of the port by the IDE and the external application. This means that the IDE must always relinquish port access when the user closes a component using the port

🐛 The port is left open after closing the Serial Plotter window.

To reproduce

  1. Select a serial port in the Arduino IDE.
  2. Select Tools > Serial Plotter from the Arduino IDE menus to open the "Serial Plotter".
  3. Close the "Serial Plotter" window.
  4. Open the port in an external application.

🐛 Opening the port fails.

Expected behavior

Port is closed when Serial Plotter window is closed.

Arduino IDE version

2.0.0-rc9.4

Operating system

Windows, Linux

Operating system version

Windows 10, Ubuntu 20.04

Additional context

From Windows Task Manager and GNOME System Monitor, I can see that the serial-monitor process is not being closed when the Serial Plotter window is closed.


I bisected the introduction of the issue to df8658e


The problem does not occur if the procedure described above is performed using Serial Monitor instead of Serial Plotter (in fact cycling Serial Monitor open and then closed again closes the port after it was left open by Serial Plotter).


The issue does not occur when using Arduino IDE 1.8.19 Serial Monitor


Some options for external applications that can be used for the final step in the demo:

$ arduino-cli upload --fqbn arduino:avr:uno --port COM7
avrdude: ser_open(): can't open device "\\.\COM7": Access is denied.
$ arduino-cli upload --fqbn arduino:samd:mkrzero --port COM47
TOUCH: error during reset: opening port at 1200bps: Serial port busy
No device found on COM47
Error during Upload: Failed uploading: uploading error: exit status 1
$ arduino-cli monitor --port COM7
Port monitor error: command 'open' failed: Serial port busy

Opening the port in Arduino IDE 1.x Serial Monitor

Error opening serial port 'COM7'. (Port busy)

Additional reports

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
@zvonler

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
criticality: medium Of moderate impact topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants