California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Instaling FTDI drivers

Sun Aug 30, 2015 7:47 pm

Hello to everybody, thiss is my first "call".
I plan to use serial communication on Raspberry Pi2, so becouse touch screen 320x240 connected to Rasp. outputs http://www.4dsystems.com.au/product/4DPi_32/, I bought extra usb-ftdi-rs232 modul http://www.ftdichip.com/Products/Modules/RPi.htm and I manage to install latest drivers for it from http://www.ftdichip.com/Drivers/D2XX.htm which suits Raspberry Pi2, instructions http://www.ftdichip.com/Drivers/D2XX/Li ... -linux.txt. The problem is that device is never recognised when it is pluged into usb socket. To see it I have to put comands

Code: Select all

sudo rmmod ftdi_sio
first, then

Code: Select all

sudo rmmod usbserial
After that device is recognised, in case of unpluging of the device and plug it bac I have to repeat procedure with commands up there.
So, what could be done or where is the problem?
Every advance or solution would be very appreciated.

Regards, California

California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Re: Instaling FTDI drivers

Mon Aug 31, 2015 12:14 pm

I found this document http://www.ftdichip.com/Support/Documen ... nux%20.pdf where is described about this problem.

Code: Select all

In Linux, the VCP driver and D2XX driver are incompatible with each other. When a FTDI device is plugged in, the VCP driver must be unloaded 
before a D2XX application can be run. Use the 
remove module (rmmod) command to do this:

sudo rmmod ftdi_sio <ret>
sudo rmmod usbserial <ret>

When the FTDI device is power cycled or reset
the VCP driver will be reloaded
.
The rmmod process 
must be repeated each time this occurs. It is possible to write a simple script that unloads the VCP driver before running the D2XX application.
Help about writeing a script to unload the VCP driver would be very appreciated.

Regards,

ame
Posts: 4140
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Instaling FTDI drivers

Mon Aug 31, 2015 1:23 pm

FTDI chips work out of the box. You shouldn't have had to install anything.

Put a fresh Raspbian image on another SD card and boot with that then try your FTDI device.
Hmm. What can I put here?

California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Re: Instaling FTDI drivers

Mon Aug 31, 2015 2:00 pm

Thanks for your reply ame, how to test it? Please understand, I am quite new to Raspbian.

Regards,

ame
Posts: 4140
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Instaling FTDI drivers

Mon Aug 31, 2015 11:31 pm

Just plug it in. The drivers ought to be present, and a new device file should appear in /dev

You could start by listing the devices:

Code: Select all

ls /dev
Then plug in the device and type that again.

You should see a device file called /dev/ttyUSB0

Then you can use this path in the programs that want to open that serial port.

You can also try this, just after plugging in the device:

Code: Select all

tail /var/log/messages
This command will print the last few lines of the message log. You should see something about the FTDI device being recognised, and driver being loaded.
Hmm. What can I put here?

California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Re: Instaling FTDI drivers

Tue Sep 01, 2015 6:23 am

Thank you very much for your help, it will be tested this afternoon.

Regards

California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Re: Instaling FTDI drivers

Tue Sep 01, 2015 2:54 pm

Thanks again ame, it's working like you describe.

Code: Select all

pi@raspberrypi ~ $ tail /var/log/messages
Sep  1 14:30:14 raspberrypi kernel: [ 1030.715428] usb 1-1.5.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Sep  1 14:30:14 raspberrypi kernel: [ 1030.715446] usb 1-1.5.3: Product: FT2232H RPi HUB Module
Sep  1 14:30:14 raspberrypi kernel: [ 1030.715463] usb 1-1.5.3: Manufacturer: FTDI
Sep  1 14:30:14 raspberrypi kernel: [ 1030.715480] usb 1-1.5.3: SerialNumber: FTXJPNSB
Sep  1 14:30:14 raspberrypi kernel: [ 1030.719414] ftdi_sio 1-1.5.3:1.0: FTDI USB Serial Device converter detected
Sep  1 14:30:14 raspberrypi kernel: [ 1030.719607] usb 1-1.5.3: Detected FT2232H
Sep  1 14:30:14 raspberrypi kernel: [ 1030.720655] usb 1-1.5.3: FTDI USB Serial Device converter now attached to ttyUSB0
Sep  1 14:30:14 raspberrypi kernel: [ 1030.723656] ftdi_sio 1-1.5.3:1.1: FTDI USB Serial Device converter detected
Sep  1 14:30:14 raspberrypi kernel: [ 1030.723849] usb 1-1.5.3: Detected FT2232H
Sep  1 14:30:14 raspberrypi kernel: [ 1030.724434] usb 1-1.5.3: FTDI USB Serial Device converter now attached to ttyUSB1
pi@raspberrypi ~ $ 
Question: is this enough to access serial port over Python, or do I need to install additional drivers for it?
Wish: small example of writing one byte (or more) to and reading also one (or more) byte from serial port with Python would be really appreciated and helpful for me.

Regards

User avatar
Douglas6
Posts: 5066
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Instaling FTDI drivers

Tue Sep 01, 2015 4:09 pm

Install PySerial, either

Code: Select all

sudo apt-get install python-serial
for Python2, or

Code: Select all

sudo apt-get install python3-serial
for Python3.

Then Google for PySerial examples.

California
Posts: 231
Joined: Sat Jun 06, 2015 2:33 pm

Re: Instaling FTDI drivers

Tue Sep 01, 2015 5:43 pm

Thanks Douglas.

Return to “Raspberry Pi OS”