当前位置: 首页>編程日記>正文

PPP拨号调试记录

PPP拨号调试记录

一、工具准备
ppp拨号下载

https://download.samba.org/pub/ppp/ppp-2.4.7.tar.gz

gsmmuxd下载:
gsmmuxd是一个多路复用的开源协议,下面这个gsmmuxd的一些介绍。

https://blog.csdn.net/hanmengaidudu/article/details/52692238

gsmmuxd可以在github上下载,然后修改makefile之后进行交叉编译

https://github.com/ya-jeks/gsmmux

二、内核配置
linux配置如下
配置内核支持PPP
Device Drivers —>
[] Network device support —>
< > Universal TUN/TAP device driver support /
选中 /
< > PPP (point-to-point protocol) support /
选中 /
< > PPP BSD-Compress compression /
选中 /
< > PPP Deflate compression /
选中 /
[ ] PPP filtering /
选中 /
< > PPP MPPE compression (encryption) /
选中 /
[ ] PPP multilink support /
选中 /
< > PPP over Ethernet /
选中 /
< > PPP support for async serial ports /
选中 /
< > PPP support for sync tty ports /
选中 /
< > SLIP (serial line) support /
选中 /
[ ] CSLIP compressed headers /
选中 */

三、pppd交叉编译

cd /work/ppp-2.4.7
./configure
make CC=arm-none-linux-gcc

四、配置
4.1 将编译得到的pppd下的pppd,chat下的chat放入sbin并给予执行权限。
4.2 拨号上网需要的配置文件有3个:ppp-on 、ppp-off 、ppp-dial-on,这三个文件可以在 ppp-2.4.4/script 文件夹内找到,将其放入开发板中(根据需要放入任意位置)
修改ppp-on
可参考下面文章中的修改

https://blog.csdn.net/ysh1042436059/article/details/86665619

下面这篇文章对ppp-on中pppd拨号参数部分进行了比较详细的解释,可以参考一下
https://www.cnblogs.com/liushuhe1990/articles/11271119.html
我的参数如下在这里插入图片描述

exec /sbin/pppd debug logfile /dev/console lock modem -chap nocrtscts $PPP_TTY 115200 \asyncmap 0 escape FF kdebug 0 $LOCAL_IP:$REMOTE_IP \user $ACCOUNT password $PASSWORD noipdefault defaultroute  netmask $NETMASK defaultroute connect $DIALER_SCRIPT

ppp-dial-on也需要修改,下面标红的地方需要注意。

在这里插入图片描述
我的修改如下:

exec /sbin/ppp/chat -s -v						\TIMEOUT		6				\ABORT		'\nBUSY\r'			\ABORT		'\nNO ANSWER\r'			\ABORT		'\nRINGING\r\n\r\nRINGING\r'	\ABORT		'\n+CME ERROR: 100\r'			\''		AT				\'OK-+++\c-OK'	AT				\TIMEOUT		$PPP_ON_TIMEOUT		\OK 			AT+CGDCONT=1,\"IP\",\"CMNET\" \OK			ATDT$TELEPHONE			\CONNECT		''				\

到此修改完成,开始拨号测试,我使用的是有方的N720,卡为移动公网卡。中途出现了一些问题,但最后都算解决,能够拨号成功,ping通百度。

expect (OK)
AT^M^M
OK-- got itsend (AT^M)
timeout set to 20 seconds
expect (OK)
^M
AT^M^M
OK-- got itsend (AT+CGDCONT=1,"IP","CMNET"^M)
expect (OK)
^M
AT+CGDCONT=1,"IP","CMNET"^M^M
OK-- got itsend (ATDT*99***1#^M)
expect (CONNECT)
^M
ATDT*99***1#^M^M
CONNECT-- got itsend (^M)
Script /pemt/ppp/script/ppp-on-dialer finished (pid 502), status = 0x0
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS5
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x982ab88d> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb8170da2> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xb8170da2> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x982ab88d> <pcomp> <accomp>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <bsd v1 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
rcvd [LCP ProtRej id=0x2 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP TermAck id=0x1]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.0.1>]
sent [IPCP ConfAck id=0x1 <addr 192.168.0.1>]
rcvd [IPV6CP ConfReq id=0x1 <addr fe80::f860:8c5b:be82:1a55>]
Unsupported protocol 'IPv6 Control Protocol' (0x8057) received
sent [LCP ProtRej id=0x2 80 57 01 01 00 0e 01 0a f8 60 8c 5b be 82 1a 55]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x1 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x2 <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x2 <addr 10.54.208.255>]
sent [IPCP ConfReq id=0x3 <addr 10.54.208.255>]
rcvd [IPCP ConfAck id=0x3 <addr 10.54.208.255>]
local  IP address 10.54.208.255
remote IP address 192.168.0.1

ping 百度ip

root@123:/123/ppp/script# ping 220.181.38.251
PING 220.181.38.251 (220.181.38.251): 56 data bytes
64 bytes from 220.181.38.251: seq=0 ttl=47 time=285.367 ms
64 bytes from 220.181.38.251: seq=1 ttl=47 time=130.517 ms
64 bytes from 220.181.38.251: seq=2 ttl=47 time=118.967 ms

ping 网址

root@123:/123/ppp/script# 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=44 time=79.350 ms
64 bytes from 103.235.46.39: seq=1 ttl=43 time=97.516 ms
64 bytes from 103.235.46.39: seq=2 ttl=43 time=89.816 ms

问题记录:
1.拨号失败

send (AT+CGDCONT=1,"IP","CMNET"^M)
timeout set to 20 seconds
expect (OK)
^M
AT+CGDCONT=1,"IP","CMNET"^M^M
OK-- got itsend (ATDT*99***1#^M)
expect (CONNECT)
^M
ATDT*99***1#^M^M
ERROR^M

解决办法:
在ppp-dial-on中,chat中增加下面一条。
OK AT+CGDCONT=1,“IP”,“CMNET”
2.无法ping通baidu域名
在/etc中创建resolv.conf文件,添加下面一条语句,然后重启网络。重新拨号之后,即可ping百度域名

nameserver 8.8.8.8

ps:gsmMuxd 的使用方法
参数的意义如下:
把真是串口ttyS3 虚拟出波特率为115200,类型类似/dev/mux的两个虚拟串口,分别为/dev/mux0 /dev/mux1
gsmMuxd -p /dev/ttyS3 -w -b 115200 -s /dev/mux /dev/ptmx /dev/ptmx

 options:-p <serport>        : Serial port device to connect to [/dev/modem]-f <framsize>       : Maximum frame size [32]-d                  : Debug mode, don't fork-m <modem>          : Modem (mc35, mc75, generic, ...)-b <baudrate>       : MUX mode baudrate (0,9600,14400, ...)-P <PIN-code>       : PIN code to fed to the modem-s <symlink-prefix> : Prefix for the symlinks of slave devices (e.g./dev/mux)-w                  : Wait for deamon startup success/failure-h                  : Show this help message


https://www.fengoutiyan.com/post/13362.html

相关文章:

  • 调试记录需要哪里签字盖章
  • 设备试运行调试记录表
  • pppoe拨号流程中第一步为客户端
  • 拨号键隐藏功能
  • ppp拨号
  • 紧急拨号绕过解锁
  • 拨号键不见了怎么恢复
  • 交换机调试记录
  • 鏡像模式如何設置在哪,圖片鏡像操作
  • 什么軟件可以把圖片鏡像翻轉,C#圖片處理 解決左右鏡像相反(旋轉圖片)
  • 手機照片鏡像翻轉,C#圖像鏡像
  • 視頻鏡像翻轉軟件,python圖片鏡像翻轉_python中鏡像實現方法
  • 什么軟件可以把圖片鏡像翻轉,利用PS實現圖片的鏡像處理
  • 照片鏡像翻轉app,java實現圖片鏡像翻轉
  • 什么軟件可以把圖片鏡像翻轉,python圖片鏡像翻轉_python圖像處理之鏡像實現方法
  • matlab下載,matlab如何鏡像處理圖片,matlab實現圖像鏡像
  • 圖片鏡像翻轉,MATLAB:鏡像圖片
  • 鏡像翻轉圖片的軟件,圖像處理:實現圖片鏡像(基于python)
  • canvas可畫,JavaScript - canvas - 鏡像圖片
  • 圖片鏡像翻轉,UGUI優化:使用鏡像圖片
  • Codeforces,CodeForces 1253C
  • MySQL下載安裝,Mysql ERROR: 1253 解決方法
  • 勝利大逃亡英雄逃亡方案,HDU - 1253 勝利大逃亡 BFS
  • 大一c語言期末考試試題及答案匯總,電大計算機C語言1253,1253《C語言程序設計》電大期末精彩試題及其問題詳解
  • lu求解線性方程組,P1253 [yLOI2018] 扶蘇的問題 (線段樹)
  • c語言程序設計基礎題庫,1253號C語言程序設計試題,2016年1月試卷號1253C語言程序設計A.pdf
  • 信奧賽一本通官網,【信奧賽一本通】1253:抓住那頭牛(詳細代碼)
  • c語言程序設計1253,1253c語言程序設計a(2010年1月)
  • 勝利大逃亡英雄逃亡方案,BFS——1253 勝利大逃亡
  • 直流電壓測量模塊,IM1253B交直流電能計量模塊(艾銳達光電)
  • c語言程序設計第三版課后答案,【渝粵題庫】國家開放大學2021春1253C語言程序設計答案
  • 18轉換為二進制,1253. 將數字轉換為16進制
  • light-emitting diode,LightOJ-1253 Misere Nim
  • masterroyale魔改版,1253 Dungeon Master
  • codeformer官網中文版,codeforces.1253 B
  • c語言程序設計考研真題及答案,2020C語言程序設計1253,1253計算機科學與技術專業C語言程序設計A科目2020年09月國家開 放大學(中央廣播電視大學)
  • c語言程序設計基礎題庫,1253本科2016c語言程序設計試題,1253電大《C語言程序設計A》試題和答案200901
  • 肇事逃逸車輛無法聯系到車主怎么辦,1253尋找肇事司機