我在Angstrom linux下使用portuxG20平台。设备收集数据并使用 3G 调制解调器通过 #g 网络将其发送到服务器。在 pppd 日志中我发现以下内容:
chat: Aug 05 20:05:23 CONNECT
Serial connection established.
using channel 28
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB_utps_modem
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xb3dc4361> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x6c <asyncmap 0x0> <auth chap MD5> <magic 0x14ad140> <pcomp> <accomp>]
No auth is possible
sent [LCP ConfRej id=0x6c <auth chap MD5>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xb3dc4361> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x6d <asyncmap 0x0> <magic 0x14ad140> <pcomp> <accomp>]
sent [LCP ConfAck id=0x6d <asyncmap 0x0> <magic 0x14ad140> <pcomp> <accomp>]
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [LCP DiscReq id=0x6e magic=0x14ad140]
rcvd [IPCP ConfNak id=0x1 <ms-dns1 10.11.12.13> <ms-dns3 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns3 10.11.12.14>]
rcvd [IPCP ConfNak id=0x2 <ms-dns1 10.11.12.13> <ms-dns3 10.11.12.14> <ms-wins 10.11.12.13> <ms-wins 10.11.12.14>]
sent [IPCP ConfReq id=0x3 <compress VJ 0f 01> <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns3 10.11.12.14>]
rcvd [IPCP ConfReq id=0x36]
sent [IPCP ConfNak id=0x36 <addr 0.0.0.0>]
rcvd [IPCP ConfRej id=0x3 <compress VJ 0f 01>]
sent [IPCP ConfReq id=0x4 <addr 0.0.0.0> <ms-dns1 10.11.12.13> <ms-dns3 10.11.12.14>]
rcvd [IPCP ConfReq id=0x37]
sent [IPCP ConfAck id=0x37]
rcvd [IPCP ConfNak id=0x4 <addr 10.21.23.245> <ms-dns1 10.74.210.210> <ms-dns3 10.74.210.211>]
sent [IPCP ConfReq id=0x5 <addr 10.21.23.245> <ms-dns1 10.74.210.210> <ms-dns3 10.74.210.211>]
rcvd [IPCP ConfAck id=0x5 <addr 10.21.23.245> <ms-dns1 10.74.210.210> <ms-dns3 10.74.210.211>]
Could not determine remote IP address: defaulting to 10.64.64.64
local IP address 10.21.23.245
remote IP address 10.64.64.64
primary DNS address 10.74.210.210
secondary DNS address 10.74.210.211
Script /etc/ppp/ip-up started (pid 8441)
Script /etc/ppp/ip-up finished (pid 8441), status = 0x0
sent [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15>]
rcvd [LCP ProtRej id=0x6f 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Connect script failed
Terminating on signal 15
Modem hangup
Connection terminated.
Connect script failed
Terminating on signal 15
Modem hangup
Connection terminated.
Connect script failed
Terminating on signal 15
Modem hangup
.
.
.
一段时间后,连接建立。我怎样才能找出为什么会发生这种情况以及问题的原因是什么?
我的提供者脚本如下所示:
debug
logfile /home/logs/pppd.log
user "vodafone"
connect "/usr/sbin/chat -v -f /home/scripts/chatscripts/pap"
/dev/ttyUSB_utps_modem
115200
noipdefault
usepeerdns
defaultroute
persist
noauth
我有一个脚本正在检查 ping 到 ntdp 服务器是否有效,如果无效,它会杀死 pppd 并进行新的调用(我不确定这是否是此类问题的正确方法,也许这会产生问题):
#!/bin/bash
source /home/scripts/isconnected
TTY="$(cat /home/scripts/.gsm_plugged)"
SERVER="0.de.pool.ntp.org"
sed s/isconnected=[0-9]/isconnected=0/ -i /home/scripts/isconnected
while [ -c $TTY ]
do
sleep 30
ping -c 10 $SERVER > /dev/null
if [ $? -ne 0 ] ; then
echo "ping failed"
echo "restarting"
pkill pppd
sleep 2
/usr/sbin/pppd call provider
sleep 10
ntpdate -s 0.de.pool.ntp.org
sed s/isconnected=[0-9]/isconnected=0/ -i /home/scripts/isconnected
else
sed s/isconnected=[0-9]/isconnected=1/ -i /home/scripts/isconnected
fi
done