1st
vi overlay/usr/local/bin/install_pppd.sh
#!/bin/sh
echo -e "\033[31m Staring install gcc ...... \033[0m"
sudo apt-get update
sudo apt-get install gcc automake autoconf libtool make
tar -xvf ppp-2.4.7.tar.gz
cd ppp-2.4.7/
./configure
make -j2
make install
echo -e "\033[31m Staring install pppd ...... \033[0m"
2st
add file overlay/usr/local/bin/ppp-2.4.7.tar.gz
3st
vi overlay/etc/ppp/peers/clm920
#add by jiangdou for CLM920-cn5 _LTE_4G
## Usage:root>pppd call wcdma
## Hide password in debug messages
hide-password
## The phone is not required to authenticate
noauth
## The chat script (be sure to edit that file,too!)
connect '/usr/local/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-connect' #制定了要使用的chat脚本的位置。加上参数-v 告诉 chat命令将其所有的输出/入拷贝到系统记录里(通常是 /var/log/messages)。
## The close script(be sure to edit that file,too!)
disconnect '/usr/local/sbin/chat -s -v -f /etc/ppp/peers/wcdma-chat-disconnect'
## Debug info from pppd
debug #加入调试信息
## Serial Device to which the HSPDA phone is connected
/dev/ttyUSB3 #指定连接使用的设备
## Serial port line speed
115200 #设置连接使用的控制字符传输速率
## If you want to use the HSDPA link as your gateway
defaultroute #使用默认线路
## pppd must not propose any IP address to the peer
noipdefault #不使用默认IP就可以加入参数noipdefault
## No ppp compression
novj
novjccomp
noccp
ipcp-accept-local #要求peer也就是isp给自己分配动态的IP地址
ipcp-accept-remote
local
## For sanity, keep a lock on the serial line
lock #则创建一个锁定文件,其他程序在发现存在这个文件后,就能得知相应的串口已经被使用。
dump
## Keep pppd attached to the terminal
## Comment this to get daemon mode pppd
nodetach
user
password
## Hardware flow control
crtscts #告诉ppp使用modem的硬件流量控制
remotename 3gppp
ipparam 3gppp
## Ask the peer for up to 2 DNS server addresses
usepeerdns #使用服务器端协商的DNS
4st
vi overlay/etc/ppp/peers/wcdma-chat-connect
#add by jiangdou for CLM920-cn5 _LTE_4G
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "NO DIALTONE"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 120
"" AT
OK \rATZ
# Connection to the network
OK \rAT+CGDCONT=1,"IP","3gnet",,0,0
# Dial the number
OK-AT-OK ATDT*99#
CONNECT \d\c
5st
vi overlay/etc/ppp/peers/wcdma-chat-disconnect
#add by jiangdou for CLM920-cn5 _LTE_4G
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\NSending break to the modem\n"
""\k"
""+++ATH"
SAY "\nGood bay\n"
6st starting system boot pppd
#!/bin/sh
#add by jiangdou for CLM920-cn5 _LTE_4G
#add for usb2
echo 1254 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio1254/direction
echo 1 >/sys/class/gpio/gpio1254/value
#for 3G_power
echo 1017 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio1017/direction
echo 1 >/sys/class/gpio/gpio1017/value
sleep 25
pppd call clm920 &
7st