forked from tasmota/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into development
- Loading branch information
Showing
49 changed files
with
719 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,157 @@ | ||
# CC2530 Zigbee module | ||
# CC253x Zigbee module | ||
|
||
!!! info "The CC2530 is a system-on-chip (SoC) for Zigbee communication" | ||
!!! info "The CC2530 or CC2531 is a system-on-chip (SoC) for Zigbee communication" | ||
|
||
Complete setup of a CC2530 module is covered in the [Zigbee article](Zigbee) | ||
Any Texas Instruments CC2530 or CC2531 chip based module can serve as a coordinator if it has [Z-Stack firmware flashed](https://zigbee.blakadder.com/flashing_ccloader.html). See [list of supported modules](https://zigbee.blakadder.com/zigbee2tasmota.html) with their pinouts and flashing instructions since they are different for each device. | ||
|
||
## Breakout Boards | ||
List of fully compatible CC2530 boards is [maintained here](https://zigbee.blakadder.com/zigbee2tasmota.html) | ||
!!! info | ||
You cannot use a CC2531 in USB mode! Flash it with CC2530 firmware and it will work in serial mode. You will have to wire it for serial communication using TX and RX pins, USB port cannot be used for communicating with the CC2531 chip. | ||
|
||
|
||
!!! info | ||
You can potentially use a CC2531 with Tasmota but **not in USB mode!** Flash it with CC2530 firmware and it will work in serial mode. You will have to wire it for serial communication using TX and RX pins, USB port cannot be used for communicating with the CC2531 chip. | ||
## Wi-Fi Adapter | ||
Using an ESP82xx device such as a Wemos D1 Mini or a NodeMCU to [flash the CC2530](https://zigbee.blakadder.com/flashing_ccloader.html) is a lower cost alternative than using a single purpose [CC_DEBUGGER](https://www.aliexpress.com/item/32869263224.html). | ||
|
||
In normal operation two free GPIOs are needed for the serial communication with the CC2530. | ||
|
||
### Custom PCBs | ||
These PCBs make all the connections required to flash the CC2530 and to run Z2T: | ||
|
||
#### SuperHouse.tv | ||
Jon Oxer created a [custom PCB](https://github.com/SuperHouse/Z2T) to connect a Wemos D1 Mini and a CC2530 board (with or without CC2591). | ||
|
||
**Complete module** | ||
<img src="https://user-images.githubusercontent.com/49731213/72688606-3c432800-3b09-11ea-9e56-ed24a7c07017.jpg" height="120"> <img src="https://user-images.githubusercontent.com/49731213/72688611-4533f980-3b09-11ea-9c10-9202d1f60f4d.jpg" height="120"> | ||
|
||
#### H4NC | ||
User _**h4nc**_ created a [custom PCB](https://github.com/h4nc/Zigbee2Tasmota_PCB) to connect a NodeMCU and a CC2530 board. | ||
|
||
You can also get a complete Z2T module with case, pre-flashed and ready to configure and deploy. | ||
<img src="https://raw.githubusercontent.com/h4nc/Zigbee2Tasmota_PCB/master/images/Z2T_2.jpeg" height="250"> <img src="https://user-images.githubusercontent.com/34340210/65651832-a7f30980-dfdd-11e9-845d-81c2b99babb9.jpg" height="140"> | ||
|
||
<!-- <table style="text-align:center; width: 80%;"> | ||
<col style="width:30%"> | ||
<col style="width:30%"> | ||
<col style="width:30%"> | ||
<tr> | ||
<th><a href="https://www.aliexpress.com/item/32904763478.html"> CC2530 with PCB antenna, DL-20</a></th> | ||
<th><a href="https://www.aliexpress.com/item/33007098493.html">CC2530 with external antenna</a></th> | ||
<th><a href="https://www.aliexpress.com/item/4000118023903.html">CC2530 with external antenna and CC2591 RF front end</a></th> | ||
</tr> | ||
<tr> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/34340210/67676080-29301a00-f957-11e9-8799-c819241e0b4c.png" style="width:10em"></img> | ||
</td> | ||
<td> | ||
<img src="https://raw.githubusercontent.com/tasmota/docs/master_media/CC2530%20External%20Antenna.png" style="width:10em"></img> | ||
</td> | ||
<td> | ||
<img src="https://user-images.githubusercontent.com/49731213/64906209-c0ad1680-d6e3-11e9-8703-71ea36c5be72.jpg" style="width:10em"></img> | ||
</td> | ||
</tr> | ||
</table> --> | ||
|
||
## Configuration | ||
### Flash Zigbee Adapter | ||
Zigbee2Tasmota requires a TI CC2530 based module flashed with [Z-Stack CC2530 firmware file](https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_Home_1.2/bin/default) from [Koen Kanters](https://github.com/Koenkk). | ||
|
||
Due to memory constraints of the CC2530, you can only pair 16 devices to a coordinator ([See details](https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator)). | ||
|
||
!!! note | ||
There is an alternative firmware allowing for Zigbee routers to create a mesh network and go beyond 16 devices. This is currently not tested nor supported by Zigbee2Tasmota. It may be added later. | ||
|
||
Flashing options: | ||
|
||
- Flashing with [CCLoader](https://zigbee.blakadder.com/flashing_ccloader.html) and ESP8266 ==(recommended)== | ||
- Flashing with [CCLib](Zigbee-CCLib-Flashing.md) and ESP8266 | ||
- Flash with a dedicated [CC Debugger](https://ptvo.info/how-to-select-and-flash-cc2530-144/) and PC | ||
|
||
### Flash Tasmota | ||
Once the flashing process completes, you can re-use the ESP82xx and flash Tasmota with Zigbee2Tasmota enabled firmware. Otherwise, you can use any ESP82xx device. | ||
|
||
!!! failure "Zigbee feature is not included in precompiled binaries" | ||
|
||
To use it you must [compile your build](Compile-your-build). Add the following to `user_config_override.h`: | ||
```arduino | ||
#define USE_ZIGBEE | ||
``` | ||
#### Optional | ||
Run the ESP at 160MHz instead of 80MHz which ensures higher reliability in serial communication with CC2530. | ||
|
||
In `platformio_override.ini` uncomment line 51: | ||
|
||
`board_build.f_cpu = 160000000L` | ||
|
||
If you find that your Zigbee2Tasmota operation is unstable, you may have an ESP82xx device that cannot operate reliably at the higher frequency. If you are using hardware serial (see below) and you still have unreliability, try compiling for 80MHz (reverse the options above) and flash the ESP82xx device again to see if operating at a lower frequency improves stability. Running at 80MHz will impact software serial communications so hardware serial is highly recommended if running the ESP82xx at 80MHz. | ||
|
||
Flash the newly compiled binary usig the [normal flashing process](Getting-Started.md#flashing). | ||
|
||
### Connect CC2530 to Tasmota | ||
If you are using your ESP82xx device to flash the Zigbee adapter as described in tutorials you may want to leave these connections in place in case you ever need to update Zigbee firmware. If not, any of the free GPIOs can be used. | ||
|
||
!!! note "It is recommended that hardware serial pins be used (GPIO1/GPIO3 or GPIO13\[Rx]/GPIO15\[Tx])" | ||
Due to ESP82xx GPIO pin constraints, GPIO15 can only be used as serial Tx. | ||
|
||
The interface between the ESP82xx Wi-Fi device and the Zigbee module uses high speed serial. | ||
|
||
!!! tip | ||
Tasmota also provides serial communications emulation through software (i.e., software serial). This allows any GPIO to be used. TasmotaSerial version 2.4.x (PR [#6377](https://github.com/arendst/Tasmota/pull/6377)) has improved the reliability of software serial making it feasible for use in this application. However, if you have an option to use hardware serial, choose that. | ||
|
||
!!! bug "Z2T uses software serial by default to allow for serial logging on GPIO1/GPIO3" | ||
Use `SerialLog 0` to enable **hardware serial on GPIO13\[Rx]/GPIO15\[Tx]**. | ||
|
||
Recommended wiring: | ||
|
||
ESP<BR>Device|Tasmota|<BR>Zigbee Module | ||
:--:|:--:|:--: | ||
GPIO13|Zigbee RX (166)|CC_TXD<BR>(A.K.A. P0_3) | ||
GPIO15|Zigbee TX (165)|CC_RXD<BR>(A.K.A. P0_2) | ||
3V3 | VCC | ||
GND | GND | ||
|
||
### Tasmota Settings | ||
In the **Configuration -> Configure Module** page assign: | ||
|
||
- GPIO13 to `Zigbee RX (166)` | ||
- GPIO15 to `Zigbee TX (165)` | ||
|
||
<img src="https://user-images.githubusercontent.com/49731213/64920989-ec043400-d7bd-11e9-8f5c-74ece5c4e26c.jpg" width="240"> | ||
|
||
You can quickly configure Tasmota using a custom template instead. | ||
|
||
Use this one for the recommended wiring scheme: | ||
|
||
```json | ||
{"NAME":"Zigbee","GPIO":[0,0,0,0,0,0,0,0,0,166,0,165,0],"FLAG":0,"BASE":18} | ||
``` | ||
|
||
|
||
### First Run | ||
|
||
When the Tasmota device boots, Zigbee2Tasmota will wait for 15 seconds before initializing the CC2530. This time allows for Wi-Fi and MQTT to connect (hopefully). | ||
|
||
First boot: | ||
``` | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":1,"Message":"CC2530 booted","RestartReason":"Watchdog","MajorRel":2,"MinorRel":6}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":50,"MajorRel":2,"MinorRel":6,"MaintRel":3,"Revision":20190608}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":2,"Message":"Reseting configuration"}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":3,"Message":"Configured, starting coordinator"}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":51,"IEEEAddr":"0x00124B00199DF06F","ShortAddr":"0x0000","DeviceType":7,"DeviceState":9,"NumAssocDevices":0}} | ||
MQT: tele/tasmota/Zigbee_home/RESULT = {"ZbState":{"Status":0,"Message":"Started"}} | ||
ZIG: Zigbee started | ||
ZIG: No zigbee devices data in Flash | ||
``` | ||
|
||
Zigbee will automatically boot the CC2530 device, configure the device and wait for Zigbee messages. | ||
|
||
Normal boot looks like: | ||
``` | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":1,"Message":"CC2530 booted","RestartReason":"Watchdog","MajorRel":2,"MinorRel":6}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":50,"MajorRel":2,"MinorRel":6,"MaintRel":3,"Revision":20190608}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":3,"Message":"Configured, starting coordinator"}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":51,"IEEEAddr":"0x00124B00199DF06F","ShortAddr":"0x0000","DeviceType":7,"DeviceState":9,"NumAssocDevices":0}} | ||
MQT: tele/%topic%/RESULT = {"ZbState":{"Status":0,"Message":"Started"}} | ||
ZIG: Zigbee started | ||
ZIG: Zigbee devices data in Flash (516 bytes) | ||
``` | ||
|
||
!!! info "You can force a factory reset of your CC2530 with `ZigbeeReset 1` and reboot" |
Oops, something went wrong.