Go Down

Topic: Trouble reading serial port using Java ("Could not find COM port") (Read 2 times) previous topic - next topic

c0dehunter

Sep 24, 2011, 11:31 pm Last Edit: Sep 24, 2011, 11:33 pm by c0dehunter Reason: 1
Hey everyone,
I followed this (http://www.arduino.cc/playground/Interfacing/Java) tutorial. I am using Linux, Ubuntu 11.04. The program compiled successfully and I have changed the PORT_NAMES to include "/dev/ttyACM0" which is my Arduino port.
However, when I run the program, it says:

Code: [Select]

c0dehunter@c0de-box2:~/Desktop$ java SerialTest
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Could not find COM port.
Started
c0dehunter@c0de-box2:~/Desktop$


Obviously the port cannot be found, but why? What am I doing wrong?

c0dehunter

Ok, found the solution.
I installed the latest version of RXTX lib (from synaptic). Then I had problem because Serial port was not recognised. I spent the last 2 hours finding out what the problem is and reinstalling alot of stuff. Then I found out I had to create a symlink from /dev/ttyACM0 to /dev/ttyUSB0. I also add myself to group uusd in /etc/group file. Now everything works ;)

kasisnu

Hey

I'm facing similar issues with Eclipse on Ubuntu. I installed rxtx using

sudo apt-get install librxtx-java


It says it's up to date. I think I need to do what you did. Can you post details of how you did everything?

Thanks

Go Up