ESP-Mesh-Lite Documentation

repository·release/v1.0·Indexed 42 days ago

https://github.com/espressif/esp-mesh-lite

A self-organizing Wi-Fi mesh networking solution based on SoftAP + Station mode for ESP32 series chips. It extends wireless coverage and allows sub-nodes to access external networks independently. Key APIs include esp_bridge_create_all_netif(), esp_mesh_lite_init(), and esp_mesh_lite_start(). The solution simplifies application-layer development compared to traditional ESP-WIFI-MESH and supports zero-touch provisioning and Rainmaker cloud integration.

Tokens
17.7K
Snippets
28
Records
106
Agent score
52%

What's inside ESP-Mesh-Lite

  1. Overview of ESP-Mesh-Lite Wireless Debug

    release/v1.0

    Wireless Debug is a solution that allows developers to control target devices and monitor the status of other devices in a Mesh-Lite network wirelessly, without requiring physical UART or JTAG connections.

    Key capabilities include:

    • Centralized Monitoring: Monitor Wi-Fi connection status, application-layer connection status, and debug logs for all devices in a Mesh-Lite network from a single host.
    • Remote Diagnostics: Retrieve logs and connection status from offline or hard-to-reach devices (e.g., industrial controllers or embedded sensors) via cloud or online device forwarding.
    • Multi-device Coordination: Debug multiple ESP32 devices in a mesh network simultaneously without connecting to each device's serial port individually.
  2. Overview of the LED Light Rainmaker Example

    release/v1.0

    This example demonstrates ESP-Mesh-Lite functionality using the Rainmaker Cloud Platform. Users can use the Nova Home app to provision devices and connect them to the Rainmaker cloud.

    While connected to the cloud, devices can also act as mesh nodes to provide internet access to other wireless devices, forming a Mesh-Lite network. This reduces the load on the router and extends wireless communication range.

    Supported Targets:

    • ESP32
    • ESP32-C3
    • ESP32-S3
    • ESP32-C6
  3. What is ESP-MESH-LITE

    release/v1.0

    ESP-MESH-LITE is a networking protocol built on top of Wi-Fi that allows a large number of devices (nodes) to connect within the same WLAN across wide areas (indoor and outdoor).

    Key characteristics include:

    • Self-organizing and Self-healing: The mesh network can autonomously build and maintain itself.
    • Independent External Access: Unlike standard ESP-WIFI-MESH, ESP-MESH-LITE allows sub-devices to access external networks independently. The parent node performs network-layer forwarding and is transparent to the application layer data, which significantly reduces application development complexity.
    • Tree Topology: Nodes connect to adjacent nodes rather than being limited to a single central Access Point (AP), extending coverage and increasing capacity.
  4. Overview of ESP-MESH-LITE

    release/v1.0

    ESP-MESH-LITE is a Wi-Fi networking solution based on the SoftAP + Station mode, built on top of the IoT-Bridge component. It allows multiple devices (nodes) to form a single Wireless Local-Area Network (WLAN) across large physical areas.

    Key characteristics:

    • Self-organizing and self-healing: The network builds and maintains itself autonomously.
    • Independent Network Access: Unlike standard ESP-MESH, sub-devices in ESP-MESH-LITE can independently access external networks.
    • Simplified Development: Transmission information is insensitive to the parent node, which reduces the complexity of application-layer development.
    • Network Layer Forwarding: Parent nodes forward data at the network layer and ignore the application layer, and each node receives an IP address assigned by its parent node.
  5. Core concepts of ESP-MESH-LITE

    release/v1.0

    ESP-MESH-LITE is a provisioning protocol that builds a tree topology network by combining multiple independent Wi-Fi networks into a single WLAN.

    Topology and Connectivity

    • Tree Topology: Nodes act as both a station (for one upstream connection) and an AP (for multiple downstream connections). This creates a multi-layered parent-child structure.
    • Connections: A connection is a traditional Wi-Fi association where a node's station interface connects to another node's SoftAP interface.
    • Subnetwork: A segment of the network consisting of a node and all its descendants.

    Network Configuration Limits

    The size of the network is governed by two configurable variables:

    1. Maximum Layers: The allowed depth of the tree (range: 1-15).
    2. Maximum Downstream Connections: The number of child nodes a single node can support (range: 1-10).
  6. How the No Router ESP-Mesh-Lite Example works

    release/v1.0

    The No Router example demonstrates how to initialize an ESP-Mesh-Lite network where no external Wi-Fi router is present. The network is established by designating one node as the root.

    Once initialized, the nodes perform the following lifecycle:

    1. Initialization: Wi-Fi and ESP-Mesh-Lite are started based on the menuconfig settings.
    2. Connection: Nodes scan for the mesh network (identified by MESH_LITE_ID) and connect to available parents.
    3. Network Formation: The mesh topology forms, with nodes automatically determining their layer (distance from root) and parent node.
    4. Monitoring: The example uses a timer to periodically print system information, including the current channel, mesh layer, device MAC address, parent BSSID, parent signal strength (RSSI), and available free heap memory.
  7. Understand ESP-MESH-LITE terminology

    release/v1.0

    ESP-MESH-LITE uses specific terms to describe the relationships and roles within the mesh network:

    • Node: Any device that is part of or can become part of an ESP-MESH-LITE network.
    • Root Node: The node at the top of the network that acts as the bridge between the ESP-MESH-LITE network and the external IP network (typically connected to a Wi-Fi router).
    • Child Node: A node that is further from the root node than its parent.
    • Parent Node: The node to which a child node is connected.
    • Descendant Node: Any node that can be traced back to the root node.
    • Sibling Node: All nodes connected to the same parent node.
    • Connection: A Wi-Fi association where a node uses its station interface to connect to another node's SoftAP interface (an uplink connection).
    • Uplink Connection: A connection from a node to its parent.
    • Downlink Connection: A connection from a parent node to one of its child nodes.
    • Subnet: A portion of the network consisting of a node and all its descendant nodes. The root node's subnet includes the entire network.
  8. Data transmission and network performance in ESP-MESH-LITE

    release/v1.0

    Data Flow

    Each node in an ESP-MESH-LITE network enables the LWIP stack. This allows every node to be treated as a device directly connected to the router, enabling independent use of application-layer protocols like Socket, MQTT, and HTTP.

    Performance Metrics

    Performance is measured by several key metrics:

    • Provisioning time: Time to build the network from scratch (typically < 60s).
    • Repair time: Time to fix a disconnection. Root node disconnection repair is < 50s; child node disconnection repair is < 45s.
    • Per-Hop delay: The delay per wireless hop (typically 8 to 12 ms).
    • Network node capacity: Total supported nodes, determined by maximum downstream connections per node and maximum allowed layers.

    Note: Performance depends on network configuration, environment, and number of devices/layers.

  9. How preferred parent selection works

    release/v1.0

    When an idle node detects multiple potential parent nodes via Wi-Fi beacon frames, it selects a Preferred Parent based on the following priority logic:

    1. Network Layer (Depth): Nodes at shallower layers (closer to the root) are prioritized. This helps minimize the total number of layers in the network. For example, a node at Layer 2 is preferred over a node at Layer 3, unless the Layer 2 node's signal strength (RSSI) is below a predefined threshold.
    2. Signal Strength (RSSI): If multiple candidate parents are at the same layer, the one with the highest RSSI is selected.

    Beacon Frame Metadata: Nodes use the Wi-Fi "Vendor Specific Information Element" to broadcast metadata in beacon frames, including:

    • Mesh-Lite version
    • Current node layer
    • Current number of child nodes
    • Maximum allowed downlink connections