嵌入式 PPPD拨号脚本详解摘录
来源:互联网 发布:mac老系统在哪下载 编辑:程序博客网 时间:2024/05/20 02:55
ppp拨号脚本配置
一.问题提出
二.解决思路
和PPP连接关系密切的有两个脚本是chat和options两个脚本。其中,chat脚本是用来进行AT呼叫和控制的脚本,而options脚本就影响PPP连接的。
1.
""
OK
CONNECT
一个chat脚本都是由字符串对来组成的。前面的字符串都是期望获取的串,紧跟的是发送的字符串。这个脚本每一项的具体含义是这样的:
1)
2)
3)
TIMEOUT 10
如果要增加对特殊情况的处理,就加入下面字段:
这三行语句的意思是:如果收到字符串“BUSY”、“NO ANSWER”、“RINGING”就退出执行。
所以在考虑到各种特殊情况下,配置一个PPP连接的CHAT脚本就可以像下面这样:
TIMEOUT
ABORT
OK
CONNECT
2.OPTIONS脚本
OPTIONS脚本的内容,为PPP连接指定了连接使用的设备、使用的控制字符传输速率、指定了硬件加速、溢出控制等。
例如下面的options脚本:
ttyS0 ---- 指定连接使用的设备,例如:ttyS0、ttyS1等
57600 ---- 设置连接使用的控制字符传输速率,可以设置为57600、115200等
debug ---- 如果需要加入调试信息,就加入参数debug
logfile /var/ ppplog ---- 将连接过程中的信息输入到某个文件中
mtu 1500
-detach
noipdefault ---- 不使用默认IP就可以加入参数noipdefault
defaultroute
usepeerdns ---- 使用服务器端协商的DNS就可以设置参数usepeerdns
lcp-echo-failure 4 ---- 当连续4次没有收到发出的LCP回声请求时,就认为服务器端已不再响应,就退出执行。这里的失败次数可以灵活来决定。
-ccp ---- 不使用压缩控制协议
-vj ---- 关掉式IP头压缩
-chap ---- 不使用chap鉴权
-mschap-v2 ---- 不使用mschap鉴权
user
hide-password
connect "/usr/bin/chat -v -t6 -f /var/ chat" ---- 制定了要使用的chat脚本的位置。加上参数-v 告诉 chat命令将其所有的输出/入拷贝到系统记录里(通常是 /var/log/messages)。-t 6 指定了执行chat该命令的时间为6s。chat脚本的位置可以位于/etc/目录下,也可以位于/var下,这个可以更加需要灵活设置。
其他的参数具体含义可以参照参考PPPD2.4.4 中options.c中注释:
int
char
bool
int
3. 鉴权脚本
Username * password
4. PPP拨号过程与脚本之间的关系
这个过程是这样的:
三.实践情况
下面是FT282 上的PPP连接使用的OPTIONS、 CHAT和PAP-SECRETS脚本。
OPTIONS:
connect "/usr/bin/chat -v -t6 -f /var/ppp/td-scdma_chat"
ttyUSB0
115200
debug
logfile /var/log/ppplog
mtu 1500
-detach
noauth
noipdefault
defaultroute
usepeerdns
crtscts
lock
lcp-echo-failure 4
-ccp
-vj
-chap
-mschap-v2
user
hide-password
CHAT:
OK ATDT*98*1#
CONNECT ""
PAP-SECRETS:
经过在FT282上进行测试,发现能够顺利进行PPP连接。
常见问题:
1、3G/GSM connection returning "Connect script failed"
Q. I am running into an error when enabling the 3G dongle. I run this command -----> pppd nodetach call e160. And the output is:
Script /usr/sbin/chat -vf /etc/ppp/peers/e160_chat finished (pid 1843), status = 0x3
Connect script failed
A. "Connect script failed" is a generic error and can mean several things:
1. SIM card not detected, not attached to an active cell plan, or attached to a cell plan without 3G data service activated.
2. Weak cell signal - try moving the plug to another location, such as closer to a window. With a weaker signal you may need to run the "pppd nodetach..." command several times before it can lock onto a signal. If your 3G/GSM adapter has an external antenna port, consider attaching a GSM antenna to boost the signal.
3. Adapter not ready. Try waiting 1 minute after connecting the adapter before attempting to connect. Check dmesg to confirm the adapter is detected as a GSM device (Look for "usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0")
4. The GSM modem device on the adapter may be showing up as something besides /dev/ttyUSB0. Try changing to /dev/ttyUSB1 or /dev/ttyUSB2 in the config file /etc/ppp/peers/e160 (Look for the line "# Serial device to which the modem is connected").
- 嵌入式 PPPD拨号脚本详解摘录
- 嵌入式 PPPD工具实现3G拨号实践以及工具PPPD和CHAT详解摘录
- pppd拨号脚本配置
- pppd拨号脚本配置
- pppd拨号脚本配置
- pppd拨号脚本配置
- pppd 拨号脚本设置 拨号讲解
- Linux下pppd拨号脚本配置
- gprs模块下pppd拨号脚本
- PPPD拨号
- pppd 按需拨号 和 持续拨号 配置详解
- 嵌入式系统中通过pppd拨号后的dns设置
- Linux下pppd拨号脚本配置(转载)
- pppd拨号3G设备
- GPRS实现pppd拨号
- pppd拨号3G设备
- 嵌入式 hi3518c平台SIMCOM5360E型号3G模块移植使用PPPD拨号(待续)
- 嵌入式 hi3518c,3g-sincom5360e平台pppd成功拨号联通3G示例
- view 树的渲染过程
- 黑马程序员_Day01 __方法与数组
- scrollview+viewpaver组合时viewpaver高度设置和滑动冲突问题
- 2014蓝桥杯本科C/C++组预赛第9题<斐波那契>解题报告
- 【jQuery 事件】- isDefaultPrevented() 方法
- 嵌入式 PPPD拨号脚本详解摘录
- 管闲事的小明
- 双堆求中位数及C实现
- 多线程中的lua同步问题
- C/C++实现split分割字符串
- 引用
- 28027 SCI boot 例程【TI FAE分享】
- struts2拦截器
- The Google File System中文版附英文资源链接(上)