0

I have plugged the USB Dongle in one port of my PC, which is running on the Ubuntu Machine, Now i need to find which port the USB Dongle is connected to. In windows normally it is detecting in COM4, now i need to find what is the PORT i need to use for Ubuntu OS. can anyone please help.

All i need is, to connect through USB dongle from the java program. I'm using RXTXComm.jar.

Code i'm using to connect:

portId = CommPortIdentifier.getPortIdentifier("/dev/ttyUSB0");    

Always i'm getting

NoSuchPort Exception only.

I have tried using , ttyUSB0/ttyUSB1/ttyUSB2 like that. but no use. can anyone please help me how can i find the port id in ubuntu machine.

Frederic Close
  • 9,389
  • 6
  • 56
  • 67
Mohan
  • 457
  • 6
  • 15
  • Hi #Frederic Close thanks for the formatting – Mohan Dec 04 '13 at 08:14
  • If you type `ls /dev` at the command prompt do you see `ttyUSBn` in the listing? – Preston Dec 04 '13 at 16:41
  • Yes it is present, but when i tried to use that, getting the same exception. NoSuchPort Exception – Mohan Dec 05 '13 at 07:46
  • Hm, does this post help you at all: http://stackoverflow.com/questions/3026804/why-am-i-getting-a-java-nosuchportexception-when-the-port-exists – Preston Dec 05 '13 at 07:53
  • Hi All i got the answer. Actually the code above is working. the problem is i was running this on the normal user. The program should be in root user / root group. Now i can able to access the ports. Thanks All – Mohan Dec 13 '13 at 11:06

0 Answers0