Skip to content
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

Mesh Internal communication : 2 nodes are becoming root node in self organizing network. (IDFGH-11175) #12343

Closed
3 tasks done
amitabhskrishworks opened this issue Oct 3, 2023 · 27 comments
Assignees
Labels
Awaiting Response awaiting a response from the author Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@amitabhskrishworks
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • 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.

v 5.0

Espressif SoC revision.

ESP 32 (chip revision 3.1)

Operating System used.

Windows

How did you build your project?

Command line with Make

If you are using Windows, please specify command line type.

None

Development Kit.

ESP 32 One

Power Supply used.

USB

What is the expected behavior?

One node becoming root node in esp wifi mesh.

What is the actual behavior?

2 nodes are becoming root node .

Steps to reproduce.

  1. Flash 2 devices with mesh internal communication.
  2. Powered both device at same time .
  3. They both started searching for network and then both of them become root node.

Debug Logs.

Device 1 :
I (838) wifi_init: tcp mss: 1440
I (838) wifi_init: WiFi IRAM OP enabled
I (838) wifi_init: WiFi RX IRAM OP enabled
I (848) phy_init: phy_version 4771,450c73b,Aug 16 2023,11:03:10
I (958) wifi:mode : sta (08:3a:8d:80:44:4c) + softAP (08:3a:8d:80:44:4d)
I (958) wifi:enable tsf
I (968) wifi:Total power save buffer number: 8
I (968) wifi:Init max length of beacon: 752/752
I (968) wifi:Init max length of beacon: 752/752
I (978) mesh: <nvs>read layer:1
I (978) mesh: <nvs>read assoc:1
I (978) wifi:Set ps type: 1

I (3158) wifi:mode : sta (08:3a:8d:80:44:4c)
I (3168) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x1, need_scan_router:0x0, look_for_nwk_count:1
I (3168) mesh_main: <MESH_EVENT_MESH_STARTED>ID:11:12:13:14:15:16
I (3168) mesh_main: mesh starts successfully, heap:154300, root not fixed<0>(tree), ps:1

I (3178) main_task: Returned from app_main()
I (3468) mesh: [S5]EWS-2ND F, c0:74:ad:cd:6a:49, channel:1, rssi:-82
I (3468) mesh: find router:[ssid_len:9]EWS-2ND F, rssi:-82, c0:74:ad:cd:6a:49(encrypted), new channel:1, old channel:0
I (3478) mesh: [FIND][ch:1]AP:7, otherID:0, MAP:0, idle:0, candidate:0, root:0[c0:74:ad:cd:6a:49]router found
I (3488) mesh: [FIND:1]find a network, channel:1, cfg<channel:1, router:EWS-2ND F, 00:00:00:00:00:00>

I (3498) mesh_main: <MESH_EVENT_FIND_NETWORK>new channel:1, router BSSID:00:00:00:00:00:00    
I (3498) wifi:mode : sta (08:3a:8d:80:44:4c) + softAP (08:3a:8d:80:44:4d)
W (3508) wifi:<MESH AP>adjust channel:1, secondary channel offset:1(40U)
I (3518) wifi:Total power save buffer number: 8
I (3848) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (3848) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (3858) mesh: 6896[SCAN]init rc[ttl:127/votes:1][08:b6:1f:ff:b1:81,-120]
I (3858) mesh: 6896[SCAN]init rc[ttl:127/votes:1][08:b6:1f:ff:b1:81,-120]
I (3868) mesh: 1368, vote myself, router rssi:-83 > voted rc_rssi:-120
I (3878) mesh: [SCAN:1/10]rc[128][08:3a:8d:80:44:4d,-83], self[08:3a:8d:80:44:4c,-83,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,08:3a:8d:80:44:4d]

I (4188) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (4198) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (4198) mesh: [SCAN:2/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-82,reason:0,votes:1,idle][mine:1,voter:2(0.50)percent:1.00][128,1,08:3a:8d:80:44:4d]

I (4518) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (4518) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (4528) mesh: [SCAN:3/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-82,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (4848) mesh: [SCAN][ch:1]AP:7, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (4848) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (4858) mesh: [SCAN:4/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (5178) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (5178) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (5188) mesh: [SCAN:5/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-82,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (5498) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (5508) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (5508) mesh: [SCAN:6/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (5828) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (5828) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (5838) mesh: [SCAN:7/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (6158) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (6158) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (6168) mesh: [SCAN:8/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-84,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (6488) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (6488) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (6498) mesh: [SCAN:9/10]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (6808) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (6818) mesh: 1140<pre>my_vote_num:0, voter_num/max_connection:8, 2nd_layer_count:0
I (6828) mesh: [SCAN:10/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-84,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,08:3a:8d:80:44:4d]

I (7138) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (7148) mesh: [SCAN:11/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:1,idle][mine:1,voter:2(0.50)percent:1.00][128,1,08:3a:8d:80:44:4d]

I (7458) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (7468) mesh: [SCAN:12/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (7778) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (7788) mesh: [SCAN:13/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-84,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (8098) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (8108) mesh: [SCAN:14/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (8418) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (8428) mesh: [SCAN:15/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (8748) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (8748) mesh: [SCAN:16/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-85,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (9068) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (9068) mesh: [SCAN:17/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-86,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (9388) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (9388) mesh: [SCAN:18/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-84,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (9708) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (9708) mesh: [SCAN:19/20+x+]rc[128][08:3a:8d:80:44:4d,-82], self[08:3a:8d:80:44:4c,-83,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (10028) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:1,i:1][c0:74:ad:cd:6a:49]router found<>
I (10028) mesh: [SCAN:20/20+x+]rc[128][08:3a:8d:80:44:4d,-81], self[08:3a:8d:80:44:4c,-81,reason:0,votes:2,idle][mine:2,voter:2(1.00)percent:1.00][128,2,08:3a:8d:80:44:4d]

I (10068) mesh: <nvs>write layer:0
I (10078) mesh: <nvs>write assoc:0
I (10078) mesh: [scan]new scanning time:600ms, beacon interval:300ms
I (10078) mesh: [DONE]connect to router:EWS-2ND F, channel:1, rssi:-81, c0:74:ad:cd:6a:49[layer:0, assoc:0], my_vote_num:2/voter_num:2, rc[08:3a:8d:80:44:4d/-81/1]
I (12798) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (12798) wifi:state: init -> auth (b0)
I (18268) wifi:state: auth -> init (200)
I (18268) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (18268) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (18268) mesh: [wifi]disconnected reason:2(auth expire), continuous:1/max:12, root, vote(,stopped)<><>
I (20948) mesh: [wifi]disconnected reason:205(), continuous:2/max:12, root, vote(,stopped)<><>
I (20948) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (23618) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (23628) wifi:state: init -> auth (b0)
I (25948) wifi:state: auth -> assoc (0)
I (25978) wifi:Association refused temporarily, comeback time 1000 (TUs)
I (27008) wifi:state: assoc -> assoc (0)
I (28008) wifi:state: assoc -> init (200)
I (28008) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (28008) mesh: [wifi]disconnected reason:202(), continuous:3/max:12, root, vote(,stopped)<><>
I (28008) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:202
I (30678) mesh: [wifi]disconnected reason:205(), continuous:4/max:12, root, vote(,stopped)<><>
I (30678) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (33348) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (33358) wifi:state: init -> auth (b0)
I (35758) wifi:state: auth -> assoc (0)
I (35778) wifi:state: assoc -> run (10)
I (35808) wifi:connected with EWS-2ND F, aid = 1, channel 1, BW20, bssid = c0:74:ad:cd:6a:49
I (35808) wifi:security: WPA3-SAE, phy: bgn, rssi: -83
I (35818) wifi:Set ps type: 0

I (35848) mesh: <nvs>write layer:1
I (35848) mesh: <flush>upstream packets, connections(max):8, waiting:0, upQ:0
I (35848) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:0-->1, parent:c0:74:ad:cd:6a:49<ROOT>, ID:11:12:13:14:15:16, duty:0
I (35848) mesh: <flush>root
I (35858) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (35858) wifi:I (35858) mesh: [TXQ]<max:128>up(0, be:0), down(0, be:0), mgmt:0, xon(req:0, rsp:0), bcast:0, wnd(0, parent:00:00:00:00:00:00)
pm start, type: 0

I (35878) mesh: [RXQ]<max:128 = cfg:128 + extra:0>self:0, <max:128 = cfg:128 + extra:0>tods:0
I (35868) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:08:3a:8d:80:44:4d
I (35858) mesh_main: The Total Nodes in Network are 1
I (35898) wifi:<ba-add>idx:0 (ifx:0, c0:74:ad:cd:6a:49), tid:0, ssn:0, winSize:64
I (35908) mesh_main: This node is Root Node
I (35908) mesh_main: This is routing table : 08:3a:8d:80:44:4c and the current layer is 1     
I (35918) mesh_main: layer:1, rtableSize:1, ROOT
I (35968) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (37858) esp_netif_handlers: sta ip: 172.16.0.51, mask: 255.255.255.0, gw: 172.16.0.1
I (37858) mesh_main: <IP_EVENT_STA_GOT_IP>IP:172.16.0.51
I (40928) mesh_main: The Total Nodes in Network are 1
I (40928) mesh_main: This node is Root Node
I (40928) mesh_main: This is routing table : 08:3a:8d:80:44:4c and the current layer is 1     
I (40928) mesh_main: layer:1, rtableSize:1, ROOT
I (45938) mesh_main: The Total Nodes in Network are 1
I (45938) mesh_main: This node is Root Node
I (45938) mesh_main: This is routing table : 08:3a:8d:80:44:4c and the current layer is 1     
I (45938) mesh_main: layer:1, rtableSize:1, ROOT
I (50948) mesh_main: The Total Nodes in Network are 1



Device 2 :
I (818) wifi_init: tcp mss: 1440
I (818) wifi_init: WiFi IRAM OP enabled
I (818) wifi_init: WiFi RX IRAM OP enabled
I (828) phy_init: phy_version 4771,450c73b,Aug 16 2023,11:03:10
I (938) wifi:mode : sta (08:b6:1f:ff:b1:80) + softAP (08:b6:1f:ff:b1:81)
I (938) wifi:enable tsf
I (948) wifi:Total power save buffer number: 8
I (948) wifi:Init max length of beacon: 752/752
I (948) wifi:Init max length of beacon: 752/752
I (958) mesh: <nvs>read layer:0
I (958) mesh: <nvs>read assoc:0
I (958) wifi:Set ps type: 1

I (3138) wifi:mode : sta (08:b6:1f:ff:b1:80)
I (3148) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x1, need_scan_router:0x0, look_for_nwk_count:1
I (3148) mesh_main: <MESH_EVENT_MESH_STARTED>ID:11:12:13:14:15:16
I (3148) mesh_main: mesh starts successfully, heap:154292, root not fixed<0>(tree), ps:1

I (3158) main_task: Returned from app_main()
I (3448) mesh: [S1]EWS-2ND F, c0:74:ad:cd:6a:49, channel:1, rssi:-92
I (3448) mesh: find router:[ssid_len:9]EWS-2ND F, rssi:-92, c0:74:ad:cd:6a:49(encrypted), new channel:1, old channel:0
I (3458) mesh: [FIND][ch:1]AP:3, otherID:0, MAP:0, idle:0, candidate:0, root:0[c0:74:ad:cd:6a:49]router found
I (3468) mesh: [FIND:1]find a network, channel:1, cfg<channel:1, router:EWS-2ND F, 00:00:00:00:00:00>

I (3478) wifi:mode : sta (08:b6:1f:ff:b1:80) + softAP (08:b6:1f:ff:b1:81)
W (3478) wifi:<MESH AP>adjust channel:1, secondary channel offset:1(40U)
I (3488) wifi:Total power save buffer number: 8
I (3478) mesh_main: <MESH_EVENT_FIND_NETWORK>new channel:1, router BSSID:00:00:00:00:00:00    
I (3818) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:0][c0:74:ad:cd:6a:49]router found<>
I (3818) mesh: 6896[SCAN]init rc[ttl:127/votes:1][08:3a:8d:80:44:4d,-120]
I (3828) mesh: 6896[SCAN]init rc[ttl:127/votes:1][08:3a:8d:80:44:4d,-120]
I (3828) mesh: 1368, vote myself, router rssi:-89 > voted rc_rssi:-120
I (3838) mesh: [SCAN:1/10]rc[128][08:b6:1f:ff:b1:81,-89], self[08:b6:1f:ff:b1:80,-89,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,08:b6:1f:ff:b1:81]

I (4158) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (4158) mesh: [SCAN:2/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-88,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,1,08:3a:8d:80:44:4d]

I (4478) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (4478) mesh: [SCAN:3/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-88,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,1,08:3a:8d:80:44:4d]

I (4798) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (4798) mesh: [SCAN:4/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-88,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (5108) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (5118) mesh: [SCAN:5/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-90,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (5428) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (5438) mesh: [SCAN:6/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-92,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (5748) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (5758) mesh: [SCAN:7/10]rc[127][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-89,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (6068) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (6078) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-92], mine:0, voter:0
I (6078) mesh: [SCAN:8/10]rc[126][08:3a:8d:80:44:4d,-89], self[08:b6:1f:ff:b1:80,-92,reason:0,votes:0,idle][mine:0,voter:1(0.00)percent:1.00][126,2,08:3a:8d:80:44:4d]

I (6398) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (6398) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-92], mine:0, voter:0
I (6408) mesh: 815[SCAN]the heard rc[08:3a:8d:80:44:4d], vote_ttl:126 <= last ttl:126, expired
I (6418) mesh: [SCAN:9/10]rc[0,expire][00:00:00:00:00:00,-89], self[08:b6:1f:ff:b1:80,-92,reason:0,votes:0,idle][mine:0,voter:0(0.00)percent:1.00][0,0,00:00:00:00:00:00]

I (6728) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (6738) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-91], mine:0, voter:0
I (6738) mesh: 1368, vote myself, router rssi:-91 > voted rc_rssi:-120
I (6748) mesh: [SCAN:10/20+x+]rc[128][08:b6:1f:ff:b1:81,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,08:b6:1f:ff:b1:81]

I (7068) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (7068) mesh: [SCAN:11/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-90,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,1,08:3a:8d:80:44:4d]

I (7388) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (7388) mesh: [SCAN:12/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,1,08:3a:8d:80:44:4d]

I (7708) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:1, idle:1, candidate:0, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]<>
I (7708) mesh: [FAIL][13]root:12, fail:1, normal:0, <pre>backoff:0

I (8018) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (8018) mesh: [SCAN:13/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-94,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (8338) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (8338) mesh: [SCAN:14/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (8658) mesh: [SCAN][ch:1]AP:2, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]<>
I (8658) mesh: [FAIL][16]root:14, fail:2, normal:0, <pre>backoff:0

I (8968) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (8968) mesh: [SCAN:15/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (9288) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (9288) mesh: [SCAN:16/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-89,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (9608) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (9608) mesh: [SCAN:17/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-92,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (9928) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (9928) mesh: [SCAN:18/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (10248) mesh: [SCAN][ch:1]AP:4, other(ID:0, RD:0), MAP:1, idle:1, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (10248) mesh: [SCAN:19/20+x+]rc[127][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:2(0.00)percent:1.00][127,2,08:3a:8d:80:44:4d]

I (10568) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (10568) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-92], mine:0, voter:0
I (10578) mesh: [SCAN:20/20+x+]rc[126][08:3a:8d:80:44:4d,-88], self[08:b6:1f:ff:b1:80,-92,reason:0,votes:0,idle][mine:0,voter:1(0.00)percent:1.00][126,2,08:3a:8d:80:44:4d]

I (10888) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (10888) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-91], mine:0, voter:0
I (10898) mesh: 815[SCAN]the heard rc[08:3a:8d:80:44:4d], vote_ttl:126 <= last ttl:126, expired
I (10908) mesh: [SCAN:21/20+x+]rc[0,expire][00:00:00:00:00:00,-88], self[08:b6:1f:ff:b1:80,-91,reason:0,votes:0,idle][mine:0,voter:0(0.00)percent:1.00][0,0,00:00:00:00:00:00]

I (11228) mesh: [SCAN][ch:1]AP:2, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]<>
I (11228) mesh: [FAIL][24]root:21, fail:3, normal:0, <pre>backoff:0

I (11358) mesh: [SCAN][ch:1]AP:3, other(ID:0, RD:0), MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1][c0:74:ad:cd:6a:49]router found<>
I (11358) mesh: 1330[SCAN]init rc[08:b6:1f:ff:b1:81,-89], mine:0, voter:0
I (11358) mesh: 1368, vote myself, router rssi:-89 > voted rc_rssi:-120
I (11368) mesh: [SCAN:22/20+x+]rc[128][08:b6:1f:ff:b1:81,-89], self[08:b6:1f:ff:b1:80,-89,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,08:b6:1f:ff:b1:81]

I (11388) mesh: [scan]new scanning time:600ms, beacon interval:300ms
I (11398) mesh: [DONE]connect to router:EWS-2ND F, channel:1, rssi:-89, c0:74:ad:cd:6a:49[layer:0, assoc:0], my_vote_num:1/voter_num:1, rc[08:b6:1f:ff:b1:81/-89/1]
I (14138) wifi:new:<1,1>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (14138) wifi:state: init -> auth (b0)
I (16508) wifi:state: auth -> assoc (0)
I (16528) wifi:state: assoc -> run (10)
I (18638) wifi:state: run -> init (fc0)
I (18638) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (18648) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:15
I (18648) mesh: [wifi]disconnected reason:15(4-way handshake timeout), continuous:1/max:12, root, vote(,stopped)<><>
I (21328) mesh: [wifi]disconnected reason:205(), continuous:2/max:12, root, vote(,stopped)<><>
I (21328) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (21748) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (21758) wifi:state: init -> auth (b0)
I (27238) wifi:state: auth -> init (200)
I (27238) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (27238) mesh: [wifi]disconnected reason:2(auth expire), continuous:3/max:12, root, vote(,stopped)<><>
I (27238) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (29908) mesh: [wifi]disconnected reason:205(), continuous:4/max:12, root, vote(,stopped)<><>
I (29908) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (30008) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (30008) wifi:state: init -> auth (b0)
I (32408) wifi:state: auth -> assoc (0)
I (33408) wifi:state: assoc -> init (2700)
I (33418) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (33418) mesh: [wifi]disconnected reason:39(), continuous:5/max:12, root, vote(,stopped)<><>
I (33418) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:39
I (36088) mesh: [wifi]disconnected reason:205(), continuous:6/max:12, root, vote(,stopped)<><>
I (36088) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (36098) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (36098) wifi:state: init -> auth (b0)
I (41598) wifi:state: auth -> init (200)
I (41598) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (41608) mesh: [wifi]disconnected reason:2(auth expire), continuous:7/max:12, root, vote(,stopped)<><>
I (41608) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (44278) mesh: [wifi]disconnected reason:205(), continuous:8/max:12, root, vote(,stopped)<><>
I (44278) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (44348) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (44348) wifi:state: init -> auth (b0)
I (49818) wifi:state: auth -> init (200)
I (49818) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (49818) mesh: [wifi]disconnected reason:2(auth expire), continuous:9/max:12, root, vote(,stopped)<><>
I (49818) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (52488) mesh: [wifi]disconnected reason:205(), continuous:10/max:12, root, vote(,stopped)<><>
I (52488) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (52498) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (52508) wifi:state: init -> auth (b0)
I (58048) wifi:state: auth -> init (200)
I (58048) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (58048) mesh: [wifi]disconnected reason:2(auth expire), continuous:11/max:12, root, vote(,stopped)<><>
I (58048) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (60718) mesh: [wifi]disconnected reason:205(), continuous:12/max:12, root, vote(,stopped)<><>
I (60718) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (63388) mesh: [wifi]disconnected reason:201(), continuous:0/max:12, root, vote(,stopped)<><>
I (63388) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201
I (63388) mesh: <MESH_NWK_PARENT_DISCONNECTED>root, need_reselect:1
I (63468) wifi:new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (63478) wifi:state: init -> auth (b0)
I (65778) wifi:state: auth -> assoc (0)
I (66788) wifi:state: assoc -> init (2700)
I (66788) wifi:new:<1,0>, old:<1,1>, ap:<1,1>, sta:<1,0>, prof:1
I (66788) mesh: [wifi]disconnected reason:39(), continuous:1/max:12, root, vote(,stopped)<><> 
I (66788) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:39
I (67568) wifi:ap channel adjust o:1,1 n:6,2
I (67568) wifi:new:<6,0>, old:<1,0>, ap:<6,2>, sta:<6,0>, prof:1
I (67568) wifi:state: init -> auth (b0)
I (73048) wifi:state: auth -> init (200)
I (73058) wifi:new:<6,0>, old:<6,0>, ap:<6,2>, sta:<6,0>, prof:1
I (73058) mesh: [wifi]disconnected reason:2(auth expire), continuous:2/max:12, root, vote(,stopped)<><>
I (73058) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (74618) wifi:ap channel adjust o:6,2 n:11,2
I (74618) wifi:new:<11,0>, old:<6,0>, ap:<11,2>, sta:<11,0>, prof:1
I (74628) wifi:state: init -> auth (b0)
I (77038) wifi:state: auth -> assoc (0)
I (78038) wifi:state: assoc -> init (2700)
I (78048) wifi:new:<11,0>, old:<11,0>, ap:<11,2>, sta:<11,0>, prof:1
I (78048) mesh: [wifi]disconnected reason:39(), continuous:3/max:12, root, vote(,stopped)<><> 
I (78048) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:39
I (80718) mesh: [wifi]disconnected reason:205(), continuous:4/max:12, root, vote(,stopped)<><>
I (80718) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (80798) wifi:ap channel adjust o:11,2 n:1,1
I (80798) wifi:new:<1,0>, old:<11,0>, ap:<1,1>, sta:<1,0>, prof:1
I (80798) wifi:state: init -> auth (b0)
I (80808) wifi:state: auth -> assoc (0)
I (80838) wifi:state: assoc -> run (10)
I (80858) wifi:connected with EWS-2ND F, aid = 2, channel 1, BW20, bssid = c0:74:ad:cd:6a:49
I (80858) wifi:security: WPA3-SAE, phy: bgn, rssi: -85
I (80888) wifi:Set ps type: 0

I (80898) wifi:pm start, type: 0

I (80918) mesh: <nvs>write layer:1
I (80918) mesh: <flush>upstream packets, connections(max):8, waiting:0, upQ:0
I (80918) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:0-->1, parent:c0:74:ad:cd:6a:49<ROOT>, ID:11:12:13:14:15:16, duty:0
I (80918) mesh: <flush>root
I (80928) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (80938) wifi:I (80928) mesh: [TXQ]<max:128>up(0, be:0), down(0, be:0), mgmt:0, xon(req:0, rsp:0), bcast:0, wnd(0, parent:00:00:00:00:00:00)
<ba-add>idx:0 (ifx:0, c0:74:ad:cd:6a:49), tid:0, ssn:0, winSize:64
I (80948) mesh: [RXQ]<max:128 = cfg:128 + extra:0>self:0, <max:128 = cfg:128 + extra:0>tods:0 
I (80938) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:08:b6:1f:ff:b1:81
I (80928) mesh_main: The Total Nodes in Network are 1
I (80978) mesh_main: This node is Root Node
I (80978) mesh_main: This is routing table : 08:b6:1f:ff:b1:80 and the current layer is 1
I (80988) mesh_main: layer:1, rtableSize:1, ROOT
I (81308) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (82928) esp_netif_handlers: sta ip: 172.16.0.54, mask: 255.255.255.0, gw: 172.16.0.1
I (82928) mesh_main: <IP_EVENT_STA_GOT_IP>IP:172.16.0.54
I (85988) mesh_main: The Total Nodes in Network are 1
I (85988) mesh_main: This node is Root Node
I (85988) mesh_main: This is routing table : 08:b6:1f:ff:b1:80 and the current layer is 1     
I (85998) mesh_main: layer:1, rtableSize:1, ROOT
I (90998) mesh_main: The Total Nodes in Network are 1
I (90998) mesh_main: This node is Root Node
I (90998) mesh_main: This is routing table : 08:b6:1f:ff:b1:80 and the current layer is 1     
I (90998) mesh_main: layer:1, rtableSize:1, ROOT
I (96008) mesh_main: The Total Nodes in Network are 1
I (96008) mesh_main: This node is Root Node
I (96008) mesh_main: This is routing table : 08:b6:1f:ff:b1:80 and the current layer is 1     
I (96008) mesh_main: layer:1, rtableSize:1, ROOT
I (101018) mesh_main: The Total Nodes in Network are 1

More Information.

No response

@amitabhskrishworks amitabhskrishworks added the Type: Bug bugs in IDF label Oct 3, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 3, 2023
@github-actions github-actions bot changed the title Mesh Internal communication : 2 nodes are becoming root node in self organizing network. Mesh Internal communication : 2 nodes are becoming root node in self organizing network. (IDFGH-11175) Oct 3, 2023
@zhangyanjiaoesp
Copy link
Collaborator

@amitabhskrishworks
Have you called the API esp_mesh_allow_root_conflicts(true) ?

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Oct 17, 2023
@amitabhskrishworks
Copy link
Author

No i have not used this option .

@amitabhskrishworks
Copy link
Author

@amitabhskrishworks Have you called the API esp_mesh_allow_root_conflicts(true) ?

No

@zhangyanjiaoesp
Copy link
Collaborator

when the device2 becomes root, the device1 still be root? The log shows that there is 1 node in the network.

I (101018) mesh_main: The Total Nodes in Network are 1

@amitabhskrishworks
Copy link
Author

amitabhskrishworks commented Oct 20, 2023

Yes
The device 1 shows that it (device 1) is root node and device 2 shows that it (device 2) is root node.
The total node count using esp_mesh_get_total_node_num method returns 1 for both devices.

@amitabhskrishworks
Copy link
Author

Collaborator

2 mesh network get formed with same Mesh ID

@zhangyanjiaoesp
Copy link
Collaborator

@amitabhskrishworks Did you test just with the internal_communication without any changes? If yes, I will test it locally to reproduce this issue.

@amitabhskrishworks
Copy link
Author

Yes i did not made any changes except adding some logs

@zhangyanjiaoesp
Copy link
Collaborator

@amitabhskrishworks I have tested locally, and I didn't reproduce your issue. And I noticed that your rssi from the router is -83/-85, can you get your devices closer to the router and test it again?

@amitabhskrishworks
Copy link
Author

amitabhskrishworks commented Nov 2, 2023

I tested it and got the same result but this time with lesser frequency.
Out of 10 4 times both of the node became root

@amitabhskrishworks
Copy link
Author

This is my full code which makes 2 root nodes when 2 nodes are switched ON simultaneously
I have node used the code relaed to mesh_light

#include <string.h>
#include <inttypes.h>
#include "esp_wifi.h"
#include "esp_mac.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_mesh.h"
#include "nvs_flash.h"
#include <stdio.h>
#include <stdlib.h>

#define RX_SIZE (1500)
#define TX_SIZE (1460)

static const char *MESH_TAG = "mesh_main";
static const uint8_t MESH_ID[6] = { 0x11, 0x12, 0x13, 0x14, 0x15, 0x16};
static uint8_t tx_buf[TX_SIZE] = { 0, };
static uint8_t rx_buf[RX_SIZE] = { 0, };
static bool is_running = true;
static bool is_mesh_connected = false;
static mesh_addr_t mesh_parent_addr;
static int mesh_layer = -1;
static esp_netif_t *netif_sta = NULL;

void esp_mesh_p2p_tx_main(void *arg)
{
ESP_LOGI(MESH_TAG, " esp_mesh_p2p_tx_main tasks is about to start ");
int i = 0, route_table_size = 0, j = 0;
//int send_count = 0;
char *str="UPSTREAM DATA BY Shubham Kanaujiya";
bool is_running = true;
esp_err_t err;
mesh_addr_t route_table[CONFIG_MESH_ROUTE_TABLE_SIZE];
mesh_addr_t route_tables[CONFIG_MESH_ROUTE_TABLE_SIZE];
mesh_data_t data;
data.data = (uint8_t *) str;
data.data = tx_buf;
data.size = sizeof(tx_buf);
data.proto = MESH_PROTO_BIN;
data.tos = MESH_TOS_P2P;

while (is_running)
{
    ESP_LOGI(MESH_TAG, "The Total Nodes in Network are %d",esp_mesh_get_total_node_num());
    esp_mesh_get_routing_table((mesh_addr_t *)&route_tables, CONFIG_MESH_ROUTE_TABLE_SIZE * 6, &route_table_size);
    if (esp_mesh_is_root())
    {
        ESP_LOGI(MESH_TAG, "This node is Root Node");
        for (i = 0; i < route_table_size; i++)
        {
            ESP_LOGI(MESH_TAG, "This is routing table : " MACSTR " and the current layer is %d", MAC2STR(route_tables[i].addr),
            esp_mesh_get_layer());
        }
    }
    else
    {
        ESP_LOGI(MESH_TAG, "This node is Non-Root node ");
        for (i = 0; i < route_table_size; i++)
        {
            ESP_LOGI(MESH_TAG, "This is routing table : " MACSTR " and the current layer is %d", MAC2STR(route_tables[i].addr),
            esp_mesh_get_layer());
        }
    }
    
    if (esp_mesh_is_root())
    {
        ESP_LOGI(MESH_TAG, "layer:%d, rtableSize:%d, %s", mesh_layer, esp_mesh_get_routing_table_size(),
                 (is_mesh_connected && esp_mesh_is_root()) ? "ROOT" : is_mesh_connected ? "NODE" : "DISCONNECT");
        vTaskDelay( pdMS_TO_TICKS(5000) );
        continue;
    }
    else
    {
        esp_mesh_get_routing_table((mesh_addr_t *)&route_table, CONFIG_MESH_ROUTE_TABLE_SIZE * 6, &route_table_size);
        vTaskDelay(pdMS_TO_TICKS(100));
        err = esp_mesh_send(NULL, &data, MESH_DATA_P2P, NULL, 0);
        if (err)
        {
            ESP_LOGE(MESH_TAG, "There was an error in sending data to root node");
        }
        vTaskDelay(2000 / portTICK_PERIOD_MS);
    }
    /* if route_table_size is less than 10, add delay to avoid watchdog in this task. */
    if (route_table_size < 10)
    {
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}
vTaskDelete(NULL);

}

void esp_mesh_p2p_rx_main(void *arg)
{
ESP_LOGI(MESH_TAG, " esp_mesh_p2p_rx_main tasks is about to start ");
esp_err_t err;
mesh_addr_t from;
mesh_data_t data;
int flag = 0;
data.data = rx_buf;
data.size = RX_SIZE;
is_running = true;

while (is_running)
{
    data.size = RX_SIZE;
    err = esp_mesh_recv(&from, &data, portMAX_DELAY, &flag, NULL, 0);
    ESP_LOGI(MESH_TAG, "Receiving Data in Mesh Network from Node : " MACSTR "", MAC2STR(from.addr));
    ESP_LOGI(MESH_TAG, "Data : %s ", data.data);
    if (err != ESP_OK || !data.size)
    {
        ESP_LOGI(MESH_TAG, "err:0x%x, size:%d", err, data.size);
        continue;
    }
}
vTaskDelete(NULL);

}

esp_err_t esp_mesh_comm_p2p_start(void)
{
static bool is_comm_p2p_started = false;
if (!is_comm_p2p_started)
{
ESP_LOGI(MESH_TAG, " tasks are about to start ");
is_comm_p2p_started = true;
xTaskCreate(esp_mesh_p2p_tx_main, "MPTX", 8192, NULL, 5, NULL);
xTaskCreate(esp_mesh_p2p_rx_main, "MPRX", 8192, NULL, 5, NULL);
}
return ESP_OK;
}

void mesh_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
{
mesh_addr_t id = {0,};
static uint16_t last_layer = 0;

switch (event_id) {
case MESH_EVENT_STARTED: {
    esp_mesh_get_id(&id);
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_MESH_STARTED>ID:"MACSTR"", MAC2STR(id.addr));
    is_mesh_connected = false;
    mesh_layer = esp_mesh_get_layer();
}
break;
case MESH_EVENT_STOPPED: {
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_STOPPED>");
    is_mesh_connected = false;
    mesh_layer = esp_mesh_get_layer();
}
break;
case MESH_EVENT_CHILD_CONNECTED: {
    mesh_event_child_connected_t *child_connected = (mesh_event_child_connected_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_CHILD_CONNECTED>aid:%d, "MACSTR"",
             child_connected->aid,
             MAC2STR(child_connected->mac));
}
break;
case MESH_EVENT_CHILD_DISCONNECTED: {
    mesh_event_child_disconnected_t *child_disconnected = (mesh_event_child_disconnected_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_CHILD_DISCONNECTED>aid:%d, "MACSTR"",
             child_disconnected->aid,
             MAC2STR(child_disconnected->mac));
}
break;
case MESH_EVENT_ROUTING_TABLE_ADD: {
    mesh_event_routing_table_change_t *routing_table = (mesh_event_routing_table_change_t *)event_data;
    ESP_LOGW(MESH_TAG, "<MESH_EVENT_ROUTING_TABLE_ADD>add %d, new:%d, layer:%d",routing_table->rt_size_change,routing_table->rt_size_new, mesh_layer);
}
break;
case MESH_EVENT_ROUTING_TABLE_REMOVE: {
    mesh_event_routing_table_change_t *routing_table = (mesh_event_routing_table_change_t *)event_data;
    ESP_LOGW(MESH_TAG, "<MESH_EVENT_ROUTING_TABLE_REMOVE>remove %d, new:%d, layer:%d",
             routing_table->rt_size_change,
             routing_table->rt_size_new, mesh_layer);
}
break;
case MESH_EVENT_NO_PARENT_FOUND: {
    mesh_event_no_parent_found_t *no_parent = (mesh_event_no_parent_found_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_NO_PARENT_FOUND>scan times:%d",
             no_parent->scan_times);
}
/* TODO handler for the failure */
break;
case MESH_EVENT_PARENT_CONNECTED: {
    mesh_event_connected_t *connected = (mesh_event_connected_t *)event_data;
    esp_mesh_get_id(&id);
    mesh_layer = connected->self_layer;
    memcpy(&mesh_parent_addr.addr, connected->connected.bssid, 6);

    ESP_LOGI(MESH_TAG, " MAC ID of Parent is:"MACSTR" ",MAC2STR(mesh_parent_addr.addr));

    ESP_LOGI(MESH_TAG, " MAC ID of Parent is:"MACSTR" ",MAC2STR(mesh_parent_addr.addr));

    // ESP_LOGI(MESH_TAG, "<MESH_EVENT_PARENT_CONNECTED>layer:%d-->%d, parent:"MACSTR"%s, ID:"MACSTR", duty:%d",last_layer, mesh_layer,
    //         MAC2STR(mesh_parent_addr.addr),esp_mesh_is_root() ? "<ROOT>" :(mesh_layer == 2) ? "<layer2>" : "", MAC2STR(id.addr), connected->duty);
    
    last_layer = mesh_layer;
    is_mesh_connected = true;
    if (esp_mesh_is_root()) {
        esp_netif_dhcpc_stop(netif_sta);
        esp_netif_dhcpc_start(netif_sta);
    }
    esp_mesh_comm_p2p_start();
}
break;
case MESH_EVENT_PARENT_DISCONNECTED: {
    mesh_event_disconnected_t *disconnected = (mesh_event_disconnected_t *)event_data;
    ESP_LOGI(MESH_TAG,"<MESH_EVENT_PARENT_DISCONNECTED>reason:%d",disconnected->reason);
    is_mesh_connected = false;
    mesh_layer = esp_mesh_get_layer();
}
break;
case MESH_EVENT_LAYER_CHANGE: {
    mesh_event_layer_change_t *layer_change = (mesh_event_layer_change_t *)event_data;
    mesh_layer = layer_change->new_layer;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_LAYER_CHANGE>layer:%d-->%d%s",
             last_layer, mesh_layer,
             esp_mesh_is_root() ? "<ROOT>" :
             (mesh_layer == 2) ? "<layer2>" : "");
    last_layer = mesh_layer;
}
break;
case MESH_EVENT_ROOT_ADDRESS: {
    mesh_event_root_address_t *root_addr = (mesh_event_root_address_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_ROOT_ADDRESS>root address:"MACSTR"",
             MAC2STR(root_addr->addr));
}
break;
case MESH_EVENT_VOTE_STARTED: {
    mesh_event_vote_started_t *vote_started = (mesh_event_vote_started_t *)event_data;
    ESP_LOGI(MESH_TAG,
             "<MESH_EVENT_VOTE_STARTED>attempts:%d, reason:%d, rc_addr:"MACSTR"",
             vote_started->attempts,
             vote_started->reason,
             MAC2STR(vote_started->rc_addr.addr));
}
break;
case MESH_EVENT_VOTE_STOPPED: {
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_VOTE_STOPPED>");
    break;
}
case MESH_EVENT_ROOT_SWITCH_REQ: {
    mesh_event_root_switch_req_t *switch_req = (mesh_event_root_switch_req_t *)event_data;
    ESP_LOGI(MESH_TAG,
             "<MESH_EVENT_ROOT_SWITCH_REQ>reason:%d, rc_addr:"MACSTR"",
             switch_req->reason,
             MAC2STR( switch_req->rc_addr.addr));
}
break;
case MESH_EVENT_ROOT_SWITCH_ACK: {
    /* new root */
    mesh_layer = esp_mesh_get_layer();
    esp_mesh_get_parent_bssid(&mesh_parent_addr);
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_ROOT_SWITCH_ACK>layer:%d, parent:"MACSTR"", mesh_layer, MAC2STR(mesh_parent_addr.addr));
}
break;
case MESH_EVENT_TODS_STATE: {
    mesh_event_toDS_state_t *toDs_state = (mesh_event_toDS_state_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_TODS_REACHABLE>state:%d", *toDs_state);
}
break;
case MESH_EVENT_ROOT_FIXED: {
    mesh_event_root_fixed_t *root_fixed = (mesh_event_root_fixed_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_ROOT_FIXED>%s",
             root_fixed->is_fixed ? "fixed" : "not fixed");
}
break;
case MESH_EVENT_ROOT_ASKED_YIELD: {
    mesh_event_root_conflict_t *root_conflict = (mesh_event_root_conflict_t *)event_data;
    ESP_LOGI(MESH_TAG,
             "<MESH_EVENT_ROOT_ASKED_YIELD>"MACSTR", rssi:%d, capacity:%d",
             MAC2STR(root_conflict->addr),
             root_conflict->rssi,
             root_conflict->capacity);
}
break;
case MESH_EVENT_CHANNEL_SWITCH: {
    mesh_event_channel_switch_t *channel_switch = (mesh_event_channel_switch_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_CHANNEL_SWITCH>new channel:%d", channel_switch->channel);
}
break;
case MESH_EVENT_SCAN_DONE: {
    mesh_event_scan_done_t *scan_done = (mesh_event_scan_done_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_SCAN_DONE>number:%d",
             scan_done->number);
}
break;
case MESH_EVENT_NETWORK_STATE: {
    mesh_event_network_state_t *network_state = (mesh_event_network_state_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_NETWORK_STATE>is_rootless:%d",
             network_state->is_rootless);
}
break;
case MESH_EVENT_STOP_RECONNECTION: {
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_STOP_RECONNECTION>");
}
break;
case MESH_EVENT_FIND_NETWORK: {
    mesh_event_find_network_t *find_network = (mesh_event_find_network_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_FIND_NETWORK>new channel:%d, router BSSID:"MACSTR"",
             find_network->channel, MAC2STR(find_network->router_bssid));
}
break;
case MESH_EVENT_ROUTER_SWITCH: {
    mesh_event_router_switch_t *router_switch = (mesh_event_router_switch_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_ROUTER_SWITCH>new router:%s, channel:%d, "MACSTR"",
             router_switch->ssid, router_switch->channel, MAC2STR(router_switch->bssid));
}
break;
case MESH_EVENT_PS_PARENT_DUTY: {
    mesh_event_ps_duty_t *ps_duty = (mesh_event_ps_duty_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_PS_PARENT_DUTY>duty:%d", ps_duty->duty);
}
break;
case MESH_EVENT_PS_CHILD_DUTY: {
    mesh_event_ps_duty_t *ps_duty = (mesh_event_ps_duty_t *)event_data;
    ESP_LOGI(MESH_TAG, "<MESH_EVENT_PS_CHILD_DUTY>cidx:%d, "MACSTR", duty:%d", ps_duty->child_connected.aid-1,
            MAC2STR(ps_duty->child_connected.mac), ps_duty->duty);
}
break;
default:
    ESP_LOGI(MESH_TAG, "unknown id:%" PRId32 "", event_id);
    break;
}

}

void ip_event_handler(void *arg, esp_event_base_t event_base, int32_t event_id, void *event_data)
{
ip_event_got_ip_t *event = (ip_event_got_ip_t *) event_data;
ESP_LOGI(MESH_TAG, "<IP_EVENT_STA_GOT_IP>IP:" IPSTR, IP2STR(&event->ip_info.ip));

}

void app_main(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
/* tcpip initialization /
ESP_ERROR_CHECK(esp_netif_init());
/
event initialization /
ESP_ERROR_CHECK(esp_event_loop_create_default());
/
create network interfaces for mesh (only station instance saved for further manipulation, soft AP instance ignored /
ESP_ERROR_CHECK(esp_netif_create_default_wifi_mesh_netifs(&netif_sta, NULL));
/
wifi initialization /
wifi_init_config_t config = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&config));
ESP_ERROR_CHECK(esp_event_handler_register(IP_EVENT, IP_EVENT_STA_GOT_IP, &ip_event_handler, NULL));
ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_FLASH));
ESP_ERROR_CHECK(esp_wifi_start());
/
mesh initialization /
ESP_ERROR_CHECK(esp_mesh_init());
ESP_ERROR_CHECK(esp_event_handler_register(MESH_EVENT, ESP_EVENT_ANY_ID, &mesh_event_handler, NULL));
/
set mesh topology /
ESP_ERROR_CHECK(esp_mesh_set_topology(CONFIG_MESH_TOPOLOGY));
/
set mesh max layer according to the topology /
ESP_ERROR_CHECK(esp_mesh_set_max_layer(CONFIG_MESH_MAX_LAYER));
ESP_ERROR_CHECK(esp_mesh_set_vote_percentage(1));
ESP_ERROR_CHECK(esp_mesh_set_xon_qsize(128));
#ifdef CONFIG_MESH_ENABLE_PS
/
Enable mesh PS function /
ESP_ERROR_CHECK(esp_mesh_enable_ps());
/
better to increase the associate expired time, if a small duty cycle is set. /
ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(60));
/
better to increase the announce interval to avoid too much management traffic, if a small duty cycle is set. /
ESP_ERROR_CHECK(esp_mesh_set_announce_interval(600, 3300));
#else
/
Disable mesh PS function /
ESP_ERROR_CHECK(esp_mesh_disable_ps());
ESP_ERROR_CHECK(esp_mesh_set_ap_assoc_expire(10));
#endif
mesh_cfg_t cfg = MESH_INIT_CONFIG_DEFAULT();
/
mesh ID */
memcpy((uint8_t ) &cfg.mesh_id, MESH_ID, 6);
/
router */
cfg.channel = CONFIG_MESH_CHANNEL;
cfg.router.ssid_len = strlen(CONFIG_MESH_ROUTER_SSID);
memcpy((uint8_t *) &cfg.router.ssid, CONFIG_MESH_ROUTER_SSID, cfg.router.ssid_len);
memcpy((uint8_t ) &cfg.router.password, CONFIG_MESH_ROUTER_PASSWD,
strlen(CONFIG_MESH_ROUTER_PASSWD));
/
mesh softAP */
ESP_ERROR_CHECK(esp_mesh_set_ap_authmode(CONFIG_MESH_AP_AUTHMODE));
cfg.mesh_ap.max_connection = CONFIG_MESH_AP_CONNECTIONS;
cfg.mesh_ap.nonmesh_max_connection = CONFIG_MESH_NON_MESH_AP_CONNECTIONS;
memcpy((uint8_t ) &cfg.mesh_ap.password, CONFIG_MESH_AP_PASSWD,
strlen(CONFIG_MESH_AP_PASSWD));
ESP_ERROR_CHECK(esp_mesh_set_config(&cfg));
/
mesh start /
ESP_ERROR_CHECK(esp_mesh_start());
#ifdef CONFIG_MESH_ENABLE_PS
/
set the device active duty cycle. (default:10, MESH_PS_DEVICE_DUTY_REQUEST) /
ESP_ERROR_CHECK(esp_mesh_set_active_duty_cycle(CONFIG_MESH_PS_DEV_DUTY, CONFIG_MESH_PS_DEV_DUTY_TYPE));
/
set the network active duty cycle. (default:10, -1, MESH_PS_NETWORK_DUTY_APPLIED_ENTIRE) */
ESP_ERROR_CHECK(esp_mesh_set_network_duty_cycle(CONFIG_MESH_PS_NWK_DUTY, CONFIG_MESH_PS_NWK_DUTY_DURATION, CONFIG_MESH_PS_NWK_DUTY_RULE));
#endif
ESP_LOGI(MESH_TAG, "mesh starts successfully, heap:%" PRId32 ", %s<%d>%s, ps:%d\n", esp_get_minimum_free_heap_size(),
esp_mesh_is_root_fixed() ? "root fixed" : "root not fixed",
esp_mesh_get_topology(), esp_mesh_get_topology() ? "(chain)":"(tree)", esp_mesh_is_ps_enabled());

}

@zhangyanjiaoesp
Copy link
Collaborator

I just run the above code can reproduce the problem, right?

@amitabhskrishworks
Copy link
Author

amitabhskrishworks commented Nov 6, 2023

yes
Please note that if you will switch ON nodes one after another then this problem doesn't occurs.

@zhangyanjiaoesp
Copy link
Collaborator

please provide the IDF branch commit id you used.

@amitabhskrishworks
Copy link
Author

ESP IDF version - v5.0.4
Is IDF branch commit id, other thing ?

@zhangyanjiaoesp
Copy link
Collaborator

ESP IDF version - v5.0.4 Is IDF branch commit id, other thing ?

OK, so the commit id is 8fbf4ba, I will test on it.

@zhangyanjiaoesp
Copy link
Collaborator

Have tested based on your code for 20 times, still can't reproduce your issue. Can you provide your sdkconfig file?

@amitabhskrishworks
Copy link
Author

amitabhskrishworks commented Nov 17, 2023

Here is the sdkconfig file in text format
sdk_config.txt

@zhangyanjiaoesp
Copy link
Collaborator

@amitabhskrishworks Do you use the ESP32 device with PSRAM?

@amitabhskrishworks
Copy link
Author

Yes i used PSRAM.
Is that the issue ?

@zhangyanjiaoesp
Copy link
Collaborator

I'm not sure, I will test on the PSRAM devices with the same code and sdkconfig with yours and feedback to you.

@zhangyanjiaoesp
Copy link
Collaborator

@amitabhskrishworks
I can reproduce the problem now ! It's seems not related to PSRAM, and it related to the mesh PS and the router.

When I enable the mesh PS in the menuconfig, and try to connect to a WPA3 router, the problem can be reproduced.
image

when I disable the mesh PS in menuconfig, and try to connect to a WPA3 router, the problem can't be reproduced.
when I enable the mesh PS in the menuconfig, and try to connect to a WPA2 router, the problem can't be reproduced.

My WPA3 router is Xiaomi AX6000, can you provide the type of your router and show me the setting of it ? So I can use the same router with yours to debug, this can ensure the behavior of the router is same.

@amitabhskrishworks
Copy link
Author

@zhangyanjiaoesp Thanks for identifying the cause of issue. My router configurations are:
SSID: EWS-2ND F
Protocol: Wi-Fi 4 (802.11n)
Security type: WPA3-Personal
Manufacturer: Intel Corporation
Description: Intel(R) Wireless-AC 9560 160MHz
Driver version: 22.0.1.1
Network band: 2.4 GHz
Network channel: 3
Link speed (Receive/Transmit): 144/144 (Mbps)

@kdm2223
Copy link

kdm2223 commented Jan 12, 2024

We also encountered a situation with two root nodes and are hoping for a good solution.

@zhangyanjiaoesp
Copy link
Collaborator

zhangyanjiaoesp commented Apr 10, 2024

@amitabhskrishworks Sorry to reply you so late. I was held up by something else. I checked the mesh code and found that the default configuration of esp_mesh_allow_root_conflicts() is true, so the conflict cannot be resolved when there are two roots in the test. After I call esp_mesh_allow_root_conflicts(false) to disable it, the roots conflict can be solved.

Here is my logs using the internal_communication:

device1:

I (8812) mesh: [DONE]connect to router:xiaomi_ax6000, channel:6, rssi:-19, a4:39:b3:db:af:c6[layer:0, assoc:0], my_vote_num:2/voter_num:2, rc[64:b7:08:29:2b:a5/-19/1]
I (8842) wifi:new:<6,1>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (8842) wifi:state: init -> auth (b0)
I (10132) wifi:state: auth -> assoc (0)
I (10162) wifi:Association refused temporarily, comeback time 1000 (TUs)
I (11182) wifi:state: assoc -> assoc (0)
I (12182) wifi:state: assoc -> init (200)
I (12182) wifi:new:<6,0>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (12192) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:202
I (12192) mesh: [wifi]disconnected reason:202(), continuous:1/max:12, root, vote(,stopped)<><>
I (14862) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (14862) mesh: [wifi]disconnected reason:205(), continuous:2/max:12, root, vote(,stopped)<><>
I (14892) wifi:new:<6,1>, old:<6,0>, ap:<6,1>, sta:<6,0>, prof:6
I (14892) wifi:state: init -> auth (b0)
I (16442) wifi:state: auth -> assoc (0)
I (16502) wifi:state: assoc -> run (10)
I (16532) wifi:connected with xiaomi_ax6000, aid = 1, channel 6, BW20, bssid = a4:39:b3:db:af:c6
I (16532) wifi:security: WPA3-SAE, phy: bgn, rssi: -21
I (16542) wifi:pm start, type: 0
I (16542) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (16552) mesh: [scan]new scanning time:600ms, beacon interval:300ms
I (16562) mesh: write layer:1
I (16562) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:0-->1, parent:a4:39:b3:db:af:c6, ID:77:77:77:77:77:77, duty:0
I (16572) mesh: upstream packets, connections(max):6, waiting:0, upQ:0
I (16572) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (16582) mesh: root
I (16582) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:64:b7:08:29:2b:a5
I (16582) mesh: [TXQ]max:128up(0, be:0), down(0, be:0), mgmt:0, xon(req:0, rsp:0), bcast:0, wnd(0, parent:00:00:00:00:00:00)
I (16602) mesh: [RXQ]<max:128 = cfg:128 + extra:0>self:0, <max:128 = cfg:128 + extra:0>tods:0
I (16642) wifi:idx:0 (ifx:0, a4:39:b3:db:af:c6), tid:6, ssn:2, winSize:64
I (16702) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (18072) esp_netif_handlers: sta ip: 192.168.31.42, mask: 255.255.255.0, gw: 192.168.31.1
I (18072) mesh_main: <IP_EVENT_STA_GOT_IP>IP:192.168.31.42
W (27382) wifi:2518len:37, max_ie_len:37, now:26201
W (27382) wifi:2538[used:0,1,0,0], count<announce:0, yield:2, fixed:0, gone:0>, expire[fixed:0, gone:0]
I (27392) mesh: <MESH_NWK_MIE_CHANGE><><><><><><>
I (32592) wifi:new:<6,1>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (32592) wifi:station: 64:b7:08:29:31:f4 join, AID=1, bgn, 40U
I (32602) mesh_main: <MESH_EVENT_PS_CHILD_DUTY>cidx:0, 64:b7:08:29:31:f4, duty:0
W (32622) mesh_main: <MESH_EVENT_ROUTING_TABLE_ADD>add 1, new:2, layer:1
I (32632) mesh: write assoc:1
I (32632) mesh_main: <MESH_EVENT_CHILD_CONNECTED>aid:1, 64:b7:08:29:31:f4
I (32632) mesh: <MESH_NWK_ROOT_ADDR>root, layer:1, child:64:b7:08:29:31:f5, conflict_roots.num:1
W (48272) wifi:2193open time expires, duration:14 seconds, expire<fixed:1, gone:0>, my_ie_len:0, conflict_roots->num:1
W (48582) wifi:2491len:0, max_ie_len:37, conflict_roots>num:1
I (48582) mesh: eliminate redundant roots, 20 seconds
I (48582) mesh: <MESH_NWK_MIE_CHANGE><><><><><><>
W (118642) mesh_main: [ROOT-2-UNICAST:100][L:1][rtableSize:2]parent:a4:39:b3:db:af:c6 to 64:b7:08:29:2b:a4, heap:160776[err:0x0, proto:0, tos:0]
W (118642) mesh_main: [#RX:100/100][L:1] parent:a4:39:b3:db:af:c6, receive from 64:b7:08:29:2b:a4, size:1460, heap:160776, flag:0[err:0x0, proto:0, tos:0]
W (118652) mesh_main: [ROOT-2-UNICAST:100][L:1][rtableSize:2]parent:a4:39:b3:db:af:c6 to 64:b7:08:29:31:f4, heap:160776[err:0x0, proto:0, tos:0]
I (119672) mesh_main: size:2/2,send_count:100
I (132622) mesh: [scan]new scanning time:1500ms, beacon interval:1000ms
W (171662) wifi:2004close time expires, duration:117 seconds, expire<fixed:0, gone:0>, my_ie_len:0, conflict_roots->num:0
W (219362) mesh_main: [#RX:200/200][L:1] parent:a4:39:b3:db:af:c6, receive from 64:b7:08:29:2b:a4, size:1460, heap:160600, flag:0[err:0x0, proto:0, tos:0]
W (219362) mesh_main: [ROOT-2-UNICAST:200][L:1][rtableSize:2]parent:a4:39:b3:db:af:c6 to 64:b7:08:29:2b:a4, heap:160600[err:0x0, proto:0, tos:0]
W (219392) mesh_main: [ROOT-2-UNICAST:200][L:1][rtableSize:2]parent:a4:39:b3:db:af:c6 to 64:b7:08:29:31:f4, heap:160600[err:0x0, proto:0, tos:0]
I (220392) mesh_main: size:2/2,send_count:200

device2:

I (14182) mesh: [DONE]connect to router:xiaomi_ax6000, channel:6, rssi:-24, a4:39:b3:db:af:c6[layer:0, assoc:0], my_vote_num:1/voter_num:1, rc[64:b7:08:29:31:f5/-24/1]
I (14262) wifi:new:<6,1>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (14262) wifi:state: init -> auth (b0)
I (15692) wifi:state: auth -> assoc (0)
I (15782) wifi:Association refused temporarily, comeback time 1000 (TUs)
I (16812) wifi:state: assoc -> assoc (0)
I (17812) wifi:state: assoc -> init (200)
I (17812) wifi:new:<6,0>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (17812) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:202
I (17812) mesh: [wifi]disconnected reason:202(), continuous:1/max:12, root, vote(,stopped)<><>
I (20482) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:205
I (20492) mesh: [wifi]disconnected reason:205(), continuous:2/max:12, root, vote(,stopped)<><>
I (20502) wifi:new:<6,1>, old:<6,0>, ap:<6,1>, sta:<6,0>, prof:6
I (20512) wifi:state: init -> auth (b0)
I (21892) wifi:state: auth -> assoc (0)
I (21932) wifi:state: assoc -> run (10)
I (21972) wifi:connected with xiaomi_ax6000, aid = 2, channel 6, BW20, bssid = a4:39:b3:db:af:c6
I (21972) wifi:security: WPA3-SAE, phy: bgn, rssi: -25
I (21982) wifi:pm start, type: 0
I (21982) wifi:dp: 1, bi: 102400, li: 3, scale listen interval from 307200 us to 307200 us
I (21982) mesh: [scan]new scanning time:600ms, beacon interval:300ms
I (22002) wifi:AP's beacon interval = 102400 us, DTIM period = 1
I (22002) mesh: write layer:1
I (22002) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:0-->1, parent:a4:39:b3:db:af:c6, ID:77:77:77:77:77:77, duty:0
I (22012) mesh: upstream packets, connections(max):6, waiting:0, upQ:0
I (22012) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (22022) mesh: root
I (22022) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:64:b7:08:29:31:f5
I (22032) wifi:I (22022) mesh: [TXQ]max:128up(0, be:0), down(0, be:0), mgmt:0, xon(req:0, rsp:0), bcast:0, wnd(0, parent:00:00:00:00:00:00)
idx:0 (ifx:0, a4:39:b3:db:af:c6), tid:6, ssn:2, winSize:64I (22042) mesh: [RXQ]<max:128 = cfg:128 + extra:0>self:0, <max:128 = cfg:128 + extra:0>tods:0
I (23512) esp_netif_handlers: sta ip: 192.168.31.217, mask: 255.255.255.0, gw: 192.168.31.1
I (23512) mesh_main: <IP_EVENT_STA_GOT_IP>IP:192.168.31.217
I (27382) wifi:state: run -> init (0)
I (27382) wifi:pm stop, total sleep time: 0 us / 5404881 us
I (27382) wifi:idx:0, tid:6
I (27382) wifi:new:<6,0>, old:<6,1>, ap:<6,1>, sta:<6,0>, prof:6
I (27492) mesh_main: <MESH_EVENT_ROOT_ASKED_YIELD>64:b7:08:29:2b:a5, rssi:-19, capacity:1
I (27492) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:8
I (27492) mesh: [wifi]disconnected reason:8(assoc leave), continuous:1/max:12, non-root, vote(,stopped)<><>
I (28012) mesh_main: layer:-1, rtableSize:1, DISCONNECT
W (30112) wifi:2518len:25, max_ie_len:25, now:28866
W (30112) wifi:2538[used:0,0,1,0], count<announce:0, yield:0, fixed:1, gone:0>, expire[fixed:0, gone:0]
I (32152) mesh: [SCAN][ch:0]AP:67, other(ID:0, RD:0), MAP:1, idle:0, candidate:1, root:1, topMAP:0[c:0,i:0][a4:39:b3:db:af:c6]router found<>
I (32152) mesh: 7387[selection]try rssi_threshold:-78, backoff times:0, max:5<-78,-82,-85>
I (32172) mesh: write layer:0
I (32172) mesh: [DONE]connect to parent:ESPM_292BA4, channel:6, rssi:-24, 64:b7:08:29:2b:a5[layer:1, assoc:0], my_vote_num:0/voter_num:0, rc[64:b7:08:29:2b:a5/-30/1]
I (32282) wifi:new:<6,1>, old:<6,0>, ap:<6,1>, sta:<6,1>, prof:6
I (32542) wifi:state: init -> auth (b0)
I (32552) wifi:state: auth -> assoc (0)
I (32562) wifi:state: assoc -> run (10)
I (32582) wifi:connected with ESPM_292BA4, aid = 1, channel 6, 40U, bssid = 64:b7:08:29:2b:a5
I (32582) wifi:security: WPA2-PSK, phy: bgn, rssi: -29
I (32592) wifi:pm start, type: 0
I (32592) wifi:dp: 1, bi: 307200, li: 1, scale listen interval from 307200 us to 307200 us
I (32602) mesh: 2012parent monitor, my layer:2(cap:6)(node), interval:5758ms, retries:1
I (32612) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:1-->2, parent:64:b7:08:29:2b:a5, ID:77:77:77:77:77:77, duty:0
I (32622) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (32882) mesh: <MESH_NWK_MIE_CHANGE><><><><><><>
I (32882) wifi:AP's beacon interval = 307200 us, DTIM period = 1
I (33542) wifi:idx:0 (ifx:0, 64:b7:08:29:2b:a5), tid:5, ssn:0, winSize:64
I (38012) mesh_main: layer:2, rtableSize:1, NODE
I (38502) mesh: 5170parent layer:1(node), channel:6, rssi:-24, assoc:0(cnx rssi threshold:-120)my_assoc:0
I (40012) mesh: 5965parent layer:1, rssi:-76, assoc:1(cnx rssi threshold:-120)
I (40012) mesh: [SCAN][ch:6]AP:1, other(ID:0, RD:0), MAP:1, idle:0, candidate:1, root:1, topMAP:0[c:2,i:2][a4:39:b3:db:af:c6]
I (40022) mesh: 7387[weak]try rssi_threshold:-120, backoff times:0, max:5<-78,-82,-85>
I (40032) mesh: 716[monitor]no change, parent:64:b7:08:29:2b:a5, rssi:-76
I (40032) mesh: 2012parent monitor, my layer:2(cap:6)(node), interval:6726ms, retries:2<>
W (45482) wifi:2193open time expires, duration:14 seconds, expire<fixed:1, gone:0>, my_ie_len:0, conflict_roots->num:0
W (45782) wifi:2491len:0, max_ie_len:25, conflict_roots>num:0
I (45792) mesh: eliminate redundant roots, 14 seconds
I (45792) mesh: 2012parent monitor, my layer:2(cap:6)(node), interval:4631ms, retries:1<>
I (45792) mesh: <MESH_NWK_MIE_CHANGE><><><><><><>
I (48012) mesh_main: layer:2, rtableSize:1, NODE
I (50542) mesh: 5170parent layer:1(node), channel:6, rssi:-24, assoc:1(cnx rssi threshold:-120)my_assoc:0
I (52042) mesh: 5965parent layer:1, rssi:-30, assoc:1(cnx rssi threshold:-120)
I (52042) mesh: [SCAN][ch:6]AP:1, other(ID:0, RD:0), MAP:1, idle:0, candidate:1, root:1, topMAP:0[c:2,i:2][a4:39:b3:db:af:c6]
I (52052) mesh: 7387[weak]try rssi_threshold:-120, backoff times:0, max:5<-78,-82,-85>
I (52062) mesh: 716[monitor]no change, parent:64:b7:08:29:2b:a5, rssi:-30
I (52062) mesh: 2012parent monitor, my layer:2(cap:6)(node), interval:5100ms, retries:2<>
I (57302) mesh: 5170parent layer:1(node), channel:6, rssi:-24, assoc:1(cnx rssi threshold:-120)my_assoc:0
I (58012) mesh_main: layer:2, rtableSize:1, NODE

@espressif-bot espressif-bot added Awaiting Response awaiting a response from the author Status: Reviewing Issue is being reviewed and removed Status: In Progress Work is in progress labels Jun 7, 2024
@Sherry616
Copy link
Collaborator

Hi @amitabhskrishworks, could you please share your latest updates on this issue? Thanks.

@Sherry616
Copy link
Collaborator

Thanks for reporting, will close due to short of feedback, feel free to reopen with more updates.
Thanks for using our Espressif product!

@Sherry616 Sherry616 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2024
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Reviewing Issue is being reviewed labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

5 participants