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 PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

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

Rodney Gedda

PC World
Show Comments

Essentials

Lexar® JumpDrive® S57 USB 3.0 flash drive

Learn more >

Microsoft L5V-00027 Sculpt Ergonomic Keyboard Desktop

Learn more >

Mobile

Lexar® JumpDrive® S45 USB 3.0 flash drive 

Learn more >

Exec

Lexar® JumpDrive® C20c USB Type-C flash drive 

Learn more >

Audio-Technica ATH-ANC70 Noise Cancelling Headphones

Learn more >

Lexar® Professional 1800x microSDHC™/microSDXC™ UHS-II cards 

Learn more >

HD Pan/Tilt Wi-Fi Camera with Night Vision NC450

Learn more >

Budget

Back To Business Guide

Click for more ›

Most Popular Reviews

Latest News Articles

Resources

PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?