0

I need to connect to and use a serial port using Java from a Linux 64bits machine. In my case an USB to Serial adapter since laptop have no more serial port since a while...

After struggling a lot, I got it working. Then changing my laptop, I lost it ;(. But finally got it working again.

I'll document how to do it in the answer.. so I can find it easily back next time I need it :D

Cedric Simon
  • 4,571
  • 4
  • 40
  • 52

1 Answers1

0

First, you need the Java JAR file RXTX and the serial library for Linux (32 and 64 bits are different...).

Main library can be found here: http://rxtx.qbang.org/wiki/index.php/Download

But a nice package with a run-install.sh copying libraries directly in right place can be found here: http://fizzed.com/oss/rxtx-for-java

After that, make sure your user is member of correct groups. In openSuse, it requires lock, uucp, and dialout groups. Log off and login to make the groups effective.

To test it, there is a nice explanation and program here: http://pharos.ece.utexas.edu/wiki/index.php/How_to_Access_Your_Serial_Port_using_Java#Test_the_Installation_of_RXTX_on_Ubuntu_Linux

Cedric Simon
  • 4,571
  • 4
  • 40
  • 52