Matter 온습도 센서(Temperature/Humidity Sensor) 예제 프로젝트
다음 2종류의 Matter 클러스터들에 대한 코드 구현 방법을 알아본다
- Temperature Measurement (Cluster Id:
0x0402
) - Relative Humidity Measurement (Cluster Id:
0x0405
)
2개의 Endpoint가 아래와 같이 생성된다
- Endpoint ID
1
Device Type: Temperature Sensor (Classification ID:0x0302
)
[Clusters]- Temperature Measurement (Cluster ID:
0x0402
)
[Attributes]- Measured Value (Attribute ID:
0x0000
) - Min Measured Value (Attribute ID:
0x0001
) - Max Measured Value (Attribute ID:
0x0002
)
- Measured Value (Attribute ID:
- Temperature Measurement (Cluster ID:
- Endpoint ID
2
Device Type: Humidity Sensor (Classification ID:0x0307
)
[Clusters]- Relative Humidity Measurement (Cluster ID:
0x0405
)
[Attributes]- Measured Value (Attribute ID:
0x0000
) - Min Measured Value (Attribute ID:
0x0001
) - Max Measured Value (Attribute ID:
0x0002
)
- Measured Value (Attribute ID:
- Relative Humidity Measurement (Cluster ID:
Si7021: I2C 통신 방식의 온습도 센서 IC 사용
I2C GPIO 핀번호 변경은 /main/include/definition.h에서 아래 항목을 수정
default: SDA
= GPIO18
/ SCL
= GPIO19
#define GPIO_PIN_I2C_SCL 19
#define GPIO_PIN_I2C_SDA 18
- esp-idf: v5.1.2
- esp-matter: fe4f9f69634b060744f06560b7afdaf25d96ba37
- connectedhomeip: d38a6496c3abeb3daf6429b1f11172cfa0112a1a
- Matter 1.1 released (2023.05.18)
- Matter 1.2 released (2023.10.23)
SDK 클론 및 설치
$ source ./scripts/install_sdk.sh
SDK (idf.py) 준비
$ source ./scripts/prepare_sdk.sh
- Factory Partition (Matter DAC)
$ source ./scripts/flash_factory_dac_provider.sh
- Configure project
$ idf.py set-target esp32
- Build Firmware
$ idf.py build
- Flash Firmware
$ idf.py -p ${seiral_port} flash monitor