sunacha3 / java-simple-serial-connector

Automatically exported from code.google.com/p/java-simple-serial-connector
1 stars 0 forks source link

Ubuntu return an empty serial list #73

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I tried this code in a Ubuntu 14 enviroment:

String[] portNames = SerialPortList.getPortNames();
List<String> list=new ArrayList<String>();
for (int i = 0; i < portNames.length; i++) {
  if(StringUtils.isNotBlank(portNames[i])) list.add(portNames[i]);
}
return list;

this list is always empty, however the web applet (terminal) can recognize all 
my ports.
That example code was tried in a Tomcat server.

Original issue reported on code.google.com by tobiascapin on 25 Sep 2014 at 4:42

GoogleCodeExporter commented 9 years ago
I found that terminal applet uses jssc version 0.9, and it successfully returns 
a serial port list, any other version of jssc doesn't work with my ubuntu: 
ubuntu-14.04.1-desktop-i386

Original comment by tobiascapin on 25 Sep 2014 at 4:59

GoogleCodeExporter commented 9 years ago
Please close this issue... 
The problem was a permission denied on the serial port. I solved adding user to 
dialout group.
It confused me because in JSSC v.0.9 it works without that permission because 
it uses "dmesg".

Original comment by tobiascapin on 26 Sep 2014 at 7:02