Huawei Setup

What follows is a description of what I did to get a Huawei CDMA phone/modem from Uganda Telecom to work as a modem under Debian Sarge Linux.

= Kernel Driver =

First of all, you need a driver module for the Texas Instruments USB-to-serial adapter that comes with the phone. This module is available in the Linux kernel as of version 2.6.11, just make sure you have CONFIG_USB_SERIAL_TI enabled. If/once you have this driver as a kernel module, most distros will use udev or hotplug to automatically load the module when you connect the cable. See your distro's documentation for more information. If you are using an earlier kernel (like in Debian Sarge), you may need to build the module yourself. You can find the standalone source here. I'm using version 1.0.

= PPP Setup =

In order to get PPP working, you need to edit a bunch of files. But first, make sure pppd is installed. In Debian:

debian:~# apt-get install ppp

Now on to configuration.

/etc/ppp/chap-secrets
Put your username and password here. This is like the passwd file for PPP. When you're done it should look something like this:

myuser      *       mypassword              *
 * 1) Secrets for authentication using CHAP
 * 2) client     server  secret                  IP addresses

This means, for any server at any IP address, login with username myuser and password mypassword. If you have multiple ISPs, you will probably want something more specific than * in the server and IP address fields.

/etc/chatscripts/provider
This doesn't have to be called provider, call it whatever you want, just make sure you use the same name in your /etc/ppp/peers/provider file. The following worked for me with the Huawei modem and UTL:

# # # ABORT       BUSY ABORT       "NO CARRIER" ABORT       VOICE ""          ATE0V1 OK          ATDT#777
 * 1) This is the chat script used to dial out to your default service provider.
 * 2) Please customize the entries enclosed in parenthesis to match your setup.
 * 3) Only the "provider" file will be handled by poff and pon (unless with
 * 4) extra command line arguments).
 * 1) Remember to edit /etc/ppp/peers/provider accordingly.
 * 1) ATZW2 as a default init string
 * 2) - On all hayes compatible modems, W2 will correctly report the connect
 * 3)   speed.

/etc/ppp/peers/provider
This seems to be right for UTL:

noauth
 * 1) You usually need this if there is no PAP authentication

Point this to the chat script you just created:

connect "/usr/sbin/chat -v -f /etc/chatscripts/provider"
 * 1) The chat script (be sure to edit that file, too!)

If this is your connection to the Internet:

defaultroute
 * 1) Set up routing to go through this PPP link

Make sure to set this correctly for your TI device, this is probably right:

/dev/ttyUSB0
 * 1) Default modem (you better replace this with /dev/ttySx!)

This speed works for me:

230400
 * 1) Speed

Put the same username here as you put in the chap-secrets file:

name myuser
 * 1) Login name

If you need DNS from PPP, you need this line. If it's your Internet connection, you definitely want to enable this:

usepeerdns
 * 1) Get DNS server addresses

If this is a server, you may want it to stay permanently connected:

persist maxfail 0
 * 1) Keep connection up
 * 1) Never stop retrying when disconnected

/etc/network/interfaces
Add this to the end of the file:

iface ppp0 inet ppp provider provider

Or, if you want the PPP interface to connect automatically when you bring up your network, use this instead:

auto ppp0 iface ppp0 inet ppp provider provider

The provider line is probably not necessary unless you've named your /etc/ppp/peers file something other than 'provider'.

resolv.conf
If you are getting your DNS from your PPP provider, Debian will write your nameserver information to /etc/ppp/resolv.conf. However, your system will only read /etc/resolv.conf. If you don't plan to use any DNS server other than the one from your PPP provider, here is the most reliable way to remody this:

debian:~# cd /etc debian:/etc# rm resolv.conf debian:/etc# ln -s ppp/resolv.conf resolv.conf

Otherwise, most ISPs (UTL included) always provide you with the same nameserver, so once you're connected, you can probably just copy and paste the nameserver line from /etc/ppp/resolv.conf.

= Troubleshooting =

If your TI driver is compiled as a module, make sure it's loaded using lsmod. You should see something like this:

debian:~# lsmod | grep ^ti_usb ti_usb_3410_5052      51564  1

In your 'dmesg' output, you should see something like this:

ti_usb_3410_5052 1-2:2.0: TI USB 3410 1 port adapter converter detected usb 1-2: TI USB 3410 1 port adapter converter now attached to ttyUSB0

If you see something other than 'ttyUSB0' there, make sure you modify /etc/ppp/peers/provider accordingly.

You can check for any PPP errors with the 'plog' command.