Zigbee: Merging light_coordinator and light switch into one

* Light bulb acting as ZED and bulb server device
  * Light switch acting as ZC and switch client device
  * ZC stay starting network steering to permit device join
This commit is contained in:
likunqiao@espressif.com
2022-04-26 21:38:22 +08:00
committed by BOT
parent d178d1d58a
commit c42628fd4f
18 changed files with 116 additions and 385 deletions
@@ -9,10 +9,9 @@ This test code shows how to configure Zigbee end device and use it as a light sw
## Hardware Required
* One development board with ESP32-H2 SoC acting as Zigbee end device (loaded with light switch example)
* One development board with ESP32-H2 SoC acting as Zigbee coordinator (loaded with light switch example)
* A USB cable for power supply and programming
* Choose another ESP32-H2 as Zigbee coordinator (see [light coordinator example](../light_coordinator))
* Choose another ESP32-H2 as Zigbee router (see [light bulb example](../light_bulb))
* Choose another ESP32-H2 as Zigbee end-device (see [light bulb example](../light_bulb))
## Configure the project
@@ -29,18 +28,24 @@ Build the project, flash it to the board, and start the monitor tool to view the
As you run the example, you will see the following log:
light switch:
I (9423) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
I (9523) ESP_ZB_SWITCH: status: -1
I (9523) ESP_ZB_SWITCH: Zigbee stack initialized
I (9523) ESP_ZB_SWITCH: Start network steering
I (11263) ESP_ZB_SWITCH: Joined network successfully (Extended PAN ID: f9:54:2d:01:a0:03:f7:84, PAN ID: 0xf5b5)
I (13433) ESP_ZB_SWITCH: Found bulb addr: 0x434a ep: 10
I (16433) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (17663) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (18693) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (19833) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (20753) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (21363) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (767) gpio: GPIO[9]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
I (857) ESP_ZB_SWITCH: status: 255
I (857) ESP_ZB_SWITCH: Zigbee stack initialized
I (857) ESP_ZB_SWITCH: Start network formation
I (1377) ESP_ZB_SWITCH: Joined network successfully (Extended PAN ID: aa:98:48:01:a0:03:f7:84, PAN ID: 0xb8db)
I (1837) ESP_ZB_SWITCH: status: 0
I (1837) ESP_ZB_SWITCH: Network steering started
I (6587) ESP_ZB_SWITCH: status: 0
I (7097) ESP_ZB_SWITCH: status: 0
I (7147) ESP_ZB_SWITCH: New device commissioned or rejoined (short: 0xd200)
I (7717) ESP_ZB_SWITCH: status: 0
I (7757) ESP_ZB_SWITCH: status: 0
I (9217) ESP_ZB_SWITCH: Found bulb addr: 0x77ea ep: 10
I (11657) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (12197) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (12547) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (12857) ESP_ZB_SWITCH: Send ON/OFF toggle command
I (17327) ESP_ZB_SWITCH: Send ON/OFF toggle command
## Light Control Functions