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
# Arduino-ESP32 Zigbee OTA Client + on/off light Example
2
+
3
+
This example shows how to configure the Zigbee end device with OTA Client 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
+
* A USB cable for power supply and programming
15
+
16
+
### Configure the Project
17
+
18
+
Set the LED GPIO by changing the `LED_PIN` definition. By default, the LED_PIN is `RGB_BUILTIN`.
19
+
By default, the `rgbLedWrite` function is used to control the LED. You can change it to digitalWrite to control a simple LED.
20
+
21
+
#### Using Arduino IDE
22
+
23
+
To get more information about the Espressif boards see [Espressif Development Kits](https://www.espressif.com/en/products/devkits).
24
+
25
+
* Before Compile/Verify, select the correct board: `Tools -> Board`.
26
+
* Select the End device Zigbee mode: `Tools -> Zigbee mode: Zigbee ED (end device)`
27
+
* Select Partition Scheme for Zigbee: `Tools -> Partition Scheme: Zigbee 4MB with spiffs`
28
+
* Select the COM port: `Tools -> Port: xxx` where the `xxx` is the detected COM port.
29
+
* Optional: Set debug level to verbose to see all logs from Zigbee stack: `Tools -> Core Debug Level: Verbose`.
30
+
31
+
## Troubleshooting
32
+
33
+
If the End device flashed with this example 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.
34
+
You can do the following:
35
+
36
+
* In the Arduino IDE go to the Tools menu and set `Erase All Flash Before Sketch Upload` to `Enabled`.
37
+
* Add to the sketch `Zigbee.factoryReset();` to reset the device and Zigbee stack.
38
+
39
+
By default, the coordinator network is closed after rebooting or flashing new firmware.
40
+
To open the network you have 2 options:
41
+
42
+
* Open network after reboot by setting `Zigbee.setRebootOpenNetwork(time);` before calling `Zigbee.begin();`.
43
+
* In application you can anytime call `Zigbee.openNetwork(time);` to open the network for devices to join.
44
+
45
+
46
+
***Important: Make sure you are using a good quality USB cable and that you have a reliable power source***
47
+
48
+
***LED not blinking:** Check the wiring connection and the IO selection.
49
+
***Programming Fail:** If the programming/flash procedure fails, try reducing the serial connection speed.
50
+
***COM port not detected:** Check the USB cable and the USB to Serial driver installation.
51
+
52
+
If the error persists, you can ask for help at the official [ESP32 forum](https://esp32.com) or see [Contribute](#contribute).
53
+
54
+
## Contribute
55
+
56
+
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
57
+
58
+
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!
59
+
60
+
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
61
+
62
+
## Resources
63
+
64
+
* Official ESP32 Forum: [Link](https://esp32.com)
65
+
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
66
+
* ESP32-C6 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf)
67
+
* ESP32-H2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf)
68
+
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)
0 commit comments