Keyspan USB-to-Serial Adapter Support in Ubuntu Linux

Today I wanted to use my Keyspan USB-to-Serial adapter on my Ubuntu (gutsy) box. Unfortunately, Ubuntu doesn’t ship with a driver for this because of some licensing restrictions. So after trying a few things the hard way, I found out an easy way to build the drivers.

Follow these steps.

Note: Wherever I use “amd64” in the below examples you’ll need to replace with your architecture if you’re not on 64-bit Intel or AMD.

Grab the kernel source package:

1
2
3
4
5
# Use whatever path you like
cd ~/debian-src/kernel

apt-get source linux-image-2.6.22-14-generic
cd linux-source-2.6.22-2.6.22/

If you don’t already have the Ubuntu tools for building packages, you’ll need to run:

1
sudo apt-get build-dep linux-image-2.6.22-14-generic

Now edit the following file:

1
vi debian/config/amd64/config

Add the following under the line that reads CONFIG_USB_SERIAL_KEYSPAN_PDA=m:

1
2
3
4
5
6
7
8
9
10
11
12
13
CONFIG_USB_SERIAL_KEYSPAN=m
CONFIG_USB_SERIAL_KEYSPAN_MPR=y
CONFIG_USB_SERIAL_KEYSPAN_USA28=y
CONFIG_USB_SERIAL_KEYSPAN_USA28X=y
CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y
CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y
CONFIG_USB_SERIAL_KEYSPAN_USA19=y
CONFIG_USB_SERIAL_KEYSPAN_USA18X=y
CONFIG_USB_SERIAL_KEYSPAN_USA19W=y
CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y
CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y
CONFIG_USB_SERIAL_KEYSPAN_USA49W=y
CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y

Rebuild the kernel like so:

1
fakeroot debian/rules binary-generic

And now install it:

1
2
cd ..
sudo dpkg -i linux-image-2.6.22-14-generic_2.6.22-14.52_amd64.deb linux-headers-2.6.22-14-generic_2.6.22-14.52_amd64.deb linux-image-debug-2.6.22-14-generic_2.6.22-14.52_amd64.deb

You should now be able to insert a Keyspan USB-to-Serial adapter into the USB port and it’ll be recognized as /dev/ttyUSB0. Check dmesg for any errors.

Comments