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.