-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
WIFI-MESH: Node lost connection after Root reboot (IDFGH-11273) #12431
Comments
I noticed that, in the example, |
This problem is displayed only in the root. But all devices have the same config:
|
@yanmartins |
The log means you should open power save when using coexist. |
This setting was active. But I had to disable sleep via software
Thanks, I updated to version
@zhangyanjiaoesp Do you have any information about this? |
yes, If you want to delete the RX task, you can call |
@zhangyanjiaoesp in my tests, the ip_internal_network example create the RX task in the NODE after each ROOT reboot. Which generated a memory leak that took a while to resolve. It might be interesting to update this example to avoid this type of problem. |
And yes, updating to version |
thanks, we will check it. |
@yanmartins I'm not clear about your memory leak issue, can you describe it in more details? |
Thanks, @zhangyanjiaoesp |
If your problem has been solved, please close this ticket, thanks. |
@zhangyanjiaoesp after modifying the ip_internal_network example to use a fixed root using PPP data. The same error came back in the NODE:
I just comment this configs: /* router */
cfg.channel = 0;
cfg.router.ssid_len = strlen((char *) wifi_params->ssid);
memcpy((uint8_t *) &cfg.router.ssid, wifi_params->ssid, cfg.router.ssid_len);
memcpy((uint8_t *) &cfg.router.password, wifi_params->password, sizeof(wifi_params->password)); Add this in the init: esp_mesh_fix_root(true);
if(wifi_mesh_config->is_root) esp_mesh_set_type(MESH_ROOT); And this in the PPP GOT IP event: if(!esp_mesh_is_root()) return false;
mesh_netifs_start(true);
esp_mesh_post_toDS_state(true);
return mesh_netif_start_root_ap(true, dns_addr); |
@yanmartins Can you provide a complete log of the Node when the reconnection works well? By the way, I think there are two things you can optimize in your code:
|
How about you don't comment the router configure lines? |
Yes! I am sending both cases. No reconnection:
With reconnection:
|
Yes, I already set
I will add this, but it seems that the error is something else, because the NODE stops looking for ROOT
You tell me to add some random value? If I do this, ROOT will be looking for this connection instead of connecting to PPP |
Since you have set the root to fixed, then the root won't try to connect to router |
Is there any code difference between scenarios that can and cannot reconnect? (I see they are both fixed-root) |
The same code
Yes, it sometimes can success, and sometimes fail with the same code. |
@zhangyanjiaoesp Root is fixed, but it continues searching for the wifi network
|
you can call APIs in this order to stop reconnection:
|
@yanmartins you can change the code as the above comment and test again. If the problem still exists, can you provide a demo for us to test locally? If you can't provide a demo, please provide the IDF branch commit id, we can try to add some debug log for you to test. |
I changed the code as you asked. Everything is fine in ROOT, but the error remained the same in NODE I can't provide a demo. But the branch commit is the 5.0.4 tag: 8fbf4ba |
@yanmartins please use the attachment to replace the esp32s3 wifi libs in the If the replacement succeeds, the wifi firmware is : And please provide the whole log (from start to error happen) of the root and node device, this will help to analyze the cause of the problem. |
@zhangyanjiaoesp Thanks, Succeed: Error: I turn off ROOT sometimes in failure scenario to force the error in NODE. With the timestamp I believe it is easy to observe this in both logs When ROOT stops raising the |
@yanmartins
Have you ever tried to call the
|
Yes I tried but the error remained the same. Is five seconds a good amount of time? Update: I increased the time to 5 seconds and the error seems to have stopped happening.
I'm using the ip_internal_network example. So, static esp_err_t mesh_netif_transmit_from_node_sta(void *h, void *buffer, size_t len)
{
mesh_data_t data;
ESP_LOGD(TAG, "Sending to root, dest addr: " MACSTR ", size: %d", MAC2STR((uint8_t *) buffer), len);
data.data = buffer;
data.size = len;
data.proto = MESH_PROTO_AP; //! Node's station transmits data to root's AP
data.tos = MESH_TOS_P2P;
esp_err_t err = esp_mesh_send(NULL, &data, MESH_DATA_TODS, NULL, 0);
if(err != ESP_OK) ESP_LOGE(TAG, "Send with err code %d %s", err, esp_err_to_name(err));
return err;
} |
sugget set the |
Thanks @zhangyanjiaoesp. It looks like the reconnection problem is gone. Just one more question: what causes so many prints like these? Is there some configuration I may have done wrong?
|
when the mesh ie of the parent change, there will be |
Thank you very much @zhangyanjiaoesp |
Answers checklist.
General issue report
Hello,
I'm working in a project using ESP32-S3 with 5.0.1 ESP-IDF.
I run the ip_internal_network example with this init:
Following is the log output of the program on a NODE.
ROOT is turned off, after the
MESH_EVENT_PARENT_CONNECTED
event on the NODE. But when ROOT is turned on again, NODE never gets a connection. Remaining infinitely in this loop. What could be causing this?In other cases, the output is:
The text was updated successfully, but these errors were encountered: