New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pppos restart failed (IDFGH-5761) #7469
Comments
Hi Peter, How do you deinitialize the client? Assuming these 3 lines should work provided you correctly reinitialize the ppp glue and netif itself. Could you please share your init and deinit code? Please, share also the exact commit in ESP-IDF, you're using. We had an issue with deinitialization, but that was fixed in 6f1b8fe (should be included in |
Thanks for your reply.
|
Maybe some forgotten event is fired during your re-initialization? (looks like a network connection event, but which interface? -- doesn't seem to be ppp netif). If you disable the default loop, the event won't be triggered. Is it only the pppos netif you're using in your example? This looks weird, as your deinitialization routine looks okay and as said, the netif-up event from your backtrace log doesn't make sense to me. Do you use any other interface? Is the issue reproducible also without the other one? I've been testing the scenario, see my test code here (using PPP server, so I can disconnect/reconnect faster), but didn't find any issue. The only trouble was missing unregistration of some handlers, this could only appear as a warning in the log. diff --git a/examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c b/examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c
index 1c6f4bcf191..46e88c743fe 100644
--- a/examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c
+++ b/examples/protocols/pppos_client/components/modem/src/esp_modem_netif.c
@@ -144,6 +144,18 @@ esp_err_t esp_modem_netif_clear_default_handlers(void *h)
if (ret != ESP_OK) {
goto clear_event_failed;
}
+ ret = esp_event_handler_unregister(IP_EVENT, IP_EVENT_PPP_GOT_IP, esp_netif_action_connected);
+ if (ret != ESP_OK) {
+ goto clear_event_failed;
+ }
+ ret = esp_event_handler_unregister(IP_EVENT, IP_EVENT_PPP_LOST_IP, esp_netif_action_disconnected);
+ if (ret != ESP_OK) {
+ goto clear_event_failed;
+ }
+ ret = esp_event_handler_unregister(NETIF_PPP_STATUS, ESP_EVENT_ANY_ID, on_ppp_changed);
+ if (ret != ESP_OK) {
+ goto clear_event_failed;
+ }
return ESP_OK;
clear_event_failed: |
thanks for your reply, and I will try to use a pure sample to test again. BTW, where is the USB-4G sample, it looks the previous link is not accessable. |
You mean a component manager's link to the |
@achao1104 @david-cermak We implemented a preliminary |
NETIF_PPP_STATUS is registerd while modem gets attached to the related netif. we don't have any network detach functionality in the modem component, so we unregister the event during esp_modem_netif_clear_default_handlers(). Related https://esp32.com/viewtopic.php?f=13&t=23632 Related #7469
NETIF_PPP_STATUS is registerd while modem gets attached to the related netif. we don't have any network detach functionality in the modem component, so we unregister the event during esp_modem_netif_clear_default_handlers(). Related https://esp32.com/viewtopic.php?f=13&t=23632 Related #7469
Hello,
I referred the pppos sample, it works fine. but if I deinit and then start again, it reports the following exception, I have used the deinit codes in the sample.
I (59650) ppposutil: PPP state changed event 259
I (59650) ppposutil: PPP state changed event 262
I (59650) ppposutil: PPP state changed event 263
I (59650) ppposutil: PPP state changed event 265
I (59670) esp-netif_lwip-ppp: Connected
I (59670) esp-netif_lwip-ppp: Name Server1: 218.4.4.4
I (59670) esp-netif_lwip-ppp: Name Server2: 218.2.2.2
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x400a3ede PS : 0x00060230 A0 : 0x800a402c A1 : 0x3ffdd620
0x400a3ede: netif_do_set_ipaddr at D:/project/esp32/es-idf-v4.3-release/components/lwip/lwip/src/core/netif.c:473 (discriminator 2)
A2 : 0x00000000 A3 : 0x3f01383c A4 : 0x3ffdd660 A5 : 0x3ffdd704
A6 : 0x3ffde210 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x00000000
A10 : 0x3ffe760c A11 : 0x00000000 A12 : 0x3ff9ffa8 A13 : 0x00000000
A14 : 0x00000000 A15 : 0x00000003 SAR : 0x0000001c EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000004 LBEG : 0x3ff9ffa8 LEND : 0x00000000 LCOUNT : 0x4002771d
0x4002771d: _xt_user_exc at D:/project/esp32/es-idf-v4.3-release/components/freertos/port/xtensa/xtensa_vectors.S:627
Backtrace:0x400a3edb:0x3ffdd620 0x400a4029:0x3ffdd660 0x4009e42b:0x3ffdd6a0 0x4009e06f:0x3ffdd6c0 0x40038049:0x3ffdd6e0 0x40038028:0x3ffdd700 0x400322d9:0x3ffdd730
0x400a3edb: netif_do_set_ipaddr at D:/project/esp32/es-idf-v4.3-release/components/lwip/lwip/src/core/netif.c:470 (discriminator 1)
0x400a4029: netif_set_addr at D:/project/esp32/es-idf-v4.3-release/components/lwip/lwip/src/core/netif.c:702
0x4009e42b: esp_netif_up_api at D:/project/esp32/es-idf-v4.3-release/components/esp_netif/lwip/esp_netif_lwip.c:1215
0x4009e06f: esp_netif_api_cb at D:/project/esp32/es-idf-v4.3-release/components/esp_netif/lwip/esp_netif_lwip.c:107
0x40038049: tcpip_thread_handle_msg at D:/project/esp32/es-idf-v4.3-release/components/lwip/lwip/src/api/tcpip.c:168
0x40038028: tcpip_thread at D:/project/esp32/es-idf-v4.3-release/components/lwip/lwip/src/api/tcpip.c:154
0x400322d9: vPortTaskWrapper at D:/project/esp32/es-idf-v4.3-release/components/freertos/port/xtensa/port.c:168
Thanks,
Peter
The text was updated successfully, but these errors were encountered: