-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Modem data reconnection is not working with 5.0-rc1 IDF (IDFGH-8893) #10308
Comments
v5.0 was just released btw! worth updating. |
related espressif/esp-protocols#188 |
same issue with 5.0 release ! |
@cpgoga Could you please try to apply this lwip patch to see if it helps? diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c
index 78a8d271..598e7051 100644
--- a/src/netif/ppp/pppos.c
+++ b/src/netif/ppp/pppos.c
@@ -226,7 +226,7 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p)
/* If the link has been idle, we'll send a fresh flag character to
* flush any noise. */
err = ERR_OK;
- if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) {
+ if (1) {
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL);
}
@@ -276,7 +276,7 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u16_t protocol)
/* If the link has been idle, we'll send a fresh flag character to
* flush any noise. */
err = ERR_OK;
- if ((sys_now() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) {
+ if (1) {
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0, NULL);
} |
Just tested with the fixes above on my side. Also enabled PPPOS logging in menuconfig. I see two strange things that may help to understand the problem:
Log file: |
Thanks for the quick test and sharing debug logs from PPP service! Ad 1) There was a minor bug in Ad 2) The log looks differently now, we are able to communicate on PPPoS protocol, just couldn't obtain an IP. Would it be possible that in this case the device couldn't reconnect due to network issues? The log above (before patching lwip) shows that we were not able to connect at all (entering PPPoS in lwip failed) |
espressif/esp-protocols#188 for my Tests. even with the fix, it still works in ESP-IDF 4.4.2 and fails in ESP-IDF 5.0 did logs for all with CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=y CONFIG_LWIP_PPP_DEBUG_ON=y please check ! |
Found the problem, it wasn't in lwip, but in a way we interpret getting IP address notifications. In diff --git a/components/esp_netif/lwip/esp_netif_lwip.c b/components/esp_netif/lwip/esp_netif_lwip.c
index f41249ba45..d303639e8e 100644
--- a/components/esp_netif/lwip/esp_netif_lwip.c
+++ b/components/esp_netif/lwip/esp_netif_lwip.c
@@ -1217,6 +1217,9 @@ static void esp_netif_internal_dhcpc_cb(struct netif *netif)
} else {
if (!ip4_addr_cmp(&ip_info->ip, IP4_ADDR_ANY4)) {
esp_netif_start_ip_lost_timer(esp_netif);
+ ip4_addr_set(&ip_info->ip, ip_2_ip4(&netif->ip_addr));
+ ip4_addr_set(&ip_info->netmask, ip_2_ip4(&netif->netmask));
+ ip4_addr_set(&ip_info->gw, ip_2_ip4(&netif->gw));
}
}
} |
Hi, tested this in ESP-IDF 5.0 Release, and this is working fine. pls integrate this in the next ESP-IDF. thanks, Franz. |
The last provided workaround also works on our side. The change in pppos.c was reverted to the original code. |
IP update notification for "point to point" interfaces is performed via the same callback function as for any other interfaces (dhcp_cb, although it's not DHCP related). In P2P interfaces we have to assure that we always get a notification, so we can set the interface up. This was omitted when getting the same IP address for the second time, causing the PPPoS interface (in esp-modem applications) failing to reconnect if disconnected. Closes #10308 Closes espressif/esp-protocols#188
IP update notification for "point to point" interfaces is performed via the same callback function as for any other interfaces (dhcp_cb, although it's not DHCP related). In P2P interfaces we have to assure that we always get a notification, so we can set the interface up. This was omitted when getting the same IP address for the second time, causing the PPPoS interface (in esp-modem applications) failing to reconnect if disconnected. Closes espressif#10308 Closes espressif/esp-protocols#188
Answers checklist.
General issue report
In case the IP is lost during normal operation, the modem should be able to reconnect to the internet and this is possible with the CMUX manual mode updates from espressif/esp-protocols#169 and the IDF 5.0 (commit 01d014c) but it is no longer possible with IDF 5.0-rc1 framework.
Preconditions:
IDF 5.0-rc1 + the changes from espressif/esp-protocols#169 integrated
Steps:
Expected results:
Observed results:
See also attached logs.
5.0_IDF_PASSED.txt
5.0-rc1_IDF_FAILED.txt
The text was updated successfully, but these errors were encountered: