Chapter 4. API Guides
Note: Root node switching must require an election hence is only supported when using a self-organized ESP-WIFI-
MESH network. In other words, root node switching cannot occur if a designated root node is used.
Parent Node Switching
Parent Node Switching entails a child node switching its upstream connection to another parent node of a shallower
layer. Parent Node Switching occurs autonomously meaning that a child node will change its upstream connection
automatically if a potential parent node of a shallower layer becomes available (i.e. due to a
Asynchronous Power-on
Reset).
All potential parent nodes periodically transmit beacon frames (see
Beacon Frames & RSSI
Thresholding) allowing
for a child node to scan for the availability of a shallower parent node. Due to parent node switching, a self-organized
ESP-WIFI-MESH network can dynamically adjust its network layout to ensure each connection has a good RSSI and
that the number of layers in the network is minimized.
4.8.6 Data Transmission
ESP-WIFI-MESH Packet
ESP-WIFI-MESH network data transmissions use ESP-WIFI-MESH packets. ESP-WIFI-MESH packets are en-
tirely contained within the frame body of a Wi-Fi data frame. A multi-hop data transmission in an ESP-WIFI-
MESH network will involve a single ESP-WIFI-MESH packet being carried over each wireless hop by a different
Wi-Fi data frame.
The following diagram shows the structure of an ESP-WIFI-MESH packet and its relation with a Wi-Fi data frame.
Fig. 17: ESP-WIFI-MESH Packet
The header of an ESP-WIFI-MESH packet contains the MAC addresses of the source and destination nodes.
The options field contains information pertaining to the special types of ESP-WIFI-MESH packets such as a
group transmission or a packet originating from the external IP network (see
MESH_OPT_SEND_GROUP
and
MESH_OPT_RECV_DS_ADDR).
The payload of an ESP-WIFI-MESH packet contains the actual application data. This data can be raw binary data,
or encoded under an application layer protocol such as HTTP, MQTT, and JSON (see mesh_proto_t).
Note:
When sending an ESP-WIFI-MESH packet to the external IP network, the destination address field of
the header will contain the IP address and port of the target server rather than the MAC address of a node (see
mesh_addr_t). Furthermore the root node will handle the formation of the outgoing TCP/IP packet.
Group Control & Multicasting
Multicasting is a feature that allows a single ESP-WIFI-MESH packet to be transmitted simultaneously to mul-
tiple nodes within the network. Multicasting in ESP-WIFI-MESH can be achieved by either specifying a list
Espressif Systems
1321
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?