Open ezamp opened 3 weeks ago
Hi @ezamp
Could you please enable CONFIG_LWIP_PPP_DEBUG_ON
and share the log for us to check the IPCP negotiation?
Hi @david-cermak
Thanks for your reply, I enabled _CONFIG_LWIP_PPP_DEBUGON but I don't see difference in the log. Now the log level is configured to DEBUG.
Log:
[...]
I (683) test: End setup
D (693) esp_netif_lwip: check: remote, if=0x3fc98364 fn=0x42013158
0x42013158: esp_netif_new_api at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:690
D (693) esp_netif_objects: esp_netif_add_to_list_unsafe netif added successfully (total netifs: 1)
D (703) esp-netif_lwip-ppp: esp_netif_new_ppp: PPP connection created: 0x3fc9bfc0
D (713) esp-netif_lwip-ppp: Phase Dead
D (713) esp_netif_lwip: call api in lwip: ret=0x0, give sem
I (723) test: Initializing esp_modem for the NB-IoT module...
I (723) uart: queue free spaces: 30
D (733) intr_alloc: Connected src 28 to int 8 (cpu 0)
I (743) test: Signal quality: rssi=22, ber=0
I (753) test: imsi=901405108749214
D (753) command_lib: generic_command command ATE0
D (753) command_lib: Response:
OK
D (753) command_lib: generic_command command AT+CGDCONT=1,"IP","iot.1nce.net"
D (953) command_lib: Response:
OK
D (963) esp_netif_handlers: esp_netif action has started with netif0x3fc9bd8c from event_id=0
D (973) esp_netif_lwip: check: remote, if=0x3fc9bd8c fn=0x420133ec
0x420133ec: esp_netif_start_api at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1068
D (973) esp_netif_lwip: esp_netif_start_api 0x3fc9bd8c
D (983) esp-netif_lwip-ppp: esp_netif_start_ppp: Starting PPP connection: 0x3fc9bfc0
D (993) esp-netif_lwip-ppp: Phase Start
D (993) esp-netif_lwip-ppp: Phase Establish
D (993) esp_netif_lwip: check: local, if=0x3fc9bd8c fn=0x420138cc
0x420138cc: esp_netif_update_default_netif_lwip at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:317
D (1003) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fc9bd8c
D (1013) esp_netif_lwip: call api in lwip: ret=0x0, give sem
I (1013) test: Waiting for IP address
D (60993) esp-netif_lwip-ppp: Phase Disconnect
D (60993) esp-netif_lwip-ppp: Phase Dead
I (60993) esp-netif_lwip-ppp: Connection lost
D (60993) event: running post IP_EVENT:7 with handler 0x4200aa2c and context 0x3fc9bd38 on loop 0x3fc9adec
0x4200aa2c: on_ip_event at /Users/emanuele/Documents/Projects/nbTest/main/main.c:29
I (61003) test: IP event! 7
I (61003) test: Modem Disconnect from PPP Server
D (61013) event: running post IP_EVENT:7 with handler 0x42012614 and context 0x3fca0818 on loop 0x3fc9adec
0x42012614: esp_netif_action_disconnected at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/esp_netif_handlers.c:83
D (61023) esp_netif_handlers: esp_netif action disconnected with netif0x3fc9bd8c from event_id=7
D (61033) esp_netif_lwip: check: remote, if=0x3fc9bd8c fn=0x42012eb0
0x42012eb0: esp_netif_down_api at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1673
D (61033) esp_netif_lwip: esp_netif_down_api esp_netif:0x3fc9bd8c
D (61043) esp_netif_lwip: esp_netif_internal_dhcpc_cb lwip-netif:0x3fc9be14
D (61043) esp_netif_lwip: check: local, if=0x3fc9bd8c fn=0x420138cc
0x420138cc: esp_netif_update_default_netif_lwip at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:317
D (61053) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fc9bd8c
D (61063) esp_netif_lwip: call api in lwip: ret=0x0, give sem
oh, sorry, forgot about the CONFIG_LWIP_DEBUG
, this needs to be enabled, too, to propagate the logs from the liwp.
Okay, now I see the logs
I (5760) test: Signal quality: rssi=99, ber=99
I (5770) test: imsi=901405108749214
D (5770) command_lib: generic_command command ATE0
D (5780) command_lib: Response:
OK
D (5780) command_lib: generic_command command AT+CGDCONT=1,"IP","iot.1nce.net"
D (5870) command_lib: Response:
OK
D (5870) command_lib: generic_command command ATD*99#
D (5870) command_lib: Response:
ERROR
D (5870) command_lib: generic_command command ATO
D (5880) command_lib: Response:
ERROR
D (5880) esp_netif_handlers: esp_netif action has started with netif0x3fc9bd8c from event_id=0
D (5890) esp_netif_lwip: check: remote, if=0x3fc9bd8c fn=0x42013684
0x42013684: esp_netif_start_api at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1068
D (5900) esp_netif_lwip: esp_netif_start_api 0x3fc9bd8c
D (5900) esp-netif_lwip-ppp: esp_netif_start_ppp: Starting PPP connection: 0x3fc9bfc0
ppp_connect[1]: holdoff=0
ppp phase changed[1]: phase=3
D (5910) esp-netif_lwip-ppp: Phase Start
pppos_connect: unit 1: connecting
ppp_start[1]
ppp phase changed[1]: phase=6
D (5930) esp-netif_lwip-ppp: Phase Establish
pppos_send_config[1]: out_accm=FF FF FF FF
ppp_send_config[1]
pppos_recv_config[1]: in_accm=FF FF FF FF
ppp_recv_config[1]
ppp: auth protocols: PAP=0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
ppp_start[1]: finished
D (5950) esp_netif_lwip: check: local, if=0x3fc9bd8c fn=0x42013b64
0x42013b64: esp_netif_update_default_netif_lwip at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:317
D (5960) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fc9bd8c
D (5970) esp_netif_lwip: call api in lwip: ret=0x0, give sem
I (5970) test: Waiting for IP address
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
pppos_input[1]: got 21 bytes
pppos_input[1]: Dropping ACCM char <13>
pppos_input[1]: Dropping ACCM char <10>
pppos_input[1]: Dropping ACCM char <13>
pppos_input[1]: Dropping ACCM char <10>
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xd5b8b5af> <pcomp> <accomp>]
pppos_write[1]: len=24
LCP: timeout sending Config-Requests
ppp phase changed[1]: phase=12
D (65950) esp-netif_lwip-ppp: Phase Disconnect
Connection terminated.
ppp_link_terminated[1]
ppp_link_end[1]
ppp phase changed[1]: phase=0
D (65950) esp-netif_lwip-ppp: Phase Dead
I (65960) esp-netif_lwip-ppp: Connection lost
D (65960) event: running post IP_EVENT:7 with handler 0x4200ac74 and context 0x3fc9bd38 on loop 0x3fc9adec
0x4200ac74: on_ip_event at /Users/emanuele/Documents/Projects/nbTest/main/main.c:29
ppp_link_terminated[1]: finished.
I (65970) test: IP event! 7
I (65980) test: Modem Disconnect from PPP Server
D (65980) event: running post IP_EVENT:7 with handler 0x420128ac and context 0x3fca0818 on loop 0x3fc9adec
0x420128ac: esp_netif_action_disconnected at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/esp_netif_handlers.c:83
D (65990) esp_netif_handlers: esp_netif action disconnected with netif0x3fc9bd8c from event_id=7
D (66000) esp_netif_lwip: check: remote, if=0x3fc9bd8c fn=0x42013148
0x42013148: esp_netif_down_api at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:1673
D (66010) esp_netif_lwip: esp_netif_down_api esp_netif:0x3fc9bd8c
D (66010) esp_netif_lwip: esp_netif_internal_dhcpc_cb lwip-netif:0x3fc9be14
D (66020) esp_netif_lwip: check: local, if=0x3fc9bd8c fn=0x42013b64
0x42013b64: esp_netif_update_default_netif_lwip at /Users/emanuele/esp/v5.3/esp-idf/components/esp_netif/lwip/esp_netif_lwip.c:317
D (66030) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3fc9bd8c
D (66030) esp_netif_lwip: call api in lwip: ret=0x0, give sem
The PPP negotiation doesn't work, since the modem is still in the text mode:
pppos_input[1]: Dropping ACCM char <13>
pppos_input[1]: Dropping ACCM char <10>
Also, it rejected the dial-up command for some reason:
D (5870) command_lib: generic_command command ATD*99#
D (5870) command_lib: Response:
ERROR
I haven't noticed these lines in the previous log...
The SIM7028 module does not implement the ATD*99# command.
The SIM7028 module does not implement the ATD*99# command.
Oh, sorry, this device does not really seem to support PPP connection. Not possible to acquire an IP after PPPoS handshake then. You'd need to use AT commands only to connect to internet, it seems. Looking at the socket TCP/IP commands, they look similar to those of SIMCOM/SIM7600, so you can check this example: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples/modem_tcp_client it uses AT commands (might need to create/update them per your device specs) to bring the esp_netif connection and enables using IDF protocol libraries (which might be useful in some cases)
Answers checklist.
General issue report
I'm getting _esp-netiflwip-ppp: Connection lost on SIM7028 module. From the logs, the module responds to the AT commands but when I switch it to the data mode I can't get IP and after a while it displays IP event 7 (IP_EVENT_PPP_LOST_IP). The APN and other configurations seem correct, and on the sim provider's portal I see that the PDP context is created correctly.
Log:
My code:
Thanks