arduino-esp32 icon indicating copy to clipboard operation
arduino-esp32 copied to clipboard

Support of Arduino Matter library

Open Humancell opened this issue 2 years ago • 53 comments

Related area

Arduino Library

Hardware specification

All Boards

Is your feature request related to a problem?

The Matter specification has been released, and there has been IDF support for quite some time. At one level is would be good to see examples of using these APIs from the Arduino environment. At another level it would be great if there was a higher level Arduino library created that leveraged these APIs and provided examples for both implementing and controlling a Matter device.

Describe the solution you'd like

It would be great if there was a higher level Arduino library created that leveraged the IDF Matter APIs and provided examples for both implementing and controlling a Matter device.

Describe alternatives you've considered

There are some other people outside of this project starting to experiment with this, but they are not fully open source nor sponsored by Espressif.

Additional context

For the Espressif platform to dominate in the market for Matter devices it could be engaging the Arduino developers better.

I have checked existing list of Feature requests and the Contribution Guide

  • [X] I confirm I have checked existing list of Feature requests and Contribution Guide.

Humancell avatar Nov 06 '22 13:11 Humancell

Why does this need to be part of the core? It can be handled in a 3rd party library.

lbernstone avatar Nov 06 '22 15:11 lbernstone

Hello @Humancell,

thanks for opening this feature Request.

I'm adding this to next major milestone 3.0.0 and we will evaluate it.

VojtechBartoska avatar Nov 07 '22 15:11 VojtechBartoska

Hello,

Thank you for considering this!

@lbernstone I can understand your question, but I see this no differently from all of the other libraries that are already a part of core. We already have Bluetooth, HTTP, DNS, Webserver, NetBIOS, RainMaker and many more. Just as many of these are built on the esp-protocols, this - it seems - would be built on https://github.com/espressif/esp-matter .

It is a protocol layer provided by Espressif in the IDF, and besides the technical reasons I believe by exposing it to Arduino developers it could assist the ESP32 in becoming an even more powerful platform for the development of Matter controllers and devices.

Humancell avatar Nov 08 '22 01:11 Humancell

You can try library I have created few days ago https://github.com/jakubdybczak/esp32-arduino-matter

Yacubane avatar Nov 10 '22 10:11 Yacubane

Hello,

You can try library I have created few days ago https://github.com/jakubdybczak/esp32-arduino-matter

I did see this library, but from my understanding you have not made this 100% open source, which is a problem for us. We can not use any closed source code in our projects.

If I am incorrect, and this really is 100% open source then we could take a look.

Humancell avatar Nov 11 '22 16:11 Humancell

@Humancell Why do you think that this one is not open-source? arduino-esp32 also contains precompiled libraries and scripts that do this are in esp32-arduino-lib-builder repo. Same with esp32-arduino-matter, you can find scripts used to build it there esp32-arduino-matter-builder.

Yacubane avatar Nov 11 '22 17:11 Yacubane

We will consider this request for next releases in 2023... please be patient.

SuGlider avatar Nov 21 '22 00:11 SuGlider

I have done an initial effort to build Matter and Arduino as Component. The steps are here:

https://github.com/espressif/esp-matter/issues/116#issuecomment-1356673244

SuGlider avatar Dec 19 '22 12:12 SuGlider

Hi all

Is there any progress for supporting Matter to the Arduino core?

HamzaHajeir avatar May 26 '24 20:05 HamzaHajeir

@HamzaHajeir - We are currently working to release OpenThread as an Arduino Library. This shall be done later this month. Next step is to work on releasing Matter as an Arduino Library. I believe that it will be done by the end of this year.

SuGlider avatar Jun 12 '24 12:06 SuGlider

About Matter Library implementation for Arduino Core 3.0.x:

  • We will initially implement it to be supported within WiFi. In the future also within Thread Protocol.
  • WiFi Matter will be supported for ESP32, ESP32-C3, ESP32-S3, ESP32-S2 and ESP32-C6. No support for ESP32-H2 and ESP32-P4, which have no WiFi radio. ESP32-S2 has no BLE, it won't have Matter Device BLE advertising service.
  • Thread Network Protocol will be supported for the ESP32-C6 and ESP32-H2. Both have also BLE, therefore, BLE Commissionable discovery is also available.
  • Commissionable discovery will be done through BLE (whenever available in the SoC), WiFi SoftAP (future feature), DNS-SD for Thread Border Routers (future feature).
  • Commissioning will follow Matter standard, including QR Code generated from a URL printed in the log output.
  • ESP32 Matter implementation for BLE Commissionable discovery is based on NimBLE. Therefore, it won't be compatible with ESP32 BLE Arduino Library that uses Bluedroid instead. This means that there may be issues when using both together in the same Arduino Sketch. This will be a limitation. We are planning to move ESP32 Arduino BLE Library to use NimBLE as well in the future, which may solve this incompatibility problem.
  • ESP32 Matter Arduino implementation will make available all possible Matter 1.0 device types as Arduino Classes: Lighting, Smart Plugs, Switches and Controls, Sensors, Closures and HVACs. Each Device Type Class will have necessary implementation of the device data model, endpoints, roles, clusters, commands and events.
  • The current implementation is only for Matter Device. No plans for Matter Controllers or Matter Commissioner library.
  • This implementation will use testing and development Matter Vendor ID (0xFFF1..4), therefore valid for CSA for testing purpose only. In case you need your own VID, please follow CSA processes and add certificates as necessary to your code, on your own.

SuGlider avatar Jun 12 '24 13:06 SuGlider

About Matter Library implementation for Arduino Core 3.0.x:

  • We will initially implement it to be supported within WiFi. In the future also within Thread Protocol.
  • WiFi Matter will be supported for ESP32, ESP32-C3, ESP32-S3, ESP32-S2 and ESP32-C6. No support for ESP32-H2 and ESP32-P4, which have no WiFi radio. ESP32-S2 has no BLE, it won't have Matter Device BLE advertising service.
  • Thread Network Protocol will be supported for the ESP32-C6 and ESP32-H2. Both have also BLE, therefore, BLE Commissionable discovery is also available.
  • Commissionable discovery will be done through BLE (whenever available in the SoC), WiFi SoftAP (future feature), DNS-SD for Thread Border Routers (future feature).
  • Commissioning will follow Matter standard, including QR Code generated from a URL printed in the log output.
  • ESP32 Matter implementation for BLE Commissionable discovery is based on NimBLE. Therefore, it won't be compatible with ESP32 BLE Arduino Library that uses Bluedroid instead. This means that there may be issues when using both together in the same Arduino Sketch. This will be a limitation. We are planning to move ESP32 Arduino BLE Library to use NimBLE as well in the future, which may solve this incompatibility problem.
  • ESP32 Matter Arduino implementation will make available all possible Matter 1.0 device types as Arduino Classes: Lighting, Smart Plugs, Switches and Controls, Sensors, Closures and HVACs. Each Device Type Class will have necessary implementation of the device data model, endpoints, roles, clusters, commands and events.
  • The current implementation is only for Matter Device. No plans for Matter Controllers or Matter Commissioner library.
  • This implementation will use testing and development Matter Vendor ID (0xFFF1..4), therefore valid for CSA for testing purpose only. In case you need your own VID, please follow CSA processes and add certificates as necessary to your code, on your own.

Glad to hear that's coming support of Matter in the Arduino core. I have just some questions and comments:

  • ESP-IDF identifies several tools related to setup Matter device (as esp-matter-mfg-tool), are these included also?
  • Per Commissioning, please consider On-Network commisioning method, in which some could have his own device on the network previously, by either Ethernet or custom implementation of WiFi-AP.
  • Therefore, I think it's okay to have ESP32-S2 supported with respect to such user responsibility (or even with the feature of WiFiAP commissioning).
  • Is it available for some to build a custom device using matter data and interaction model?

With thanks, Hamza Hajeir

HamzaHajeir avatar Jun 12 '24 14:06 HamzaHajeir

@HamzaHajeir - Thanks for the comments.

ESP-IDF identifies several tools related to setup Matter device (as esp-matter-mfg-tool), are these included also?

Not as part of the tools that ESP32 Arduino would provide. These tools, as the CHIP tools, or any other Python tools, can be used independently of the ESP32 SDK used to build Matter Applications. These tools can be used while using IDF, Rust or Arduino Frameworks for Matter development.

Per Commissioning, please consider On-Network commisioning method, in which some could have his own device on the network previously, by either Ethernet or custom implementation of WiFi-AP.

Commissioning will always be done on-network. The device must be already on the network and WiFi/Thread credentials shall be already in place. Ethernet must have the cable connected. In all cases, the device must have a valid IP address (DHCP or Static IP).

Therefore, On-Network Commissioning method will be included.

Therefore, I think it's okay to have ESP32-S2 supported with respect to such user responsibility (or even with the feature of WiFiAP commissioning).

Yes, correct.

Is it available for some to build a custom device using matter data and interaction model?

We may consider it for future feature. At first, we'll focus on the Matter 1.0 device types as described above. But given that ESP32 Arduino is based on IDF and ESP-Matter, it is always possible to add code from those two to an Arduino Sketch and We may consider it for future feature. At first, we'll focus on the Matter 1.0 device types as described above. But given that ESP32 Arduino is based on IDF and ESP-Matter, it is always possible to add code from those two to an Arduino Sketch and create custom devices, as well as custom interaction models.

SuGlider avatar Jun 12 '24 20:06 SuGlider

@SuGlider Nice, that explains all, I was mixing between commissioning discovery and commissioning process, seems two different operations.

However, it seems that all Factory Data Providers would be 'custom' in Arduino, correct?

HamzaHajeir avatar Jun 15 '24 18:06 HamzaHajeir

However, it seems that all Factory Data Providers would be 'custom' in Arduino, correct?

Arduino will set the Matter Device as a Testing unit using a VIDs allocated by the CSA for testing purposes. https://developers.home.google.com/matter/get-started#vendor_id No Real Provider information would be used within Arduino.

Commissioning will happen as defined in the description from https://developers.home.google.com/matter/primer/commissioning

Discovery may be done using BLE and/or WiFi AP, as described here: https://developers.home.google.com/matter/primer/commissionable-and-operational-discovery

SuGlider avatar Jun 17 '24 14:06 SuGlider

However, it seems that all Factory Data Providers would be 'custom' in Arduino, correct?

Arduino will set the Matter Device as a Testing unit using a VIDs allocated by the CSA for testing purposes. https://developers.home.google.com/matter/get-started#vendor_id No Real Provider information would be used within Arduino.

But this might contradict with this (regarding the providers), where it should be a custom one if someone would use the Arduino:

  • This implementation will use testing and development Matter Vendor ID (0xFFF1..4), therefore valid for CSA for testing purpose only. In case you need your own VID, please follow CSA processes and add certificates as necessary to your code, on your own.

What I could suggest is making it custom with overridable test providers: defaulted to a derived class of such, that points to test information.

Commissioning will happen as defined in the description from https://developers.home.google.com/matter/primer/commissioning

Discovery may be done using BLE and/or WiFi AP, as described here: https://developers.home.google.com/matter/primer/commissionable-and-operational-discovery

I'll read about them soon and check if any suggestion or comment I can assist with.

HamzaHajeir avatar Jun 18 '24 10:06 HamzaHajeir

@SuGlider I try to build with 3.0 as component and latest esp matter but it not working, show error:

build/esp-idf/chip/gen/include/system/SystemBuildConfig.h:31:38:fatal error: platform/1/CHIPPlatformConfig.h: No such file or directory
   31 | #define CHIP_PLATFORM_CONFIG_INCLUDE <platform/ESP32/CHIPPlatformConfig.h>

dzungpv avatar Aug 17 '24 06:08 dzungpv