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/usbAnd 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

Join the newsletter!

Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Rodney Gedda

PC World
Show Comments

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Ratchada Dunn

Sharp PN-40TC1 Huddle Board

The Huddle Board’s built in program; Sharp Touch Viewing software allows us to easily manipulate and edit our documents (jpegs and PDFs) all at the same time on the dashboard.

George Khoury

Sharp PN-40TC1 Huddle Board

The biggest perks for me would be that it comes with easy to use and comprehensive programs that make the collaboration process a whole lot more intuitive and organic

David Coyle

Brother PocketJet PJ-773 A4 Portable Thermal Printer

I rate the printer as a 5 out of 5 stars as it has been able to fit seamlessly into my busy and mobile lifestyle.

Kurt Hegetschweiler

Brother PocketJet PJ-773 A4 Portable Thermal Printer

It’s perfect for mobile workers. Just take it out — it’s small enough to sit anywhere — turn it on, load a sheet of paper, and start printing.

Matthew Stivala

HP OfficeJet 250 Mobile Printer

The HP OfficeJet 250 Mobile Printer is a great device that fits perfectly into my fast paced and mobile lifestyle. My first impression of the printer itself was how incredibly compact and sleek the device was.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?