You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example shows how to configure the Zigbee end device and use it as a Home Automation (HA) on/off light.
4
+
5
+
# Supported Targets
6
+
7
+
Currently, this example supports the following targets.
8
+
9
+
| Supported Targets | ESP32-C6 | ESP32-H2 |
10
+
| ----------------- | -------- | -------- |
11
+
12
+
## Hardware Required
13
+
14
+
* One development board (ESP32-H2 or ESP32-C6) acting as Zigbee coordinator (loaded with Zigbee_On_Off_switch example)
15
+
* A USB cable for power supply and programming
16
+
* Choose another board (ESP32-H2 or ESP32-C6) as Zigbee end device and upload the Zigbee_On_Off_Light example
17
+
18
+
### Configure the Project
19
+
20
+
Set the LED GPIO by changing the `LED_PIN` definition. By default, the LED_PIN is `RGB_BUILTIN`.
21
+
By default, the `neoPixelWrite` function is used to control the LED. You can change it to digitalWrite to control a simple LED.
22
+
23
+
#### Using Arduino IDE
24
+
25
+
To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits).
26
+
27
+
* Before Compile/Verify, select the correct board: `Tools -> Board`.
28
+
* Select the End device Zigbee mode: `Tools -> Zigbee mode: Zigbee ED (end device)`
29
+
* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs`
30
+
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
31
+
32
+
## Troubleshooting
33
+
34
+
If the End device flashed with this example is not connecting to the coordinator, erase the flash before flashing it to the board. It is recommended to do this if you did changes to the coordinator.
35
+
You can do the following:
36
+
37
+
* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`
38
+
* In the sketch uncomment function `esp_zb_nvram_erase_at_start(true);` located in `esp_zb_task` function.
39
+
40
+
By default, the coordinator network is open for 180s after rebooting or flashing new firmware. After that, the network is closed for adding new devices.
41
+
You can change it by editing `esp_zb_bdb_open_network(180);` in `esp_zb_app_signal_handler` function.
42
+
43
+
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
44
+
45
+
***LED not blinking:** Check the wiring connection and the IO selection.
46
+
***Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed.
47
+
***COM port not detected:** Check the USB cable and the USB to Serial driver installation.
48
+
49
+
If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute).
50
+
51
+
## Contribute
52
+
53
+
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
54
+
55
+
If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome!
56
+
57
+
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
58
+
59
+
## Resources
60
+
61
+
* Official ESP32 Forum: [Link](https://esp32.com)
62
+
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
63
+
* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf)
64
+
* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf)
65
+
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)
# Arduino-ESP32 Zigbee On/Off Light Switch Example
2
+
3
+
This example shows how to configure Zigbee Coordinator and use it as a Home Automation (HA) on/off light switch.
4
+
5
+
# Supported Targets
6
+
7
+
Currently, this example supports the following targets.
8
+
9
+
| Supported Targets | ESP32-C6 | ESP32-H2 |
10
+
| ----------------- | -------- | -------- |
11
+
12
+
## Hardware Required
13
+
14
+
* One development board (ESP32-H2 or ESP32-C6) acting as Zigbee end device (loaded with Zigbee_On_Off_Light example).
15
+
* A USB cable for power supply and programming.
16
+
* Choose another board (ESP32-H2 or ESP32-C6) as Zigbee coordinator and upload the Zigbee_On_Off_Switch example.
17
+
18
+
### Configure the Project
19
+
20
+
Set the Button Switch GPIO by changing the `GPIO_INPUT_IO_TOGGLE_SWITCH` definition. By default, it's the pin `9` (BOOT button on ESP32-C6 and ESP32-H2).
21
+
22
+
#### Using Arduino IDE
23
+
24
+
To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits).
25
+
26
+
* Before Compile/Verify, select the correct board: `Tools -> Board`.
* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs`.
29
+
* Select the COM port: `Tools -> Port: xxx where the `xxx` is the detected COM port.
30
+
* Optional: Set debug level to info to see logs from Zigbee stack: `Tools -> Core Debug Level: Info`.
31
+
32
+
## Troubleshooting
33
+
34
+
If the End device flashed with the example `Zigbee_Light_Bulb` is not connecting to the coordinator, erase the flash of the End device before flashing the example to the board. It is recommended to do this if you re-flash the coordinator.
35
+
You can do the following:
36
+
37
+
* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`.
38
+
* In the `Zigbee_Light_Bulb` example sketch uncomment function `esp_zb_nvram_erase_at_start(true);` located in `esp_zb_task` function.
39
+
40
+
By default, the coordinator network is open for 180s after rebooting or flashing new firmware. After that, the network is closed for adding new devices.
41
+
You can change it by editing `esp_zb_bdb_open_network(180);` in `esp_zb_app_signal_handler` function.
42
+
43
+
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
44
+
45
+
***LED not blinking:** Check the wiring connection and the IO selection.
46
+
***Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed.
47
+
***COM port not detected:** Check the USB cable and the USB to Serial driver installation.
48
+
49
+
If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute).
50
+
51
+
## Contribute
52
+
53
+
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
54
+
55
+
If you have any **feedback** or **issue** to report on this example/library, please open an issue or fix it by creating a new PR. Contributions are more than welcome!
56
+
57
+
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
58
+
59
+
## Resources
60
+
61
+
* Official ESP32 Forum: [Link](https://esp32.com)
62
+
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
63
+
* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf)
64
+
* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf)
65
+
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)
0 commit comments