Best Practice for determining if a USB serial device is still valid.
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Best Practice for determining if a USB serial device is still valid.
I have a micro-controller board connected to a home server computer (Ubuntu Linux 10.04) via USB. The board appears as a serial device (i.e. ttyUSB000). If the USB cable is disconnected the lock on the device remains and the process controlling it still thinks the device is there. When the cable is reconnected the device will appear as a different device (i.e. ttyUSB001). What is the best way for a process to determine if this has happened and find the new device name. I am using Java to program the process. Everything works fine but If I start doing some cable switching then I lose contact with the device. I assume that I know the device name and would also like to know if there is a better way of finding the device.
Udev rules might be at least a part of the answer. At least I should be able to determine the behaviour of the device if I can't communicate with it.
david1941,
I'm not sure that I want to be using lsusb from within my Java program. I could do that, but I'm not sure what value it would give me. Here is the specific lsusb line for this device.
Bus 001 Device 015: ID 16c0:0483 VOTI
Remember that I'm using it as a serial device ttyUSB000.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.