下了个ppp源码编译 gprs拨号 问题记录

昨天从ftp://ftp.samba.org/pub/ppp/ppp-2.4.5.tar.gz下了ppp2.4.5的源码,编译出来的chat和pppd程序在板端运行后出现这样的错误:

1、./pppd: line 1: syntax error: "(" unexpected


百度了下说是编译器的问题,但是不知道怎么指定编译器啊。

解决了:在make的时候加上

make CC=arm-arago-linux-gnueabi-gcc AR=arm-arago-linux-gnueabi-ar

2、

Couldn't open the /dev/ppp device: No such file or directory
./pppd: You need to create the /dev/ppp device node by
executing the following command as root:
        mknod /dev/ppp c 108 0

root@am37x-evm:/etc/ppp# mknod /dev/ppp c 108 0

3、

root@am37x-evm:/etc/ppp# ./pppd
Couldn't open the /dev/ppp device: No such device or address
./pppd: Please load the ppp_generic kernel module.

重新配置内核支持ppp device driver--networkdevice--ppp

进入Linux内核目录,执行#make menuconfig
Network Device Support à
       <*> PPP (point-to-point protocol) support
       [*]   PPP multilink support
       <*> PPP support for async serial ports
       <*> PPP support for sync tty ports
       <*> SLIP (serial line) support
       [*]   CSLIP compressed headers

4.采用pppd call gprsoptions 的方式一直没成功,拨号时用示波器检测发现串口信号根本没有变化,折腾了几天无意中试了下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= #george # The account name for logon (as in 'George Burns')
PASSWORD= #gracie # 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=/etc/ppp/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 /usr/sbin/pppd debug lock modem nocrtscts /dev/ttyS1 115200\
asyncmap 20A0000 escape FF kdebug 0 $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' \
''               AT+CGDCONT=1,"IP","CMNET"      \
'' \rAT                            \
'OK-+++\c-OK' ATH0 \
TIMEOUT 30 \
OK ATDT$TELEPHONE \
CONNECT '' \
#ogin:--ogin: $ACCOUNT \
#assword: $PASSWORD

ppp-off

#!/bin/sh
######################################################################
#
# Determine the device to be terminated.
#
if [ "$1" = "" ]; then
DEVICE=ppp0
else
DEVICE=$1
fi


######################################################################
#
# If the ppp0 pid file is present then the program is running. Stop it.
if [ -r /var/run/$DEVICE.pid ]; then
        kill -INT `cat /var/run/$DEVICE.pid`
#
# If the kill did not work then there is no process running for this
# pid. It may also mean that the lock file will be left. You may wish
# to delete the lock file at the same time.
        if [ ! "$?" = "0" ]; then
                rm -f /var/run/$DEVICE.pid
                echo "ERROR: Removed stale pid file"
                exit 1
        fi
#
# Success. Let pppd clean up its own junk.
        echo "PPP link to $DEVICE terminated."
        exit 0
fi
#
# The ppp process is not running for ppp0
echo "ERROR: PPP link is not active on $DEVICE"
exit 1



 

 

 

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值