free314 发表于 2008-5-26 21:28:01

求助:mp2530开发板pppd拨号问题

谢谢你关注!!!!

1首先交叉编译pppd源码包,生成拨号所需的程序pppd和chat
2 配置三个拨号脚本ppp-on,ppp-on-dialer,ppp-off
ppp-on

#!/bin/sh
#
# Script to initiate a ppp connection. This is the first part of the
# pair of scripts. This is not a secure pair of scripts as the codes
# are visible with the 'ps' command.However, it is simple.
#
# These are the parameters. Change as needed.
TELEPHONE=*99***1#      # The telephone number for the connection
ACCOUNT=                # The account name for logon (as in 'George Burns')
PASSWORD=               # The password for this account (and 'Gracie Allen')
LOCAL_IP=0.0.0.0      # Local IP address if known. Dynamic = 0.0.0.0
REMOTE_IP=0.0.0.0       # Remote IP address if desired. Normally 0.0.0.0
NETMASK=255.255.255.0   # The proper netmask if needed
#
# Export them so that they will be available at 'ppp-on-dialer' time.
export TELEPHONE ACCOUNT PASSWORD
#
# This is the location of the script which dials the phone and logs
# in.Please use the absolute file name as the $PATH variable is not
# used on the connect option.(To do so on a 'root' account would be
# a security hole so don't ask.)
#
DIALER_SCRIPT=/pppdial/ppp-on-dialer
#
# Initiate the connection
#
# I put most of the common options on this command. Please, don't
# forget the 'lock' option or some programs such as mgetty will not
# work. The asyncmap and escape will permit the PPP link to work with
# a telnet or rlogin connection. You are welcome to make any changes
# as desired. Don't use the 'defaultroute' option if you currently
# have a default route to an ethernet gateway.
#
exec /pppdial/pppd debug lock modem crtscts /dev/rfcomm0 115200 \
      asyncmap 20A0000 escape FF kdebug 7 $LOCAL_IP:$REMOTE_IP \
      noipdefault netmask $NETMASK defaultroute connect $DIALER_SCRIPT

ppp-on-dialer

#!/bin/sh
#
# This is part 2 of the ppp-on script. It will perform the connection
# protocol for the desired connection.
#
exec chat -v                                          \
      TIMEOUT         5                               \
      ABORT         '\nBUSY\r'                      \
      ABORT         '\nNO ANSWER\r'               \
      ABORT         '\nRINGING\r\n\r\nRINGING\r'    \
      ''            \rAT                            \
      'OK-+++\c-OK'   ATH0                            \
      TIMEOUT         30                              \
      OK            AT+IPR=115200                   \
      OK               AT+CGDCONT=1,'IP','CMNET'      \
      OK            ATDT$TELEPHONE                  \
      CONNECT         ''

ppp-off
略去
运行pppd-on
/var/log/message中显示如下:
Jan1 03:30:36 ATR daemon.notice pppd: pppd 2.4.1 started by root, uid 0
Jan1 03:30:37 ATR daemon.info hcid: link_key_request (sba=00:18:E4:0B:3E:B3, dba=00:17:84:0B:D0:7F)
Jan1 03:30:39 ATR local2.info chat: timeout set to 5 seconds
Jan1 03:30:39 ATR local2.info chat: abort on (\nBUSY\r)
Jan1 03:30:39 ATR local2.info chat: abort on (\nNO ANSWER\r)
Jan1 03:30:39 ATR local2.info chat: abort on (\nRINGING\r\n\r\nRINGING\r)
Jan1 03:30:39 ATR local2.info chat: send (rAT^M)
Jan1 03:30:39 ATR local2.info chat: expect (OK)
Jan1 03:30:39 ATR local2.info chat: rAT^M^M
Jan1 03:30:39 ATR local2.info chat: OK
Jan1 03:30:39 ATR local2.info chat:-- got it
Jan1 03:30:39 ATR local2.info chat: send (ATH0^M)
Jan1 03:30:39 ATR local2.info chat: timeout set to 30 seconds
Jan1 03:30:39 ATR local2.info chat: expect (OK)
Jan1 03:30:39 ATR local2.info chat: ^M
Jan1 03:30:39 ATR local2.info chat: ATH0^M^M
Jan1 03:30:39 ATR local2.info chat: OK
Jan1 03:30:39 ATR local2.info chat:-- got it
Jan1 03:30:39 ATR local2.info chat: send (AT+IPR=115200^M)
Jan1 03:30:39 ATR local2.info chat: expect (OK)
Jan1 03:30:39 ATR local2.info chat: ^M
Jan1 03:30:39 ATR local2.info chat: AT+IPR=115200^M^M
Jan1 03:30:39 ATR local2.info chat: OK
Jan1 03:30:39 ATR local2.info chat:-- got it
Jan1 03:30:39 ATR local2.info chat: send (AT+CGDCONT=1,IP,CMNET^M)
Jan1 03:30:40 ATR local2.info chat: expect (OK)
Jan1 03:30:40 ATR local2.info chat: ^M
Jan1 03:30:40 ATR local2.info chat: AT+CGDCONT=1,IP,CMNET^M^M
Jan1 03:30:40 ATR local2.info chat: OK
Jan1 03:30:40 ATR local2.info chat:-- got it
Jan1 03:30:40 ATR local2.info chat: send (ATDT*99***1#^M)
Jan1 03:30:40 ATR local2.info chat: expect (CONNECT)
Jan1 03:30:40 ATR local2.info chat: ^M
Jan1 03:30:40 ATR local2.info chat: ATDT*99***1#^M^M
Jan1 03:30:40 ATR local2.info chat: CONNECT
Jan1 03:30:40 ATR local2.info chat:-- got it
Jan1 03:30:40 ATR local2.info chat: send (^M)
Jan1 03:30:40 ATR daemon.info pppd: Serial connection established.
Jan1 03:30:40 ATR daemon.debug pppd: using channel 6
Jan1 03:30:40 ATR daemon.info pppd: Using interface ppp0
Jan1 03:30:41 ATR daemon.notice pppd: Connect: ppp0 <--> /dev/rfcomm0
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:42 ATR daemon.debug pppd: rcvd
Jan1 03:30:42 ATR daemon.debug pppd: rcvd
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:42 ATR daemon.debug pppd: rcvd
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:42 ATR daemon.debug pppd: rcvd
Jan1 03:30:42 ATR daemon.debug pppd: rcvd
Jan1 03:30:42 ATR daemon.debug pppd: sent
Jan1 03:30:45 ATR daemon.debug pppd: sent
问题就在这里,正常情况下要rcvd一个addr,不知道问题出在哪里了,望哪个高人不吝提点
Jan1 03:30:47 ATR daemon.info pppd: Hangup (SIGHUP)
Jan1 03:30:47 ATR daemon.notice pppd: Modem hangup
Jan1 03:30:47 ATR daemon.notice pppd: Connection terminated.
Jan1 03:30:48 ATR daemon.info pppd: Exit.

这个问题已经困扰我很长时间了,很郁闷啊,小弟在这里恳求大家了
PS:我是通过蓝牙设备利用蓝牙手机网络拨号上网的
QQ 6056991
页: [1]
查看完整版本: 求助:mp2530开发板pppd拨号问题