LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   USB to serail port adaptor COM port number (https://www.linuxquestions.org/questions/linux-software-2/usb-to-serail-port-adaptor-com-port-number-586890/)

areftaidi 09-24-2007 03:20 AM

USB to serail port adaptor COM port number
 
Hello everyone,

I have a laptop running Redhat 9 to which I have connected a USB to RS232 adaptor. Please tell me is there anyway that I could programmatically find out what COM port number the adaptor is connected to? Or should I launch a system call from my programme - what would that be?

Many thanks in advance

A.T.

michaelk 09-24-2007 06:54 AM

First, Redhat 9 is out of date and may not have the required driver unless you have already installed it. Look at the output of the dmesg command to see if the adapter is being recognized.

The device ID is typically:
/dev/usb/ttyUSB0

pcardout 09-25-2007 01:05 AM

A cute trick with USB hardware
 
Welcome to LQ!

Here is something I like, and you may too.

Open a terminal window and

Code:

tail -f /var/log/syslog
Leave the window open and insert your USB device.
As you insert it it will generate system messages and the tail -f
command will show them to you in real-time.

This is good for all hot-plug devices (USB, PCMCIA)
to see what messages they generate.
(And though linux sometimes refer to "COM1", "COM2" etc., those are really
DOS/Windows names for the serial ports. As linux devices, they are
usually called /dev/ttyS0, /dev/ttyS1 etc.)


All times are GMT -5. The time now is 07:07 PM.