Search code examples
linuxmatlabubuntuusbserialftdi

USB<>serial communication not working on linux


I'm currently working on a project in which I have to communicate with a custom-made sonar board over an USB<>Serial connection with cts/rts hardware flow control at a baud rate of 4,499,456. MATLAB code for sending and receiving data is already available and fully tested on Windows.

The problem occurs when trying to execute the MATLAB code on linux (Ubuntu 14.10/15.04). Both the commands for toggling the LED on the board (write) as well as receiving information (read) are not working. Python ports of the MATLAB code using the pyserial and pylibftdi library do allow writing, but also hang on receiving data.

Does anyone have any idea as to why it does work on Windows but not Ubuntu? Maybe a driver issue? Or something having to do with cts/rts on Linux?

lsusb output

Bus 002 Device 004: ID 0403:6014 Future Technology Devices International, Ltd FT232H Single HS USB-UART/FIFO IC

dmesg output

[11906.209231] usb 2-3: new high-speed USB device number 5 using ehci-pci
[11906.346701] usb 2-3: New USB device found, idVendor=0403, idProduct=6014
[11906.346713] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11906.346720] usb 2-3: Product: USB <-> Serial Converter
[11906.346725] usb 2-3: Manufacturer: FTDI
[11906.346730] usb 2-3: SerialNumber: FT69T4N
[11906.351716] ftdi_sio 2-3:1.0: FTDI USB Serial Device converter detected
[11906.351800] usb 2-3: Detected FT232H
[11906.352234] usb 2-3: FTDI USB Serial Device converter now attached to ttyUSB1

Edit: Just logging my progress in case somebody encounters the same issue. The problem seems to lie in the baudrate; changing it to 115200 allows reading from the device, but messes up sending data to it.


Solution

  • Apparently the FTDI driver doesn't work to well with very high/non-standard baudrates. I ended up solving this by using a baudrate of 3,000,000