OpenPort Linux Kernel Driver

User topics relating to hardware that interfaces PCs to ECUs

Moderator: Freon

OpenPort Linux Kernel Driver

Postby tones111 » Fri Mar 16, 2007 7:49 pm

I just got my OpenPort 1.3 cable this afternoon and started working on getting the drivers working in linux. This might be old news, but after searching I couldn't find any answers to my problem. So, if someone else is having this problem this might save their afternoon.

Even after loading the ftdi_sio driver and plugging in the OpenPort cable it wasn't getting assigned to a device. Some googling turned up that there was a patch (http://lists-archives.org/linux-usb-devel/12503-usb-serial-ftdi_sio-add-support-for-tactrix-openport-devices.html) made to the 2.6.18 kernel to add device IDs for the Tactrix cables.

I'm using Ubuntu 6.10 and didn't want to upgrade to (currently alpha) 7.04. So, to get the cable working here's what I did. The same general steps will work for other distros but the commands will be different.

1. Download and extract the kernel source files for your kernel.

You can find out what kernel you're running with the command "uname -r". In Ubuntu I opened Synaptic and installed the linux-source package. This downloaded a bzip archive to /usr/src. To extract...
Code: Select all
cd /usr/src
sudo tar -xjf linux-source-2.6.17.tar.bz2


2. Edit the FTDI_SIO source files (see patch link)

Code: Select all
cd /usr/src/linux-source-2.6.17/drivers/usb/serial
sudo gedit ftdi_sio.h


Now we need to add a few constants that define the product IDs for the 1.3 cables. Add the following lines...
Code: Select all
/*
 * Tactrix OpenPort (ECU) devices.
 * OpenPort 1.3M submitted by Donour Sizemore.
 * OpenPort 1.3S and 1.3U submitted by Ian Abbott.
 */
#define FTDI_TACTRIX_OPENPORT_13M_PID   0xCC48   /* OpenPort 1.3 Mitsubishi */
#define FTDI_TACTRIX_OPENPORT_13S_PID   0xCC49   /* OpenPort 1.3 Subaru */
#define FTDI_TACTRIX_OPENPORT_13U_PID   0xCC4A   /* OpenPort 1.3 Universal */


They should be placed immediately before the following lines
/* Commands */
#define FTDI_SIO_RESET 0 /* Reset the port */
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */

Now lets update the ftdi_sio.c file
Code: Select all
sudo gedit ftdi_sio.c


again, we're going to add the following lines... For me this was right around line 500.
Code: Select all
   { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13M_PID) },
   { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13S_PID) },
   { USB_DEVICE(FTDI_VID, FTDI_TACTRIX_OPENPORT_13U_PID) },


which will be placed at the end of the id_table_combined struct. Just paste them in so the syntax matches the rest of the entries.

3. Compile the ftdi_sio kernel module
Code: Select all
cd /usr/src/linux-source-2.6.17
sudo make CONFIG_USB_SERIAL_FTDI_SIO=m M=drivers/usb/serial


4. Back up the old module and copy in the new module
Code: Select all
cd /lib/modules/2.6.17-11-generic/kernel/drivers/usb/serial
mv ftdi_sio.ko ftdi_sio.ko.bak
cp /usr/src/linux-source-2.6.17/drivers/usb/serial/ftdi_sio.ko .


5. Automatically load the ftdi_sio kernel module on bootup
sudo gedit /etc/modules
add ftdi_sio to the list

6. Load the kernel module
run "sudo modprobe ftdi_sio". If you don't get any error messages then everything is working great. You can verify the module loaded by running "lsmod | grep ftdi".

Now when you plug in your OpenPort 1.3 cable it'll map to a serial port. In my case it creates the device /dev/ttyUSB0. If you're using a different kernel version then the commands above won't match exactly, but should be pretty close. A little trial and error can go a long ways. Good luck and happy logging / tuning.
tones111
 
Posts: 7
Joined: Tue Mar 22, 2005 3:04 pm

Postby radsdau » Mon Mar 19, 2007 5:06 pm

Nice work, thanks for sharing it with us!
radsdau
 
Posts: 674
Joined: Wed Feb 08, 2006 6:56 pm

Postby Thrill » Wed Mar 28, 2007 6:37 pm

I'm trying to do the same thing on FreeBSD. The existing driver is uftdi but it does not guess the FTDI chip type so I hope it's not a 8U100AX. Anyway if this works I'll fill a bug report to FreeBSD to get it included in a future release.

Is there an ECUFlash source tree available so that I could try to port it to FreeBSD ?
Thrill
 
Posts: 3
Joined: Wed Sep 14, 2005 3:49 pm
Location: Sherbrooke, Canada

Postby Thrill » Wed Mar 28, 2007 6:45 pm

Yeah it worked.

$ dmesg | grep ucom
ucom0: Tactrix OpenPort 1.3 Universal, rev 2.00/6.00, addr 2
Thrill
 
Posts: 3
Joined: Wed Sep 14, 2005 3:49 pm
Location: Sherbrooke, Canada

Postby tones111 » Thu Mar 29, 2007 7:13 pm

Congratulations! Glad the info was helpful.

I still haven't had much time to play around with software besides some logging with Enginuity. I'd also like to take a look at the EcuFlash software to try and port something over to the linux / *BSD world. Once the code is released I don't imagine it would be too hard to get some command line utilities written up in C/C++.
tones111
 
Posts: 7
Joined: Tue Mar 22, 2005 3:04 pm

Postby gabedude » Fri Apr 06, 2007 11:47 am

Yeah I got this working like 2 months ago. ;)

The drivers have been in the gentoo kernel for a good bit now. ;) 2.6.19 I am running.

http://www.enginuity.org/viewtopic.php? ... ll&start=0

I guess I shoulda posted here too. hehe.
gabedude
 
Posts: 19
Joined: Wed Aug 23, 2006 4:31 am

Postby gabedude » Fri Apr 06, 2007 11:51 am

tones111 wrote:Congratulations! Glad the info was helpful.

I still haven't had much time to play around with software besides some logging with Enginuity. I'd also like to take a look at the EcuFlash software to try and port something over to the linux / *BSD world. Once the code is released I don't imagine it would be too hard to get some command line utilities written up in C/C++.


I won't be able to get to it until about 4 weeks from now, so if you want go over to enginuity.org, there is a task for someone to port/wrapper/whatever the ecuflash code. I have the code, but cannot give a copy out (due to my agreement with Colby and enginuity). If you want to do this for enginuity, please go here, and volunteer:

Thanks!

-Gabe

http://www.enginuity.org/viewtopic.php?t=36&start=30
gabedude
 
Posts: 19
Joined: Wed Aug 23, 2006 4:31 am

Postby tones111 » Fri Apr 06, 2007 3:32 pm

gabedude wrote:Yeah I got this working like 2 months ago. ;)

The drivers have been in the gentoo kernel for a good bit now. ;) 2.6.19 I am running.


Similar but slightly different issues. In my case I didn't get the /dev/ttyUSB0 device when inserting the cable even though the driver was loaded into the kernel. This was because the product IDs for the 1.3 series of cables didn't get included into the kernel until 2.6.19. So, it took a little extra work to get things working. Having references to both problems should be helpful for people struggling to get things set up.

It looks like there's a good number of people waiting to see the EcuFlash source but I completely respect Colby's role as the developer and will wait until he feels the time is right. Between work, school, and trying to work on an OpenEmbedded based carPC distro time is limited. There's some bright minded Linux users out there looking forward to this functionality so it's just a matter of time before the pieces stabilize and come together.
tones111
 
Posts: 7
Joined: Tue Mar 22, 2005 3:04 pm


Return to Interface Hardware

Who is online

Users browsing this forum: No registered users and 8 guests