首页 > 解决方案 > Mesh-wifi:如果 RSSI 低于阈值,则更改父级

问题描述

我正在使用几个连接在 wifi 网格中的 ESP32。

现在我有 5 个节点(N1, N2, N3, N4, N5)以这种方式连接:

Root(N1)

|

L2 ( N2,N3,N4 )

|

L3 ( N5)

关于位置和距离:

图像网格

我以为N3N4会连接到N5。我发现如果 RSSI 大于或小于参考值,是否可以设置变量以告诉节点更改父节点。这是esp-idf 的链接

我想我必须设置:

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;

select_rssi并且switch_rssi,对吗?

我是否还必须设置:

typedef struct {
    int high;
    int medium;
    int low;
} mesh_rssi_threshold_t;

这些变量如何相关?

标签: wifiesp32rssiesp-idfmesh-network

解决方案


推荐阅读