We make use of a java application that manages a pinpad via the serial port. This works perfectly on windows with the Sun Comm.jar, the supplied dll and the properties file.
Now we are attempting to use this solution on Linux (actually it does run on various other flavours of linux out in the field) - with Ubuntu server mode.
After much attempts - blood, sweat and almost tears we have this scenario:
Java version 1.4.2_17 Linux - Ubuntu Comm libs - Comm3 supplied by sun with the default driver specified
An external comm test shows the comm ports: /dev/ttyS0 and /dev/ttyS1 But the java application says unable to open port /dev/ttyS1
(using the RXRT files produces invalid port errors)
Has anyone been able to use java 1.4.2 on linux for serial port communication and found a solution that I could apply in my scenario?
greatly appreciated
Phill
A serial port is a bidirectional communication interface that allows sending and receiving data byte by byte. The Web Serial API provides a way for websites to read from and write to a serial device with JavaScript.
Use the setserial command to check and use serial ports. The setserial is a program designed to set and/or report the configuration information associated with a serial port.
I know this is an old question but I have created a Java package and native library to allow serial port read and write, currently in synchronous mode only.
It's open source and available on GitHub:
j232 - The Java source code
libj232 - j232's native library.
The wiki page is here.
Note this is a Linux only package and library.
Make sure that you are using a user with permissions to access the serial ports. Some distributions put the serial ports in the uucp group, so make sure that the user belongs to that group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With