espressif / esp-zigbee-sdk

Espressif Zigbee SDK
Apache License 2.0
155 stars 26 forks source link

Router can't join a network at a distance of +/- 20meters (TZ-610) #235

Closed BaWe155 closed 6 months ago

BaWe155 commented 7 months ago

Question

How to get a router ESP32C6 with TX power value 0 (dBm?) joined at a distance of 20 meter (LQI is than 10) can I do something with the link cost?

Additional context.

After factory reset and a first join at 2meter (20 meter is not possible), the router can reach 20 meters (LQI=10)

BaWe155 commented 7 months ago

Join and hopes

Is it possible to make a join after factory reset at position C?

I have tested the following situation, see figure: A router would only join after a factory reset at position A, not at B or C and would not make hopes. After a factory reset and a join at position A, I move a router to position B, it will connect with the network. At position C a router will not join after factory reset, it need first a join at position A after that moving the router to position C, it will make a connection with a hop via B

chshu commented 7 months ago

@BaWe155 Did you do the test with 0 dBm txpower? I think 0 dBm is too low for 40 meters distance, could you increase the txpower by esp_zb_set_tx_power API, and rerun the tests?

BaWe155 commented 7 months ago

@BaWe155 Did you do the test with 0 dBm txpower? I think 0 dBm is too low for 40 meters distance, could you increase the txpower by esp_zb_set_tx_power API, and rerun the tests?

@chshu I think for now the TX power is not a problem, the routers will make only a join at small range of the coordinator (with a factory reset) after that I can reach a range of +/- 20 meter with 0dBm Can a router C join a network via a hop (B) after a factory reset, is the stack tested for this?

chshu commented 7 months ago

Can a router C join a network via a hop (B) after a factory reset, is the stack tested for this?

Yes, it works. But if the RSSI / LQI is too low, the device will consider the link is too bad, and refuse to join the network via this parent. The LQI threshold is 32 (RSSI is around -74 dBm) in current SDK.

BaWe155 commented 7 months ago

Can a router C join a network via a hop (B) after a factory reset, is the stack tested for this?

Yes, it works. But if the RSSI / LQI is too low, the device will consider the link is too bad, and refuse to join the network via this parent. The LQI threshold is 32 (RSSI is around -74 dBm) in current SDK.

@chshu Thank you for the quick reply, Is it possible to change the threshold?

chshu commented 7 months ago

It can't be changed with current SDK, but we can make it configurable in future release. However lower threshold may cause stability issues with high packet loss rate.

BaWe155 commented 7 months ago

It can't be changed with current SDK, but we can make it configurable in future release. However lower threshold may cause stability issues with high packet loss rate.

Are you sure that a factory new router can join the network trough router at position B (join via other routers not only via the coordinator)? when I place a factory new router 1 meter from B, it would not join the network (LQI is more than 32)

xieqinan commented 7 months ago

Hello @BaWe155,

Are you sure that a factory new router can join the network trough router at position B (join via other routers not only via the coordinator)? when I place a factory new router 1 meter from B, it would not join the network (LQI is more than 32)

In a centralized network, a device intending to join a network created by the coordinator typically needs to be able to communicate with the Trust Center directly. The routers in the centralized network should not be responsible for managing the network key exchange process.

image

Therefore,I believe the factory new router can not join the network trough router at position B.

BaWe155 commented 7 months ago

@xieqinan thank you for the info.

Is my conclusion right? If there is meshnetwork and I will join a new router nearby position C (The range to the coordinator/(trust center) is too far/large, The new router can’t join in the network?

xieqinan commented 7 months ago

@BaWe155 ,

Yes, according to the Zigbee BDB specification, your conclusion is correct. The behavior of the ESP-Zigbee-SDK on the ESP32H2 is also correct.

Hedda commented 7 months ago

How to get a router ESP32C6 with TX power value 0 (dBm?) joined at a distance of 20 meter (LQI is than 10) can I do something with the link cost?

I think for now the TX power is not a problem, the routers will make only a join at small range of the coordinator (with a factory reset) after that I can reach a range of +/- 20 meter with 0dBm

FYI, unless you are talking about line-of-sight outdoors with no obstacles or walls/ceilings/floors then that is too long distance for Zigbee. Indoors with normal obstacles and walls/ceilings/floors then standard Zigbee device range is usually around 5 meters.

2.4GHz based Zigbee devices are low-power devices and the high-frequency used makes them all have short range and poor radio propagation (building material penetration) so they all depend on being part of a larger and stable/reliable Zigbee network mesh with many Zigbee Router devices connected in a mesh network + on top of that Zigbee radios are also relatively speaking very susceptible to EMF/RMI/RMI interference, so highly recommend you read these related guides and follow recommendations:

https://community.home-assistant.io/t/zigbee-networks-how-to-guide-for-avoiding-interference-and-optimize-for-getting-better-range-coverage/515752

and

https://community.home-assistant.io/t/not-many-people-know-that-a-random-collection-of-zigbee-trivia/656267

Summery; Regardless of your Zigbee device types and setup, you really need to be aware of Zigbee limitations and reliance on mesh networking and then take appropriate actions, most importantly adding many more Zigbee Router devices closer to each other to extend range/coverage and almost as important is avoiding EMF/RMI/RMI sources interference close to Zigbee radios, (especially close to the Zigbee Coordinator adapter, which is a single point of failure in an RF noisy environment so make sure get that at least 1 meter away from anything electric).

PS: Slightly off-topic but also recommend reading this -> https://community.home-assistant.io/t/zigbee-buyers-guide/654695

xieqinan commented 7 months ago

@BaWe155 @Hedda

I may have made a mistake regarding the "Figure 12 – Trust Center link key exchange procedure sequence chart." I conducted a test as follows: After performing a factory reset and a join at position A, I moved a router to position B, where it successfully connected to the network. However, at position C, a router failed to join after a factory reset. However, if the factory-reset router was placed at position D can be routed through position B so that it was able to join the network.

image

In summary, while the stack requires an RSSI value of more than -74 during the joining network process, there seems to be no such limitation for joined devices. Therefore, could you also attempt to place the device at position D and observe its behavior?

In a centralized network, a device intending to join a network created by the coordinator typically needs to be able to communicate with the Trust Center directly. The routers in the centralized network should not be responsible for managing the network key exchange process.

The test verifies that it was an erroneous conclusion. Actually, the position B can indeed route the network key for devices whose RSSI from the beacon is sufficiently large.

chshu commented 6 months ago

Is it possible to change the threshold?

@BaWe155 A new API is provided to change the threshold: https://docs.espressif.com/projects/esp-zigbee-sdk/en/latest/esp32/api-reference/esp_zigbee_secur.html#_CPPv437esp_zb_secur_network_min_join_lqi_set7uint8_t, please have a try.

Please reopen if you have any follow up question on this topic.

BaWe155 commented 4 months ago

@chshu Thank you I will test it