Pages: [1]   Go Down
Author Topic: Trouble reading serial port using Java ("Could not find COM port")  (Read 1945 times)
0 Members and 1 Guest are viewing this topic.
Slovenia, EU
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Hungry for more code!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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?
« Last Edit: September 24, 2011, 04:33:10 pm by c0dehunter » Logged

Slovenia, EU
Offline Offline
Newbie
*
Karma: 0
Posts: 5
Hungry for more code!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-wink
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1]   Go Up
Jump to: