esp-idf/examples/zigbee/light_sample/light_coordinator
likunqiao a9146920b9 Zigbee: Add light example
* provide light example for acting as zigbee coordinator, router and end-device
* remove unused componenent for example usage
* remove unused variable
* clean up unused header include for example
* update the license header
* update copyright
* Add readme for instruction adding esp-zboss-lib component
* esp-idf:update copy_right_check ignore file
* CI: fix the ci check error from pipeline
* sdkconfig: default set change for better user use
* use Button (BOOT) as switch input
* update the statemachine for debouncing
* esp-zboss-lib: support lib 0.0.2
* fix warning issue from example
2021-11-11 19:03:01 +08:00
..
main Zigbee: Add light example 2021-11-11 19:03:01 +08:00
CMakeLists.txt Zigbee: Add light example 2021-11-11 19:03:01 +08:00
partitions.csv Zigbee: Add light example 2021-11-11 19:03:01 +08:00
README.md Zigbee: Add light example 2021-11-11 19:03:01 +08:00
sdkconfig.defaults Zigbee: Add light example 2021-11-11 19:03:01 +08:00

Supported Targets ESP32-H2

Light Coordinator Example

(See the README.md file in the upper level 'examples' directory for more information about examples.)

This test code shows how to configure Zigbee coordinator device.

Hardware Required

  • One development board with ESP32-H2 SoC acting as Zigbee coordinator (loaded with light coordinator example)
  • A USB cable for power supply and programming
  • Choose another ESP32-H2 as Zigbee router (see light bulb example)
  • Choose another ESP32-H2 as Zigbee end-device (see light switch example)

Configure the project

[Mandatory] Download esp-zboss-lib packages from Espressif's component serivce. You can add them to your project via idf.py add-dependency espressif/esp-zboss-lib==0.0.2

Before project configuration and build, make sure to set the correct chip target using idf.py set-target esp32h2.

Build and Flash

Build the project, flash it to the board, and start the monitor tool to view the serial output by running idf.py -p PORT flash monitor.

(To exit the serial monitor, type Ctrl-].)

Example Output

As you run the example, you will see the following log:

light coodrinator: I (9556) ESP_ZB_COORDINATOR: status: -1 I (9556) ESP_ZB_COORDINATOR: Zigbee stack initialized I (9556) ESP_ZB_COORDINATOR: Start network formation I (10066) ESP_ZB_COORDINATOR: Joined network successfully (Extended PAN ID: f9:54:2d:01:a0:03:f7:84, PAN ID: 0xf5b5) I (10526) ESP_ZB_COORDINATOR: Network steering started I (11306) ESP_ZB_COORDINATOR: status: 0 I (11806) ESP_ZB_COORDINATOR: status: 0 I (11886) ESP_ZB_COORDINATOR: New device commissioned or rejoined (short: 0x434a) I (12386) ESP_ZB_COORDINATOR: status: 0 I (12486) ESP_ZB_COORDINATOR: status: 0 I (12896) ESP_ZB_COORDINATOR: status: 0 I (12946) ESP_ZB_COORDINATOR: New device commissioned or rejoined (short: 0x09c2) I (13516) ESP_ZB_COORDINATOR: status: 0 I (26686) ESP_ZB_COORDINATOR: status: 0

Light Control Functions

  • By toggling the switch button (BOOT) on the ESP32-H2 board loaded with light switch example, the LED on the board loaded with light bulb example will be on and off.

Troubleshooting

For any technical queries, please open an issue on GitHub. We will get back to you soon.