Home/Support/Support Forum/Trouble accessing RealPort from Java
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Trouble accessing RealPort from Java

0 votes
I have Java SDK 1.4.2 running on a Linux box and have downloaded the javax.comm extension and everything works fine when accessing the standard Linux serial port /dev/ttyS0. I have a EtherLite 80 serial port server hooked up to the Linux box and have successfully installed RealPort and created 8 new device files /dev/ttyRP00 through /dev/ttyRP07 - all of which works fine when accessed from a C program. The problem I am having is gaining access to these RealPort ports from a Java program - receive a NoSuchPortException when trying to access them. Again, the standard /dev/ttyS0 serial port works just fine from my Java test program. It is the RealPort device files that I am having trouble getting the Java code to see. Any suggestions would be great appreciated - thank you
asked Jan 11, 2005 in Realport by KRS New to the Community (0 points)

Please log in or register to answer this question.

2 Answers

0 votes
We are 100% POSIX compliant.

If the Java application is coded so it can talk with the built-in COM port (/dev/ttyS0), then that code will work perfectly against the RealPort devices as well.

One possibility that comes to mind is that maybe the application doesn't like the device naming convention of the Realport devices. This would be a change necessary in the application though, not the driver. One possibility that might work if thats the case would be creating symbolic links to the Realport devices with a name acceptable to the application(ttyS4... or whatever the first open device name would be). Rather than recoding the application, this would be a workaround.

You'll want to check deeper into the javax.comm extension documentation to see if this is the case. If you need further assistance with this, I'd recommend calling in to Technical Support so we can get a case created and begin documenting this issue.
answered Jan 12, 2005 by michaelt Veteran of the Digi Community (768 points)
0 votes
I must agree since I've had the same problem. The solution was to use IBM's serial port driver which is part of IBM's Java developer kit for Linux (http://www-128.ibm.com/developerworks/java/jdk/linux140).
After everything is set up, you should end with ports like /dev/ttyA00, /dev/ttyA01, .. or whatever is configured. You must then create link to /dev/ttySXX. Java will only recognize "S" type of serial ports. Find last ttySXX and then use next one for your first virtual port. And java starts counting serial ports from 1 and address them as COM ports. Thus /dev/ttyS32 equals to "COM33" in java.

Hope it helps! You may contact me for details if you'd like to.
answered Jul 7, 2005 by tinezorko New to the Community (1 point)