Java RXTX Com Port Detection Issue

Hi All,

I've been following the playground guide for connecting an Arduino with Java (specifically in the Netbeans IDE) via the RXTX library: Arduino Playground - Java

I did encounter problems with finding certain gnu.io's in the code and having the native lib and java lib files mismatched, like most people on these forums seem to be have issues with, but got those figured out. Now the code compiles and seems to run fine, without giving errors, except it emits the statement "Could not find COM port." I did a bit of troubleshooting, to see if the problem revolved around naming the wrong port, but it turns out that the program doesn't even get into the main while loop that cycles through and tries to match the port names, which I can only assume is simply because no ports are found at all. This lead me to try and list the ports from the program, but none were found, even though on the Arduino IDE I have multiple bluetooth ports in addition to the actual Arduino tty.modem port I'm trying to connect to.

Is this a problem with the library? Note that I'm very new to netbeans and am possibly missing something simple, but I've tried everything I can find online for troubleshooting. I'm running everything on Mac OS X 10.9.4 (Mavericks) as well. Any help is much appreciated, thanks in advance!

Pat

I have tried several times over the years to get rxtx to work, and given up in frustration each time, I find that the "Processing" language/environment works fine for me.

If you get rxtx to work, come back and enlighten me how you did it or which version of it that you use.

none were found, even though on the Arduino IDE I have multiple bluetooth ports in addition to the actual Arduino tty.modem port I'm trying to connect to.

I am not an expert on the recent macs, but on windows, if you had the arduino plugged into the usb, which was appearing as a serial port on the pc, and the arduino IDE was using it, then the netbeans program would not be able to use it. To put it simply, only one program can access the particular serial port. What I would have to do, if I wanted to do that, is probably shut down the arduino IDE, unplug the usb cable running to the arduino, plug it back into the computer, and then the application running in netbeans would be able to grab the serial port for itself.

Someone else had trouble with that Playground Guide and posted their solution in the last 2 or 3 days.

I use JRuby (which uses the JVM) and I don't think I ever had any problems with RxTx - apart from stupid things I did. I have now switched over to using JSSC which seems much more straightforward and is well documented. RxTx seems no longer to be supported.

The Arduino IDE 1.5.6 uses JSSC.

In Reply #2 in this Thread I posted some JRuby code that uses JSSC. The process should be nearly identical in Java.

...R

Thanks a lot everyone, sure enough right after posting this I gave up with RXTX and switched over to JSSC, and it worked like a charm on the first try. I did try unplugging the arduino and made sure the Arduino IDE wasn't controlling any serial communication over the monitor, still no luck. Oh well, I'm fine with jSSC for now.

Pat

I've just installed JSSC into Netbeans, I can't get it to work, it doesn't load the DLL.

You got it to work , first time ??

Where do you put the DLL ?

I don't use Windows but I thought I read on the JSSC website, or in its instructions, that the DLL is within the JAR and works from there.

...R

I changed the code so it uses the javaLibPath properly, and it works fine now. I must be the only person who does it that way.