I have been using RXTX with Java for quite a long time. It was the component I used for my senior research project in college and I have used it with may other projects demonstrated on this website.
I have used it since the beginning of my exploits in trying to use Flash for real time control of hardware. However in trying to finish the RC Interceptor I have found a few heart wrenching bugs in RXTX.
The first major bug is that in all versions it doesnt work with ACM named devices. If you follow most of the general advice by arduino people having trouble with rxtx on Ubuntu they say to compile
the newest version and use that. This wont work if you have a device like mine with a name like ttyACM0.
The RC Interceptor is a USB to rs232 device but shows up in an Ubuntu 9.04 system as ttyACM0. In order to make rxtx2.2pre2 recognize this device I had to download the source, and modify RXTXCommDriver.java around line 500 to add a prefix of ACM to the allowed prefixes for Linux type serial ports. I then had to compile and install the rxtx 2.2pre2 driver myself. Oh, you also have to crazily use the configure option --disable-PRINTER or make will fail. I hope this helps someone. I appreciate RXTX, but it caused me some gut wrenching pain and deadline missing this weekend which I am not happy about. I guess the motto in software is just like those lame NBC the more you know public announcements.
Comments
Thank you so much for that Charles! It worked for me!
The easiest way to handle this situation in RXTX is actualy to use Java to write a system property. You can force RXTX to include a serial port in its search by inserting the following into your class. In my case, I tell it to look for /dev/ttyACM0 System.setProperty("gnu.io.rxtx.SerialPorts", "/dev/ttyACM0") Its easiest to solve this problem this way because you can forgo custom OS configurations. My code is portable across WIN and NIX systems doing it this way, plus there is no need to recompile rxtx.
No kidding? I have no clue how to use a udev rule or even what it is. There is another thing I found in RXTX that I am having to modify it for as well unfortunately anyway.
I assume it won't open device names in /dev/ttyACM0 ? Why not use a simple udev rule to make a new name for it that RXTX like? You can give any type of name you want, I renamed a 64hardrive machine so that the names were based on what controller they were on for example.
Comments are currently disabled.