You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
5.2.2
Espressif SoC revision.
ESP32-D0WD-V3 (revision v3.0)
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board
Power Supply used.
USB
What is the expected behavior?
A netif can be created and destroyed at any times and there are no timers left active if the netif does not exists anymore.
When using CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL = 120 (default value) a timer is started with the given time interval, so that an ip lost event is generated. Expectation is that when the netif is destroyed, the timer is also stopped.
What is the actual behavior?
IP Lost timer remains active even if the netif is destroyed and if by chance a new netif is generated later having the same address, then the timer will fire and generates an ip lost event.
Please check my log bellow and see that after a while a new netif is created with the same address.
...
D (12048) APP: WiFiPL station created net interface 0x3ffcad1c
...
D (14598) APP: WiFiPL release free netif 0x3ffcad1c
...
D (24908) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (27388) APP: WiFiPL release netif 0x3ffc9ae4
...
D (32648) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (35128) APP: WiFiPL release netif 0x3ffc9ae4
...
D (254488) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254518) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254528) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
...
As one can see in my log, is possible that a new netif is allocated at the same address (0x3ffc9ae4) when using esp_netif_new and esp_netif_destroy.
After 120s (or whatever is configured in CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL) the event callback for ip lost is called. The number of calls looks to be the same as the number of times netif was created with same address.
Debug Logs.
...
I (11998) APP: IP connection start interface wifi0 config wifi0
...
D (12018) APP: WiFi connect
D (12028) APP: WiFi connect ssid SSID1 auth_mode wpa2_psk
D (12028) APP: WiFiPL init station
D (12048) APP: WiFiPL station created net interface 0x3ffcad1c
...
D (14598) APP: WiFiPL release free netif 0x3ffcad1c
...
I (14618) APP: IP connection start interface wifi0 config wifi1
...
D (14648) APP: WiFiPL station created net interface 0x3ffc9b7c
...
D (17078) APP: WiFi station disconnected from SSID2, reason 201
D (17078) APP: WiFi station disconnected from SSID2, error ap not found
D (17128) APP: WiFiPL release netif 0x3ffc9b7c
...
D (22378) APP: WiFiPL station created net interface 0x3ffcf348
...
D (24858) APP: WiFiPL release netif 0x3ffcf348
...
D (24908) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (27388) APP: WiFiPL release netif 0x3ffc9ae4
...
D (32648) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (35128) APP: WiFiPL release netif 0x3ffc9ae4
...
D (35178) APP: WiFiPL station created net interface 0x3ffc9b7c
...
D (37658) APP: WiFiPL release netif 0x3ffc9b7c
...
D (42908) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (45388) APP: WiFiPL release netif 0x3ffc9ae4
...
D (45438) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (47918) APP: WiFiPL release netif 0x3ffc9ae4
...
D (53178) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (55658) APP: WiFiPL release netif 0x3ffc9ae4
...
D (55708) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (58188) APP: WiFiPL release netif 0x3ffc9ae4
...
D (63438) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (65918) APP: WiFiPL release netif 0x3ffc9ae4
...
D (65978) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (68458) APP: WiFiPL release netif 0x3ffc9ae4
...
D (132048) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (134528) APP: WiFiPL release netif 0x3ffc9ae4
...
D (134578) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (137058) APP: WiFiPL release netif 0x3ffc9ae4
...
D (142308) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (144788) APP: WiFiPL release netif 0x3ffc9ae4
...
D (144838) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (147318) APP: WiFiPL release netif 0x3ffc9ae4
...
D (152568) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (155048) APP: WiFiPL release netif 0x3ffc9ae4
...
D (155098) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (157578) APP: WiFiPL release netif 0x3ffc9ae4
...
D (162828) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (165308) APP: WiFiPL release netif 0x3ffc9ae4
...
D (165358) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (167838) APP: WiFiPL release netif 0x3ffc9ae4
...
D (173098) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (175578) APP: WiFiPL release 0x3ffc9ae4
...
D (175628) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (178108) APP: WiFiPL release netif 0x3ffc9ae4
...
D (183358) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (185838) APP: WiFiPL release netif 0x3ffc9ae4
...
D (185888) APP: WiFiPL station created net interface 0x3ffc9ae4
...
D (188368) APP: WiFiPL release netif 0x3ffc9ae4
...
D (252048) APP: WiFiPL station created net interface 0x3ffc9ae4
..
D (254488) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254518) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254528) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254548) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254558) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254578) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254588) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254598) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254608) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254618) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254628) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254648) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254658) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254678) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254698) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254718) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254728) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254748) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254768) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254778) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254798) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254818) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254838) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254848) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
D (254868) APP: IPMPL lost IP (evt id 1), net if 0x3ffc9ae4
More Information.
In version 5.2.2 (but I don't see any change in 5.4) the timer is created here and I don't think is ever destroyed. I think the timer relays on the fact that if a netif is destroyed, then is not found anymore here.
I think the solution will be to add here something like:
if (esp_netif->timer_running) {
sys_untimeout(esp_netif_ip_lost_timer, (void *)esp_netif);
esp_netif->timer_running = false;
}
The text was updated successfully, but these errors were encountered:
Answers checklist.
IDF version.
5.2.2
Espressif SoC revision.
ESP32-D0WD-V3 (revision v3.0)
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Custom board
Power Supply used.
USB
What is the expected behavior?
A netif can be created and destroyed at any times and there are no timers left active if the netif does not exists anymore.
When using CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL = 120 (default value) a timer is started with the given time interval, so that an ip lost event is generated. Expectation is that when the netif is destroyed, the timer is also stopped.
What is the actual behavior?
IP Lost timer remains active even if the netif is destroyed and if by chance a new netif is generated later having the same address, then the timer will fire and generates an ip lost event.
Please check my log bellow and see that after a while a new netif is created with the same address.
As one can see in my log, is possible that a new netif is allocated at the same address (0x3ffc9ae4) when using esp_netif_new and esp_netif_destroy.
Steps to reproduce.
In a loop:
After 120s (or whatever is configured in CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL) the event callback for ip lost is called. The number of calls looks to be the same as the number of times netif was created with same address.
Debug Logs.
More Information.
In version 5.2.2 (but I don't see any change in 5.4) the timer is created here and I don't think is ever destroyed. I think the timer relays on the fact that if a netif is destroyed, then is not found anymore here.
I think the solution will be to add here something like:
The text was updated successfully, but these errors were encountered: