------------------------------------------------------------------------------------------------------------------------------

交叉编译器:arm-linux-gcc-4.5.4

Linux内核版本:Linux-3.0

主机操作系统:Centos 6.5

开发板:FL2440

GPRS:SIM900A

在开发SIM900模块之前,开发板已经加载了linux内核以及文件系统,并且开发板串口已经使能。并且一定要注意的是:要有一张没有欠费的电话卡!不要笑,这是个很严肃的问题!

------------------------------------------------------------------------------------------------------------------------------

所需源码:

ppp-2.4.4.tar.gz  http://download.chinaunix.net/download.php?id=35208&ResourceID=8334

注:个人觉得这是一个比较典型又比较简单的移植问题。

大体步骤:添加内核ppp上网的支持-->编译ppp-2.4.4生成一些可执行文件(pppd, chat, pppdump, pppstats)放到开发板的/usr/sbin/目录下-->将可执行脚本放在开发板的指定位置(/etc/ppp/peers/gprs, /etc/ppp/chat-gprs-connect),并执行pppd命令。

一、添加内核支持

Linux-3.0以上的版本中,rt3070的驱动已经加入了内核源码中去了,本篇用的是Linux-3.0的内核,只需要在内核的make menuconfig中选择ppp上网的支持就可以了。

修改如下:

Device Drivers --->
  [*] Network device support --->
    <*> PPP (point-to-point protocol) support
    [*] PPP multilink support (EXPERIMENTAL)
    <*> PPP support for async serial ports
    <*> PPP support for sync tty ports
    <*> SLIP (serial line) support
    [*] CSLIP compressed headers

二、编译ppp-2.4.4

# tar -xzf  ppp-2.4.4.tar.gz

# ./configure

# make CC=/opt/buildroot-2012.08/arm920t/usr/bin/arm-linux-gcc (交叉编译器)

如果编译成功,则会在pppd, chat, pppdump, pppstats下分别生成可执行程序pppd, chat, pppdump, pppstats。将其拷贝到开发板的/usr/sbin目录下。

三、开发板的配置

# vi /etc/ppp/peers/gprs

 # Usage: root>pppd call gprs

 #set seriral
/dev/ttyS1 # set baudrate # set flowdate
nocrtscts connect '/usr/sbin/chat -v -f /etc/ppp/gprs-connect-chat' #set debug ,send message to /var/log/messages
debug #To keep pppd on the terminal
nodetach #hide-password # Accept the peer's idea of our local IP address
ipcp-accept-local
# Accept the peer's idea of its (remote) IP address
ipcp-accept-remote #dial up connetion as the default route
defaultroute usepeerdns

# vi /etc/ppp/chat-gprs-connect

 #Copyright (c)  guanlei @qq.com
# This is second part of the ppp dial script. It will perform the connection
#
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'NO CARRIER'
ABORT 'NO DIALTONE'
ABORT 'ERROR'
ABORT '\nRING\r\n\r\nRING\r'
TIMEOUT
'' \rAT
#set apn
OK AT+CGDCONT=,"IP","cmnet"
# ............
OK ATDT****# //这里要改成相应的运行商的设置
SAY " + requesting data connection\n"
CONNECT ''
SAY " + connected\n"

使能pppd:

# pppd call gprs &  (&表示后台运行)

配置完就可以了,现在可以测试一下上网功能了:

# ping www.baidu.com

PING www.baidu.com (103.235.46.39): 56 data bytes

64 bytes from 103.235.46.39: seq=0 ttl=48 time=555.719 ms

64 bytes from 103.235.46.39: seq=1 ttl=48 time=273.481 ms

--- www.baidu.com ping statistics ---

3 packets transmitted, 2 packets received, 33% packet loss

round-trip min/avg/max = 273.481/414.600/555.719 ms

# ifconfig

ppp0      Link encap:Point-to-Point Protocol

inet addr:10.110.1.110  P-t-P:192.200.1.21  Mask:255.255.255.255

UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

RX packets:10 errors:0 dropped:0 overruns:0 frame:0

TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:3

RX bytes:686 (686.0 B)  TX bytes:557 (557.0 B)

linux下GPRS模块ppp拨号上网的更多相关文章

  1. sim900GPRS模块ppp拨号上网

    --------------------------------------------- 主机操作系统:Centos 6.5 交叉编译器环境:arm-linux-gcc-4.5.4 开发板平台: F ...

  2. Linux下EC20实现ppp拨号(转)

    源: Linux下EC20实现ppp拨号 参考: 4g模块EC20+android6.0系统移植 OK6410开发板调试EC20通信模块 海思3531添加移远EC20 4g模块 将移远通信的EC20驱 ...

  3. 在ARM-linux上实现4G模块PPP拨号上网【转】

    本文转载自:http://blog.csdn.net/zqixiao_09/article/details/52540887 在ARM平台上实现4G模块的PPP拨号上网,参考网上的资料和自己的理解,从 ...

  4. linux下GPRS模块的应用程序

    ---------------------------------------------------------------------------------------------------- ...

  5. linux下GPRS模块使用AT命令实现拨接电话,发中英文短信

    开发板           :fl2440 cpu                :  s3c2440(arm9) 开发模块       :A7(GPRS/GPS) 远程登陆软件:PUTTY **** ...

  6. linux下利用mentohust校园拨号上网小记

    mentohust下载地址 :http://code.google.com/p/mentohust/downloads/list 安装就不多说了,我是在kali系统下使用的,经测试只有32为的可以使用 ...

  7. GPRS模块在Linux平台上ppp拨号上网总结与心得

    linux平台的ppp拨号上网,(注明:这里只谈命令行拨号,用linux就要习惯和熟练使用命令行) 在网上常见的有三种方式:1.使用智能的ppp拨号软件wvdial:参考案例:本博客的<使用wv ...

  8. 树莓派实现SIM868 ppp拨号上网

    环境:raspbian-stretch(2018-06-27) 树莓派:3代B型 SIM868模块具有GPRS数据传输功能(2G网络),但是模块是通过AT指令控制的,在树莓派上用AT指令控制会非常不方 ...

  9. SIM7600CE TCP/IP连接与PPP拨号上网 4G上网

    SIM7600CE联网测试分为两部分: 1.TCP/IP连接 2.PPP拨号上网 实验环境:ubuntu-meta 16.04 硬件:树莓派3B,SIM7600CE 上网卡:移动的NB-IOT物联网卡 ...

随机推荐

  1. java List排序 顺序 倒序 随机

    List list = new LinkedList(); for ( int i = 0 ; i < 9 ; i ++ ) { list.add( " a " + i); ...

  2. CSS3动画(重要)

    CSS3 动画 CSS3,我们可以创建动画,它可以取代许多网页动画图像,Flash动画,和JAVAScripts. CSS3 @keyframes 规则 要创建CSS3动画,你将不得不了解@keyfr ...

  3. redis有string,hash,list,sets.zsets几种数据类型

    1.string数据类型 可包含任何数据,是二进制安全的,比如图片或者序列化的对象set key valueset name hkset age 20get name 得到"hk" ...

  4. [转载]Go的50度灰:Golang新开发者要注意的陷阱和常见错误

    初级 开大括号不能放在单独的一行 未使用的变量 未使用的Imports 简式的变量声明仅可以在函数内部使用 使用简式声明重复声明变量 偶然的变量隐藏Accidental Variable Shadow ...

  5. python模块之os.path

    对文件路径的操作 os.path.split(p)函数返回一个路径的目录名和文件名. os.path.splitext():分离文件名与扩展名 os.path.isfile()和os.path.isd ...

  6. 在什么情况下Java比C++快?

    转载   http://www.importnew.com/16056.html

  7. python 执行顺序

    从上往下顺序执行,定义的方法和类要写在调用之前, 如果有 if __name__ == '__main__'   改方法所在的文件作为启动文件时会被调用,如果作为模块被调用时不会被执行.

  8. 模板—数学—Lucas

    模板—数学—Lucas Code: #include <cstdio> #include <algorithm> using namespace std; #define N ...

  9. sed replace HEX sequence in your binary file:

    Here is how to replace a HEX sequence in your binary file: $ sed 's/\x0D\x4D\x53\x48/\x0D\x0A\x4D\x5 ...

  10. [CF735E/736C]Ostap and Tree

    题目大意: 一个$n(n\le100)$个点的树,将一些点染成黑点,求满足每个点到最近黑点的距离$\le k(k\le\min(20,n-1))$的方案数. 思路: 树形DP. 用$f[i][j]$表 ...