2

I'm trying to write a program to have an Arduino Uno communicate with a Java program via the Serial Port. I followed the instructions from here (http://playground.arduino.cc/Interfacing/Java). When I try to run the code, the output is "Could not find COM port". When I looked further, I noticed that getPortIdentifiers() is returning an empty enumeration.

I've already tried multiple solutions (RXTX cannot list or find ports under windows 7 64 bits, http://www.coderanch.com/t/535173/java-io/java/CommPortIdentifier-getPortIdentifiers-empty) but none have worked.

I'm running 64-bit Windows 8.

Thanks in advance.

Community
  • 1
  • 1
jcolen19
  • 318
  • 3
  • 11

1 Answers1

2

EDIT: Steps for using RXTX for serial communication are -

  1. Copy RXTXcomm.jar, rxtxSerial.dll and rxtxParallel.dll files to the lib directory of your project
  2. Expand the RXTXComm.jar entry in the list and select "Native Library Location" and Select the project lib directory.

rxtxSerial.dll is for windows which restricts your application work only on windows. Use of JSSC lib can make it cross platform application.

If you are still using RXTX lib, there can be "permission" issue for getPortIdentifier returning empty.

code_poetry
  • 333
  • 1
  • 6
  • 16
  • Could you elaborate a bit more? – Ḟḹáḿíṅḡ Ⱬỏḿƀíé Oct 19 '15 at 07:12
  • Steps for using RXTX for serial communication are - 1. Copy RXTXcomm.jar, rxtxSerial.dll and rxtxParallel.dll files to the lib directory of your project 2. expand the RXTXComm.jar entry in the list and select "Native Library Location" and Select the project lib directory. rxtxSerial.dll is for windows which restricts your application work only on windows. Use of JSSC lib can make it cross platform application. If you are still using RXTX lib, there can be permission issue for getPortIdentifier returning empty. – code_poetry Oct 21 '15 at 05:52
  • Thank you, it is clearer now, can you put that in your answer instead of a comment? :) – Ḟḹáḿíṅḡ Ⱬỏḿƀíé Oct 21 '15 at 07:16
  • Posted as answer. I too was struggling with the same (getPortIdentifier returning empty). I found it was permission issue. I am developing on Ubuntu 14.04 32bit and want to run the application on any machine. After a lot of investigation I got to know about jssc lib. So dropped rxtx and installed it. Sad that all java serial communication tutorials use rxtx lib which is quite outdated. – code_poetry Oct 21 '15 at 07:34