zigbee2Mqtt part 1 with CC2530 and FTDI
from here:https://github.com/koenkk/zigbee2mqtt
https://www.zigbee2mqtt.io/information/supported_devices.html
Zigbee2mqtt supports several CC2530 and CC2531 devices. Both can be used as a router or coordinator. A discussion of these devices can be found here. For more information about a coordinator and routers can be found here.
and their limitation:
I will fist try my CC2530 with external antenna.
using 2530 + FTDI as 2531 dongle:
https://www.zigbee2mqtt.io/information/connecting_cc2530.html
after flashing the firmware, I plug the device into USB of Pi, and following this instruction:https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html
the instruction use a CC2531, so it appears as ttyACM0, my ftdi show as ttyusb0, and I have a wireless keyboard/mouse dongle shows as ttyAMA0
here to install zigbee2mqtt
https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html#2-installing
the default setting is using cc2531, we need to change some setting:
I purchased few xiami sensors, I paired the switch and the temp/humid sensor.
To pair switch, you need something sharp to push the hole on the back, 3 secs, when the blue led on the left start to flash, it start to pair. Same thing for sensor with a small button on top.
then we can use this command to check the journal
we can see the time and the data sent to mqtt.
each device is represented as a 8 bytes ID, it could be the mac address of zigbee chip. in the following you can see there are 2 device one is botton, one is sensor.
Then I can get an other terminal to subscript to each topic(node),
Zigbee2mqtt supports several CC2530 and CC2531 devices. Both can be used as a router or coordinator. A discussion of these devices can be found here. For more information about a coordinator and routers can be found here.
Z-Stack coordinator firmwares
This repository contains various Z-Stack coordinator firmwares.
Overiew
Z-Stack | Device | Zigbee | Direct children | Routes | Notes |
Z-Stack_Home_1.2 (default) | CC2531 | 1.2 HA | 20 | 30/0 | |
CC2530, CC2530 + CC2591, CC2530 + CC2592 | 1.2 HA | 16 | 30/0 | ||
Z-Stack_Home_1.2 (source_routing) | CC2531, CC2530, CC2530 + CC2591, CC2530 + CC2592 | 1.2 HA | 5 | 40/40 | |
Z-Stack_3.0.x | CC2531 | 3.0 | 15 | 40/0 | - Discussion #1445 - Max 40 Zigbee 3.0 devices |
CC2530, CC2530 + CC2591, CC2530 + CC2592 | 3.0 | 10 | 40/0 | - Discussion #1445 - Max 40 Zigbee 3.0 devices | |
Z-Stack_3.x.0 | CC26X2R1, CC1352P_2 | 3.0 | 50 | 100/200 | - Discussion #1429 - Max 200 Zigbee 3.0 devices |
which one should I use?
This depends:
- Zigbee 3.0 coordinators are only recommended for CC26X2R1 and CC1352P_2 (other devices might not be powerful enough)
- If you have a network of 1 - 30 devices, the Z-Stack_Home_1.2 default firmware is recommended.
- If you have a network of 30+ devices, the Z-Stack_Home_1.2 source routing firmware is recommended.
- Note that the source routing firmware only supports 5 direct children, therefore you need to have routers in range of the coordinator.
I will fist try my CC2530 with external antenna.
using 2530 + FTDI as 2531 dongle:
https://www.zigbee2mqtt.io/information/connecting_cc2530.html
after flashing the firmware, I plug the device into USB of Pi, and following this instruction:https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html
the instruction use a CC2531, so it appears as ttyACM0, my ftdi show as ttyusb0, and I have a wireless keyboard/mouse dongle shows as ttyAMA0
here to install zigbee2mqtt
https://www.zigbee2mqtt.io/getting_started/running_zigbee2mqtt.html#2-installing
the default setting is using cc2531, we need to change some setting:
nano /opt/zigbee2mqtt/data/configuration.yaml
https://www.zigbee2mqtt.io/information/connecting_cc2530.html#configuring-zigbee2mqttserial:
port: /dev/ttyUSB0
advanced:
baudrate: 115200
rtscts: false
after adding service to systemctl
Some tips that can be handy later:
# Stopping zigbee2mqtt
sudo systemctl stop zigbee2mqtt
# Starting zigbee2mqtt
sudo systemctl start zigbee2mqtt
# View the log of zigbee2mqtt, it will show the action update
sudo journalctl -u zigbee2mqtt.service -f
I purchased few xiami sensors, I paired the switch and the temp/humid sensor.
To pair switch, you need something sharp to push the hole on the back, 3 secs, when the blue led on the left start to flash, it start to pair. Same thing for sensor with a small button on top.
then we can use this command to check the journal
sudo journalctl -u zigbee2mqtt.service -f
we can see the time and the data sent to mqtt.
each device is represented as a 8 bytes ID, it could be the mac address of zigbee chip. in the following you can see there are 2 device one is botton, one is sensor.
Then I can get an other terminal to subscript to each topic(node),
pi@raspberry:~ $ mosquitto_sub -d -t zigbee2mqtt/0x00158d0003584cba
The we can see the data comes in
留言
張貼留言