Gentoo Linux Dailup Internet by CDMA Phone

My CDMA phone connects to the laptop via a USB cable. So I have to configurate the kernel with USB Modem support.

Device Drivers -->
    USB support -->
        [M] Support for Host-side USB
        [M] USB Modem (CDC ACM) support

Check if the device is well reconized after install and modprobe the module(cdc_acm).

# dmesg | grep acm
usbcore: registered new driver cdc_acm
drivers/usb/class/cdc-acm.c: v0.23:USB Abstract Control Model driver for USB modems and ISDN adapters

Great, the device has been recognized. Then create the ttyACM0 node in /dev is it does exist.

mknod /dev/ttyACM0 c 166 0

Edit the configuration file /etc/conf.d/net.ppp0 (or .ppp1, .ppp2). Here’s mine

# Config file for /etc/init.d/net.ppp0

PEER="cdma"                     # Define peer (aka ISP)
DEBUG="yes"                     # Turn on debugging
PERSIST="no"                    # Redial after being dropped
ONDEMAND="no"                   # Only bring the interface up on demand?
MODEMPORT="/dev/ttyACM0"        # TTY device modem is connected to
LINESPEED="230400"              # Speed pppd should try to connect at
INITSTRING=""                   # Extra init string for the modem
DEFROUTE="yes"                  # Must pppd set the default route?
HARDFLOWCTL="yes"               # Use hardware flow control?
ESCAPECHARS="yes"               # Use escape caracters ?
PPPOPTIONS=""                   # Extra options for pppd
USERNAME="card"                 # The PAP/CHAP username
PASSWORD="card"                 # Your password/secret.  Ugly I know, but i
                                # will work on something more secure later
                                # on.  700 permission on /etc/init.d/net.ppp0
                                # should be enouth for now.
NUMBER="#777"                   # The telephone number of your ISP
                                # leave blank for leased-line operation.
REMIP=""                        # The ip of the remote box if it should be set
NETMASK=""                      # Netmask
IPADDR=""                       # Our IP if we have a static one
MRU="768"                       # Sets the MRU
MTU="768"                       # Sets the MTU
RETRYTIMEOUT="60"               # Retry timeout for when ONDEMAND="yes" or
                                # PERSIST="yes"
IDLETIMEOUT="600"               # Idle timeout for when ONDEMAND="yes"
PEERDNS="yes"                   # Should pppd set the peer dns?

AUTOCFGFILES="no"               # By default this scripts will generate
                                # /etc/ppp/chat-isp, /etc/ppp/chap-secrets,
                                # /etc/ppp/pap-secrets and /etc/ppp/peers/isp
                                # automatically.  Set to "no" if you experience
                                # problems, or need specialized scripts.  You
                                # will have to create these files by hand then.

AUTOCHATSCRIPT="no"             # By default this script iwll generate
                                # /etc/ppp/chat-${PEER} automatically. Set to "no"
                                # if you experience problems, or need specialized
                                # scripts. You will have to create these files by
                                # hand then.


# Directory where the templates is stored
TEMPLATEDIR=/etc/ppp

Then have to manual edit two additional files /etc/ppp/chat-cdma and /etc/ppp/peers/cdma.

# /etc/ppp/chat-cdma:
'ABORT' 'BUSY'
'ABORT' 'ERROR'
'ABORT' 'NO ANSWER'
'ABORT' 'NO CARRIER'
'ABORT' 'NO DIALTONE'
'ABORT' 'Invalid Login'
'ABORT' 'Login incorrect'
'' 'ATZ'
'OK' 'ATDT#777'
'CONNECT' ''
'TIMEOUT' '5'
'~--' ''
# /etc/ppp/peers/cdma:
connect "/usr/sbin/chat -v -f /etc/ppp/chat-cdma"
defaultroute
usepeerdns
/dev/ttyACM0
230400
local
novj

Now everything is OK. To dialup the Internet simply type

etc/init.d/net.ppp0 start

The CDMA ISP is China Unicom.

If the above configurations does not fit for your situation try to search more information here.

Technorati Tags: , , , ,

Friday, November 18th, 2005 07:49pm

Comments

1 Comment | Add comment | TrackBack URI
Posted by bxy at January 11, 2006 2:28 pm

看不懂,不过我知道我需要用到这个的时候可以联系你 :)

我喜欢你这个放垃圾留言的图形的东西。因为上面的数字还是比较好辨认的。有的系统那个数字和字母我人眼都干不出来是什么。介绍一下吧。

不过它还是失误,就是我认为色盲用不了。还是对残障人士考虑的不够。


RSS feed for comments on this post.

Leave a comment

Or use your OpenID:

Google
 
Web erning.net