Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicator matter #24

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ bin
sdkconfig
sdkconfig.old
dependencies.lock

# Generated during build process
managed_components

# emacs
.dir-locals.el

Expand Down
5 changes: 5 additions & 0 deletions examples/indicator_matter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## changelog

### v1.0.0 ###

* Initial version.
33 changes: 33 additions & 0 deletions examples/indicator_matter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.5)

if(NOT DEFINED ENV{ESP_MATTER_PATH})
message(FATAL_ERROR "Please set ESP_MATTER_PATH to the path of esp-matter repo")
endif(NOT DEFINED ENV{ESP_MATTER_PATH})

set(ENV{ESP_MATTER_DEVICE_PATH} $ENV{ESP_MATTER_PATH}/device_hal/device/esp32s3_devkit_c)

set(PROJECT_VER "1.0")
set(PROJECT_VER_NUMBER 1)

set(ESP_MATTER_PATH $ENV{ESP_MATTER_PATH})
set(MATTER_SDK_PATH ${ESP_MATTER_PATH}/connectedhomeip/connectedhomeip)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
include($ENV{ESP_MATTER_DEVICE_PATH}/esp_matter_device.cmake)

set(EXTRA_COMPONENT_DIRS
"../../components"
"${MATTER_SDK_PATH}/config/esp32/components"
"${ESP_MATTER_PATH}/components"
)

add_compile_options(-fdiagnostics-color=always -w)
add_compile_options(-fdata-sections)
add_compile_options(-ffunction-sections)
add_link_options(-Wl,-gc-sections)

project(indicator_matter)

idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-Wno-overloaded-virtual" APPEND)
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)
55 changes: 55 additions & 0 deletions examples/indicator_matter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Indicator Matter Demo

This demo builds off of the indicator basis demo to implement the Matter 1.0 specification for tracking of the associated sensor data. In addition the demo provides a pull down virtual interface for enabling some Matter device elements.

In the case of this demo it does such by implementing two light dimmer devices and a door lock device.

This demo mainly implements time, sensor data display, and some configuration functions.

<figure class="third">
<img src="./docs/page1.png" width="480"/> <img src="./docs/page2.png" width="480"/>
<img src="./docs/page3.png" width="480"/>
</figure>

## Function
- [x] Matter configuration
- [x] Home assistant dashboard
- [x] Time display.
- [x] CO2, tVOC, Temperature and Humidity data real-time display.
- [x] CO2, tVOC, Temperature and Humidity history data display.
- [x] Wifi config.
- [x] Display config.
- [x] time config.


## How to use example

Please first read the [User Guide](https://wiki.seeedstudio.com/SenseCAP_Indicator_Get_Started) of the SenseCAP Indicator Board to learn about its software and hardware information.


### Dependencies

In order to build this project you will need an environment setup to build esp-matter applications. Please read the [install guide](https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html) from Espressif to get your machine ready for installation.

#### Versions

The following library versions were used for this example:
- esp-idf: v5.0.1
- esp-matter: v1.1

#### Preparing your environment

1. Install esp-idf 5.0.1
2. Install the patch as mentioned below in the build and flash section for the 120M Octal PSRAM
3. Install esp-matter
4. Export your environment for esp-idf and matter
5. Build, flash, and (optionally) monitor the deployment

#### Build and Flash

1. The project configure PSRAM with Octal 120M by default. please see [here](../../tools/patch/README.md#idf-patch) to enable `PSRAM Octal 120M` feature.
2. Run `idf.py -p PORT flash monitor` to build, flash and monitor the project.

(To exit the serial monitor, type ``Ctrl-]``.)

See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/indicator_matter/docs/page1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/indicator_matter/docs/page2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/indicator_matter/docs/page3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions examples/indicator_matter/main/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
set(UI_DIR ./ui)
file(GLOB_RECURSE UI_SOURCES ${UI_DIR}/*.c)

set(MODEL_DIR ./model)
file(GLOB_RECURSE MODEL_SOURCES ${MODEL_DIR}/*.c ${MODEL_DIR}/*.cpp)

set(VIEW_DIR ./view)
file(GLOB_RECURSE VIEW_SOURCES ${VIEW_DIR}/*.c)

set(CONTROLLER_DIR ./controller)

file(GLOB_RECURSE CONTROLLER_SOURCES ${CONTROLLER_DIR}/*.c)

set(UTIL_DIR ./util)
file(GLOB_RECURSE UTIL_SOURCES ${UTIL_DIR}/*.c)

idf_component_register(
SRCS "main.cpp" "lv_port.c" ${UI_SOURCES} ${MODEL_SOURCES} ${VIEW_SOURCES} ${CONTROLLER_SOURCES} ${UTIL_SOURCES}
INCLUDE_DIRS "." ${UI_DIR} ${MODEL_DIR} ${VIEW_DIR} ${CONTROLLER_DIR} ${UTIL_DIR}
PRIV_INCLUDE_DIRS "."
EMBED_TXTFILES timeapi_cert.pem)

set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17)
target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")
35 changes: 35 additions & 0 deletions examples/indicator_matter/main/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@


#ifndef CONFIG_H
#define CONFIG_H


#include <stdbool.h>
#include <string.h>
#include "esp_system.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_event_base.h"
#include "bsp_board.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

#include "matter_config.h"

#ifdef __cplusplus
extern "C" {
#endif


ESP_EVENT_DECLARE_BASE(VIEW_EVENT_BASE);

extern esp_event_loop_handle_t view_event_handle;



#ifdef __cplusplus
}
#endif

#endif
Loading