2017-04-06 17:08 GMT+08:00 Axel Lin <[email protected]>: > Hi list, > My device sometimes got status_cb: err_code=PPPERR_CONNECT (Connection lost). > To reconnect, I call ppp_connect(pcb, 30); if got PPPERR_CONNECT but > it seems never success. > > Initially, I can connect to internet after boot. > I usually got below phases: > PPP_PHASE_DEAD > PPP_PHASE_INITIALIZE > PPP_PHASE_ESTABLISH > PPP_PHASE_AUTHENTICATE > PPP_PHASE_NETWORK > PPP_PHASE_RUNNING > > When I got PPPERR_CONNECT and calling ppp_connect(pcb, 30); > I always got > PPP_PHASE_HOLDOFF > PPP_PHASE_INITIALIZE > PPP_PHASE_ESTABLISH > PPP_PHASE_DISCONNECT > PPP_PHASE_DEAD > > It seems the PPP_PHASE_AUTHENTICATE is missed but I'm not sure if I > miss anything. > I'm mainly reference the doc/ppp.txt. > Should I also add ppp_set_auth() before calling ppp_connect() when got > PPPERR_CONNECT? It should be nothing to do with ppp_set_auth() because I don't set username/password at all.
I hit this again with PPP_DEBUG enabled, so add the log: Below is the log when I got connection lost if enable PPP_DEBUG: LCP terminated by peer ppp phase changed[0]: phase=9 sifvjcomp[0]: VJ compress enable=0 slot=0 max slot=0 sifdown[0]: err_code=0 NETIF: pp0 is UP IPV4: Host at 0.0.0.0 mask 255.255.255.255 gateway 10.64.64.64 ppp phase changed[0]: phase=6 pppos_send_config[0]: out_accm=FF FF FF FF ppp_send_config[0] pppos_recv_config[0]: in_accm=0 0 0 0 ppp_recv_config[0] ppp phase changed[0]: phase=12 Below is the log when booting... (for comparison). [17:17:56:292] ATD*99***1#␍␍␊ [17:17:56:294] CONNECT 115200␍␊ [17:17:56:294] @P0␍␍␊ [17:17:56:294] ppp_connect[0]: holdoff=0␍␊ [17:17:56:330] ppp phase changed[0]: phase=3␍␊ [17:17:56:330] pppos_connect: unit 0: connecting␍␊ [17:17:56:330] ppp_start[0]␍␊ [17:17:56:330] ppp phase changed[0]: phase=6 [17:17:56:330] pppos_send_config[0]: out_accm=FF FF FF FF␍␊ [17:17:56:330] ppp_send_config[0]␍␊ [17:17:56:330] pppos_recv_config[0]: in_accm=FF FF FF FF␍␊ [17:17:56:330] ppp_recv_config[0]␍␊ [17:17:56:330] ppp: auth protocols: PAP=1 CHAP=1 CHAP_MD5=1␍␊ [17:17:56:330] pppos_write[0]: len=24␍␊ [17:17:56:330] ppp_start[0]: finished␍pppos_input[0]: got 28 bytes␍␊ [17:17:56:356] ␊ [17:17:56:356] pppos_input[0]: got 71 bytes␍␊ [17:17:56:356] pppos_write[0]: len=29␍␊ [17:17:56:356] netif_set_mtu[0]: mtu=1500␍␊ [17:17:56:356] pppos_send_config[0]: out_accm=0 0 0 0␍␊ [17:17:56:370] ppp_send_config[0]␍␊ [17:17:56:370] pppos_recv_config[0]: in_accm=0 0 0 0␍␊ [17:17:56:370] ppp_recv_config[0]␍␊ [17:17:56:370] ppp phase changed[0]: phase=7 [17:17:56:370] pppos_input[0]: got 24 bytes␍␊ [17:17:56:384] pppos_input[0]: got 39 bytes␍␊ [17:17:56:384] No CHAP secret found for authenticating us to UMTS_CHAP_SRVR␍␊ [17:17:56:384] pppos_write[0]: len=25␍␊ [17:17:56:395] pppos_input[0]: got 10 bytes␍␊ [17:17:56:395] CHAP authentication succeeded␍␊ [17:17:56:405] CHAP authentication succeeded␍␊ [17:17:56:405] ppp phase changed[0]: phase=9 _______________________________________________ lwip-users mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/lwip-users
