From 7db0f0feb13c2f98d8b2ad3414aab056fc441ab4 Mon Sep 17 00:00:00 2001 From: David Cermak Date: Tue, 22 Feb 2022 08:48:43 +0100 Subject: [PATCH] esp_mesh: Document that hard-coded non-root nodes do not need TCP/IP --- components/esp_wifi/include/esp_mesh.h | 3 ++- docs/en/api-reference/network/esp-wifi-mesh.rst | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/esp_wifi/include/esp_mesh.h b/components/esp_wifi/include/esp_mesh.h index a3df334acf..0ba31b3618 100644 --- a/components/esp_wifi/include/esp_mesh.h +++ b/components/esp_wifi/include/esp_mesh.h @@ -60,7 +60,8 @@ * * In present implementation, applications are able to access mesh stack directly without having to go through LwIP stack. * Applications use esp_mesh_send() and esp_mesh_recv() to send and receive messages over the mesh network. - * In mesh stack design, normal devices don't require LwIP stack. + * In mesh stack design, normal devices don't require LwIP stack, but if any of these devices could be promoted to a root node in runtime, + * (due to automatic or manual topology reconfiguration) the TCP/IP stack should be initialized (for the root code to access external IP network) * * Over the mesh network, only the root is able to access external IP network. * In application mesh event handler, once a device becomes a root, start DHCP client immediately whether DHCP is chosen. diff --git a/docs/en/api-reference/network/esp-wifi-mesh.rst b/docs/en/api-reference/network/esp-wifi-mesh.rst index 626abfac0e..460170ff06 100644 --- a/docs/en/api-reference/network/esp-wifi-mesh.rst +++ b/docs/en/api-reference/network/esp-wifi-mesh.rst @@ -65,7 +65,7 @@ LwIP & ESP-WIFI-MESH The application can access the ESP-WIFI-MESH stack directly without having to go through the LwIP stack. The LwIP stack is only required by the root node to transmit/receive data to/from an external IP network. However, since every node can potentially become the root node (due to automatic root node selection), each node must still initialize the LwIP stack. -**Each node is required to initialize LwIP by calling** :cpp:func:`esp_netif_init`. In order to prevent non-root node access to LwIP, the application should not create or register any network interfaces using esp_netif APIs. +**Each node that could become root is required to initialize LwIP by calling** :cpp:func:`esp_netif_init`. In order to prevent non-root node access to LwIP, the application should not create or register any network interfaces using esp_netif APIs. ESP-WIFI-MESH requires a root node to be connected with a router. Therefore, in the event that a node becomes the root, **the corresponding handler must start the DHCP client service and immediately obtain an IP address**. Doing so will allow other nodes to begin transmitting/receiving packets to/from the external IP network. However, this step is unnecessary if static IP settings are used.