Skip to content

Add Matter component as part of the libs #220

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

Merged
merged 25 commits into from
Sep 25, 2024
Merged

Add Matter component as part of the libs #220

merged 25 commits into from
Sep 25, 2024

Conversation

me-no-dev
Copy link
Member

@SuGlider
Copy link
Contributor

Ok. I'll set up the sdkconfig of each SoC in order to make it work.

@SuGlider
Copy link
Contributor

builder/managed_components/espressif__esp_matter/connectedhomeip/connectedhomeip/src/system/SystemConfig.h:99:2: error: #error "REQUIRED: CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK"
99 | #error "REQUIRED: CHIP_SYSTEM_CONFIG_USE_LWIP || CHIP_SYSTEM_CONFIG_USE_SOCKETS || CHIP_SYSTEM_CONFIG_USE_NETWORK_FRAMEWORK"
| ^~~~~

This error seems to be related to this line in the ESP-Matter CMakeLists.txt:

#Generate some include files
include(${CMAKE_CURRENT_LIST_DIR}/generate-include-files.cmake)

That CMake command creates two header files:
./build/esp-idf/espressif__esp_matter/platform/CHIPDeviceBuildConfig.h
./build/esp-idf/espressif__esp_matter/system/SystemBuildConfig.h

Those 2 files have many #define that are necessary to compile ESP-Matter.
But for some reason, they are not included into the ESP-Matter code.

When building a project, like the example recently merged for Matter Light as IDF Component, it includes those 2 files and builds fine.

I can't find a reason for that... I could use some help here.

@SuGlider
Copy link
Contributor

SuGlider commented Sep 19, 2024

OK... I've found the issue....

CMakeLists.txt needs to define -DCHIP_HAVE_CONFIG_H

@SuGlider
Copy link
Contributor

PR #222 shall fix the issue here reported.

@SuGlider
Copy link
Contributor

Next Steps:

  • test the Arduino-Matter example and check if it is working fine.
  • Strip Matter Library - modify scripts.

@SuGlider SuGlider self-assigned this Sep 22, 2024
@SuGlider
Copy link
Contributor

Necessary changes to run the artifacts with the Arduino IDE:

1- It must define CHIP_HAVE_CONFIG_H=1
2- It must correctly define CHIP_ADDRESS_RESOLVE_IMPL_INCLUDE
3- Flags are incorrectly set. It causes compilation errors
4- lwip_hook_ip6_input() isn't defined. It causes a linker error.


All those problems were solved manually for testing a Matter Light sketch.

Results:

1- WiFi works fine for ESP32, ESP32-S2, ESP32-S3, ESP32-C3, ESP32-C6. Commissioning works correctly after the device connects to the WiFi network and the Commissioner APP is used.

2- Thread doesn't commission the Matter Fabric using the ESP Thread Border Router. APP can't find the device in order to commission the Matter Fabric. Using OpenThread Arduino Library, it is possible to add the node to the same Thread Network of the ESP Thread Border Router, but it doesn't forward mDNS addresses to the commissioner APP.

Therefore, ESP32-H2 can't use Matter + Thread.
The soution is to move Arduino BLE to nimBLE and enable BLE within Matter Library in order to allow it to use BLE to communicate and commission the ESP32-H2 based matter Light Sketch.

@SuGlider
Copy link
Contributor

@me-no-dev - This PR make all necessary changes in order to allow building Matter Applications.
I have tested it and it works as expected.

Please review it.

@me-no-dev me-no-dev merged commit 5d4ed02 into master Sep 25, 2024
8 checks passed
@me-no-dev me-no-dev deleted the feat/esp_matter branch September 25, 2024 22:41
@SuGlider SuGlider mentioned this pull request Oct 2, 2024
darkxst added a commit to darkxst/esp32-arduino-lib-builder that referenced this pull request Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants