Skip to content

Serial parity not set stops serial monitor from opening #3381

@pfeerick

Description

@pfeerick

I started using Arduino again after a short break due to uni exams, and when trying to open the serial monitor on v1.6.5, was greeted with this nasty error message in the log, and no serial monitor opening.

Arduino: 1.6.5 (Windows 7 x64), Board: "Arduino Uno", COM6

java.lang.StringIndexOutOfBoundsException: String index out of range: 0

    at java.lang.String.charAt(String.java:646)

    at processing.app.Serial.<init>(Serial.java:71)

    at processing.app.SerialMonitor$3.<init>(SerialMonitor.java:93)

    at processing.app.SerialMonitor.open(SerialMonitor.java:93)

    at processing.app.Editor.handleSerial(Editor.java:2540)

    at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:357)

    at java.awt.Component.processMouseEvent(Component.java:6522)

    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)

    at java.awt.Component.processEvent(Component.java:6290)

    at java.awt.Container.processEvent(Container.java:2234)

    at java.awt.Component.dispatchEventImpl(Component.java:4881)

    at java.awt.Container.dispatchEventImpl(Container.java:2292)

    at java.awt.Component.dispatchEvent(Component.java:4703)

    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)

    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4530)

    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)

    at java.awt.Container.dispatchEventImpl(Container.java:2278)

    at java.awt.Window.dispatchEventImpl(Window.java:2750)

    at java.awt.Component.dispatchEvent(Component.java:4703)

    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)

    at java.awt.EventQueue.access$500(EventQueue.java:97)

    at java.awt.EventQueue$3.run(EventQueue.java:709)

    at java.awt.EventQueue$3.run(EventQueue.java:703)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)

    at java.awt.EventQueue$4.run(EventQueue.java:731)

    at java.awt.EventQueue$4.run(EventQueue.java:729)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)

    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)

    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)

    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)

    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)

    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

String index out of range: 0

I tried older versions (back to 1.6.1) to no avail. I removed Java just in case there was some conflict with the installed version. In trying to work out what else had changed since I had last been using Arduino, I deleted the preferences.txt file and started the v1.6.5 IDE back up again... set the board again, set the com port again, and yay, the serial monitor opened. I compared the newly created preferences file, and the old one, and noticed that in the old file, the serial.parity had not been set i.e. there was nothing after the = sign, but on the new one it was set to N. I deliberately changed this value, and the serial monitor broke again, so it was the culprit. So perhaps a check for this needs to be added to allow this behaviour or set it to 'N' if missing? I have never bothered touching the preferences.txt file before, so I have no idea why it was configured that way (or wasn't!).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions