您的位置:首页 > 其它

wvdial 在 suse10.3 下 完成GPRS的配置

2009-01-09 21:55 555 查看
我们用的是极速行800,GPRS无线拨号上网
1.linux的内核在2.6以上已经有了cp2101-cp2102,能够支持其USB转串口的要求。具体操作:
a. 插上去应该能自动识别。可以用 dmesg来查看相应的硬件连接情况。
# dmesg
usb 3-2: USB disconnect, address 3
usb 6-2: new full speed USB device using uhci_hcd and address 3
usb 6-2: new device found, idVendor=10c4, idProduct=ea60
usb 6-2: new device strings: Mfr=1, Product=2, SerialNumber=3
usb 6-2: Product: CP2102 USB to UART Bridge Controller
usb 6-2: Manufacturer: Silicon Labs
usb 6-2: SerialNumber: 0001
usb 6-2: configuration #1 chosen from 1 choice
cp2101 6-2:1.0: cp2101 converter detected
usb 6-2: reset full speed USB device using uhci_hcd and address 3
usb 6-2: cp2101 converter now attached to ttyUSB0
可以看出 硬件已经挂载到 /dev/ttyUSB0上。

2.配置wvdial
#vi /etc/wvdial.conf


[Dialer Defaults]
Modem = /dev/ttyUSB0
Baud = 115200
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Init5 = AT+CGDCONT=1, "IP" "CMNET"
Area Code =
Phone = *99***1#
Username = CARD
Password = CARD
Ask Password = 0
Dial Command = ATDT
Stupid Mode = 1
Compuserve = 0
Force Address =
Idle Seconds = 300
DialMessage1 =
DialMessage2 =
ISDN = 0
Auto DNS = 1
FlowControl = Hardware (CRTSCTS)
SetVolume = 0
Modem Type = USB Modem
值得注意的地方是:

1.Init5 = AT+CGDCONT=1, "IP" "CMNET"
这句话一定要加,
AT+CGDCONT=1,"IP","CMNET"
1:表示使用第一种配置方案
IP:表示协议
CMNET:APN

否则出现的错误是
The PPP daemon has died: A modem hung up the phone (exit code = 16)
在/var/log/message中对应的信息是:
Jan 9 10:32:43 linux-xrl7 pppd[27961]: Plugin passwordfd.so loaded.
Jan 9 10:32:43 linux-xrl7 pppd[27961]: pppd 2.4.4 started by root, uid 0
Jan 9 10:32:43 linux-xrl7 pppd[27961]: Using interface ppp0
Jan 9 10:32:43 linux-xrl7 pppd[27961]: Connect: ppp0 <--> /dev/ttyUSB0
Jan 9 10:32:46 linux-xrl7 pppd[27961]: CHAP authentication succeeded
Jan 9 10:32:46 linux-xrl7 pppd[27961]: CHAP authentication succeeded
Jan 9 10:32:47 linux-xrl7 pppd[27961]: LCP terminated by peer (!)
Jan 9 10:32:49 linux-xrl7 pppd[27961]: Connection terminated.
Jan 9 10:32:49 linux-xrl7 pppd[27961]: Modem hangup
Jan 9 10:32:49 linux-xrl7 pppd[27961]: Exit.

2,Modem Type = USB Modem
这句也一定要加,否则出现:
--> pppd: [18][17][06][08]
--> Script /etc/ppp/ip-up run successful
--> Default route Ok.
--> warning, can't find address for `www.suse.de`
--> warning, address lookup does not work
--> Nameserver (DNS) failure, the connection may not work.
--> Connected... Press Ctrl-C to disconnect

中国地质大学机器人实验室Copyright 朱宇
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: