4

I'm using RXXTX java lib to connect to serial ports. I'm using this lib with no problems connecting to /dev/ttyUSB0 (1,2,3,etc).

But when I want to connect to /dev/ttyACM0 the port its not found.

CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("/dev/ttyACM0");

the Exception is thrown:

gnu.io.NoSuchPortException at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)

I already listed all the ports but no success.

MPelletier
  • 16,256
  • 15
  • 86
  • 137
Eduardo Pinheiro
  • 3,409
  • 3
  • 30
  • 39
  • http://pblog.ebaker.me.uk/2011/09/processing-usb-ports-devttyacm0.html and http://mailman.qbang.org/pipermail/rxtx/2007-June/9733356.html – ecle Mar 15 '12 at 11:14
  • You can find the solutions to the problem in the given links: - http://pblog.ebaker.me.uk/2011/09/processing-usb-ports-devttyacm0.html - http://mailman.qbang.org/pipermail/rxtx/2007-June/9733356.html – ecle Mar 15 '12 at 16:02

2 Answers2

3

Processing and USB ports /dev/ttyACM0, /dev/ttyACM1, .... http://pblog.ebaker.me.uk/2011/09/processing-usb-ports-devttyacm0.html

Processing doesn't like reading Linux USB devices like /dev/ttyACM0 or /dev/ttyACM1.

The solution is easy, just symlink the devices like this...

ln -s /dev/ttyACM[x] /dev/ttyS8[x]

You can put any number after the ttyS, although it is possible that ttyS0 and other low numbers are defined, numbers in the eighties are (almost) guaranteed to work.

MountainX
  • 6,217
  • 8
  • 52
  • 83
3

This might help you: https://groups.google.com/forum/#!topic/openhab/f-gVkwJg-hg

update your startup script to include "->Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0" in the Java command line

AHonarmand
  • 530
  • 1
  • 8
  • 16