Skip to content

kochaika/esp32-c6-thread-led

Repository files navigation

Matter logo

XIAO ESP32-C6 Matter over Thread light fixture

This is my experiment with a light device using ESP-IDF and Espressif's SDK for Matter.

Kind of a next generation of my this project.

Note: use your own device, partition name and other parameters value. This is not a complete guide.

Resources

Clone

Clone this repo to the esp-matter directory.

Environment Setup

Open IDF Terminal, navigate to esp-matter directory.

  1. source ./export.sh
  2. export IDF_CCACHE_ENABLE=1

Restart from scratch

idf.py fullclean
rm -rf build/
esptool.py --chip esp32c6 --port /dev/cu.usbmodem2101 erase_flash

Build and Flash

Navigate to this project directory.

  1. idf.py set-target esp32c6
  2. idf.py build
  3. idf.py -p /dev/cu.usbmodem2101 flash

Debug

Should be enabled before. It was disabled here.

idf.py -p /dev/cu.usbmodem2101 monitor

Generating pair codes with partitions

esp-matter-mfg-tool -n 3 \
  -v 0xFFF1 -p 0x8001 \
  --vendor-name "ChaikaMatter" \
  --product-name "Smart_LED" \
  --hw-ver 1 --hw-ver-str "1.0"

Flashing partitions

esptool.py --chip esp32c6 --port /dev/cu.usbmodem2101 write_flash 0x10000 out/fff1_8001/**/**-partition.bin

Hardware Configuration

Antenna

An external UFL antenna is used for Thread communication. The FM8625H RF switch on the XIAO ESP32-C6 is configured at startup via GPIO3 (enable) and GPIO14 (antenna select).

LED

PWM-controlled LED on GPIO19 (XIAO ESP32-C6 D8 pin). Uses LEDC timer with 13-bit resolution (0-8191) at 5 kHz.

Button

Push button on GPIO20 (XIAO ESP32-C6 D9 pin), active low. The button has a two-stage press logic:

State Action Result
Light is OFF Press Turn on at 4% brightness, start 1s window
Light is ON, within 1s of first press Press Set brightness to 70%
Light is ON, after 1s window Press Turn off

When toggled on, the light restores the last set brightness level.

About

ESP32-C6 Matter over Thread lighting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors