|
我用的是lwip,目前对于大部分sim卡都可以正常登陆gprs,但是还是有部分卡无法登陆,卡是没有问题的,因为在别人的硬件上可以正常上网,只是不知道他用的是什么协议,下面是lwip进行ppp协商的过程,可以看到在lcp、pap都通过了之后,发送ipcp配置请求时却得到了lcp的链路中止请求,不知道这是为什么呢?
已经确定APN没有设置错误
lcp_init: xmit_accm=0 0 0 0
pppStartCB: unit 0
ppp_set_xaccm[0]: outACCM=0 0 0 0
ppp_send_config[0]: outACCM=FF FF FF FF
ppp_recv_config[0]: inACCM=0 0 0 0
lcp_lowerup: asyncmap=0 0 0 0
LCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED)
auth_reset: 0
lcp_addci: L opt=2 0
lcp_addci: L opt=5 52181044
lcp_addci: opt=7
lcp_addci: opt=8
pppWrite[0]: len=47
fsm_sdata(LCP): Sent code 1,1,20.
LCP: sending Configure-Request, id 1
LCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT)
Connect GPRS OK!
LCP: timeout resending Config-Request state=6 (LS_REQSENT)
lcp_addci: L opt=2 0
lcp_addci: L opt=5 52181044
lcp_addci: opt=7
lcp_addci: opt=8
pppWrite[0]: len=47
fsm_sdata(LCP): Sent code 1,1,20.
LCP: sending Configure-Request, id 1
PPP Data = [ 7E FF 7D 23 C0 21 7D 21 7D 23 7D 20 7D 39 7D 22 7D 26 7D 20 7D 2A 7D 20 7D 20 7D 27 7D 22 7D 28 7D 22 7D 25 7D 26 6A D4 A9 7D 2D 7D 23 7D 25 C2 23 7D 25 59 5A 7E 7E FF 7D 23 C0 21 7D 23 7D 21 7D 20 7D 2A 7D 22 7D 26 7D 20 7D 2A 7D 20 7D 20 6C 50 7E 7E FF 7D 23 C0 21 7D 23 7D 21 7D 20 7D 2A 7D 22 7D 26 7D 20 7D 2A 7D 20 7D 20 6C 50 7E ]
pppInProc[0]: got 112 bytes
pppInput[0]: LCP len=25
fsm_input(LCP):1,3,25
fsm_rconfreq(LCP): Rcvd id 3 state=6 (LS_REQSENT)
lcp_reqci: rcvd ASYNCMAP=A000 PCOMPRESSIO ACCOMPRESSIO MAGICNUMBER (6AD4A90D
lcp_reqci: Nak AUTHTYPE CHAP not allowed
lcp_reqci: returning CONFNAK.
pppWrite[0]: len=23
fsm_sdata(LCP): Sent code 3,3,8. pppInput[0]: LCP len=10
fsm_input(LCP):3,1,10
fsm_rconfnakrej(LCP): Rcvd id 1 state=6 (LS_REQSENT)
lcp_addci: L opt=2 A0000
lcp_addci: L opt=5 52181044
lcp_addci: opt=7
lcp_addci: opt=8
pppWrite[0]: len=47
fsm_sdata(LCP): Sent code 1,2,20.
LCP: sending Configure-Request, id 2
pppInput[0]: LCP len=10
fsm_input(LCP):3,1,10
fsm_rconfnakrej(LCP): Rcvd id 1 state=6 (LS_REQSENT)
PPP Data = [ 7E FF 7D 23 C0 21 7D 21 7D 25 7D 20 7D 38 7D 22 7D 26 7D 20 7D 2A 7D 20 7D 20 7D 27 7D 22 7D 28 7D 22 7D 25 7D 26 6A D4 A9 7D 2D 7D 23 7D 24 C0 23 DF 21 7E 7E FF 7D 23 C0 21 7D 22 7D 22 7D 20 7D 34 7D 22 7D 26 7D 20 7D 2A 7D 20 7D 20 7D 25 7D 26 52 7D 38 7D 30 44 7D 27 7D 22 7D 28 7D 22 7D 5D 7D 33 7E ]
pppInProc[0]: got 101 bytes
pppInput[0]: LCP len=24
fsm_input(LCP):1,5,24
fsm_rconfreq(LCP): Rcvd id 5 state=6 (LS_REQSENT)
lcp_reqci: rcvd ASYNCMAP=A000 PCOMPRESSIO ACCOMPRESSIO MAGICNUMBER (6AD4A90D
lcp_reqci: PAP (C023
lcp_reqci: returning CONFACK. pppWrite[0]: len=53
fsm_sdata(LCP): Sent code 2,5,24.
pppInput[0]: LCP len=20
fsm_input(LCP):2,2,20
fsm_rconfack(LCP): Rcvd id 2 state=8 (LS_ACKSENT)
lcp_acki: Ack
ppp_send_config[0]: outACCM=0 0 A 0
ppp_recv_config[0]: inACCM=0 0 A 0
link_established: 0
upap_lowerup: 0 s=0
IPCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED)
upap_authwithpeer: 0 user=%s password=%s s=1
pppWrite[0]: len=18
pap_sauth: Sent id 1
PPP Data = [ 7E C0 23 02 01 00 05 00 FD 30 7E ]
pppInProc[0]: got 11 bytes
pppInput[0]: PAP len=5
pap_rauthack: Rcvd id 1 s=3
Remote message: auth_withpeer_success: 0 proto=C023 <----- PAP成功了
pppWrite[0]: len=30
sio_write = [ 7E FF 03 80 21 01 01 00 16 03 06 00 00 00 00 81 06 00 00 00 00 83 06 00 00 00 00 6E DB 7E ]
fsm_sdata(IPCP): Sent code 1,1,22.
IPCP: sending Configure-Request, id 1 <----- 发送IPCP请求
IPCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT)
PPP Data = [ 7E ]
pppInProc[0]: got 1 bytes
PPP Data = [ FF 7D 23 C0 21 7D 25 7D 25 7D 20 7D 24 5C A4 7E ] <----- 得到的却是LCP!!
pppInProc[0]: got 16 bytes
pppInput[0]: LCP len=4
fsm_input(LCP):5,5,4
fsm_rtermreq(LCP): Rcvd id 5 state=9 (LS_OPENED)
LCP terminated by peer <----- 链路终止了
link_down: 0
upap_lowerdown: 0 s=4
IPCP: lowerdown state 6 (LS_REQSENT) -> 1 (LS_STARTING)
IPCP: close reason=LCP down state 1 (LS_STARTING) -> 0 (LS_INITIAL)
pppLinkDown: unit 0
pppMainWakeup: unit 0
ppp_send_config[0]: outACCM=FF FF FF FF
ppp_recv_config[0]: inACCM=0 0 A 0
pppWrite[0]: len=17
fsm_sdata(LCP): Sent code 6,5,4.
PPP Data = [ 7E ]
pppInProc[0]: got 1 bytes
PPP Data = [ FF 7D 23 C0 21 7D 25 7D 25 7D 20 7D 24 5C A4 7E ]
pppInProc[0]: got 16 bytes
pppInput[0]: LCP len=4
fsm_input(LCP):5,5,4
fsm_rtermreq(LCP): Rcvd id 5 state=5 (LS_STOPPING)
pppWrite[0]: len=17
fsm_sdata(LCP): Sent code 6,5,4.
upap_timeout: 0 timeout 6 expired s=0
PPP Data = [ 0D ]
pppInProc[0]: got 1 bytes
LCP: timeout sending Terminate-Request state=5 (LS_STOPPING)
link_terminated: 0
Connection terminated.
pppLinkTerminated: unit 0
pppMainWakeup: unit 0
pppMain: unit 0: PHASE_DEAD
|
|