User Tools

Site Tools


howto:usbserial

Working with USB serial devices (phones, GPSes, ...)

In order to work with USB serial devices like phones and GPSes, you need to get the EEE PC to load the appropriate driver for them. Usually this is handled through the usbserial driver (there are alternatives, see below). The problem with this driver is that the one supplied by Asus doesn't include the necessary capabilities to handle generic USB serial devices. Before you do anything else, you need to install the fixed USB driver.

Installing the fixed usbserial

If you feel comfortable rebuilding the driver yourself with CONFIG_USB_SERIAL_GENERIC enabled, you probably know what to do here anyway. If not, follow the steps below.

  • Download mdfischer's fixed usbserial driver (the file you want from the zip is usbserial.ko).
  • Make sure that there isn't already a copy of usbserial loaded:
sudo rmmod usbserial
  • Extract and copy the fixed usbserial into the USB drivers directory
sudo mv usbserial.ko /lib/modules/2.6.21.4-eeepc/kernel/drivers/usb/serial
cd /lib/modules/2.6.21.4-eeepc/kernel/drivers/usb/serial
sudo chown root usbserial.ko
sudo chmod 644 usbserial.ko

Determining the USB vendor/device ID for your device

With your USB device unplugged, type lsusb to get a list of USB devices. On a stock EEE PC this should be something like:

Bus 001 Device 003: ID 0cf2:6225 ENE Technology, Inc.

which is the EEE's SD card reader. Then plug in your device and type lsusb again. There should now be a new device listed:

Bus 001 Device 003: ID 0cf2:6225 ENE Technology, Inc.
Bus 002 Device 003: ID 1234:5678 Example Corp.

with an actual vendor and device ID in place of the 1234:5678. To get the device recognised by usbserial you need to edit /etc/modprobe.conf (and not /etc/modules.conf or something in /etc/modprobe.d, which won't have any effect) to add the line:

options usbserial vendor=0x1234 product=0x5678

with the 1234 and 5678 replaced by the device information from lsusb. Without this, usbserial won't know what to do with the device. Note that the device IDs are hex values so you need to prefix them with 0x, if you leave this out then the values will be interpreted as decimal numbers and usbserial won't be able to do anything with your device.

Loading the usbserial driver

To load the driver manually (to check that everything is OK), you can call modprobe directly:

sudo modprobe usbserial

To have the system load it automatically on boot, add the line:

usbserial

to the file /etc/modules. To make sure that it's been loaded correctly, use:

lsmod | grep usb

This will show all of the USB drivers currently loaded, one of which should be usbserial.

Other ways to load the driver

There are two other ways to load the driver, either using the cdc_acm framework or via udev. udev allows on-demand loading of the appropriate driver when a USB device is plugged in. Unfortunately writing udev rules (or more specifically getting them to work) is mostly voodoo, not helped by the fact that the default EEE config isn't conducive to getting them working (that is, it's not easily possible to determine whether a failure to recognise a device is due to a udev problem or a problem with a misconfigured driver like the default usbserial driver shipped with the EEE PC). If anyone can get udev working reliably, please describe the steps here.

Problems with using usbserial

If you encounter problems with opening and using the usb serial port a problem might be that the networkmonitor2 constantly tries to open the serial usb port. This is done in the /usr/bin/x-session-manager script. Disabling the line with ” # networkmonitor2 -i ppp0 & ” might help.

howto/usbserial.txt · Last modified: 2009/03/27 09:24 by nekwrife