Installing Keyspan USB/Serial Converter Firmware in Debian Squeeze

Purchased a four-port Keyspan USB/Serial converter to drive various RS232 serial devices via my home automation controller. Conveniently enough, Debian no longer includes the firmware for these devices due to licensing concerns (see DFSG). As of the time this article was written, the firmware was not included in the firmware-nonfree package available via apt. Fortunately, the files *ARE* included in the standard Linux kernel, and can be easily fetched and installed via git.

mh@misterhouse: mh $ aptitude install git-core
mh@misterhouse: mh $ mkdir firmware && cd firmware
mh@misterhouse: firmware $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/dwmw2/linux-firmware.git
mh@misterhouse: firmware $ sudo mkdir /lib/firmware/keyspan
mh@misterhouse: firmware $ sudo cp linux-firmware/keyspan/* /lib/firmware/keyspan/

Simply unplugging and re-inserting the device should then allow the driver to find the firmware and properly initialize the adapter.

11 thoughts on “Installing Keyspan USB/Serial Converter Firmware in Debian Squeeze”

  1. Hey Steve,

    I’ve been searching all day on forums and getting nowhere, thanks for posting this.

    I have a Keyspan USA19HS and have been hitting a wall getting it running on Squeeze. I tried the instructions you posted and everything went off without errors, but I still cant access the device. I’m using Heyu for home automation and am try to access the Keyspan USB2Serial device at /dev/ttyUSB0.

    I get “HEYU: Can’t open tty line. Check the permissions.,” even though I have the correct permissions set. This was also happening before I tried installing the driver.

    I’m thinking maybe I need a diferent driver for the 19HS? What do you think? Anything I can try?

  2. Two things: first, execute ‘ls -al /dev/ttyUSB0’ and note permissions. Second, execute ‘groups’ as your user.

    In my case, the TTY permissions are:

    crw-rw-rw- 1 root dialout 188, 0 May 21 14:24 /dev/ttyUSB0

    My groups are:

    steve dialout cdrom floppy sudo audio dip video plugdev mh owfs

    As I am a member of the dialout group and the group has read/write permissions, I can safely access the device (apologies if this is pedantic, just want the response to be thorough).

    What user are you running heyu as? I haven’t used heyu, but if it is started via init it is possible that it’s running as another user. Check that user’s permissions as well.

    Execute ‘ps -aux | grep -i heyu’ and note the first column; execute ‘sudo groups {user}’ to check the user’s groups.

    1. Hey Steve,

      Thanks for helping me with this.

      I’ve been trying to run heyu as root (maybe not the best idea)
      I’m kind of stumped because it looks like the permissions should work, unless somehow I screwed up the install of heyu – here’s what I get:

      root@iConnectDebian:~# ls -la /dev/ttyUSB0
      crwxrwxrwx 1 root root 188, 0 Jun 1 13:23 /dev/ttyUSB0
      root@iConnectDebian:~# ps -aux | grep -i heyu
      Warning: bad ps syntax, perhaps a bogus ‘-‘? See http://procps.sf.net/faq.html
      root 21543 0.0 0.3 3380 772 pts/0 S+ 22:03 0:00 grep -i heyu
      root@iConnectDebian:~# heyu info
      starting heyu_relay
      HEYU: Can’t open tty line. Check the permissions.

      any ideas of what else to try? I’m trying to get my hands on a different USB2Serial converter with an FTDI chipset, since that help narrow down if it’s heyu or a problem with the Keyspan driver

  3. Try the ps command without the dash: ps aux | grep -I heyu

    Make sure you don’t have another process running as a different user. Next thing to try would be to check if something already has the port open. Try ‘lsof | grep -I ttyusb0’ (without the quotes); does this show anything?

    if you are running as root there’s something else going on. Unplug the adapter from your usb port, wait a minute, type ‘tail -f /var/log/messages’, plug in the adapter and note what is displayed. Are any errors reported?

    The next thing id try would be to talk to the device directly using a terminal program like picocom and see if you have similar results.

    1. Hi Steve,
      Thanks for all your help.
      so, “lsof | grep -I ttyusb0” doesn’t show anything.

      The device shows up in var/log/messages
      Jun 8 14:51:51 iConnectDebian kernel: usb 1-1.2: new full speed USB device using orion-ehci and address 9

      It’s really weird that heyu cant talk to it. I ended up getting heyu to work an FTDI based adapter, so I might just stick with that for heyu since I use the keyspan for other things.

      It’s pretty awesome – I have x10 commander on the iphone talking to heyu so I can control all my devices from the iphone.

      thanks again for all your help!
      -Josh

  4. Great thanks!!! These are the only instructions which actually work, and are doable for a non-expert.

    Just adding my 2¢. After these steps, I checked things this way:
    dmesg | grep Keyspan

    … Keyspan 1 port adapter converter now attached to ttyUSB0
    stty -aF /dev/ttyUSB0
    (Bunch of configs)
    Just for me to feel comfortable the beast finally woke up. Now I’m using it – I seriously thought about installing Windows in this machine, and you saved it!

    Best regards,
    Emerson

  5. Hello and thanks for this posting. I am a true newbie and am trying to get my Android device to recognize my Keyspan. I plug it in and can tell that the Keyspan is found on the USB bus. But no ttyUSB is created in /dev. I am running a Debian distribution along side Android via the LinuxDeploy app. I can successfully complete the steps shown above but nothing I seem to do causes the ttyUSB device to be created. Any suggestions are appreciated. Thanks

    1. Can’t help you on the Android end, don’t have any experience with the platform. It’s possible that the device is being created as an ACM device rather than tty (more details here.)

      Type ‘dmesg’ after plugging in the device. The last few entries should show you (a) whether there were any errors enumerating the device and (b) where the device was actually created in the device tree.

      1. Thanks for the response, Steve. I figured it was a long shot. I can see the Keyspan being recognized to some extent in dmesg. But I do not see any lines regarding its attachment to any ttyUSB. I think that the kernel being used is monolithic. So I don’t know if there there is a way to manually load the stuff in /lib/firmware/keyspan. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *