# minicom: RS232 connection through USB

## luca

Hi All

I was just wondering, what configuration is required to make a RS232 connection through USB.

I'm not sure how to configure it, like: what should I define for 

 A)    Serial Device  :  /dev/......

Any suggestions ?

Thnx

LuCa

----------

## linuxtuxhellsinki

If you mean that kind of serialport-->USB connector, then you'll need to have the driver for it compiled in the Kernel (or module) ?   I was using once that kind of serial device in work when I needed to attach my work ThinkPad (with Ubuntu) without serialport to one Sparc server for configuration.

----------

## luca

You mean the 

```
Device Drivers -----> 

     USB support -----> 

          USB Serial Converter support ----->

               <M> USB Serial Converter support                

               [*] USB Generic Serial Driver (NEW)

```

I'll try this out!

Thnx

LuCa

----------

## luca

I'v load usbserial, but still I don't have a clue what my tty is!

What is the normal way people find out what tty they should use with their RS232 connection ?

Thanx a lot

LuCa

----------

## /carlito

Plug in your USB/Serial convertor and check dmesg. It will tell you what driver its using and what node was created. On my system i get /dev/ttyUSB0 and i need to load the usbserial module along with the ftdi_sio.

----------

## luca

I just loaded the module you are using but when I connect the usb cable I only see the following

```
Jul 23 14:59:28 leppie usb 2-1: new full speed USB device using uhci_hcd and address 3
```

But on the other hand there are modules to choose from. How do I determine which one to use ?

Thnx

LuCa

----------

## /carlito

Make sure you have hotplug installed and running. Then compile in all USB/serial modules for your kernel but DO NO LOAD them. Just make sure the usbserial is loaded. Then plugin the adapter and hotplug should load the proper driver and output the node to dmesg. After you know wha driver to use you can remove the other modules.

----------

## luca

Ok I'll try that tonight!

This weekend I compiled all the USB-serial drivers into the kernel. With the idea that Linux knows which one to take (maybe this is not true, is it?)

Anyway, when I connected the cable the device /dev/ttyUSB0 was created!!, but the information I received via the cable was complete garbage!

LuCa

----------

## /carlito

Post the output of 

```
tail /var/log/dmesg
```

 and 

```
lsmod
```

 from right after you plugin the serial convertor.

----------

## luca

it worked. When all the usb-serials devices are modules it is very clear which module is loaded from messages.

Maybe just a little bit off topic, is there a tool that can determine baut rates, parity bits etc. Because I seem not to be able to get readable output from the device (althoug the settings seems right according the manual of the device). 

Thnx

LuCa

----------

## NiceGuy

 *Quote:*   

> Make sure you have hotplug installed and running. Then compile in all USB/serial modules for your kernel but DO NO LOAD them. Just make sure the usbserial is loaded.

 

Hey Luca and Carlito,

Quick Question,

How do you make sure the usbserial  is loaded  .....  Can you post how to do that???

Thanks

----------

## luca

watch /var/log/messages for example like

```
tail -f /var/log/messages
```

 and plugin the cable. At that point you should see something happening. In my case I see

```
Aug  1 21:53:32 xxx usb 2-2: new full speed USB device using uhci_hcd and address 2

Aug  1 21:53:32 xxx usb 2-2: configuration #1 chosen from 1 choice

Aug  1 21:53:32 xxx drivers/usb/serial/usb-serial.c: USB Serial support registered for pl2303

Aug  1 21:53:32 xxx pl2303 2-2:1.0: pl2303 converter detected

Aug  1 21:53:32 xxx usb 2-2: pl2303 converter now attached to ttyUSB0

Aug  1 21:53:32 xxx usbcore: registered new driver pl2303

Aug  1 21:53:32 xxx drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver

```

good luck

LuCa

----------

## lindegur

Maybe this is also helpful:

Fist make a kernel that supports your USB serial converter (e.g Prolific Technologies)

Start  udevmonitor

Plug it in and check usbview

Scan trough /dev and notice /dev/tts/USB0 appears and disapears (the udevmonitor does not point straight to this location).

Start minicom and configure to /dev/tts/USB0 (no HW handshake)

Make a jumper pin 3 and 2 on  a sub D 9pol connector (I have made a plug for that)

Type a character and it echos back, remove jumper and it does not work (so it is not a local echo, the characters went through the cable.)

----------

## luca

should I really see the character that is typed or should I just see something happening when I type a character ?

----------

## lindegur

 :Wink:  Now it comes to hardware. The character that you type comes out of on pin 3 of the sub D 9 pin connector. Pin 2 is the input, so if you take a wire to connect pin 2 with pin 3 than all character typed, will be feed back. So you will see them in minicom. 

Type charaters with jumper wire => you will see what you type in minicom

Type characters without jumper wire => you will see nothing in minicom

Conclusion: All you type goes through the wire (If you have an oscilloscope you could also see it).

You may have configured local echo in minicom. If so, you would see the character typed even without jumper wire. However when you plug in the wire then you simply would see every character typed twice. Type also the carriage return (CR) button, since some terminal configurations store all characters in a buffer and sent them out when the CR button is pressed. I do not know if minicom allows those settings, but some terminal emulations do. 

If you look close than you see the pin numbers embossed on the connectors, otherwise http://www.lammertbies.nl/comm/cable/RS-232.html#pins or google for RS232 pinout)

A side effect of this test is that you do not have to be worried about baud rate and friends, since the receiver always configured the same way as the transmitter. This is obvious since it is the same tty chip.

----------

## luca

well, now it gets interesting. I do what you suggested, but it will take a while before I have time to do it (> 1month).

Isn't time our biggest problem!

I'll be back   :Evil or Very Mad: 

LuCa

----------

