MY-I.MX6 评估板 开发指导手册 3G模块(MU609)
内核配置(kernel configuration)
提示:内核配置对3G模块的支持在《MY-I.MX6 V2.5 Linux编译手册》中已经完成。
tips:3G module supported by kernel configuration was described in《MY-I.MX6 V2.5 Linux compilation manual》。
编译ppp(compife ppp)
准备源码(prepare source code)
下载源码包(download source code package)
从网盘下载ppp-2.4.4.tar.gz,路径为MY-I.MX6 V2.5/04_模块/3G_MU609。
download ppp-2.4.4.tar.gz from network disk,path is MY-I.MX6 V2.5/04_ module/3G_MU609。
创建并进入3G工作目录(create and enter 3G working directory)
$ mkdir ~/MY-I.MX6/3G/
$ cd ~/MY-I.MX6/3G/
解压源码包(decompress source code package)
- 将ppp源码包复制到工作目录
copy ppp source code packge to working directory
- 解压源码包
decompress source code package
$ tar zxf ppp-2.4.4.tar.gz
编译(compilation)
- 进入源码目录
enter source code directory
$ cd ppp-2.4.4/
生成配置文件(created configruation file)
$ ./configure
编译源码(compife source code)
- 使MY-I.MX6配置文件生效
make MY-I.MX6 configuration file valid
$ source ~/MY-I.MX6/my-imx6_build.conf
- 编译
compilation
$ make CC=${CROSS_COMPILE}gcc
目标文件(target file)
编译完成后即可得到pppd和chat,这两个文件即我们的目标文件。
pppd and chat can be gained after compilation is finished,which are our target files。
pppd 路径: pppd/pppd
pppd path: pppd/pppd
chat路径: chat/chat
chat path: chat/chat
打包文件系统(package file system)
准备应用程序(prepare application)
- 将目标文件复制到文件系统中的usr/sbin目录里
copy target file to usr/sbin directory in file system
$ cp pppd/pppd ~/MY-I.MX6/rootfs/usr/sbin
$ cp chat/chat ~/MY-I.MX6/rootfs/usr/sbin
- 进入文件系统目录
enter file system directory
$ cd ~/MY-I.MX6/rootfs
- 创建拨号脚本目录
create dialing script directory
$ mkdir etc/ppp/peers/ –p
创建脚本(create script)
wcdma
在etc/ppp/peers/下创文件wcdma并写入以下内容
create file of wcdma and write in below contents under etc/ppp/peers/
nodetach
lock
/dev/ttyUSB0
115200
user "card"
password "card"
crtscts
show-password
usepeerdns
noauth
noipdefault
novj
novjccomp
noccp
defaultroute
ipcp-accept-local
ipcp-accept-remote
connect '/usr/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-connect'
disconnect '/usr/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-disconnect'
wcdma-chat-connect
在etc/ppp/peers/下创文件wcdma-chat-connect并写入以下内容
create file of wcdma-chat-connect and write in below contents under etc/ppp/peers/
ABORT 'NO CARRIER'
ABORT 'ERROR'
ABORT 'NO DIALTONE'
ABORT 'BUSY'
ABORT 'NO ANSWER'
\rAT
OK \rATZ
OK \rAT+CGDCONT=1,"IP","3gnet",,0,0
OK-AT-OK ATDT*99#
CONNECT \d\c
wcdma-chat-disconnect
在etc/ppp/peers/下创文件wcdma-chat-disconnect并写入以下内容
create file of wcdma-chat-disconnect and write in below contents etc/ppp/peers/
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"\K"
"+++ATH"
SAY "\nGoodbay\n"
打包文件系统(package file system)
$ tar cjf ../rootfs.tar.bz2 *
3G模块测试(3G module test)
启动开发板,执行下面的命令:
start up development board,execute below command:
$ pppd call wcdma &