This project involves developing an IoT system using the ESP32-H2 microcontroller. Below are instructions for setting up the project, an overview of the hardware, and the build process using the ESP-IDF toolchain. Additionally, Zigpy is integrated for Zigbee protocol support.
The system is built around the ESP32-H2, which supports low-power applications and Zigbee connectivity. The primary hardware components include:
Power Supply:
Sensor Integration:
Communication:
More information about ESP32-H2. Below is the pinout diagram for the device:
Zigpy is a Zigbee protocol stack enabling communication between Zigbee devices, used for wireless networking within the system.
To set up the environment for building the project, follow these steps:
sudo apt-get install -y git wget flex bison gperf python3 python3-pip python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0
mkdir -p ~/esp
cd ~/esp
git clone -b v5.4-dev --recursive https://github.com/espressif/esp-idf.git
cd ~/esp/esp-idf
./install.sh esp32h2
. $HOME/esp/esp-idf/export.sh
To install Zigpy for Zigbee communication:
pip3 install zigpy
To build the project for the ESP32-H2, follow these steps:
idf.py set-target esp32h2
idf.py build
After building the project, flash the firmware to the ESP32-H2 using:
idf.py flash
For debugging, monitor the serial output from your ESP32-H2:
idf.py monitor
This project uses GitHub Actions for continuous integration. The build triggers automatically on each push or pull request to the main branch. Key steps in the build process include:
The configuration is specified in the .github/workflows/c-cpp.yaml
file.
Sensor or feature | Binary value |
---|---|
OTA_UPGRADE | 0 or 1 |
Humidity | 0 or 1 |
Temperature | 0 or 1 |
BATTERY | 0 or 1 |
LIGHT_SLEEP | 0 or 1 |
DEEP_SLEEP | 0 or 1 |
SENSOR_WATERLEAK | 0 or 1 |
For example use a RFD, which suppert temperature, humidity and light sleep.
110100