arduino / arduino/Arduino

Arduino disconnect and reconnect causes exception when uploading if serial monitor left open

Open
#3,382 24 comments 2 reactions 1 assignee Claimed by @per1234 View on GitHub
Component: IDE Component: IDE Serial monitor Component: Uploading Type: Bug Waiting for feedback
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

Related partly to #3379 (actually discovered due to testing repeatability).

An exception error will occur if the serial monitor is opened, the arduino is unplugged, plugged back in, and then uploaded to. When you click upload a second time, it disables the serial monitor properly and uploads.

```
java.io.IOException: jssc.SerialPortException: Port name - COM6; Method name - setEventsMask(); Exception type - Can't set mask.
at processing.app.Serial.dispose(Serial.java:146)
at processing.app.SerialMonitor.close(SerialMonitor.java:108)
at processing.app.AbstractMonitor.suspend(AbstractMonitor.java:206)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2375)
at java.lang.Thread.run(Thread.java:745)
Caused by: jssc.SerialPortException: Port name - COM6; Method name - setEventsMask(); Exception type - Can't set mask.
at jssc.SerialPort.setEventsMask(SerialPort.java:279)
at jssc.SerialPort.removeEventListener(SerialPort.java:1064)
at jssc.SerialPort.closePort(SerialPort.java:1090)
at processing.app.Serial.dispose(Serial.java:143)
... 4 more
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.