espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.91k stars 7.33k forks source link

[ESP-WIFI-MESH]: Issue on mesh device when added sleep mesh functionality (IDFGH-13088) #14034

Open andy-danieal opened 5 months ago

andy-danieal commented 5 months ago

Answers checklist.

General issue report

ESP_ERROR_CHECK(esp_mesh_enable_ps());
ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(120));
ESP_ERROR_CHECK(esp_mesh_set_beacon_interval(10000));
ESP_ERROR_CHECK(esp_mesh_set_passive_scan_time(1000));

ESP_ERROR_CHECK(esp_mesh_set_active_duty_cycle(12, MESH_PS_DEVICE_DUTY_REQUEST));
ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(12, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE));

Devices are working in a mesh network, but When i added sleep mesh device functionality then issue has comes to same range device was not connecting to parent and delay on command.

Logs:-


W (12730127) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12731049) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12731970) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12732892) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12733813) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12735350) wifi:The previous beacon was not Tx done
W (12735649) wifi:The previous beacon was not Tx done
W (12735964) wifi:The previous beacon was not Tx done
W (12736264) wifi:The previous beacon was not Tx done
W (12736571) wifi:The previous beacon was not Tx done
W (12736574) wifi:The previous beacon was not Tx done
W (12736874) wifi:The previous beacon was not Tx done
W (12736882) wifi:The previous beacon was not Tx done
W (12736893) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12737178) wifi:The previous beacon was not Tx done
W (12737193) wifi:The previous beacon was not Tx done
W (12737481) wifi:The previous beacon was not Tx done
W (12737787) wifi:The previous beacon was not Tx done
W (12737803) wifi:The previous beacon was not Tx done
W (12738091) wifi:The previous beacon was not Tx done
W (12738110) wifi:The previous beacon was not Tx done
W (12738394) wifi:The previous beacon was not Tx done
W (12738418) wifi:The previous beacon was not Tx done
W (12738697) wifi:The previous beacon was not Tx done
W (12738725) wifi:The previous beacon was not Tx done
W (12739001) wifi:The previous beacon was not Tx done
W (12739032) wifi:The previous beacon was not Tx done
W (12739304) wifi:The previous beacon was not Tx done
W (12739339) wifi:The previous beacon was not Tx done
W (12739606) wifi:The previous beacon was not Tx done
W (12739646) wifi:The previous beacon was not Tx done
W (12739909) wifi:The previous beacon was not Tx done
W (12739954) wifi:The previous beacon was not Tx done
W (12739965) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12740212) wifi:The previous beacon was not Tx done
W (12740265) wifi:The previous beacon was not Tx done
W (12740516) wifi:The previous beacon was not Tx done
W (12740823) wifi:The previous beacon was not Tx done
W (12740879) wifi:The previous beacon was not Tx done
W (12741126) wifi:The previous beacon was not Tx done
W (12741434) wifi:The previous beacon was not Tx done
W (12741494) wifi:The previous beacon was not Tx done
W (12741736) wifi:The previous beacon was not Tx done
W (12742043) wifi:The previous beacon was not Tx done
W (12742108) wifi:The previous beacon was not Tx done
W (12742347) wifi:The previous beacon was not Tx done
W (12742654) wifi:The previous beacon was not Tx done
W (12742718) wifi:The previous beacon was not Tx done
W (12742957) wifi:The previous beacon was not Tx done
W (12743026) wifi:The previous beacon was not Tx done
W (12743036) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12743260) wifi:The previous beacon was not Tx done
W (12743337) wifi:The previous beacon was not Tx done
W (12743951) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12744873) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12745794) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12746716) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12747637) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12748559) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12749480) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12750402) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12751324) wifi:The previous beacon was not Tx done
W (12751551) wifi:The previous beacon was not Tx done
W (12751857) wifi:The previous beacon was not Tx done
W (12751938) wifi:The previous beacon was not Tx done
W (12752552) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12753474) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12754396) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12755317) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12756239) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12757160) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12757775) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12758696) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12759618) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12760539) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12761461) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12762383) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12763304) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12764226) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12765147) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12766069) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12766991) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12767912) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12768834) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12769755) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12770677) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12771599) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12772520) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12772827) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12774056) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12775285) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12776207) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12777128) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12778050) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12778971) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12780507) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12781429) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12782350) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
I (03:33:01.690) [APP]: [SYSTEM INFO]: HEAP: 41 MESH-DEVICES - 6 | Parent ID: 68:b6:b3:08:5b:57 | RSSI:    -1
              0 | a0:76:4e:8b:f8:16 |  5880 ||
W (12783272) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12784501) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12785730) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12786037) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12787266) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12787573) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12787880) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12788187) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12788494) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12789416) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12790645) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12790952) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12792488) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12793717) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12794638) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12795560) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12796481) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12797403) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12798325) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12799246) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12799553) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12800475) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12801397) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12802318) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12803547) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12804469) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12805390) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12806312) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12807540) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12808462) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12809384) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12810305) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12811227) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12812148) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
I (03:33:31.690) [APP]: [SYSTEM INFO]: HEAP: 41 MESH-DEVICES - 6 | Parent ID: 68:b6:b3:08:5b:57
W (12813070) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12813992) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12814299) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12815220) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12816142) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12817064) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12817985) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12818907) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12819828) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12820750) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12821672) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12822593) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12823515) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12824436) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12825358) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12826279) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12827201) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12828430) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12829351) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12830273) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12831195) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12832116) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
W (12833038) wifi:(->sleep)busy, waked:1, dream:0, sleep:0
I (03:35:01.690) [APP]: [SYSTEM INFO]: HEAP: 41 MESH-DEVICES - 6 | Parent ID: 68:b6:b3:08:5b:57
zhangyanjiaoesp commented 5 months ago

@andy-danieal

ESP_ERROR_CHECK(esp_mesh_enable_ps()); ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(120)); ESP_ERROR_CHECK(esp_mesh_set_beacon_interval(10000)); ESP_ERROR_CHECK(esp_mesh_set_passive_scan_time(1000)); ESP_ERROR_CHECK(esp_mesh_set_active_duty_cycle(12, MESH_PS_DEVICE_DUTY_REQUEST)); ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(12, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE));

Are these configurations for all devices? Which IDF branch do you use? Can you describe the structure of your mesh network? Which layer or device does the above log belong to? Do you mean the device can't connect to the mesh network due to the above logs? Can you provide the complete logs?

andy-danieal commented 5 months ago

Yes, I had set configuration for all devices.

ESP-IDF v5.2.1-533-g9f4f8e24f2

Fixed root without router and MESH_TOPO_TREE topology. and issue on 1 layer of device.

Yes, not connected to mesh network. Other-side Fixed range without sleep mode device was connected to MESH network. but when range was decrease then device was connected to mesh network.

Sleep Mode mesh network devices. Why do the Wi-Fi logs contain these warnings

W (12735350) wifi:The previous beacon was not Tx done and W (12824436) wifi:(->sleep)busy, waked:1, dream:0, sleep:0

zhangyanjiaoesp commented 5 months ago

@andy-danieal W (12824436) wifi:(->sleep)busy, waked:1, dream:0, sleep:0 this log indicates that there is packet in the TX queue, and W (12735350) wifi:The previous beacon was not Tx done this log indicates that the last beacon hasn't been sent out. It seems the beacon sending is affected.

and issue on 1 layer of device

Do you mean the issue is on root device? Can you capture the packets of the device? Can you provide a demo to test?

andy-danieal commented 5 months ago

Thanks for your response.

Do you mean the issue is on root device?

Can you capture the packets of the device? Can you provide a demo to test?

I'm using ESP-WiFi-Mesh with fixed range of devices. I've added only one time configuration. Please help me get this working with low power. because We have been experiencing heating issues. Some devices have hung, and the watchdog timer is not working. The only indication is a WiFi log.

zhangyanjiaoesp commented 5 months ago

how to capture packets of devices

you can use Wireshark to capture packets.

I will try to reproduce this problem locally.

zhangyanjiaoesp commented 5 months ago

@andy-danieal How about you call esp_mesh_set_network_duty_cycle() only on the fixed-root node? https://github.com/espressif/esp-idf/blob/e7070e777a079695f69720ffb3c631c5fe620cc6/components/esp_wifi/include/esp_mesh.h#L1638

andy-danieal commented 5 months ago

@zhangyanjiaoesp

ROOT Settings

    ESP_ERROR_CHECK(esp_mesh_set_type(MESH_ROOT));
    esp_mesh_set_self_organized(false, false);

    ESP_ERROR_CHECK(esp_mesh_set_vote_percentage(1));
    ESP_ERROR_CHECK(esp_mesh_set_xon_qsize(256));

    ESP_ERROR_CHECK(esp_mesh_enable_ps());
    ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(60));
    ESP_ERROR_CHECK(esp_mesh_allow_root_conflicts(false));
    ESP_ERROR_CHECK(esp_mesh_send_block_time(2000));

   /*---------Mesh Config NOT SHARED ----*/

    ESP_ERROR_CHECK(esp_mesh_start());

    ESP_ERROR_CHECK(esp_mesh_set_active_duty_cycle(50, MESH_PS_DEVICE_DUTY_DEMAND));
    ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(50, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE));

Child Setting

    ESP_ERROR_CHECK(esp_mesh_set_type(MESH_IDLE));
    esp_mesh_fix_root(true);
    esp_mesh_set_self_organized(true, true);

    ESP_ERROR_CHECK(esp_mesh_set_xon_qsize(128));

    ESP_ERROR_CHECK(esp_mesh_enable_ps());
    ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(60));
    ESP_ERROR_CHECK(esp_mesh_set_beacon_interval(1000));
    ESP_ERROR_CHECK(esp_mesh_set_passive_scan_time(500));
    ESP_ERROR_CHECK(esp_mesh_send_block_time(2000));

    ESP_ERROR_CHECK(esp_mesh_start());

    ESP_ERROR_CHECK(esp_mesh_set_active_duty_cycle(50, MESH_PS_DEVICE_DUTY_REQUEST));
    ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(50, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE));
zhangyanjiaoesp commented 5 months ago

@andy-danieal I use two devices, one is fixded root, and one is node, the configuration is same as above, but I didn't reproduce the problem, do I need more devices?

zhangyanjiaoesp commented 5 months ago

@andy-danieal Now I can reproduce this problem.

andy-danieal commented 5 months ago

@andy-danieal I use two devices, one is fixded root, and one is node, the configuration is same as above, but I didn't reproduce the problem, do I need more devices?

The issue is related to a range test failed, not to a mesh connection.

When i added sleep mesh device functionality then issue has comes to same range device was not connecting to parent and delay on command.

Testing step:-

  1. Disable Power mode - esp_mesh_disable_ps()
  2. Test mesh with maximum range of devices.
  3. After that enable power mode - esp_mesh_enable_ps()
  4. Test same with range with Sleep mesh devices.