I am trying to find a proper set of parameters of configuration for parent node selection within ESP-WIFI-MESH (ESP-IDF version 5.4).
Could anyone describe the meaning of the parameters of parent selection/switching (or even the whole mechanism) with more details, please?
I have found every fragment of information from the official documentation, source code, this forum and many other sources. Then I was trying to deduce the purpose of parameters very hard. I was comparing parameters of configuration of ESP-WIFI-MESH with many other wireless mesh networks. I was trying to study the compiled code of the library (libmesh.a) to find an answer. But I am still not able to understand the proper meaning of configuration parameters and do not know, how to set them.
According to the documentaion, the selection of parent node is controlled with the following structures defined in esp-mesh-internal.h (https://github.com/espressif/esp-idf/bl ... internal.h)
Code: Select all
typedef struct {
int high; /**< high RSSI threshold, used to determine whether the new parent and the current parent are in the same RSSI range */
int medium; /**< medium RSSI threshold, used to determine whether the new parent and the current parent are in the same RSSI range */
int low; /**< low RSSI threshold. If the parent's RSSI is lower than low for a period time of duration_ms,
then the mesh node will post MESH_WEAK_RSSI event.
Also used to determine whether the new parent and the current parent are in the same RSSI range */
} mesh_rssi_threshold_t;Code: Select all
typedef struct {
int duration_ms; /**< parent weak RSSI monitor duration, if the RSSI continues to be weak during this duration_ms,
device will search for a new parent. */
int cnx_rssi; /**< RSSI threshold for keeping a good connection with parent.
If set a value greater than -120 dBm, a timer will be armed to monitor parent RSSI at a period time of duration_ms. */
int select_rssi; /**< RSSI threshold for parent selection. It should be a value greater than switch_rssi. */
int switch_rssi; /**< Disassociate with current parent and switch to a new parent when the RSSI is greater than this set threshold. */
int backoff_rssi; /**< RSSI threshold for connecting to the root */
} mesh_switch_parent_t;As far as I am able to understand, the mesh_rssi_threshold_t cuts the whole range of RSSI from -120 dB up to (teoretical) +14 dBm to subranges (cathegories). The values are in dBm and default values are -78 dBm, -82 dBm and -85 dBm respectively. Nodes listened with RSSI below low are ignored. Nodes listened with RSSI from higher subrange are prefered as parent candidates over those from lower subrange.
More as I far as I am able to understand, the mesh_switch_parent_t involves parent node selection/swithing in more detail. The *_rssi values are in dBm, the duration_ms is in miliseconds. The default values are 60000 ms for duration_ms, -120 dBm for cnx_rssi and -78 dBm for select_rssi, switch_rssi and backoff_rssi. The cnx_rssi sets a simple threshold for "good connection for current parent node". If it is set to value higher value than -120 dBm, it is being periodically compared to RSSI of every message received from the current parent (e.g. its beacon). If RSSI listened from the parent is below cnx_rssi (at least single-times) during the period of duration_ms, searching for any better parent is triggered.
The meaning of select_rssi and switch_rssi is not reachable for me and I am hesitating about backoff_rssi.
In the code of libmesh.a library I can see that parent selection/switing also depends on layer and number of associated child nodes of parent candidates within the same RSSI subrange. Moreover there are some more constants of time and maximal counts of repeated tryies for certain phases of the whole process and some RSSI quantizations steps. Due to respect to Espressif, I do not mention any other details here.
The main points of my confusion are the following:
- 1. Is any mechanism for network self-healing active when cnx_rssi is -120 dBm?
- 2. What is the relation of items of mesh_rssi_threshold_t and mesh_switch_parent_t and which priority they are applied with?
- 3. What is the relation of switch_rssi and select_rssi to duration_ms and cnx_rssi? Do switch_rssi and select_rssi make any time-independent hysteresis-based mechanims in oposition to time-dependent hysteresis-free mechanism of duration_ms and cnx_rssi?
- 4. Why is the mechanism of cnx_rssi and duration_ms deactivated by default?
- 5. Why are the default values of select_rssi and switch_rssi the same while select_rssi should be greater than select_rssi according to its description?
- 6. Why is connection to the root of a network (i.e. at the layer 2) evaluated in a specially way with backoff_rssi in comparation to all other upper layers and what is its priority agains to all the other parameters?
Thank very much in advance to any help or hint.
Best regards, Jan Konecny.
References of my research:
- https://docs.espressif.com/projects/esp ... -mesh.html
- https://docs.espressif.com/projects/esp ... -mesh.html
- https://github.com/espressif/esp-idf/bl ... internal.h
- https://github.com/espressif/esp32-wifi ... v5.4/esp32
- https://docs.esp-rs.org/esp-idf-svc/esp ... ent_t.html
- viewtopic.php?t=21604
- viewtopic.php?t=35856
- viewtopic.php?p=138472&hilit=rssi#p138472
- viewtopic.php?p=120605&hilit=RSSI+cnx_rssi#p120605
- https://github.com/espressif/esp-idf/issues/8108
- https://docs.espressif.com/projects/esp-mdf/en/latest/
- https://github.com/espressif/esp-mdf
- ... and some minor others