Matter is an IP-based, royalty-free connectivity protocol standard that enables communication among a wide range of smart devices.

Posts under Matter tag

35 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Matter development - Matter Accessory - Apple Ecosystem
Apple developer support could not answer my question which is the following: How are Matter developers supposed to test accessory pairing, accessory communication and accessory discovery if the Console logs provided by Apple (iOS, MacOS, iPadOS) are encrypted, incomplete or straight up non-existent. Current issue is mDNS-SD discovery, pairing and PAKE requests initialisation. Impossible to figure out why X or Y stopped on the Apple Device. Chip-tool (provided by PROJECT-CHIP) acts 100% differently than iOS (Home) or iPadOS(Home). Thank you
0
0
200
3w
Unable to commission with wifi device using iOS matter framework
Hi there: Following document: https://developer.apple.com/documentation/mattersupport to add wifi sensor to my own fabric. I added MatterExtension, Matter Allow Setup Payload = YES, Add following to info.plist _matter._tcp _matterc._udp _matterd._udp _meshcop._udp I can still not get callback from MatterAddDeviceExtensionRequestHandler commissionDevice. I know print log can not be seen in Extension, but I can still not see any logs even use os_log.
2
0
236
3w
Matter subscriptions not working with MTRBaseDevice obtained from HomeKit
I am working on an app for a Home automation device built on Matter. There are both standard and custom features/services/clusters on this device. HomeKit seems to pick up the standard ones except for one (leak detector) that is part of the Matter 1.3 spec. Of course HomeKit doesn't know what to do with the custom ones so they aren't shown in the Home app. I am trying to access those directly via calls to the Matter APIs so I can present them in a custom app. To access Matter APIs I am using a process suggested by DTS in a forum post that can be found here. The MTRBaseDevice I obtain in the suggested way responds appropriately to read and write commands, but subscribe doesn't work as expected. It returns an error code 48 which is described as "The operation couldn’t be completed." and the source that contains the error calls it "operationNotSupported". This is the subscribe call referenced in the DTS response to earlier post, however there are three more "subscribe" methods and I have tried them all. Two also return an error 48, and the last one never calls any of the callback handlers providing no data or errors. Since a subscription is supposed to return data periodically even when there have been no changes it doesn't seem that different than polling so I have written code for that and it works. However I don't expect iOS will let me poll in the background for alarm conditions and I am hoping subscription updates will be sent to a background app so it can notify users of these conditions. Is that a reasonable assumption? Here is the code I am using to test subscribe, perhaps I am doing something wrong? Originally I had shorter intervals but changing them made no difference. Do they need to be longer? let subscribeParams = MTRSubscribeParams(minInterval: 15, maxInterval: 900) if #available(iOS 17.6, *) { subscribeParams.shouldAssumeUnknownAttributesReportable = true } subscribeParams.shouldFilterByFabric = false subscribeParams.shouldReplaceExistingSubscriptions = true subscribeParams.shouldReportEventsUrgently = true subscribeParams.shouldResubscribeAutomatically = false print("Attempting subscribe:with") let localClusterStateCache = MTRClusterStateCacheContainer() matterBaseDevice.subscribe(with: OS_dispatch_queue_global.global(), params: subscribeParams, clusterStateCacheContainer: localClusterStateCache) { (attributes: [Any]) in print("subscribe:with attributeHandler: \(attributes)") } eventReportHandler: { (events: [Any]) in print("subscribe:with eventHandler: \(events)") } errorHandler: { (error: any Error) in let reportingError = error as NSError if reportingError.domain == "HMErrorDomain" { let hkError = HMError(HMError.Code(rawValue: reportingError.code)!) print("subscribe:with errorHandler: \(hkError.localizedDescription); UserInfo: \(hkError.userInfo); ErrorUserInfo: \(hkError.errorUserInfo)") } else { print("subscribe:with errorHandler: \(reportingError)") } } subscriptionEstablished: { print("subscribe:with Subscription established!!!") } resubscriptionScheduled: { (error: any Error, numericParam: NSNumber) in print("subscribe:with Resubscription scheduled; error: \(error); numericParam: \(numericParam)") }
6
0
362
Aug ’24
Matter: Commissioning of a device
Hi everyone, I am pretty new to writing Swift and only doing it to extend a React Native App, thus my knowledge is a bit limited. I am trying to follow the example from https://developer.apple.com/documentation/mattersupport/adding-matter-support-to-your-ecosystem#Set-the-principal-class Without implementing the Extension, the Workflow starts but fails after a few minutes to add the device to Apple Home. Hence, I am currently trying to add the extension (as this is later on needed anyway to commission the device to our ecosystem). I added the class with some dummy logs to see if anything gets triggered but I am failing at registering the class as stated at https://developer.apple.com/documentation/mattersupport/adding-matter-support-to-your-ecosystem#Set-the-principal-class How is this meant to work? I guess I need to define it in info.plist but at least this did not work out: ... <key>NSExtensionPointIdentifier</key><string>com.apple.matter.support.extension.device-setup</string> <key>NSExtensionPrincipalClass</key><string>IoBrokerAddDeviceExtensionRequestHandler</string> ... Does anyone know how to register the class? Thanks in advance. Kind regards Moritz
1
0
226
Aug ’24
How use MatterSupport to commission a thread device?
Hi, When I would like to use MatterAddDeviceRequest to commission a thread device, I will get error "Error Domain=HMErrorDomain Code=18 "Pairing Failed" UserInfo={NSLocalizedDescription=Pairing Failed, NSUnderlyingError=0x282786e20 {Error Domain=HAPErrorDomain Code=15 "(null)"}}". As checking logs, I found App will always get fail to store thread credential (-[THClient storeCredentialsForBorderAgent:activeOperationalDataSet:completion:]_block_invoke:646: - Response: Error Domain=ThreadCredentialsStore Code=1 "Backing store is nil..." UserInfo={NSLocalizedDescription=}) so that I will also get error "CHIP Accessory Server failed to obtain Thread credentials for selected extended PAN ID... Error: (null)" in following. Logs: error 17:59:05.713433+0800 CoreThreadCommissionerServiced ThreadCommissioningService is Enabled error 17:59:05.713597+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService checkEntitlements:connection:] - Entitlement Check is successful for the key : <private> error 17:59:05.714183+0800 MatterExtension Client: -[THClient getConnectionEntitlementValidity]_block_invoke - Error: (null) error 17:59:05.714695+0800 MatterExtension -[THClient storeCredentialsForBorderAgent:activeOperationalDataSet:completion:]_block_invoke:646: - Response: Error Domain=ThreadCredentialsStore Code=1 "Backing store is nil..." UserInfo={NSLocalizedDescription=<private>} error 17:59:05.715346+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService listener:shouldAcceptNewConnection:]_block_invoke - XPC Connection invalidated error 17:59:05.747498+0800 CoreThreadCommissionerServiced ThreadCommissioningService is Enabled error 17:59:05.748245+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService checkEntitlements:connection:] - Entitlement Check is successful for the key : <private> error 17:59:05.749249+0800 homed Client: -[THClient getConnectionEntitlementValidity:]_block_invoke - Error: (null) error 17:59:05.750575+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService checkEntitlements:connection:] - Entitlement Check is successful for the key : <private> default 17:59:05.750705+0800 CoreThreadCommissionerServiced Request to fetch active dataset record with xpanid <private> default 17:59:05.751315+0800 CoreThreadCommissionerServiced nw_path_evaluator_start [AC0FC426-242F-40D0-945A-27682116B6EE <NULL> generic, attribution: developer]path: satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns error 17:59:05.752692+0800 homed [1263984240/1] CHIP Accessory Server failed to obtain Thread credentials for selected extended PAN ID... Error: (null) error 17:59:05.754467+0800 homed Invalidating XPC connection. error 17:59:05.754694+0800 homed Client: -[THClient connectToXPCService]_block_invoke - CTCS XPC Client is invalidated. error 17:59:05.755485+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService listener:shouldAcceptNewConnection:]_block_invoke - XPC Connection invalidated May I get an advice?? Thanks
2
0
254
Jul ’24
How use MatterSupport to commission a thread device?
Hi, Currently I would like to commission a thread device via MatterSupport. When I call MatterAddDeviceRequest API, it returns "Failed to perform Matter device setup setup: Error Domain=HMErrorDomain Code=18 "Pairing Failed" UserInfo={NSLocalizedDescription=Pairing Failed, NSUnderlyingError=0x282786e20 {Error Domain=HAPErrorDomain Code=15 "(null)"}}". As Log, I found I always get error while calling [THClient storeCredentialsForBorderAgent:activeOperationalDataSet:completion:]. It will return error "Invalid parameter sent to server..." so that I also get error log "CHIP Accessory Server failed to obtain Thread credentials for selected extended PAN ID... Error: (null)" in following. Logs: error 17:59:05.714183+0800 MatterExtension Client: -[THClient getConnectionEntitlementValidity]_block_invoke - Error: (null) error 17:59:05.714695+0800 MatterExtension -[THClient storeCredentialsForBorderAgent:activeOperationalDataSet:completion:]_block_invoke:646: - Response: Error Domain=ThreadCredentialsStore Code=4 "Invalid parameter sent to server..." UserInfo={NSLocalizedDescription=<private>} error 17:59:05.715346+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService listener:shouldAcceptNewConnection:]_block_invoke - XPC Connection invalidated error 17:59:05.747498+0800 CoreThreadCommissionerServiced ThreadCommissioningService is Enabled error 17:59:05.748245+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService checkEntitlements:connection:] - Entitlement Check is successful for the key : <private> error 17:59:05.749249+0800 homed Client: -[THClient getConnectionEntitlementValidity:]_block_invoke - Error: (null) error 17:59:05.750575+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService checkEntitlements:connection:] - Entitlement Check is successful for the key : <private> default 17:59:05.750705+0800 CoreThreadCommissionerServiced Request to fetch active dataset record with xpanid <private> default 17:59:05.751315+0800 CoreThreadCommissionerServiced nw_path_evaluator_start [AC0FC426-242F-40D0-945A-27682116B6EE <NULL> generic, attribution: developer]path: satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns error 17:59:05.752692+0800 homed [1263984240/1] CHIP Accessory Server failed to obtain Thread credentials for selected extended PAN ID... Error: (null) error 17:59:05.754467+0800 homed Invalidating XPC connection. error 17:59:05.754694+0800 homed Client: -[THClient connectToXPCService]_block_invoke - CTCS XPC Client is invalidated. error 17:59:05.755485+0800 CoreThreadCommissionerServiced Server: -[CTCSXPCService listener:shouldAcceptNewConnection:]_block_invoke - XPC Connection invalidated May I get an advice?? Thanks
1
0
230
Aug ’24
Matter Device OTA upgrade issue
I am using a Matter Device to do the OTA test with iPhone 8 Plus, HomePod mini, and the Home App. however, there is some abnormal behavior. The problem is that: The Matter device in the pop-up message is still the old firmware version after the OTA upgrade successfully. A few minutes later, the firmware version is updated in the device info but Apple Home still pop-up that a new firmware version is available for the Matter device with the same new version. When I restart the HomePod mini, no more updates are available for my device. is the HomePod cached the firmware version? The firmware version display format is incorrect? I remember the firmware format is in string e.g. 1.6.138. I could confirm this issue happened on HomePod mini V17.4. example: The old firmware version of the Matter device should be 251689472 in number and 1.5.122.0 in string. The new firmware version of the Matter device after OTA should be 1.6.138.0 in string and 268470784 in number (OTA upgrade with new firmware version) **Please let me know if more information is needed. ** Environment: iPhone 8 Plus, IOS 16.7.5 Apple HomePod Mini V17.5
0
0
320
Jul ’24
Support for custom Matter endpoints, clusters and attributes
I am working on an app for a home automation device. If I were using HomeKit exclusively I could add custom services or custom characteristics on standard services and these things would all be reported to my app via HomeKit. There is sample code from Apple that demonstrates how to do this. When a Matter device is commissioned using HomeKit you might expect custom clusters and/or custom attributes in a standard cluster would be translated to appropriate HomeKit services and characteristics, but this doesn't appear to be the case. Is there a way to have HomeKit do this? If not it seems I would need to use Matter directly rather than via HomeKit to access custom features. But if I commission the device using Matter in my app then I understand a new fabric is created and the device would not show in the Home app. Maybe the user needs to commission the device twice, once with my custom app and once with the Home app? That seems like a poor user experience to me. Perhaps that is the price paid for using a cross-platform standard? Is there a better way to get the same level of customization using Matter that I am able to get using HomeKit?
3
0
613
Jun ’24
Pairing with MatterSupport framework
In my RequestHandler.swift, this is extension of MatterAddDeviceExtensionRequestHandler After commission device is completion. I call getBaseDevice method in the MTRDeviceController. func controller(_ controller: MTRDeviceController, commissioningComplete error: Error?, nodeID: NSNumber?) { if error != nil { os_log(.default, "TrinhVM: commissioningComplete error -> \(error!.localizedDescription)") } else { os_log(.default, "TrinhVM: commissioningComplete ->\(nodeID)") chipController.getBaseDevice(1, queue: DispatchQueue.main, completionHandler: { chipDevice, error in if chipDevice == nil { os_log(.debug, "Status: Failed to establish a connection with the device") } else { os_log(.error, "Status: Success to establish a connection with the device: \(chipDevice?.description ?? "")") let onOff = MTRBaseClusterOnOff(device: chipDevice, endpointID: 1, queue: DispatchQueue.main) // Send the "on" command to the device onOff?.on { error in let resultString: String if let error = error { resultString = String(format: "An error occurred: 0x%02lx", error._code) } else { resultString = "On command success" } debugPrint(resultString) } } }) } } It's working well, the status is always "Status: Success to establish a connection with the device". And I can control the lightbulb here with chipDevice (chipDevice is MTRBaseDevice). But, after the commission device has finished in the extension, get back the application scheme. I call method: chipController.getBaseDevice(1, queue: DispatchQueue.main, completionHandler: { chipDevice, error in if chipDevice == nil { os_log(.debug, "Status: Failed to establish a connection with the device") } else { os_log(.error, "Status: Success to establish a connection with the device: \(chipDevice?.description ?? "")") let onOff = MTRBaseClusterOnOff(device: chipDevice, endpointID: 1, queue: DispatchQueue.main) // Send the "on" command to the device onOff?.on { error in let resultString: String if let error = error { resultString = String(format: "An error occurred: 0x%02lx", error._code) } else { resultString = "On command success" } debugPrint(resultString) } } }) It's always show timeout error . Mdns: Resolve failure (src/platform/Darwin/DnssdImpl.cpp:476: CHIP Error 0x00000074: The operation has been cancelled) OperationalSessionSetup[1:0000000000000015]: operational discovery failed: src/lib/address_resolve/AddressResolve_DefaultImpl.cpp:119: CHIP Error 0x00000032: Timeout Creating NSError from src/lib/address_resolve/AddressResolve_DefaultImpl.cpp:119: CHIP Error 0x00000032: Timeout (context: (null)) "Failed to establish a connection with the device Optional(Error Domain=MTRErrorDomain Code=9 \"Transaction timed out.\" UserInfo={NSLocalizedDescription=Transaction timed out.})" I don't know why the same method, works in RequestHandler.swift but not in AppScheme. Any support for this issue. Thank and best regards.
1
1
603
Jun ’24
Commission Matter accessory added via Apple Home
Greetings! I've added a Matter accessory via the Apple Home app. In my app, I'm attempting to commission this device and add it to my fabric. However, when I try to open the commissioning window, I receive an error stating, MTRBaseDevice doesn't support openCommissioningWindowWithDiscriminator over XPC. It appears that opening a commissioning window via an XPC connection is not yet supported. Is there another method to commission the device? Can I retrieve the setup payload from the MTRBaseDevice object or the shared MTRDeviceController? Here's the simplified version of my code: var home: HMHome // HMHome received via HMHomeManager var accessory: HMAccessory = home.accessory[0] // my Matter-supported accessory let deviceController = MTRDeviceController.sharedController( withID: home.matterControllerID as NSCopying, xpcConnect: home.matterControllerXPCConnectBlock ) let device = MTRBaseDevice( nodeID: accessory.matterNodeID as NSNumber, controller: deviceController ) device.openCommissioningWindow( withDiscriminator: 0, duration: 900, queue: .main) { payload, error in if let payload { // payload not received } else if let error { // I'm getting here "Error Domain=MTRErrorDomain Code=6 "(null)"" // and "MTRBaseDevice doesn't support openCommissioningWindowWithDiscriminator over XPC" logged in the console print(error) }
1
0
725
Aug ’24
Home App Jump to Supplier App Issue
When the Homekit device is added to the home app and the device settings interface is opened, the supplier app will be displayed. We are currently developing a Matter product and would like to implement this feature. We consulted with the Matter testing agency and they said they need to communicate with Apple. However, they did not find a solution after consulting with Apple customer service. No one knows how to do it?
0
0
452
Feb ’24
Error on commissioning step 'FindOperational' -CA certificate not found
Reproduction steps Xcode15.1 iPhone14Pro/iOS16.3 commission with MatterSupport implementation @objc class func commission(with setupPayload: MTRSetupPayload?) throws { MTRLog("MatterSupport start request") let topology: MatterAddDeviceRequest.Topology = .init( ecosystemName: "SmartHome", homes: [ // .init(displayName: "smart office"), // .init(displayName: "smart living"), ] ) let request = MatterAddDeviceRequest( topology: topology, setupPayload: setupPayload ) Task { do { try await request.perform() } catch { throw error } } } Always failed with Error on commissioning step 'FindOperational': '../../../../../../../../Sources/CHIPFramework/connectedhomeip/src/credentials/CHIPCert.cpp:488: CHIP Error 0x0000004A: CA certificate not found' relate issue: https://github.com/project-chip/connectedhomeip/issues/31309
0
0
576
Jan ’24
[Matter] MTRController is not running
I've been getting into Matter framework and succeeded to add a matter device into Apple Home app. Then, I use a HomeKit base app to get that device and would like to control that device directly through Matter framework. This is how I create a MTR Device Controller static func create(withHmAccessory hmAccessory: HMAccessory, ofHome hmHome: HMHome) -> HomekitLockAccessory { if #available(iOS 16.4, *) { let matterNodeId = hmHome.matterControllerID as NSCopying let controller = MTRDeviceController.sharedController( withID: matterNodeId, xpcConnect: hmHome.matterControllerXPCConnectBlock ) return MatterHomekitLockAccessory(hmAccessory: hmAccessory, controller: controller) } return HomekitLockAccessory(hmAccessory: hmAccessory) } the controller never gets running and I'm not able to get that controllerNodeId from it. Here is error log
1
1
663
Dec ’23