Hello,
I have been evaluating the ESP-MESH using the Internal Communications sample code. I get very slow response and recovery times upon a node disconnection. If I switch off for example a node in layer 2, it takes 10 seconds for the root node to complete the esp_mesh_send and return an error:
W (652452) mesh_main: [#RX:622/622][L:1] parent:84:16:f9:2d:a9:f2, receive from 30:ae:a4:d3:41:8c, size:1460, heap:168060, flag:0[err:0x0, proto:0, tos:0]
W (653452) mesh_main: [#RX:623/623][L:1] parent:84:16:f9:2d:a9:f2, receive from 30:ae:a4:d3:41:8c, size:1460, heap:169620, flag:0[err:0x0, proto:0, tos:0]
W (663272) wifi: inactive timer: now=26759c1a last_rx_time=25d08cd9 diff=2a41, aid[1]30:ae:a4:d3:9f:d8 leave
I (663272) wifi: station: 30:ae:a4:d3:9f:d8 leave, AID = 1, bss_flags is 134243
I (663282) wifi: new:<6,2>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (663292) mesh_main: <MESH_EVENT_CHILD_DISCONNECTED>aid:1, 30:ae:a4:d3:9f:d8
W (663302) mesh_main: <MESH_EVENT_ROUTING_TABLE_REMOVE>remove 2, new:2
I (663302) mesh: [scan]new scanning time:300ms
W (663302) wifi: [beacon]new interval:100ms
E (663312) mesh_main: [ROOT-2-UNICAST:623][L:1]parent:84:16:f9:2d:a9:f2 to 30:ae:a4:d3:9f:d8, heap:171068[err:0x400b, proto:0, tos:0]
E (663332) mesh_main: [ROOT-2-UNICAST:623][L:1]parent:84:16:f9:2d:a9:f2 to 30:ae:a4:d3:a0:c4, heap:171076[err:0x400f, proto:0, tos:0]
W (664342) mesh_main: [#RX:624/624][L:1] parent:84:16:f9:2d:a9:f2, receive from 30:ae:a4:d3:41:8c, size:1460, heap:171084, flag:0[err:0x0, proto:0, tos:0]
Likewise, it takes 10 seconds to the child node in layer 3 to detect parent disconnected:
W (523077) mesh_main: [#RX:505/622][L:3] parent:30:ae:a4:d3:9f:d9, receive from 30:ae:a4:d3:41:8c, size:1460, heap:171856, flag:0[err:0x0, proto:0, tos:0]
I (530687) mesh_main: layer:3, rtableSize:1, NODE
I (533077) wifi: bcn_timout,ap_probe_send_start
I (535587) wifi: ap_probe_send over, resett wifi status to disassoc
I (535587) wifi: state: run -> init (c800)
I (535587) wifi: pm stop, total sleep time: 0 us / 524927152 us
I (535597) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (535607) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:200
My questions are:
1. Is it possible to reduce the timeout for the root to send a packet with no ack returned?
2. Is it possible to reduce the child beacon timeout (I saw in the documentation it needs to lose 60 beacons, is this a must?)
3. Is the MESH and WiFi source code available for developers?
Thanks!
ESP-MESH timeouts
-
- Posts: 68
- Joined: Wed May 16, 2018 12:31 pm
Re: ESP-MESH timeouts
Hi cvar12,
1. There's no ack timeout in esp_mesh_send now.
2. `esp_mesh_set_assoc_expire` could change the time of `beacon timout` and `inactive timer` on non-root mesh nodes.
3. Not available now.
1. There's no ack timeout in esp_mesh_send now.
2. `esp_mesh_set_assoc_expire` could change the time of `beacon timout` and `inactive timer` on non-root mesh nodes.
3. Not available now.
Re: ESP-MESH timeouts
Thanks for your response.
Regarding your answer to second question, I suppose you mean esp_mesh_set_ap_assoc_expire, correct?
In the documentation this setting is mentioned for the softAP, not for the station configuration. How will this also impact the child node beacon timeout? I understand the beacon timeout is defined as 60 beacon intervals. Can this be modified? Also is it possible to set the beacon interval fixed at 100 mSec? I see that in the mesh it automatically changes to 300 mSec and afterwards to 1000 mSec.
Also it is mentioned that "If mesh softAP is encrypted, this value should be set a greater value, such as 30 seconds". What is the reason? What will be the impact if I set it under 10 seconds and still use encryption?
Regarding your answer to second question, I suppose you mean esp_mesh_set_ap_assoc_expire, correct?
In the documentation this setting is mentioned for the softAP, not for the station configuration. How will this also impact the child node beacon timeout? I understand the beacon timeout is defined as 60 beacon intervals. Can this be modified? Also is it possible to set the beacon interval fixed at 100 mSec? I see that in the mesh it automatically changes to 300 mSec and afterwards to 1000 mSec.
Also it is mentioned that "If mesh softAP is encrypted, this value should be set a greater value, such as 30 seconds". What is the reason? What will be the impact if I set it under 10 seconds and still use encryption?
-
- Posts: 68
- Joined: Wed May 16, 2018 12:31 pm
Re: ESP-MESH timeouts
Yes, it's esp_mesh_set_ap_assoc_expire.
For non-root mesh nodes, beacon timeout = inactive timer = assoc expire. The parent's beacon interval will not impact the child's beacon timeout.
Beacons are boardcast frames, they have a big impact on the environment. So it is expected to reduce the frequency beacons.
Station will spend more time connecting to a encrypted softAP. So mesh network will be unstable if you set assoc_expire too small.
For non-root mesh nodes, beacon timeout = inactive timer = assoc expire. The parent's beacon interval will not impact the child's beacon timeout.
Beacons are boardcast frames, they have a big impact on the environment. So it is expected to reduce the frequency beacons.
Station will spend more time connecting to a encrypted softAP. So mesh network will be unstable if you set assoc_expire too small.
Re: ESP-MESH timeouts
Thanks for your response.
Bottom line what I am trying to achieve is minimum healing time of a node failure in the mesh.
Currently when I turn power off on a node in layer 2 I expect his child node to resume connectivity within less than 5 seconds as per your performance specs (mesh is very small so I expect it to be much faster), but it takes 25 seconds to resume connectivity for the child node and receive packets from the root.
You can see the child node log below.
I need to understand why it takes so long, and what configuration settings I need to reduce it under 5 sec.
W (523077) mesh_main: [#RX:505/622][L:3] parent:30:ae:a4:d3:9f:d9, receive from 30:ae:a4:d3:41:8c, size:1460, heap:171856, flag:0[err:0x0, proto:0, tos:0]
I (530687) mesh_main: layer:3, rtableSize:1, NODE
I (533077) wifi: bcn_timout,ap_probe_send_start
I (535587) wifi: ap_probe_send over, resett wifi status to disassoc
I (535587) wifi: state: run -> init (c800)
I (535587) wifi: pm stop, total sleep time: 0 us / 524927152 us
I (535597) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (535607) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:200
I (535607) mesh: [wifi]disconnected reason:200(beacon timeout), continuous:1/max:12, non-root, vote(,)<><>
I (535617) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (535617) wifi: state: init -> auth (b0)
I (536627) wifi: state: auth -> init (200)
I (536637) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (536637) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (536647) mesh: [wifi]disconnected reason:2(auth expire), continuous:2/max:12, non-root, vote(,)<><>
I (536647) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (536657) wifi: state: init -> auth (b0)
I (537667) wifi: state: auth -> init (200)
I (537667) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (537667) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (537677) mesh: [wifi]disconnected reason:2(auth expire), continuous:3/max:12, non-root, vote(,)<><>
I (537677) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (537697) wifi: state: init -> auth (b0)
I (538697) wifi: state: auth -> init (200)
I (538697) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (538697) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (538707) mesh: [wifi]disconnected reason:2(auth expire), continuous:4/max:12, non-root, vote(,)<><>
I (538717) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (538727) wifi: state: init -> auth (b0)
I (539727) wifi: state: auth -> init (200)
I (539727) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (539727) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (539737) mesh: [wifi]disconnected reason:2(auth expire), continuous:5/max:12, non-root, vote(,)<><>
I (539747) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (539757) wifi: state: init -> auth (b0)
I (540687) mesh_main: layer:-1, rtableSize:1, DISCONNECT
I (540757) wifi: state: auth -> init (200)
I (540757) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (540757) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (540777) mesh: [wifi]disconnected reason:2(auth expire), continuous:6/max:12, non-root, vote(,)<><>
I (540777) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (540787) wifi: state: init -> auth (b0)
I (541787) wifi: state: auth -> init (200)
I (541787) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (541797) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (541807) mesh: [wifi]disconnected reason:2(auth expire), continuous:0/max:12, non-root, vote(,)<><>
I (541807) mesh: [auth expire]looking for a new parent, [L:3]try layer:2
I (546217) mesh: [SCAN][ch:0]AP:30, other(ID:0, RD:0), MAP:2, idle:0, candidate:2, root:1, topMAP:1[c:3,i:2][84:16:f9:2d:a9:f2]router found[FIXED-ROOT]<>
I (546227) mesh: 6545[selection]try rssi_threshold:-78, backoff times:0, max:5<-78,-82,-85>
I (546227) mesh: [DONE]connect to parent:ESPM_D3418C, channel:6, rssi:-19, 30:ae:a4:d3:41:8d[layer:1, assoc:1], my_vote_num:0/voter_num:0, rc[00:00:00:00:00:00/-45/4]
I (547777) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (547777) wifi: state: init -> auth (b0)
I (547787) wifi: state: auth -> assoc (0)
I (547807) wifi: state: assoc -> run (10)
I (547827) wifi: connected with ESPM_D3418C, channel 6, bssid = 30:ae:a4:d3:41:8d
I (547837) wifi: pm start, type: 0
I (547837) mesh: [scan]new scanning time:600ms
E (547847) event: invalid static ip
W (547847) wifi: [beacon]new interval:300ms
I (547857) mesh: 1888<arm>parent monitor, my layer:2(cap:6), interval:9631ms, retries:1<normal connected>
I (547857) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:3-->2, parent:30:ae:a4:d3:41:8d<layer2>, ID:77:77:77:77:77:77
I (547867) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (547877) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:30:ae:a4:d3:41:8d
W (548007) mesh_main: [#RX:506/637][L:2] parent:30:ae:a4:d3:41:8d, receive from 30:ae:a4:d3:41:8c, size:1460, heap:172644, flag:0[err:0x0, proto:0, tos:0]
Bottom line what I am trying to achieve is minimum healing time of a node failure in the mesh.
Currently when I turn power off on a node in layer 2 I expect his child node to resume connectivity within less than 5 seconds as per your performance specs (mesh is very small so I expect it to be much faster), but it takes 25 seconds to resume connectivity for the child node and receive packets from the root.
You can see the child node log below.
I need to understand why it takes so long, and what configuration settings I need to reduce it under 5 sec.
W (523077) mesh_main: [#RX:505/622][L:3] parent:30:ae:a4:d3:9f:d9, receive from 30:ae:a4:d3:41:8c, size:1460, heap:171856, flag:0[err:0x0, proto:0, tos:0]
I (530687) mesh_main: layer:3, rtableSize:1, NODE
I (533077) wifi: bcn_timout,ap_probe_send_start
I (535587) wifi: ap_probe_send over, resett wifi status to disassoc
I (535587) wifi: state: run -> init (c800)
I (535587) wifi: pm stop, total sleep time: 0 us / 524927152 us
I (535597) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (535607) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:200
I (535607) mesh: [wifi]disconnected reason:200(beacon timeout), continuous:1/max:12, non-root, vote(,)<><>
I (535617) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (535617) wifi: state: init -> auth (b0)
I (536627) wifi: state: auth -> init (200)
I (536637) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (536637) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (536647) mesh: [wifi]disconnected reason:2(auth expire), continuous:2/max:12, non-root, vote(,)<><>
I (536647) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (536657) wifi: state: init -> auth (b0)
I (537667) wifi: state: auth -> init (200)
I (537667) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (537667) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (537677) mesh: [wifi]disconnected reason:2(auth expire), continuous:3/max:12, non-root, vote(,)<><>
I (537677) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (537697) wifi: state: init -> auth (b0)
I (538697) wifi: state: auth -> init (200)
I (538697) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (538697) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (538707) mesh: [wifi]disconnected reason:2(auth expire), continuous:4/max:12, non-root, vote(,)<><>
I (538717) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (538727) wifi: state: init -> auth (b0)
I (539727) wifi: state: auth -> init (200)
I (539727) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (539727) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (539737) mesh: [wifi]disconnected reason:2(auth expire), continuous:5/max:12, non-root, vote(,)<><>
I (539747) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (539757) wifi: state: init -> auth (b0)
I (540687) mesh_main: layer:-1, rtableSize:1, DISCONNECT
I (540757) wifi: state: auth -> init (200)
I (540757) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (540757) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (540777) mesh: [wifi]disconnected reason:2(auth expire), continuous:6/max:12, non-root, vote(,)<><>
I (540777) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (540787) wifi: state: init -> auth (b0)
I (541787) wifi: state: auth -> init (200)
I (541787) wifi: new:<6,0>, old:<6,2>, ap:<6,2>, sta:<6,2>, prof:6
I (541797) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:2
I (541807) mesh: [wifi]disconnected reason:2(auth expire), continuous:0/max:12, non-root, vote(,)<><>
I (541807) mesh: [auth expire]looking for a new parent, [L:3]try layer:2
I (546217) mesh: [SCAN][ch:0]AP:30, other(ID:0, RD:0), MAP:2, idle:0, candidate:2, root:1, topMAP:1[c:3,i:2][84:16:f9:2d:a9:f2]router found[FIXED-ROOT]<>
I (546227) mesh: 6545[selection]try rssi_threshold:-78, backoff times:0, max:5<-78,-82,-85>
I (546227) mesh: [DONE]connect to parent:ESPM_D3418C, channel:6, rssi:-19, 30:ae:a4:d3:41:8d[layer:1, assoc:1], my_vote_num:0/voter_num:0, rc[00:00:00:00:00:00/-45/4]
I (547777) wifi: new:<6,2>, old:<6,0>, ap:<6,2>, sta:<6,2>, prof:6
I (547777) wifi: state: init -> auth (b0)
I (547787) wifi: state: auth -> assoc (0)
I (547807) wifi: state: assoc -> run (10)
I (547827) wifi: connected with ESPM_D3418C, channel 6, bssid = 30:ae:a4:d3:41:8d
I (547837) wifi: pm start, type: 0
I (547837) mesh: [scan]new scanning time:600ms
E (547847) event: invalid static ip
W (547847) wifi: [beacon]new interval:300ms
I (547857) mesh: 1888<arm>parent monitor, my layer:2(cap:6), interval:9631ms, retries:1<normal connected>
I (547857) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:3-->2, parent:30:ae:a4:d3:41:8d<layer2>, ID:77:77:77:77:77:77
I (547867) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (547877) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:30:ae:a4:d3:41:8d
W (548007) mesh_main: [#RX:506/637][L:2] parent:30:ae:a4:d3:41:8d, receive from 30:ae:a4:d3:41:8c, size:1460, heap:172644, flag:0[err:0x0, proto:0, tos:0]
Re: ESP-MESH timeouts
Dear ESP_yudong,
I would appreciate your reply on my last question about 25 sec. healing time (vs 5 sec in the mesh performance spec).
Also we tried to reduce the esp_mesh_set_ap_assoc_expire under 10 seconds, and it does not accept values under 10 sec, it reverts back to 10 sec.
This means that if the root tries to send a packet using esp_mesh_send with no ack returned, the whole communication to all other nodes is halted for 10 seconds. Am I missing something or this is how the mesh is designed?
Thanks.
I would appreciate your reply on my last question about 25 sec. healing time (vs 5 sec in the mesh performance spec).
Also we tried to reduce the esp_mesh_set_ap_assoc_expire under 10 seconds, and it does not accept values under 10 sec, it reverts back to 10 sec.
This means that if the root tries to send a packet using esp_mesh_send with no ack returned, the whole communication to all other nodes is halted for 10 seconds. Am I missing something or this is how the mesh is designed?
Thanks.
-
- Posts: 68
- Joined: Wed May 16, 2018 12:31 pm
Re: ESP-MESH timeouts
I think it is not not possible to reduce the healing time under 5 sec. That's the design.
The assoc_expire can not be less than 10 sec beacuse the network may be instable.
`esp_mesh_send` returns after disconnection.
By the way,
When a parent node is powered off, the child node will:
1. detect the disconnection. (usually `assoc_expire`)
2. re-connect. (about 6*auth_timeout = 6 sec in your case)
3. scan, find a new parent.
4. connect to new parent.
The assoc_expire can not be less than 10 sec beacuse the network may be instable.
`esp_mesh_send` returns after disconnection.
By the way,
When a parent node is powered off, the child node will:
1. detect the disconnection. (usually `assoc_expire`)
2. re-connect. (about 6*auth_timeout = 6 sec in your case)
3. scan, find a new parent.
4. connect to new parent.
Re: ESP-MESH timeouts
Dear ESP_yudong,
I found a few undocumented ESP-MESH functions which are used by Mwifi:
esp_mesh_set_switch_parent_paras
esp_mesh_set_beacon_interval
esp_mesh_set_passive_scan_time
esp_mesh_set_attempts
Do you have documentation for them? What is the range for each of them?
Can these functions be relevant to reduce the mesh healing times?
Thanks.
I found a few undocumented ESP-MESH functions which are used by Mwifi:
esp_mesh_set_switch_parent_paras
esp_mesh_set_beacon_interval
esp_mesh_set_passive_scan_time
esp_mesh_set_attempts
Do you have documentation for them? What is the range for each of them?
Can these functions be relevant to reduce the mesh healing times?
Thanks.
Who is online
Users browsing this forum: jsmith56x and 180 guests