How to know the Port name of a Serial port using its directory?
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to know the Port name of a Serial port using its directory?
hello guys.
I was working with a java project which will read from serial port of my laptop like USB.
So, i know the directory of my serial usb is that dev/ttyUSB0
but it is not working with my java program but when i use minicom -s
it starts reading the values.
The problem is that my java program only accepts the name of the serial ports like COM0,COM10,COM22 etc.
when i run this java program on windows it works fine.
now i want to find the port name of the directory dev/ttyUSB0
Does anyone can help me on this? it will be very thankful.
that is /dev/ttyUSB0, probably you only missed the / at the beginning. Without knowing anything about your java code we can hardly tell you the solution.
first thank u for reply.
I used that '/' too at the beginning.. thats not the problem.
like whenever we connect a device to windows, it automatically provide the name to that connection like COM0,COM22,COM10 etc
I am asking that how to know that name in linux ?
well you dont need any information about java.
okeh thank u sir..
the problem is that linux dont use the port names as COM0,COM30,COM21 etc
but linux store the usb names as /dev/ttyUSB0 or /dev/ttyUSB1 etc
there maybe problem with java program it do not know what a /dev/ttyUSB0/1/2 is.
i dont know but it works fine in windows.
I suggest java is a worst language. C is best among all.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.