Welcome! Log In Create A New Profile

Advanced

Ubuntu USB-Serial port install procedure

Posted by Anonymous User 
Anonymous User
Ubuntu USB-Serial port install procedure
August 26, 2007 03:58PM
The procedure for using the USB adapter from the BOM wasn't in the wiki - nor was it immediately obvious, so, here goes.


If you are using the usb -> RS232 adapter, the serial drivers may need to be installed for the device to work properly. After plugging in the device, first check the hardware messages to see the device was detected:

dmesg

Torward the end of the messages, you should see this:

usb 1-1: new full speed USB device using uhci_and address 2
usb 1-1: configuration #1 chosen from 1 choice

Now, we need to figure out the device vendor number and product number to tell the usbserial driver. For this we can use lsusb. The easiest way to find the information is to first unplug the device, then run lsusb:

lsusb


You will see a summary list of your USB devices on the system, I only have one:

Bus 001 Device 001: ID 0000:0000

Now, plug the device back in, and run lsusb again:

lsusb

Which returns the summary list again, but now showing the new USB device:

Bus 001 Device 002: ID 4348:5523
Bus 001 Device 001: ID 0000:0000


Now, we can load up the driver for this device:

sudo modprobe usbserial vendor=0x4348 product=0x5523

Finally, check dmesg again to ensure it loaded properly.

dmesg

Near the end, you should see something like:

usbserial_generic 1-1:1.0: generic converter detected
usb 1-1: generic converter now attached to ttyUSB0
usbcore: registered new interface driver usbserial_generic

Congratulations, your link is up - in this example, the device can be used on /dev/ttyUSB0. As much fun as you had doing this, there is some chance you want to do this automatically in the future. Just add this line:

usbserial vendor=0x4348 product=0x5523

to /etc/modules with the vendor and product numbers you found. Now, you should have no problem using this device for RepRap like a normal serial port. Huzzah! grinning smiley

Edited 1 time(s). Last edit at 08/26/2007 11:01PM by Freeman.
I DEVELOPED THE PROGRAM USING BUTTON IN JAVA.IAMUSING THE SOFTWARE eclipse.iWANT TO KNOW THE INSTALLATIONPROCEDURE FOR SERIALPORTINJAVA USING eclipse.give me the codefor buttons using serialport in java ALSO.
I DEVELOPED THE PROGRAM USING BUTTON IN JAVA.IAMUSING THE SOFTWARE eclipse.iWANT TO KNOW THE INSTALLATIONPROCEDURE FOR SERIALPORTINJAVA USING eclipse.give me the codefor buttons using serialport in java ALSO.
Re: Ubuntu USB-Serial port install procedure
September 10, 2007 08:12PM
Wow! Thanks for the tip. You should add that to the Wiki, so that everyone can take advantage of your hard experience!
hey freeman! can u tell me the link where from i can download the drivers? i am having same vid & pid, but unfortunately the drivers that came along have different vid & pid.. i tried to change the vid & pid in the driver inf files, but still it is not working.. i also tried radioshack's drivers after changing vid & pid to 4348 & 5523 respectively, but in vain! please help!
Re: Ubuntu USB-Serial port install procedure
September 29, 2007 10:54AM
[imgs.xkcd.com]

smileys with beer

Edited 1 time(s). Last edit at 09/29/2007 10:54AM by Forrest Higgs.
pratik Wrote:
-------------------------------------------------------
> hey freeman! can u tell me the link where from i
> can download the drivers? i am having same vid &
> pid, but unfortunately the drivers that came along
> have different vid & pid.. i tried to change the
> vid & pid in the driver inf files, but still it is
> not working.. i also tried radioshack's drivers
> after changing vid & pid to 4348 & 5523
> respectively, but in vain! please help!
Hey Freeman..

sudo modeprobe usbserial vendor=0x4348 product=0x5523
works for me while writing to the serial port, but I could not read nicely from the serial port.

Can you trace any reason?
please give me uni usb high speed service box driver download link.
please give me uni usb box driver
The procedure you describe for USB-serial has worked very well for me up to a point.
However, I cannot establish end to end communication to an embedded controller device.
Having established USB link as described I can cp a text file down the USB-serial adaptor cable I am using (LED shows activity on the device) but cannot communicate with minicom or gtkterm on /dev/ttyUSB#. The target device is a PC/104 cpu running linux and has been seen working through Hyperterminal.

Any help will be much appreciated.
When I inserted the RS232 serial adapter

and done dmesg , it shows the following error :

[ 3130.480028] usb 4-1: new full speed USB device using uhci_hcd and address 2
[ 3130.648050] usb 4-1: unable to read config index 0 descriptor/all
[ 3130.648060] usb 4-1: can't read configurations, error -84
[ 3130.760027] usb 4-1: new full speed USB device using uhci_hcd and address 3
[ 3130.964054] usb 4-1: device descriptor read/all, error -84
[ 3131.076028] usb 4-1: new full speed USB device using uhci_hcd and address 4
[ 3131.112050] usb 4-1: device descriptor read/all, error -84
[ 3131.224025] usb 4-1: new full speed USB device using uhci_hcd and address 5
[ 3131.261051] usb 4-1: device descriptor read/8, error -32
[ 3131.398053] usb 4-1: device descriptor read/all, error -32
[ 3131.400054] hub 4-0:1.0: unable to enumerate USB device on port 1
[ 3175.136027] usb 4-1: new full speed USB device using uhci_hcd and address 6
[ 3175.319614] usb 4-1: configuration #1 chosen from 1 choice
[ 3175.322044] usb 4-1: can't set config #1, error -32

can you tell me how to detect the adpater

Thanks and regards

Freeman Wrote:
-------------------------------------------------------
> The procedure for using the USB adapter from the
> BOM wasn't in the wiki - nor was it immediately
> obvious, so, here goes.
>
>
> If you are using the usb -> RS232 adapter, the
> serial drivers may need to be installed for the
> device to work properly. After plugging in the
> device, first check the hardware messages to see
> the device was detected:
>
> dmesg
>
> Torward the end of the messages, you should see
> this:
>
> usb 1-1: new full speed USB device using uhci_and
> address 2
> usb 1-1: configuration #1 chosen from 1 choice
>
> Now, we need to figure out the device vendor
> number and product number to tell the usbserial
> driver. For this we can use lsusb. The easiest
> way to find the information is to first unplug the
> device, then run lsusb:
>
> lsusb
>
>
> You will see a summary list of your USB devices on
> the system, I only have one:
>
> Bus 001 Device 001: ID 0000:0000
>
> Now, plug the device back in, and run lsusb
> again:
>
> lsusb
>
> Which returns the summary list again, but now
> showing the new USB device:
>
> Bus 001 Device 002: ID 4348:5523
> Bus 001 Device 001: ID 0000:0000
>
>
> Now, we can load up the driver for this device:
>
> sudo modprobe usbserial vendor=0x4348
> product=0x5523
>
> Finally, check dmesg again to ensure it loaded
> properly.
>
> dmesg
>
> Near the end, you should see something like:
>
> usbserial_generic 1-1:1.0: generic converter
> detected
> usb 1-1: generic converter now attached to
> ttyUSB0
> usbcore: registered new interface driver
> usbserial_generic
>
> Congratulations, your link is up - in this
> example, the device can be used on /dev/ttyUSB0.
> As much fun as you had doing this, there is some
> chance you want to do this automatically in the
> future. Just add this line:
>
> usbserial vendor=0x4348 product=0x5523
>
> to /etc/modules with the vendor and product
> numbers you found. Now, you should have no
> problem using this device for RepRap like a normal
> serial port. Huzzah! grinning smiley
my modem is made from china how to use mymodem. merk this product is SE-YI. thank before.
harsha
Re: Ubuntu USB-Serial port install procedure
September 04, 2009 03:32AM
hi,
im getting this message at the end of the procedure.why m i not getting ttyUSB0??
thanks

[13840.081028] /build/buildd/linux-2.6.28/drivers/hid/usbhid/hid-core.c: usb_submit_urb(ctrl) failed
[13840.081034] generic-usb 0003:0764:0005.0009: timeout initializing reports
[13840.081094] generic-usb 0003:0764:0005.0009: hiddev97,hidraw3: USB HID v1.10 Device [Cyber Power System CPS RS232 USB BRIDGE for UPS] on usb-0000:00:1a.1-2/input0
Re: Ubuntu USB-Serial port install procedure
September 30, 2009 05:39PM
I hope that someone on this can help. I need to get a usb to serial cable working. the verson of ubuntu is 9.04, the tipe of cable is a giga ware usb-a to serial cable with part # 26-949. i have triyed all the things that you have toled me to do , but it will not work for me. this is what it looks like.


will@outside:~$ lsusb
bus 001 device 001: id 1d6b:0002 linux foundation 2.0 root hub
bus 003 device 007: id 05ad:0fba y.c. cablu u.s.sa. inc.
bus 003 device 001: id 1d6b:0001 linux foundation 1.1 root hub
bus 002 device 001: id 1d6b:0001 linux foundation 1.1 root hub
will@outside:~$ sud modprobe usbserial vendor=0x05ad product=0x0fba
fatal: module usbserial not found.

this is the first real time that i have used linux of eny tipe and help would be much appreciated.
try the lsusb command first and take a look to see if it recognizes your adapter.

it should come up like this

root@putadabaca:/etc# lsusb
Bus 001 Device 003: ID 174f:a311 Syntek 1.3MPixel Web Cam - Asus A3A, A6J, A6K, A6M, A6R, A6T, A6V, A7T, A7sv, A7U
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

if you see a line alike the one in italic, then run the mod probe command as in the tutorial but use the numbers you get in bold as the vendor and product, being the first four the vendor and the last four the product ID.

the run a dmesg | grep "name product ID"
in my case, since i have a pl2303 i used it like this

root@putadabaca:/etc# dmesg | grep 2303
[ 22.727184] USB Serial support registered for pl2303
[ 22.727216] pl2303 3-1:1.0: pl2303 converter detected
[ 22.783919] usb 3-1: pl2303 converter now attached to ttyUSB0
[ 22.783938] usbcore: registered new interface driver pl2303
[ 22.783941] pl2303: Prolific PL2303 USB to serial adaptor driver
[ 28.230371] [drm] DAC-6: set mode 640x480 0
[ 966.645283] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[ 966.645303] pl2303 3-1:1.0: device disconnected
[ 967.025161] pl2303 3-1:1.0: pl2303 converter detected
[ 967.056183] usb 3-1: pl2303 converter now attached to ttyUSB0

Hope that helps out
also i forgot...

after you have done that and the dmesg shows the serial funcioning properly you have to go to the /dev folder and give permissions to the ttyUSBx being "x" the number assigned to the cable.

this is the command i used and after that it worked properly for me
root@putadabaca:/dev# chmod 777 ttyUSB0
Ebooa,

Could you tell me where you got that Prolific pl2303 driver? I've looked on Prolifics web site but could only find a version for 'redhat' linux, plus windows.

how do you get it to work with Ubuntu (9.10)?

Many thanks for your reply

Richard
Re: Ubuntu USB-Serial port install procedure
December 15, 2009 01:02PM
Richard, pl2303 driver is already part of kernel, no need to download from anywhere
Rakesh S Joshi
Re: Ubuntu USB-Serial port install procedure
December 16, 2009 01:49AM
Thanks Buddy. It worked for me.
I have a USB-serial cable that worked once even under umbutu ( but now with minicom). I followed the tutorial, and I get:

ssn@vydt-ubuntu:~$ lsusb
Bus 002 Device 004: ID 1453:4026 Radio Shack 26-183 Serial Cable
Bus 002 Device 003: ID 046d:08d7 Logitech, Inc. QuickCam Communicate STX
Bus 002 Device 002: ID 046d:c505 Logitech, Inc. Cordless Mouse+Keyboard Receiver
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04a9:221c Canon, Inc. CanoScan LiDE 60
Bus 001 Device 007: ID 058f:6362 Alcor Micro Corp. Hi-Speed 21-in-1 Flash Card Reader/Writer (Internal/External)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
ss@vydt-ubuntu:~$

so the USB serial cable is the Radio Shack device.

min@vydt-ubuntu:~$ dmesg | grep tty
[ 0.001692] console [tty0] enabled
[ 0.871735] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.872067] 00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 0.961111] tty tty34: hash matches
[ 9.772070] usb 2-6: pl2303 converter now attached to ttyUSB0


so I am pretty sure that I have this installed properly. or not..
THIS IS THE PROBLEM I AM HAVING.

from minicom, I am setup as 115200 8n1, but it shows as OFFLINE... and I can not get the cursor to do anything. Anyideas what this can be.
I tried ports:
ttyS0 and ttyUSB0
thanks
Re: Ubuntu USB-Serial port install procedure
March 12, 2010 10:16PM
115200 IS too fast, drop it to 19200 if you can. I had the same problem, but with windows.

following the method in the first post got it working for me, first time, under Ubuntu 9.10

No mention of the setup was on the wiki, that has now been fixed.
Freeman, Thanks so much for posting this procedure here. It was really helpful!
does anyone know how to permanently change permissions for /dev/ttyUSB0. Mine keep reverting back.

Also when I first tried the method described above it worked fine. And now I am unable to set commands to the motor.

I am using the PL2303 usb-to-serial cable which is connected to a RS485 adapter that takes computer commands and converts them to electrical signals send to a EZHR17 circuit which in turn drives a motor.

My dmesg output is:

[ 921.680125] usb 3-2: new full speed USB device using uhci_hcd and address 4
[ 921.835534] usb 3-2: configuration #1 chosen from 1 choice
[ 921.838201] pl2303 3-2:1.0: pl2303 converter detected
[ 921.850268] usb 3-2: pl2303 converter now attached to ttyUSB0

Does anyone know why the procedure initially worked but then stopped working?

Thanks.
the commands I send are :
echo "/1A640000R" > /dev/ttyUSB0
I have one more question. Does anyone know how to set the speed for a usb -to serial port?

my stty output is:

speed 38400 baud; line = 0;
eol = M-^?; eol2 = M-^?; swtch = M-^?;
ixany iutf8

and I would like to set the speed to 9600 as I am thinking that the speed might be the issue here.
Thanks Freeman thumbs up
Re: Ubuntu USB-Serial port install procedure
June 05, 2010 12:17AM
Quote
mm
does anyone know how to permanently change permissions for /dev/ttyUSB0. Mine keep reverting back.

Don't do that. Just add your user to the dialout group so you have appropriate permissions on the device. Try something like:
  sudo usermod -a -G dialout $USER
(in Ubuntu or Debian, this may need minor changes in other distributions).

Quote
mm
Does anyone know how to set the speed for a usb -to serial port?
  stty -F /dev/ttyUSB0 9600
should set /dev/ttyUSB0 to 9600bps.

In other words, this works exactly like any other serial port, you can set its speed using stty. Once the device is visible to the system, applications (including stty) do not know or care whether the serial port is a virtual one over USB, or any other low level hardware details about the way the device is implemented -- the driver and the kernel hide all that from applications. That's how Unix/Linux is supposed to work.

To see if setting the speed worked, use
  stty -F /dev/ttyUSB0 -a
and you should get all the details of exactly how that serial port is currently configured, including its speed.



Jonathan
thanks a lot.

Glad to know that this post is still alive and kicking. Just followed the procedures by Freeman and it worked out of the box.
No fuss.
Ubuntu 10.4 netbook edition on EeePC.

Used Cutecom to connect to my Cisco AP without a problem
thanks again Freeman


the rainbowarrior
Thanks freeman it saved me a lot of time .
Sorry, only registered users may post in this forum.

Click here to login