On Ubuntu 10.04
Dear Paul Lutus,
I have installed Javax.comm
and also the rxtx followed an howto
But could never make it work:
Code:
System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyUSB0");
//System.setProperty("os.name", "Linux-all-ports");
String driverName = "gnu.io.RXTXCommDriver";
try{
CommDriver commdriver =
(CommDriver)Class.forName(driverName).newInstance( );
commdriver.initialize();
}
catch (Exception e2)
{
e2.printStackTrace();
}
portList = CommPortIdentifier.getPortIdentifiers();
System.out.println(portList.hasMoreElements());
it returns a false, list is always empty.
Though I have tried changing the version of rxtx, tried recompiling RXTXCommDriver.java as well following another recommendation from another forum but couldn't rebuild the RXTXcomm.jar successfully. (now re-using backup)
Though:
laptop:/dev$ ls ttyS* ttyUSB*
ttyS0 ttyS1 ttyS100 ttyS2 ttyS3 ttyUSB0
=> So the ports do exist actually.
And javax.comm.properties file is in JAVA_HOME/lib
I need to send data through my usb-serial adapter on linux.
The thread is quite old but I hope you still can help me.
Thanks a lot.