昨天把开发板的
bootloader
删了
,
没办法
,
只得在
PC
上调
GPRS
拨号了
.
先在
windows
下拨号成功
,
然后用工具看拨号时具体使用了哪些
AT
命令
,
再使用这些命令到
linux
下使用
pppd
来拨号
,
最后终于成功了
,
之前开发板上不能成功拨号极有可就是
AT
指令有问题
,
现在只有等开发板回来后再到
ARM7
上调了
.
下面贴一下拨号使用的几个脚本 ,GPRS 模块是使用的华为的 GTM900-B: 1, /etc/ppp/peers/gprs:
复制内容到剪贴板
代码:
#/etc/ppp/peers/gprs
# This is pppd script for China Mobile, used Huawei GTM900-B GPRS Module # Usage: root>pppd call gprs /dev/ttyS0 19200 crtscts modem #noauth debug nodetach #hide-password usepeerdns noipdefault defaultroute user "cmnet" 0.0.0.0:0.0.0.0 #ipcp-accept-local #ipcp-accept-remote #lcp-echo-failure 12 #lcp-echo-interval 3 #noccp #novj #novjccomp #persist connect '/usr/sbin/chat -s -v -f /etc/ppp/gprs-connect-chat' #connect '/bin/chat -v -s -f /etc/ppp/gprs-connect-chat' #disconnect '/bin/chat -v -f /etc/ppp/gprs-disconnect-chat'
2, gprs-connect-chat:
复制内容到剪贴板
代码:
#/etc/ppp/gprs-connect-chat
# chat script for China Mobile, used HuaWei GTM900-B GPRS module. TIMEOUT 15 ABORT "DELAYED" ABORT "BUSY" ABORT "ERROR" ABORT "NO DIALTONE" ABORT "NO CARRIER" TIMEOUT 40 '' \rAT OK ATS0=0 OK ATE0V1 OK AT+CGDCONT=1,"IP","CMNET" OK ATDT*99***1# CONNECT ''
3,
用于
chap
认证的密码文件
:chap-secrets,
由于移动的
GPRS
服务不需要用户名和密码
,
所以刚开始没设用户名和密码
,
结果在
chap
认证的时候总不能通过
.
后来在
gprs
里添加
user "cmnet"
和这个密码文件后就
OK
了
.
复制内容到剪贴板
代码:
#/etc/ppp/chap-secrets
#client server secret IP address "cmnet" * "cmnet" *
4,
另外还有个可选的
,
断开连接的脚本如下
:
复制内容到剪贴板
代码:
ABORT OK
ABORT BUSY ABORT DELAYED ABORT "NO ANSWER" ABORT "NO CARRIER" ABORT "NO DIALTONE" ABORT VOICE ABORT ERROR ABORT RINGING TIMEOUT 12 "" \\k\\k\\k\\d+++ATH "
使用
:
将
PC
上的
DNS
删掉后运行如下
: [root@localhost ppp]# pppd call gprs timeout set to 15 seconds abort on (DELAYED) abort on (BUSY) abort on (ERROR) abort on (NO DIALTONE) abort on (NO CARRIER) timeout set to 40 seconds send (^MAT^M) expect (OK) ^M^M OK -- got it send (ATS0=0^M) expect (OK) ^M AT^M OK -- got it send (ATE0V1^M) expect (OK) ^M ATS0=0^M^M OK -- got it send (AT+CGDCONT=1,"IP","CMNET"^M) expect (OK) ^M ATE0V1^M^M OK -- got it send (ATDT*99***1#^M) expect (CONNECT) ^M ^M OK^M ^M CONNECT -- got it send (^M) Serial connection established. using channel 42 Using interface ppp0 Connect: ppp0 <--> /dev/ttyS0 sent [LCP ConfReq id=0x1 rcvd [LCP ConfRej id=0x1 sent [LCP ConfReq id=0x2 rcvd [LCP ConfAck id=0x2 rcvd [LCP ConfReq id=0x1 sent [LCP ConfAck id=0x1 rcvd [CHAP Challenge id=0x1 sent [CHAP Response id=0x1 <2c757eac52b8d9a7d80ca7a77c419ad9>, name = "cmnet"] rcvd [CHAP Success id=0x1 ""] CHAP authentication succeeded sent [CCP ConfReq id=0x1 sent [IPCP ConfReq id=0x1 rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00] rcvd [IPCP ConfReq id=0x1 sent [IPCP ConfAck id=0x1 rcvd [IPCP ConfRej id=0x1 sent [IPCP ConfReq id=0x2 rcvd [IPCP ConfNak id=0x2 sent [IPCP ConfReq id=0x3 rcvd [IPCP ConfAck id=0x3 local IP address 10.165.226.25 remote IP address 221.177.160.163 primary DNS address 211.137.64.163 secondary DNS address 211.136.20.203 有 IP, 网关 ,DNS 之后就能上 www.mcuos.com了.... [ 本帖最后由 dglwx 于 2008-6-19 14:37 编辑 ] |
|
可用积分:
490
分
专家积分:
0
分
培训积分:
0
分
管理积分:
0
分
查看详细资料
|
|