views:

89

answers:

1

This should be simple, very simple, but I'm having a hard time with it.


Problem
I'm looking for an open source project, in java, that will communicate using the RFC2217 protocol. I find no shortage of Java RFC2217 Terminal Servers but I need a client. If all these people are writing servers, someone has to have written a client! Right? I just can't find one in java.


Context
We have a piece of hardware (SeaLINK+16 Ultra) that's physically connected to a dozen serial devices and accepts TCP network connections to control them. This device is networked with a server that has virtual COM ports that our application uses to communicate with those dozen devices.

Basically, our server ultimately sends network data to this SeaLINK device and this device converts the TCP traffic to COM data and transmits it via serial to its connected serial devices. The server and the SeaLINK device use the protocol specified in RFC2217 in order to communicate.

The commands that need to be sent to these serial devices are very simple (Cisco IOS). Short strings like "enable", "write memory", "reload", etc.

The issue is, the virtual COM ports enabled on our server require drivers that are a HUGE hassle to install in Linux and are not cross-platform. Plus, our entire application is written in Java so if we could just find a java networking package that can "speak RFC2217," we could solve our problems in no time and our application wouldn't need to be bundled with drivers.


Summary
All I need to do is "wrap" these commands into TCP packets that comply with RFC2217. There should be a java client out there somewhere that, you provide it a command string and it opens a socket and transmits your characters in a manner compiant with RFC2217.

Meaning, I wouldn't have to deal with installing drivers or using virtual COM ports locally. All I'd have to do is run code along the lines of:

RFC2217Client magicJavaClient;

magicJavaClient.setServer("192.168.40.5");
magicJavaClient.setPort(4162);
magicJavaClient.connect();

magicJavaClient.send("enable");
magicJavaClient.send("write memory");    
magicJavaClient.close();

Heck, I'd even settle for something that created virtual com ports locally--as long as it's all java. Something like this COM Redirector is exactly what I need but it's not in Java. Thanks in advance for any and all suggestions!

Update
NVTCom seems to be the type of java-based RFC2217 client I'm looking for but it's so poorly documented that it's almost unusable. Are there any other clients out there? We would even consider a commercial solution.

+1  A: 

http://www.viara.eu/en/nvtcom.htm

Romain Hippeau
Thanks! Looks like it might do exactly what I need. It's very poorly documented but the source code looks okay. I'll have to wait until I'm back in the office next week to really test this out. Thanks.
gmale
Gave this a try yesterday and it didn't work. It complained that the server was not RFC2217 compliant, which is almost certainly not true. Both the documentation and error-handling are poor so the only way to decipher the problem is to step through the code. It's not clear what the problem is. Are there other java clients?
gmale
@gmale It is the only one I know of. I think I saw some commercial ones. You might want to go that route, at least you get support.
Romain Hippeau
@gmale - You could always use Serial Port Redirector and then use Javacomm or an equivalent serial port library for Java to talk to the serial port.
Romain Hippeau
@Romain: that's pretty much what we're doing--we're using RxTx to open and manage serial connections. The problem with Serial Port Redirector and programs like it is that they are Windows applications and we use only Unix based systems (RedHat and OS X). I've been working with Tibbo--which is a linux-based serial port "emulator" but I'm having a lot of problems installing the drivers because I'm not a Linux guru and our application runs on a virtual machine, which complicates everything (I'm actually opening another question related to the issues I'm having with that effort)
gmale
@gmale I have done a lot of interfacing with serial devices, but only on Windows using the old JavaComm API (which is no longer supported by Oracle, they say to use RxTx). The app I wrote used deicated machines just to talk to the serial devices on an Intranet. The machines then used EJB technology to talk to the server.
Romain Hippeau
Also used the JavaComm library to receive data from Serial scanners and to write to Serial Port based label printers. It should be pretty straight forward to talk to a Serial Port using RxTx on Linux.
Romain Hippeau
@gmale look at this - might give you more oprions http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux Also you could use a USB to Serial port converter and then program as if for a Serial port. The OS sees it as a Serial POrt, even though it is hooked into the box via USB.
Romain Hippeau