posi90
Posts: 4
Joined: Sun Feb 03, 2013 11:53 am

RXTX - CommPortIdentifier

Sun Feb 03, 2013 12:10 pm

Hello,

I want to create a serial connection between raspberry pi and arduino due.

My problem is that CommPortIdentifier.getPortIdentifier(portName) throws an expression:

My code:

Code: Select all

		CommPortIdentifier portIdentifier = CommPortIdentifier
				.getPortIdentifier(portName);
This is the errorcode:

Code: Select all

gnu.io.NoSuchPortException
        at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:269)
        at main.connect(main.java:17)
        at main.main(main.java:129)
The function CommPortIdentifier.getPortIdentifiers(); does not list any ports.

The code is running fine on windows. Are there any permissions or releases due to /dev/ttyAMA0 to define?

The funny thing is that minicom and gtkterm work even without su i just cant get it work for java.

KG
Poseidon

ramp
Posts: 8
Joined: Mon Feb 11, 2013 1:19 pm

Re: RXTX - CommPortIdentifier

Mon Feb 11, 2013 1:35 pm

Hi,
Try this command:
sudo ln -s /dev/ttyAMA0 /dev/ttyS80
and use ttyS80, other option is pi4j for work directly with ttyAMA0
http://pi4j.com/example/serial.html
i tested sucessfully pi4j for communicate raspi and arduino.

Note: Sorry for my english :P

Return to “Java”

Who is online

Users browsing this forum: No registered users and 3 guests