Arduino IDE under Linux serials port list
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 7k
- PR merge metrics
- No merged PRs in 30d
Description
Since about 1.5.0 under Linux the drop down list of serial ports has been filtered in such a manner that one cannot use device names created using udev. At one time one could create a port using udev definitions such as
```text
KERNELS=="1-1.1.3:1.0", SYMLINK+="ttyAtmega328P", GROUP="dialout"
```
For a later release I had to change to use udev definitions such as
```text
KERNELS=="1-3.4.4:1.0", SYMLINK+="ttyUSB99-stepper", GROUP="dialout"
```
the important point being that the device name had to be prefixed by a something that could be matched by the Java regular expression hard coded into the IDE source code. The latest release has gone one step further in the restrictions so that I can no longer use udev to define a device name.
I decided to try to find the source of the problem so built the IDE from a GIT checkout. No problem with this so I then searched though the code to find the regular expression involved. It seemed to be in Java class `processing.app.SerialPortList` so I modified it and re-built. This built OK but nothing changed! Debugging I found that this class is not used to populate the port list. I then went to the JSSC source code and found the identical regular expression as in class `processing.app.SerialPortList`! I modified this and re-built. Again this built OK but nothing changed. Doubting my sanity I debugged again and found the the list is populated by a native method `listSerialsNative()` which does not seem to be part of JSSC. I cannot find the source code for this but it does seem to have the same regular expression as both JSSC and class `processing.app.SerialPortList`.
Somewhere along the line the IDE stopped using RXTX and went over to using JSSC ( a move I approve of since it works more reliably than RXTX ) BUT it seems that at that point the strict serial port name restrictions came in.
Why three identical regular expressions for the filter with two of them not being used and the one that is being used in a native method that does not seem to have it's source in GIT. To my mind a filter regular expression should be used but this should be in the configuration file and not hard coded.
If this issue is not currently being addressed I shall spend more time on trying to fix this but it could be some while before I get round to it.
Contributor guide
Research direction
Start with processing.app.SerialPortList and the JSSC source, then trace the native listSerialsNative() path that actually populates the Linux serial-port list. Compare its filtering with the udev device names described in the report and determine where that native code is sourced. Done means valid udev-created serial names appear in the IDE port list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, linux
- Domain
- operating-systems, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100