Skip to content

Commit 419a030

Browse files
authored
Update ESP32 board to 2.0.6, esp-matter to 65e1ed1 and Matter to V1.0.0.2 (#10)
* Update SDK * Update readme and version
1 parent 67177c5 commit 419a030

File tree

524 files changed

+81221
-51553
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

524 files changed

+81221
-51553
lines changed

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1-
> :warning: This library is currently meant to be used only for research purposes. Please read limitations section before using it.
2-
31
# ESP32 Arduino Matter
4-
This projects aims at possibility to easily launch Matter internet-of-things protocol on ESP32 with Arduino. Project contains precompiled and ready to use components from two projects: [Espressif's SDK for Matter](https://github.com/espressif/esp-matter) and [Matter](https://github.com/project-chip/connectedhomeip).
2+
This projects aims at possibility to easily launch Matter internet-of-things protocol on ESP32 with Arduino. Repository contains precompiled and ready to use components from two projects: [Espressif's SDK for Matter](https://github.com/espressif/esp-matter) and [Matter](https://github.com/project-chip/connectedhomeip).
53

64
## Installing on Arduino IDE
7-
1. Make sure that ESP32 board version is 2.0.5
5+
1. Make sure that ESP32 board version is 2.0.6
86
2. [Turn on C++17 support for Arduino](#enabling-c17-on-arduino-ide)
9-
3. Download this repository and [import library into Arduino IDE](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries)
7+
3. [Download](https://github.com/jakubdybczak/esp32-arduino-matter/releases) and [import library into Arduino IDE](https://docs.arduino.cc/software/ide-v1/tutorials/installing-libraries)
108
4. Choose larger partition scheme, for example `Minimal SPIFFS`
119
5. To prevent some issues related to old data, enable `Erase Flash Before Sketch Upload` option
1210
6. Run example sketch
1311

1412
## Installing on PlatformIO
15-
1. Use espressif32 platform at version 5.2.0
13+
1. Use espressif32 platform at version 5.3.0
1614
2. Turn on C++17 support, by setting `build_unflags=-std=gnu++11` and `build_flags=-std=gnu++17`.
1715
3. Add this library: `lib_deps=https://github.com/jakubdybczak/esp32-arduino-matter.git`
1816
4. Choose larger partition scheme, for example `board_build.partitions=min_spiffs.csv`
@@ -21,35 +19,37 @@ This projects aims at possibility to easily launch Matter internet-of-things pro
2119
## Example usage
2220
Please look at [examples](https://github.com/jakubdybczak/esp32-arduino-matter/tree/master/examples).
2321

22+
## Compatibility
23+
This project contains precompiled libraries based on specific version of ESP32 SDK and this library does not guarantee support for other versions. Current build is based on `esp-idf` at version 4.4.3 and will work with:
24+
* Arduino IDE with [ESP32 board](https://github.com/espressif/arduino-esp32) at version 2.0.6
25+
* PlatformIO with [PlatformIO espressif32 platform](https://github.com/platformio/platform-espressif32) at version 5.3.0
26+
2427
## Limitations
25-
* Library only works on base ESP32 (with experimental support for ESP32-S3, ESP32-C3).
28+
* Library only works on ESP32, ESP32-S3 and ESP32-C3.
2629
* There is no possibility to change vendor/product ID as this value is pre-compiled.
2730
* There is no known possibility to change setup PIN.
2831
* This library comes with precompiled NimBLE, because default Bluedroid shipped with arduino-esp32 takes too much RAM memory.
29-
* Matter Controllers such as Apple Home, Google Home, Smarthings and other might not have full support of all device types.
32+
* Matter Controllers such as Apple Home, Google Home, SmartThings and others might not have full support of all device types.
3033

3134
## Versions
3235
This project is currently build based on these projects:
3336

34-
| Project | Tag/Commit Hash |
37+
| Project | Tag / Commit hash |
3538
| ------------- | ------------- |
36-
| [Espressif's esp-idf](https://github.com/espressif/esp-idf) | 4.4.2</br>Arduino IDE ESP32 board @ 2.0.5</br>PlatformIO espressif platform @ 5.2.0 |
37-
| [Espressif's SDK for Matter](https://github.com/espressif/esp-matter) | a0f13786 |
38-
| [Matter](https://github.com/project-chip/connectedhomeip) | 7c2353bb |
39+
| [Matter](https://github.com/project-chip/connectedhomeip) | V1.0.0.2 |
40+
| [esp-matter](https://github.com/espressif/esp-matter) | 65e1ed1 |
41+
| [esp-idf](https://github.com/espressif/esp-idf) | 4.4.3 |
3942

4043
## Enabling C++17 on Arduino IDE
4144
1. Find `platform.txt` for ESP32 board. Location of this file is platform depended.
4245

43-
MacOS: `~/Library/Arduino15/packages/esp32/hardware/esp32/2.0.5/platform.txt`
46+
MacOS: `~/Library/Arduino15/packages/esp32/hardware/esp32/2.0.6/platform.txt`
4447

45-
Windows: `C:\Users\<USER>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\platform.txt`
48+
Windows: `C:\Users\<USER>\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\platform.txt`
4649

47-
2. Inside `platform.txt` find `ESP32 Support Start` section and it's `compiler.cpp.flags.esp32` key. Change `-std=gnu++11` to ` -std=gnu++17`. Do the same thing for `ESP32S3` and `ESP32C3` `Support Start` section if you are using ESP32S3/ESP32C3.
50+
2. Inside `platform.txt` find `ESP32 Support Start` section and it's `compiler.cpp.flags.esp32` key. Change `-std=gnu++11` to `-std=gnu++17`. Do the same thing for `ESP32S3` and `ESP32C3` `Support Start` section if you are using ESP32-S3/ESP32-C3.
4851

4952
3. Restart Arduino IDE.
5053

5154
## Building custom version of this library
52-
Please look [here](https://github.com/jakubdybczak/esp32-arduino-matter-builder).
53-
54-
## Future and possibilities
55-
* Creating more user-friendly wrapper API.
55+
Please look [here](https://github.com/jakubdybczak/esp32-arduino-matter-builder).

examples/Debug/Debug.ino

+10-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ using namespace esp_matter;
66
using namespace esp_matter::endpoint;
77

88
/**
9-
This program presents example many Matter devices and should be used only
10-
for debug purposes (for example checking which devices types are supported)
9+
This program presents many Matter devices and should be used only
10+
for debug purposes (for example checking which devices types are supported
11+
in Matter controller).
1112
1213
Keep in mind that it IS NOT POSSIBLE to run all those endpoints due to
1314
out of memory. There is need to manually comment out endpoints!
14-
Running about 4-5 endpoints at the same time should work.
15+
Running about 4 endpoints at the same time should work.
1516
*/
1617

1718
static void on_device_event(const ChipDeviceEvent *event, intptr_t arg) {}
@@ -53,6 +54,7 @@ void setup() {
5354

5455
// !!!
5556
// USE ONLY ABOUT 4 ENDPOINTS TO AVOID OUT OF MEMORY ERRORS
57+
// MANUALLY COMMENT REST OF ENDPOINTS
5658
// !!!
5759

5860
on_off_light::config_t light_config;
@@ -65,6 +67,10 @@ void setup() {
6567

6668
color_temperature_light::config_t color_temperature_light_config;
6769
endpoint = color_temperature_light::create(node, &color_temperature_light_config, ENDPOINT_FLAG_NONE, NULL);
70+
/* Add color control cluster */
71+
cluster = cluster::get(endpoint, ColorControl::Id);
72+
cluster::color_control::feature::hue_saturation::config_t hue_saturation_config;
73+
cluster::color_control::feature::hue_saturation::add(cluster, &hue_saturation_config);
6874
print_endpoint_info("color_temperature_light", endpoint);
6975

7076
extended_color_light::config_t extended_color_light_config;
@@ -102,6 +108,7 @@ void setup() {
102108

103109
window_covering_device::config_t window_covering_device_config;
104110
endpoint = window_covering_device::create(node, &window_covering_device_config, ENDPOINT_FLAG_NONE, NULL);
111+
/* Add additional control clusters */
105112
cluster = cluster::get(endpoint, WindowCovering::Id);
106113
cluster::window_covering::feature::lift::config_t lift;
107114
cluster::window_covering::feature::tilt::config_t tilt;

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ESP32 Arduino Matter
2-
version=0.0.1
2+
version=1.0.0
33
author=Jakub Dybczak <[email protected]>
44
maintainer=Jakub Dybczak <[email protected]>
55
sentence=Matter for ESP32 on Arduino

src/CHIPDevicePlatformConfig.h

-7
Original file line numberDiff line numberDiff line change
@@ -81,23 +81,16 @@
8181
#define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MIN
8282
#define CHIP_DEVICE_CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX CONFIG_BLE_SLOW_ADVERTISING_INTERVAL_MAX
8383
#define CHIP_DEVICE_CONFIG_CHIPOBLE_SINGLE_CONNECTION CONFIG_CHIPOBLE_SINGLE_CONNECTION
84-
#define CHIP_DEVICE_CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC CONFIG_ENABLE_CHIP_TIME_SERVICE_TIME_SYNC
85-
#define CHIP_DEVICE_CONFIG_CHIP_TIME_SERVICE_ENDPOINT_ID CONFIG_CHIP_TIME_SERVICE_ENDPOINT_ID
86-
#define CHIP_DEVICE_CONFIG_DEFAULT_TIME_SYNC_INTERVAL CONFIG_DEFAULT_TIME_SYNC_INTERVAL
87-
#define CHIP_DEVICE_CONFIG_TIME_SYNC_TIMEOUT CONFIG_TIME_SYNC_TIMEOUT
8884
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID CONFIG_SERVICE_PROVISIONING_ENDPOINT_ID
8985
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT CONFIG_SERVICE_PROVISIONING_CONNECTIVITY_TIMEOUT
9086
#define CHIP_DEVICE_CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT CONFIG_SERVICE_PROVISIONING_REQUEST_TIMEOUT
9187
#define CHIP_DEVICE_CONFIG_ENABLE_TEST_SETUP_PARAMS CONFIG_ENABLE_TEST_SETUP_PARAMS
9288
#define CHIP_DEVICE_CONFIG_TEST_SERIAL_NUMBER CONFIG_USE_TEST_SERIAL_NUMBER
93-
#define CHIP_DEVICE_CONFIG_ENABLE_TRAIT_MANAGER CONFIG_ENABLE_TRAIT_MANAGER
9489
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY CONFIG_ENABLE_THREAD_TELEMETRY
9590
#define CHIP_DEVICE_CONFIG_ENABLE_THREAD_TELEMETRY_FULL CONFIG_ENABLE_THREAD_TELEMETRY_FULL
9691
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE CONFIG_EVENT_LOGGING_CRIT_BUFFER_SIZE
97-
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE CONFIG_EVENT_LOGGING_PROD_BUFFER_SIZE
9892
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE CONFIG_EVENT_LOGGING_INFO_BUFFER_SIZE
9993
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE
100-
#define CHIP_DEVICE_CONFIG_LOG_PROVISIONING_HASH CONFIG_LOG_PROVISIONING_HASH
10194
#define CHIP_DEVICE_CONFIG_CHIP_FACTORY_NAMESPACE_PARTITION CONFIG_CHIP_FACTORY_NAMESPACE_PARTITION_LABEL
10295
#define CHIP_DEVICE_CONFIG_CHIP_CONFIG_NAMESPACE_PARTITION CONFIG_CHIP_CONFIG_NAMESPACE_PARTITION_LABEL
10396
#define CHIP_DEVICE_CONFIG_CHIP_COUNTERS_NAMESPACE_PARTITION CONFIG_CHIP_COUNTERS_NAMESPACE_PARTITION_LABEL

src/CHIPPlatformConfig.h

-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353

5454
#define CHIP_CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS CONFIG_MAX_UNSOLICITED_MESSAGE_HANDLERS
5555
#define CHIP_CONFIG_MAX_EXCHANGE_CONTEXTS CONFIG_MAX_EXCHANGE_CONTEXTS
56-
#define CHIP_CONFIG_MAX_SESSION_KEYS CONFIG_MAX_SESSION_KEYS
5756
#define CHIP_CONFIG_MAX_FABRICS CONFIG_MAX_FABRICS
5857
#define CHIP_CONFIG_SECURITY_TEST_MODE CONFIG_SECURITY_TEST_MODE
5958

src/ConfigurationManagerImpl.h

-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class ConfigurationManagerImpl : public Internal::GenericConfigurationManagerImp
5353
CHIP_ERROR StoreRebootCount(uint32_t rebootCount) override;
5454
CHIP_ERROR GetTotalOperationalHours(uint32_t & totalOperationalHours) override;
5555
CHIP_ERROR StoreTotalOperationalHours(uint32_t totalOperationalHours) override;
56-
CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override;
57-
CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override;
5856
CHIP_ERROR GetSoftwareVersionString(char * buf, size_t bufSize);
5957
CHIP_ERROR GetSoftwareVersion(uint32_t & softwareVer) override;
6058
CHIP_ERROR GetLocationCapability(uint8_t & location) override;

src/DeviceNetworkProvisioningDelegateImpl.h

-43
This file was deleted.

src/DnssdImpl.h

+15-19
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#pragma once
1717

1818
#include <lib/dnssd/platform/Dnssd.h>
19+
#include <lib/support/CHIPMemString.h>
1920
#include <lib/support/CodeUtils.h>
2021
#include <mdns.h>
2122

@@ -49,8 +50,7 @@ struct BrowseContext : public GenericContext
4950
Inet::IPAddressType addrType, DnssdBrowseCallback cb, void * cbCtx)
5051

5152
{
52-
memset(mType, 0, sizeof(mType));
53-
strncpy(mType, type, strnlen(type, kDnssdTypeMaxSize));
53+
Platform::CopyString(mType, type);
5454
mContextType = ContextType::Browse;
5555
mAddressType = addrType;
5656
mProtocol = protocol;
@@ -104,23 +104,19 @@ struct ResolveContext : public GenericContext
104104
ResolveContext(DnssdService * service, Inet::InterfaceId ifId, mdns_search_once_t * searchHandle, DnssdResolveCallback cb,
105105
void * cbCtx)
106106
{
107-
memset(mType, 0, sizeof(mType));
108-
memset(mInstanceName, 0, sizeof(mInstanceName));
109-
strncpy(mType, service->mType, strnlen(service->mType, kDnssdTypeMaxSize));
110-
mType[kDnssdTypeMaxSize] = 0;
111-
strncpy(mInstanceName, service->mName, strnlen(service->mName, Common::kInstanceNameMaxLength));
112-
mInstanceName[Common::kInstanceNameMaxLength] = 0;
113-
mContextType = ContextType::Resolve;
114-
mProtocol = service->mProtocol;
115-
mResolveCb = cb;
116-
mCbContext = cbCtx;
117-
mInterfaceId = ifId;
118-
mSearchHandle = searchHandle;
119-
mResolveState = ResolveState::QuerySrv;
120-
mResult = nullptr;
121-
mService = nullptr;
122-
mAddresses = nullptr;
123-
mAddressCount = 0;
107+
Platform::CopyString(mType, type);
108+
Platform::CopyString(mInstanceName, service->mName);
109+
mContextType = ContextType::Resolve;
110+
mProtocol = service->mProtocol;
111+
mResolveCb = cb;
112+
mCbContext = cbCtx;
113+
mInterfaceId = ifId;
114+
mSearchHandle = searchHandle;
115+
mResolveState = ResolveState::QuerySrv;
116+
mResult = nullptr;
117+
mService = nullptr;
118+
mAddresses = nullptr;
119+
mAddressCount = 0;
124120
}
125121

126122
~ResolveContext()

src/ESP32FactoryDataProvider.h

+2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ class ESP32FactoryDataProvider : public CommissionableDataProvider,
6666
CHIP_ERROR GetVendorId(uint16_t & vendorId) override;
6767
CHIP_ERROR GetProductName(char * buf, size_t bufSize) override;
6868
CHIP_ERROR GetProductId(uint16_t & productId) override;
69+
CHIP_ERROR GetProductURL(char * buf, size_t bufSize) override;
70+
CHIP_ERROR GetProductLabel(char * buf, size_t bufSize) override;
6971
CHIP_ERROR GetHardwareVersionString(char * buf, size_t bufSize) override;
7072
CHIP_ERROR GetRotatingDeviceIdUniqueId(MutableByteSpan & uniqueIdSpan) override;
7173
#endif // CHIP_DEVICE_CONFIG_ENABLE_DEVICE_INSTANCE_INFO_PROVIDER

src/access/AccessControl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ void SetAccessControl(AccessControl & accessControl);
683683
*
684684
* Calls to this function must be synchronized externally.
685685
*/
686-
void ResetAccessControl();
686+
void ResetAccessControlToDefault();
687687

688688
} // namespace Access
689689
} // namespace chip

src/address_resolve/AddressResolve.h

+16-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class NodeLookupRequest
142142

143143
private:
144144
static constexpr uint32_t kMinLookupTimeMsDefault = 200;
145-
static constexpr uint32_t kMaxLookupTimeMsDefault = 15000;
145+
static constexpr uint32_t kMaxLookupTimeMsDefault = 45000;
146146

147147
PeerId mPeerId;
148148
System::Clock::Milliseconds32 mMinLookupTimeMs{ kMinLookupTimeMsDefault };
@@ -204,6 +204,21 @@ class Resolver
204204
/// in progress)
205205
virtual CHIP_ERROR LookupNode(const NodeLookupRequest & request, Impl::NodeLookupHandle & handle) = 0;
206206

207+
/// Inform the Lookup handle that the previous node lookup was not sufficient
208+
/// for the purpose of the caller (e.g establishing a session fails with the
209+
/// result of the previous lookup), and that more data is needed.
210+
///
211+
/// If this returns CHIP_NO_ERROR, the following is expected:
212+
/// - The listener OnNodeAddressResolved will be called with the additional data.
213+
/// - handle must NOT be destroyed while the lookup is in progress (it
214+
/// is part of an internal 'lookup list')
215+
/// - handle must NOT be reused (the lookup is done on a per-node basis
216+
/// and maintains lookup data internally while the operation is still
217+
/// in progress)
218+
///
219+
/// If no additional data is available at the time of the request, it returns CHIP_ERROR_WELL_EMPTY.
220+
virtual CHIP_ERROR TryNextResult(Impl::NodeLookupHandle & handle) = 0;
221+
207222
/// Stops an active lookup request.
208223
///
209224
/// Caller controlls weather the `fail` callback of the handle is invoked or not by using

0 commit comments

Comments
 (0)