Utilising USB modems with Linux

Universal Serial Bus, or USB, is fast becoming the standard in external device interfacing and, as a result, a range of USB modems is now available on the market. A key benefit of external USB modems is that they are bus powered and hence don't require an additional AC power supply. The good news for Linux users is that USB modems are supported by the kernel and you don't need to install third-party software or reboot your computer to get one working.

REQUIREMENTS

The first requirement is that the modem must comply with the Communication Device Class Abstract Control Model (CDC ACM) USB sub-class. There is a generic ACM driver in the kernel, which is used for modems and ISDN terminal adapters that conform to this specification. Therefore, make sure that the modem is ACM-compliant before you buy, and keep in mind that some USB modems are not ACM-compliant and have only Windows drivers. The Netcomm Roadster II 56 USB is a popular modem that complies with ACM.

The second major requirement is a Linux kernel version with USB support. The USB sub-system was developed and introduced with the 2.4 series and has since been back-ported to 2.2.18 and later kernels. A 2.4 series kernel is recommended to ensure that you have the latest drivers and features.

INSTALLING THE MODULES

The great thing about using USB devices with Linux is that you can take advantage of the kernel's "hot plugging" ability. Hot plugging will load the appropriate module(s) upon detection of a device. If your distribution supports this, just plug in the USB modem and the ACM module will be loaded. Setting up hot plugging is beyond the scope of this article but Red Hat 7.2, Mandrake 8.1 and SuSE 7.3 all support it. If the modem lights flash and executing the # lsmod command reveals an ACM module, then your modem has been installed by hot plugging and you can skip ahead to the section on using the modem:

MANUAL INSTALLATION

You will need at least three kernel modules loaded to get a USB modem working. They are usbcore - the base USB module; usb-uhci - the Universal Host Controller Interface (UHCI) root hub driver used in most Intel-based systems (use usb-ohci if yours is an Open HCI); and ACM - the Abstract Control Model driver. If these didn't come pre-compiled then re-compile your kernel with these drivers as modules.

Before you load the modules, as root, create a device node (if not already there) that will be used by the acm driver:

# mkmod /dev/usb/ttyACM0 c 166 0

Then do:

# modprobe -a usbcore usb-uhci acm

This will load all the required modules. In order to see your USB device details, mount the USB device file system with:

# mount -t usbdevfs usbdevfs /proc/bus/usb

And then, with the modem plugged in, you can see it and the root hub's specifications with:

# cat /proc/bus/usb/devices

USING THE MODEM

With all the USB modem drivers loaded, you are now ready to connect to the Internet. Insert (or replace) the device location of your USB modem - /dev/usb/ttyACM0 (Red Hat 7.2 uses /dev/input/ttyACM0) - into your Internet connection program or script. If you are accessing the Internet as a regular user, make sure all users can read and write to the device. As root, type in the following:

# chmod a+rw /dev/usb/ttyACM0

If you are accustomed to using /dev/modem then delete the old link and create a new one with:

# ln -s /dev/usb/ttyACM0 /dev/modem

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Rodney Gedda

PC World

Comments

Comments are now closed.

Latest News Articles

Most Popular Articles

Follow Us

GGG Evaluation Team

Kathy Cassidy

STYLISTIC Q702

First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni

STYLISTIC Q572

For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell

LIFEBOOK UH574

The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi

STYLISTIC Q702

The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott

STYLISTIC Q702

My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Resources

Best Deals on GoodGearGuide

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?