pvvx / ZigbeeTLc

Custom firmware for Zigbee 3.0 IoT devices on the TLSR825x chip
Other
391 stars 21 forks source link

Are TLSR825x also compatible with OpenThread? #122

Open UnaiUribarri-TomTom opened 1 month ago

UnaiUribarri-TomTom commented 1 month ago

Since Zigbee and Thread are both based on 802.15.4, maybe it is possible to have a simple thread implementation that just broadcasts an UDP packet every X seconds.

I am just curious if Thread is more power efficient than Zigbee.

pvvx commented 1 month ago

The most energy efficient is BLE.

In terms of communication range, this is also BLE in LE Long Range mode (Coded PHY S8). Сoded PHY S8 (chip BT5.0+) - typical receiver range up to -110 dBm. This is 500..1500 meters at TX 0 dBm. There are also chips with -115 dBm.

Zigbee/802.15.4 = Сoded PHY S2 - receiver range up to -98..100 dBm. WiFi - 80..90 dBm.

Transmitter power grows logarithmically depending on TX power in dBm. Most Zigbee devices use an increased transmission level - +4..20 dBm, because old Zigbee receivers have poor sensitivity. Also, Tuya routers and coordinators usually have poor (terrible) internal antenna layout. This increasingly affects energy efficiency.

A UDP packet has a header, and it takes 4 times longer to transmit one bit in 802.15.4 than in BLE. That is, energy efficiency is immediately 4 times worse than in BLE (PHY 1M).

At best, ZigBee requires 8 times more energy to transmit the same amount of information compared to BLE.

Protocol timings also differ. Receiving transmission confirmations is always accompanied by additional consumption. BLE has a reception window (receiver operation to wait for a response) of 500 µs, while Zibee has tens of ms.

Plus Zigbee and other 802.15.4 protocols require approvals and a large processed code (chip resources). As a result, the comparison of energy efficiency comes to tens of times.

Zigbee/802.15.4 uses one RF channel. If there is interference on this channel, the connection drops, which causes transmission repetitions - additional consumption. Even if the coordinator and routers are temporarily disabled in Zigbee, all devices switch to network search mode. This is a very energy-consuming procedure - a CR2032 battery will only last for an hour in this mode...

One USB-BT adapter can work with dozens of BLE devices. Maximum of about a hundred received BLE advertising packets per second. Zigbee has a maximum of about 5 connections per second per coordinator... This greatly limits Smart Home and IoT automation.

Energy efficiency in Zigbee/802.15.4 is achieved only through forced advertising for the sake of sales.

All of the above is deprived of BLE (see the Bluetooth 5.4 PAwR specification and standard encryption).

UnaiUribarri-TomTom commented 1 month ago

Thread theoretically consumes less power than Zigbee because the wait states are shorter. Maybe it takes twice longer transmitting a packet, but wait periods in RX mode are 10x shorter because it does not need to wait for notification acks and parent node maximum poll interval is also longer.

I already have a solid thread network with six border routers and great redundancy that came free with my wifi routers, TVs and speakers, but I do not have any BLE mesh network at home and my devices are too far away from my home assistant server for direct connection.

pvvx commented 1 month ago

But there is no SDK from Telink for "Thread". Also there is no complete documentation for the RF part of the TLSR825x chips. Plus there is no documentation and nuances on working with your "Thread" network.

A good USB-BT adapter costs a couple of dollars...