Chapter 4. API Guides
1. Node A is designated the root node by the user therefore directly connects with the router. All other nodes forgo
the election process.
2. Nodes C/D connect with node A as their preferred parent node. Both nodes form the second layer of the network.
3. Likewise, nodes B/E connect with node C, and node F connects with node D. Nodes B/E/F form the third layer
of the network.
4. Node G connects with node E, forming the fourth layer of the network. However the maximum permitted number
of layers in this network is configured as four, therefore node G becomes a leaf node to prevent any new layers from
forming.
Note: When designating a root node, the root node should call
esp_mesh_set_parent()
in order to directly
connect with the router. Likewise, all other nodes should call
esp_mesh_fix_root()
to forgo the election
process.
Parent Node Selection
By default, ESP-WIFI-MESH is self organizing meaning that each node will autonomously select which potential
parent node to form an upstream connection with. The autonomously selected parent node is known as the preferred
parent node. The criteria used for selecting the preferred parent node is designed to reduce the number of layers
in the ESP-WIFI-MESH network and to balance the number of downstream connections between potential parent
nodes (see section on
Preferred Parent
Node).
However ESP-WIFI-MESH also allows users to disable self-organizing behavior which will allow users to define their
own criteria for parent node selection, or to configure nodes to have designated parent nodes (see the
Mesh Manual
Networking
Example).
Asynchronous Power-on Reset
ESP-WIFI-MESH network building can be affected by the order in which nodes power-on. If certain nodes within
the network power-on asynchronously (i.e. separated by several minutes), the final structure of the network could
differ from the ideal case where all nodes are powered on synchronously. Nodes that are delayed in powering
on will adhere to the following rules:
Rule 1: If a root node already exists in the network, the delayed node will not attempt to elect a new root node, even
if it has a stronger RSSI with the router. The delayed node will instead join the network like any other idle node
by connecting with a preferred parent node. If the delayed node is the designated root node, all other nodes in the
network will remain idle until the delayed node powers-on.
Rule 2: If a delayed node forms an upstream connection and becomes an intermediate parent node, it may also
become the new preferred parent of other nodes (i.e. being a shallower node). This will cause the other nodes to
switch their upstream connections to connect with the delayed node (see
Parent Node
Switching).
Rule 3: If an idle node has a designated parent node which is delayed in powering-on, the idle node will not attempt to
form any upstream connections in the absence of its designated parent node. The idle node will remain idle indefinitely
until its designated parent node powers-on.
The following example demonstrates the effects of asynchronous power-on with regards to network building.
1. Nodes A/C/D/F/G/H are powered-on synchronously and begin the root node election process by broadcasting their
MAC addresses and router RSSIs. Node A is elected as the root node as it has the strongest RSSI.
2. Once node A becomes the root node, the remaining nodes begin forming upstream connections layer by layer with
their preferred parent nodes. The result is a network with five layers.
3. Node B/E are delayed in powering-on but neither attempt to become the root node even though they have stronger
router RSSIs (-20 dB and -10 dB) compared to node A. Instead both delayed nodes form upstream connections
with their preferred parent nodes A and C respectively. Both nodes B/E become intermediate parent nodes after
connecting.
Espressif Systems
1316
Release v4.4
Submit Document Feedback
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?