1

我想将嵌入式 linux 板连接到 Internet。在野猪上我有一个 cinterion 3G 调制解调器 (PH8)。

为此,我将 pppd 与以下 ph8 peers 文件一起使用:

/dev/ttyS2 115200
noauth
nodetach
lock 
local 
debug 
noipdefault 
netmask 255.255.255.0 
defaultroute 
lcp-echo-failure 4 
lcp-echo-interval 65535
connect" connect "/usr/local/sbin/chat -v -T my.APN.here -f /etc/ppp/chatscripts/ph8-connect"

我使用以下聊天脚本“ph8-connect”文件:

TIMEOUT 20
ABORT BUSY
#ABORT 'NO ANSWER'
ABORT "NO CARRIER"
ABORT VOICE
ABORT "NO DIALTONE"
ABORT 'ERROR'
"" 'ATZ'
#pas d'echo
"" 'ATE0'
OK 'AT+CGATT=0'
#activation du multiplexage
#OK 'AT+CMUX=0'
#passage en interface modem sur le lien serie
#OK 'AT^SDPORT=2'
OK 'AT+CGDCONT=101, "IP", "\T","0.0.0.0",0,0'
OK 'AT\^SCFG="GPRS/Auth",1'
OK 'AT+CGATT=1'
OK 'AT+CGACT=1,101'
ABORT 'NO CARRIER'
SAY 'Dialing...'
OK 'ATD*99***1#'
CONNECT

当我调用命令时:

/usr/local/sbin/pppd call ph8

我的 /var/log/messages 日志文件返回:

daemon.notice pppd[1168]: pppd 2.4.5 started by LOGIN, uid 0
local2.info chat[1171]: timeout set to 20 seconds
local2.info chat[1171]: abort on (BUSY)
local2.info chat[1171]: abort on (NO CARRIER)
local2.info chat[1171]: abort on (VOICE)
local2.info chat[1171]: abort on (NO DIALTONE)
local2.info chat[1171]: abort on (ERROR)
local2.info chat[1171]: send (ATZ^M)
local2.info chat[1171]: send (ATE0^M)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (AT+CGATT=0^M)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: ATE0^M^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (AT+CGDCONT=101, "IP", "ORANGE.M2M.SPEC","0.0.0.0",0,0^M)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: ^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (AT\^SCFG="GPRS/Auth",1^M)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: ^M
local2.info chat[1171]: ^SIS: 101,0,6002,"Unsolicited change of connection state"^M
local2.info chat[1171]: ^M
local2.info chat[1171]: ^SCFG: "GPRS/Auth","1"^M
local2.info chat[1171]: ^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (AT+CGATT=1^M)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: ^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (AT+CGACT=1,101^M)
local2.info chat[1171]: abort on (NO CARRIER)
local2.info chat[1171]: expect (OK)
local2.info chat[1171]: ^M
local2.info chat[1171]: ^M
local2.info chat[1171]: OK
local2.info chat[1171]:  -- got it
local2.info chat[1171]: send (ATD*99***1#^M)
local2.info chat[1171]: expect (CONNECT)
local2.info chat[1171]: ^M
local2.info chat[1171]: ^M
local2.info chat[1171]: CONNECT
local2.info chat[1171]:  -- got it
daemon.debug pppd[1168]: Script /usr/local/sbin/chat -v -T my.APN.here -f /etc/ppp/chatscripts/eu3e-connect finished (pid 1170), status = 0x0
daemon.info pppd[1168]: Serial connection established.
daemon.debug pppd[1168]: using channel 12
daemon.info pppd[1168]: Using interface ppp0
daemon.notice pppd[1168]: Connect: ppp0 <--> /dev/pts/3
daemon.debug pppd[1168]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x5878b56a> <pcomp> <accomp>]
daemon.debug pppd[1168]: rcvd [LCP ConfReq id=0x9 <asyncmap 0x0> <auth pap> <magic 0x497f954f> <pcomp> <accomp>]
daemon.debug pppd[1168]: No auth is possible
daemon.debug pppd[1168]: sent [LCP ConfRej id=0x9 <auth pap>]
daemon.debug pppd[1168]: rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0x5878b56a> <pcomp> <accomp>]
daemon.debug pppd[1168]: rcvd [LCP ConfReq id=0xa <asyncmap 0x0> <magic 0x497f954f> <pcomp> <accomp>]
daemon.debug pppd[1168]: sent [LCP ConfAck id=0xa <asyncmap 0x0> <magic 0x497f954f> <pcomp> <accomp>]
daemon.debug pppd[1168]: sent [LCP EchoReq id=0x0 magic=0x5878b56a]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: rcvd [LCP DiscReq id=0xb magic=0x497f954f]
daemon.debug pppd[1168]: rcvd [LCP EchoRep id=0x0 magic=0x497f954f 58 78 b5 6a]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.debug pppd[1168]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
daemon.warn pppd[1168]: IPCP: timeout sending Config-Requests
daemon.debug pppd[1168]: sent [LCP TermReq id=0x2 "No network protocols running"]
daemon.debug pppd[1168]: sent [LCP TermReq id=0x3 "No network protocols running"]
daemon.notice pppd[1168]: Connection terminated.
daemon.notice pppd[1168]: Modem hangup
daemon.debug pppd[1168]: Waiting for 1 child processes...
daemon.debug pppd[1168]:   script pppd (charshunt), pid 1169
daemon.debug pppd[1168]: Script pppd (charshunt) finished (pid 1169), status = 0x0
daemon.info pppd[1168]: Exit.

运行 ifconfig 时看不到 ppp0 行。如果我手动运行 ifup ppp0,会出现该行但没有写入 IP。我认为它错过了一些小东西,但我无法找到它。

我不知道这些产生超时的 IPCP ConfReq 是什么。

谢谢你的帮助

4

0 回答 0