Root node selection and espconn_mesh_enable()

iia
Posts: 14
Joined: Sat Oct 15, 2016 11:55 pm

Root node selection and espconn_mesh_enable()

Postby iia » Sun Oct 16, 2016 1:14 am

Hi,

Going through the forum and reading some posts I figured out that when nodes of a mesh network are powered up there are two ways a root node for the mesh network is chosen.

a) A contest based approach, where available nodes compete to be the root node and only one node is then chosen to be the root node based on metrics like RSSI, capacity etc.

b) A node can be manually configured to be the node of as mesh network. In which case there will not be any contest to choose a root node.

1. Is my understanding correct?

2. How can one explicitly specify whether a node must be the root node or to go for the contest based approach to choose a root node? Is there any API for this?

3. What are the differences between the following API calls? What are the effects of calling this API in these two different ways?

Code: Select all

espconn_mesh_enable(cb_enable_mesh, MESH_LOCAL);
espconn_mesh_enable(cb_enable_mesh, MESH_ONLINE);


Cheers.

ESP_Alen
Posts: 208
Joined: Tue Mar 01, 2016 2:01 pm

Re: Root node selection and espconn_mesh_enable()

Postby ESP_Alen » Tue Oct 18, 2016 3:46 pm

iia wrote:Hi,

Going through the forum and reading some posts I figured out that when nodes of a mesh network are powered up there are two ways a root node for the mesh network is chosen.

a) A contest based approach, where available nodes compete to be the root node and only one node is then chosen to be the root node based on metrics like RSSI, capacity etc.

b) A node can be manually configured to be the node of as mesh network. In which case there will not be any contest to choose a root node.

1. Is my understanding correct?

2. How can one explicitly specify whether a node must be the root node or to go for the contest based approach to choose a root node? Is there any API for this?

3. What are the differences between the following API calls? What are the effects of calling this API in these two different ways?

Code: Select all

espconn_mesh_enable(cb_enable_mesh, MESH_LOCAL);
espconn_mesh_enable(cb_enable_mesh, MESH_ONLINE);


Cheers.


1. What you said is right.
2. You can specify one node as root, then setup mesh network.
If you power off all the nodes and power on them again, they will contest for root.
Now, there is not api to set policy.
3. MESH_LOCAL means that the root connect router and doesn't setup TCP connection with server;
MESH_ONLINE means that the node connect parent AP or router AP and setup TCP connection with parent or server.

Note: Only root can work with MESH_LOCAL, the other node must work with MESH_ONLINE.

iia
Posts: 14
Joined: Sat Oct 15, 2016 11:55 pm

Re: Root node selection and espconn_mesh_enable()

Postby iia » Wed Oct 19, 2016 12:02 am

1. What you said is right.
2. You can specify one node as root, then setup mesh network.
If you power off all the nodes and power on them again, they will contest for root.
Now, there is not api to set policy.
3. MESH_LOCAL means that the root connect router and doesn't setup TCP connection with server;
MESH_ONLINE means that the node connect parent AP or router AP and setup TCP connection with parent or server.

Note: Only root can work with MESH_LOCAL, the other node must work with MESH_ONLINE.


Thank you ESP_Alen for the informative reply.

I have a few more more questions.

1. So it is always ensured that a mesh network has a root node even though the root node might change? For example, let's assume that there are three nodes powered up at the same time. There is one Wi-Fi router which is connected to the internet. Now, even if all of these three nodes are all well within the range of the internet router, still only one node will be the root which will connect to the internet router and the other two nodes will be normal nodes which will connect to the root node, right?

2. Now let's assume the current root node is powered off. In this case a new node will be the root node from the normal nodes, right?

3. Let's assume a group of three nodes which are normal nodes and are connected to the root node. Now if this group of three nodes are moved far away out of the range of the root node and also out of the range of the internet router then what will happen? One of these three nodes will now become a root node and the other two will connect to this root node I suppose?

4. Now let's assume the group of three nodes are brought back to within the range of the internet router and the root node that is connected to the internet router. Now it will be detected that there are two root nodes which is not correct so there will be a new contest and a new root node will be chosen?

Cheers.

ESP_Alen
Posts: 208
Joined: Tue Mar 01, 2016 2:01 pm

Re: Root node selection and espconn_mesh_enable()

Postby ESP_Alen » Wed Nov 02, 2016 10:20 pm

iia wrote:
1. What you said is right.
2. You can specify one node as root, then setup mesh network.
If you power off all the nodes and power on them again, they will contest for root.
Now, there is not api to set policy.
3. MESH_LOCAL means that the root connect router and doesn't setup TCP connection with server;
MESH_ONLINE means that the node connect parent AP or router AP and setup TCP connection with parent or server.

Note: Only root can work with MESH_LOCAL, the other node must work with MESH_ONLINE.


Thank you ESP_Alen for the informative reply.

I have a few more more questions.

1. So it is always ensured that a mesh network has a root node even though the root node might change? For example, let's assume that there are three nodes powered up at the same time. There is one Wi-Fi router which is connected to the internet. Now, even if all of these three nodes are all well within the range of the internet router, still only one node will be the root which will connect to the internet router and the other two nodes will be normal nodes which will connect to the root node, right?

Right.

2. Now let's assume the current root node is powered off. In this case a new node will be the root node from the normal nodes, right?

Right.

3. Let's assume a group of three nodes which are normal nodes and are connected to the root node. Now if this group of three nodes are moved far away out of the range of the root node and also out of the range of the internet router then what will happen? One of these three nodes will now become a root node and the other two will connect to this root node I suppose?

the three nodes try to find parent node until the process fails.

4. Now let's assume the group of three nodes are brought back to within the range of the internet router and the root node that is connected to the internet router. Now it will be detected that there are two root nodes which is not correct so there will be a new contest and a new root node will be chosen?

The two root will contest for root.

Cheers.

LPerezBustos
Posts: 6
Joined: Sun Oct 23, 2016 4:16 am

Re: Root node selection and espconn_mesh_enable()

Postby LPerezBustos » Sat Dec 24, 2016 10:29 am

ESP_Alen wrote:
iia wrote:
3. Let's assume a group of three nodes which are normal nodes and are connected to the root node. Now if this group of three nodes are moved far away out of the range of the root node and also out of the range of the internet router then what will happen? One of these three nodes will now become a root node and the other two will connect to this root node I suppose?

the three nodes try to find parent node until the process fails.

4. Now let's assume the group of three nodes are brought back to within the range of the internet router and the root node that is connected to the internet router. Now it will be detected that there are two root nodes which is not correct so there will be a new contest and a new root node will be chosen?

The two root will contest for root.
Cheers.


and what happen when the process fails ? the three nodes re-arrange themself and create a new mesh with the corresponding root node contest ? is it possible with no router AP in range ?

thanks for the help, we appreciate it !

Who is online

Users browsing this forum: No registered users and 2 guests