Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently upgraded to ubuntu 12.04 from 10.04. Under 10.04 I had no trouble using usbserial driver to connect to a device through the serial port. After the upgrade usually I cannot reset the baud rate: it is initialized to 9600, but my device needs 115200. When I try to reset the speed I get:

$ sudo stty -F /dev/ttyUSB0 
speed 9600 baud; line = 0;
-brkint -imaxbel
$ sudo stty -F /dev/ttyUSB0 115200
stty: /dev/ttyUSB0: unable to perform all requested operations
$ sudo setserial -av /dev/ttyUSB0
Cannot get serial info: Invalid argument
$ ls -l /dev/ttyUS*
crw-rw---- 1 root dialout 188, 0 Nov 26 10:21 /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 1 Nov 26 10:21 /dev/ttyUSB1

The oddest thing is that I have gotten this to work on occasion. The first time I rebooted the system, and it worked. After a shutdown it had the same problem and rebooting did not work, but reloading the driver did. Unfortunately this has not worked since:

$ sudo modprobe -r usbserial
$ sudo modprobe usbserial vendor=0x0403 product=0x6001
$ sudo stty -F /dev/ttyUSB0 115200
stty: /dev/ttyUSB0: unable to perform all requested operations
share|improve this question
add comment

2 Answers 2

USB to serial devices like the Prolific or FTDI series don't follow any official specification. Instead, they use two bulk endpoints (one for output, one for input) with specific vendor-specific control messages used to configure things like baudrate. Thus, it's not too much of a surprise if something like the generic usbserial driver has trouble setting baudrates or doing other configuration tasks on a FTDI chip. As you noticed, using ftdi_sio will work much better.

Even 10.04 should be loading ftdi_sio by default, as ftdi_sio has been hardcoded to handle 4003:6001 (FT232) devices for nearly as long as Ubuntu has existed. My guess is that you were loading two drivers that were both registered to handle 4003:6001 -- one by design, one due to your module parameters. Changing your kernel or even the phase of the moon could mean that one happens to get loaded before the other -- and if usbserial gets loaded first, you will not be able to set baudrate. You should remove your manual usbserial configuration, and let ftdi_sio handle the device. It will work on both 10.04 and 12.04.

share|improve this answer
add comment

I think I found the solution to this, in case anyone googles it in the future. My 10.04 did not load usbserial by default, so I had to do it with modprobe usbserial vendor=0x0403 product=0x6001, which I added to /etc/modules. After I upgraded, my 12.04 loads the ftdi_sio driver by default, which is for the embedded device I am using. I didn't change my /etc/modules back, so usbserial was being loaded too, and probably causing some sort of conflict. I removed usbserial from /etc/modules and rebooted, and it worked.

If I were really confident in this solution I would confirm it by rebooting my machine again and seeing if the serial port came up properly - but I would feel pretty silly if I rebooted and lost the connection, since I do need to get work done while I have it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.