Can I use a Sierra Wireless Modem on Linux Machines (direct IP modems)?

sumber: http://sierrawireless.custhelp.com/app/answers/detail/a_id/641/kw/modem%20command%20lightning

Can I use a Sierra Wireless Modem on Linux Machines (direct IP modems)?

Yes, but these instructions are not supported and are provided to the Linux user community as a courtesy. These instructions and associated drivers, scripts, and executable files are provided by Sierra Wireless “AS IS” without warranty of any kind.

The drivers provided in the Download section below are freeware; you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation.

This guide is for owners of Sierra Wireless modems who would like to use it on a computer running the Linux operating system. Only a limited number of kernels are supported as listed in the table below.

*Note: Sierra Wireless submits driver updates and patches to the public Linux distribution found at www.kernel.org.

**Note: Ubuntu 9.10 distribution is not supported with Sierra Wireless modems. Ubuntu 9.04 and 10.4 distributions are supported with all Sierra Wireless modems listed in this KB article.
The Sierra Wireless sierra_net.c driver presents certain models of Sierra Wireless modems to the operating system as Network Interface Cards (NICs). The data communication interface between host and modem transfers packets which carry Ethernet frames over the USB bus and utilizes the high-speed USB bandwidth more efficiently. It greatly increases data throughput especially when combined with other mechanisms that optimize the bus usage for user packets.

Please note that sierra_net DirectIP driver requires USB Sierra Wireless driver version 1.7.0 or higher. Use command modinfo sierra to verify the version.

Supported Modems

  • USB 306
  • USB 308/309
  • AT&T Shockwave
  • USB 305 (AT&T Lightning )
  • M8700 minicard
  • MC8790 minicard*
  • Compass 888/889*
  • USB 301/302*
  • AirCard 501/502*
  • AirCard 503 ( Telstra Elite)
  • AirCard 504( AT&T AirCard 890)
  • USB 310U modem
  • AirCard 312U /Telstra Ultimate

* with a direct IP firmware

Driver Downloads

Note: If you don’t want to install the latest Direct IP drivers below, you can still use your Sierra Wireless AirCard modem with Linux. Starting from kernel ver. 2.6.25 most of Linux distributions include the Sierra Linux drivers and are equipped with the Network Manager application.
Simply insert your modem and follow the prompts on your screen. Please refer to the KB article below for more details.
http://sierrawireless.custhelp.com/app/answers/detail/a_id/659

The Direct IP drivers for the most of Linux kernels are listed in the table below. Additional kernels are not supported at this time.

Kernel version Driver Version TRU-Install Patch
2.6.20 v1.22_1736 patch
2.6.21 v1.22_1736 patch
2.6.22 v1.22_1736 patch
2.6.23 v1.22_1736 Not required
2.6.24 v1.22_1736 Not required
2.6.25 v1.22_1736 Not required
2.6.26 v1.22_1736 Not required
2.6.27 v1.22_1736 Not required
2.6.28 v1.22_1736 Not required
2.6.29 v1.22_1736 Not required
2.6.30 v1.22_1736 Not required
2.6.31 v1.22_1736 Not required
2.6.32 v1.22_1736 Not required
2.6.33** v1.22_1736 Not required
2.6.34** v1.22_1736 Not required

**Note: Starting with kernel ver. 2.6.33  the sierra_net driver enumerates the DirectIP interface as “ wwan0” (instead of “usb0”) and is re-named from “DirectIP Driver for Sierra Wireless modems” to “USB-to-WWAN Driver for Sierra Wireless modems”. Because of this, Sierra Wireless DirectIP device has been re-named from “Sierra Wireless Direct IP Modem”  to “Sierra Wireless USB-to-WWAN Modem”.

The drivers (and possibly other files, depending upon your kernel) are bundled together into one file. Once you have downloaded the file you can unpack the contents using the following procedure:

1. Open a terminal window. The procedure for opening a terminal window varies from one Linux distribution to another. For example, on Ubuntu Linux you can select

Applications >Accessories >Terminal

2. Extract the tarfile’s contents by typing the following commands:
a) Create a directory for the tarfile if you haven’t already done so:
# mkdir kernel-2.6.y


b) Move the tar file you downloaded from this website into the new directory:
# mv  v1.0x_kernel2.6.y.directIP.tar  kernel-2.6.y


c) Extract the files into the new directory:
# tar -xvf v1.0x_kernel-2.6.y.directIP.tar

3. Your directory should now contain the files extracted from the image. You no longer require the downloaded tar file and can optionally keep it or delete it at your discretion.

1.Downloaded file contents

The file you have downloaded contains the following files:

1. sierra.c
This driver file manages your modem’s serial USB interfaces and is required for direct IP operation. It contains a black list of interfaces which it must ignore. USB interfaces managed by this driver are exposed in your /dev/ directory as       /dev/ttyUSBn,
where in most cases “n” ranges from 0 up to 6 or higher depending upon your product. This driver is mandatory for all Sierra Wireless USB-based products

2. sierra_net.c
This driver is specifically for Direct IP operation. It makes the Sierra Wireless modem appear to your Linux machine as one or more Ethernet-like devices, depending upon your modem’s configuration. Installation of this driver is mandatory for Sierra Wireless Direct IP modems

3. Makefile
This file contains instructions your Linux computer needs to build and install the sierra.c and sierra_net.c drivers

4. usbnet.h [1] , skb_compat.h [2]
This file is required by the sierra_net.c driver and is provided as part of this download in the event that it is not available on your Linux computer. If the file is already resident on your computer, the make file will replace this unzipped copy in the directory where you have unzipped your driver with your pre-existing copy

2. Driver Installation

Preparation

IMPORTANT! This article assumes you have a properly-configured USB modem, including a SIM card with an active account on it.

Direct IP driver installation instructions

The installation of these drivers is a two-step process consisting of compilation and then installation. The compilation step can be performed by anyone, however, the installation step can only be done by someone with appropriate authorization. In this case, appropriate authorization means having access to the sudo command or else having root account privileges.

Compiling the driver

To compile the sierra.c and sierra_net.c drivers, use the following step:

1. Open a terminal window. The procedure for opening a terminal window varies from one Linux distribution to another. For example, on Ubuntu Linux you can select
Applications->Accessories->Terminal

2. Navigate to the directory in which you have unpacked your driver files
# cd <directory path>

3. Compile the drivers with the following command:
# make

4. When the command prompt returns your drivers should be successfully compiled and you should see no reports of errors from the make output

5. Keep your terminal open for the next procedure – installing the driver

Installing the driver using “root” privileges

Now that the two driver files have been compiled, they need to be installed before you can use them. Installation of a driver module is straightforward; use the following steps:

1. Ensure your Sierra Wireless modem is not plugged into your computer

2. If you have root privileges, log in as root now:

# su root

When prompted, enter the password for the root account

3. Install the drivers using the following command on your terminal window:

# make install

4. When the command prompt returns your drivers should be installed and ready for use.

Note: if you see an error message of the form:

FATAL: Module sierra is in use.
make: *** [install_sierra] Error 1

Then you have an application running that has at least 1 /dev/ttyUSB handle to the modem open. Please ensure all applications are stopped and re-install your drivers beginning from step 3, above.

Installing the driver using “sudo”

If you have sudo access you can use these steps to install the drivers

1. Ensure your Sierra Wireless modem is not plugged into your computer

2. You should have a terminal window open and you should have navigated to the directory in which you compiled your drivers

3. Install the drivers using the following command:

# sudo make install

When prompted for your password, enter the password you normally use to log into your account

4. When the command prompt returns your drivers should be installed and ready for use.

Note: if you see an error message of the form:

FATAL: Module sierra is in use.
make: *** [install_sierra] Error 1

Then you have an application running that has at least 1 /dev/ttyUSB handle to the modem open. Please ensure all applications are stopped and re-install your drivers beginning from step 3, above.

TRU-Install patch instructions

If you have Kernel 2.6.23 or later you may skip this section (kernel version you can check with commanduname -r“)

USB 306/MC8700 Modem products come with the TRU-Install feature which bundles the software ( compatible with PCs running Windows™)  for the adapter inside the adapter. Older versions of Linux have compatibility issues with this and require a patch. If you have a kernel without TRU-Install support you will need to apply the TRU-Install patch.

You should consult your Linux Distribution web site for more information on the procedure for recompiling and installing patches. You may want to download the Kernel from www.kernel.org. As a courtesy we offer the following generic steps for applying the TRU-Install patch.
The steps are as follows:

1. Extract the Kernel by typing the following command:
# tar -jxf linux-2.6.x.x.tar.bz2

2. Download the patch from the Driver Downloads section  above ( select your kernel version) and extract it to the same base directory you extracted the Kernel to.

3. Apply the patch by typing the following commands:
# cd linux-2.6.x.x
# patch -p1< ../the-patch-file.patch

4. Copy the sierra.c driver into the usbserial directory (Linux-2.6.x.x/drivers/usb/serial).

5. Compile and install the Kernel. (Check with your Linux distribution for more details.)
# make clean
# sudo make modules SUBDIRS=driver/usb/storage
# sudo make modules_install SUBDIRS=drivers/usb/storage

Reboot and insert the TRU-Install device. It should be identified as USB modem device.

Verify your installation

Now that you have compiled and installed your drivers, you can use the following steps to verify the installation was successful.

1. Open a terminal window

2. Check the version numbers of your drivers using the following commands:

# modinfo sierra you should see v.1.7.x or later

# modinfo sierra_net you should see v.1.xx or later

The driver’s version number appears within the top few lines of the output from these commands

3. Plug your modem into one of your computer’s USB connections. Within a few seconds you should see several file handles appear in the /dev directory. Check this using the following command, issued from a terminal window:

# ls /dev/ttyUSB*

The response should look something like:

/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3

4. Check to see whether the modem’s direct IP interface has been enumerated. From a terminal window enter the following command:

# ifconfig

The output should resemble the following with the “usb0” being the key piece of information, ignore the remainder of the printout for now.

usb0 Link encap:Ethernet HWaddr 00:1e:37:21:9c:80
inet addr:10.1.32.113 Bcast:10.1.32.255 Mask:255.255.255.0
inet6 addr: fe80::21e:37ff:fe21:9c80/64 Scope:Link
DOWN BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14288 errors:0 dropped:0 overruns:0 frame:0
TX packets:639 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1674202 (1.5 MB) TX bytes:106755 (104.2 KB)
Interrupt:21

5. If your modem supports multiple direct IP interfaces you will see additional interfaces in step 4, numbered usb1, etc.

3. Connecting to the Network

*Note: The following procedure has been tested on Ubuntu 8.10 only and details may differ for other distributions of Linux.

Your Sierra Wireless modem requires a valid SIM with an active account on it as well as some minimal configuration which can easily be accomplished using AT commands. You will need some kind of terminal program (e.g. minicom) to enter AT commands to your modem. If you haven’t already done so, you will need to find out some important information from your wireless service provider – the APN. The following procedure can be used to establish a Direct IP data connection. Assuming the APN information you got from your service provider is  internet.com then the following procedure can be used to configure your modem and then bring up a direct IP data connection.

1. Configure the APN on your modem using the following command:

AT+CGDCONT=1,”IP”,”internet.com” [3]

The modem should respond with “OK

Optional step: To change the Authentication method with the Carrier you can use the following commands:

AT$QCPDPP=1,1,”password”,”username”

(second parameter is the auth_method: none=0, PAP=1, CHAP=2)

Note: for USB 305 (AT&T Lightning ) modem use the AT command AT%IPDPCFG instead of  AT$QCPDPP.

AT%IPDPCFG=<cid>[,<nbns_enable>,[<auth_type>,[<username>,[<password>]]]] (set command)

e.g. AT%IPDPCFG=1,0,1,”my_user_name”,”my_password”

2. Tell the modem to establish a Direct IP data connection with the wireless network:

AT!SCACT=1,1 ( to disconnect use this command AT!SCACT=0,1 )
After a short delay the modem should respond with OK and your data connection should be available for use; your modem’s flashing blue LED should have changed to solid blue.

3. You can verify the connection is established by exiting minicom and issuing the following command in a terminal window:

# ifconfig

The command output should reveal a valid IP address and the connection should be flagged as UP.

4. If you don’t see a valid IP address after running the ifconfig command, try the following command:

# sudo dhclient usb0
(Enter the password you use to log into your account when prompted)

This command will force your Linux machine to run a DHCP discovery sequence on the usb0 interface. If you repeat the command in step 3, above, you should be able to see a valid IP address. At this point your modem is ready for use and you should be able to access the internet.

Leave a Reply