Battery-powered Zigbee End Device that reads up to 3 DS18B20 temperature sensors and reports battery voltage.
Before building, you need to set up the ESP-IDF environment in each terminal session:
# Source ESP-IDF tools (adds idf.py to PATH and sets environment variables)
. ~/prototypes/tools/esp-idf/export.shWhat export.sh does: Sets up the ESP-IDF toolchain by adding build tools (idf.py, xtensa-gcc, etc.) to your PATH and configuring environment variables needed for ESP32 development.
Optional: Add to ~/.zshrc to make it automatic:
echo ". ~/prototypes/tools/esp-idf/export.sh" >> ~/.zshrcTo see active devices on ports and which to use:
dmesg | grep ttyEase flash
Every time you flash, ZHA sees it as a NEW device because:
idf.py erase-flash wipes the IEEE address stored in NVS
The ESP32-C6 generates a new random IEEE address on each flash erase
ZHA identifies Zigbee devices by their IEEE address (like a MAC address)
Different IEEE address = different device in ZHA
idf.py -p /dev/ttyACM0 erase-flashBuild & flash
idf.py -p /dev/ttyACM0 build flashMontitor (aka run)
idf.py -p /dev/ttyACM0 monitorRecommended: All in one full erase and reflash
./erase_build_flash_monitor.shOr manually:
idf.py -p /dev/ttyACM0 erase-flash
idf.py -p /dev/ttyACM0 build flash
idf.py -p /dev/ttyACM0 monitor- Use script to erase, build, flash & monitor: Sometimes had issues running monitor right after build/flash in one line, run separetly.
- If battery monitoring does not get identified, try removing the USB before it pairs/connects, then running it off the battery for pairing, helps with identifying the power source = battery != mains