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

Posts under Matter tag

40 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

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.
0
1
118
1d
How to connect OpenThread Border Router to Matter Home?
Does anyone know if this is even supported at the moment? I've tried pairing a sample light application based on Silicon Lab's EFR32 but it's unable to find the OTBR on the network. [module](GitHub - SiliconLabs/matter: Matter is creating more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.) I'm also using the RaspberryPi 4/RCP combination as directed by Silicon Lab's documentation. I have no problems pairing the devices to the OTBR directly through its chiptool interface but Home isn't discovering the Thread network or showing me options to add the OTBR devices. I'm currently running iOS 16.1 beta on my iPhone and I'm using a HomePod Mini which is on version 16.0 and has the HomeKit Matter Support profile installed.
2
3
1.7k
May ’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) }
0
0
448
Feb ’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
305
Feb ’24
How to commission a device to our fabric after adding it using Matter.Support
How to commission a device to our fabric after adding it using Matter.Support We have the following configuration: eero border router our own thermostat device that we are developing no home pod or home TV are used We have followed this guide https://developer.apple.com/documentation/mattersupport/adding-matter-support-to-your-ecosystem and implemented Matter Extension, as Matter.Framework is no more allowed to pair device. In Matter Extension the following callbacks are fired: override func selectThreadNetwork(from threadScanResults: [MatterAddDeviceExtensionRequestHandler.ThreadScanResult]) async throws -> MatterAddDeviceExtensionRequestHandler.ThreadNetworkAssociation override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws In our demo app the following function completes without errors try await request.perform() The thermostat device seems to be successfully commissioned. In https://developer.apple.com/documentation/mattersupport/adding-matter-support-to-your-ecosystem there is a comment that says: Use Matter.Framework APIs to pair the accessory to your application with the provided onboardingPayload. How should this thing be done ? We tried to start the matter controller in the old way: func start() -> Bool { if (self.matterController == nil) { let storage = MatterStorage.shared let factory = MTRDeviceControllerFactory.sharedInstance() let factoryParams = MTRDeviceControllerFactoryParams(storage: storage) do { try factory.start(factoryParams) } catch { return false } let keys = FabricKeys() let params = MTRDeviceControllerStartupParams(signing: keys, fabricId: UInt64(fabricId), ipk: keys.ipk) params.vendorID = NSNumber(value: self.vendorId) self.matterController = try? factory.createController(onExistingFabric: params) let controllerNid = self.matterController?.controllerNodeID if (self.matterController == nil) { self.matterController = try? factory.createController(onNewFabric: params) } } return (self.matterController != nil) } Certificate are generated locally as in Matter Darwin example. We tried to call let params = MTRCommissioningParameters() matterController?.commissionNode(withID: NSNumber(value: self.deviceNid), commissioningParams: params) in commissionDevice of Matter Extension but we get error: Invalid object state.
1
0
768
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
418
Jan ’24
Create Matter Binding
I'd like to learn how a Matter "Binding" can be created on iOS, e.g. via the "Matter" Framework. I'm aware of the Matter Framework "Documentation" here. But since it's missing any real description or documentation it's not helpful to me atm. Any examples/ tutorials/ explanations are greatly appreciated.
3
0
1.8k
Dec ’23
Matter pairing without Matter client developer profile
To be able to paire a matter device on ios I need to installed on my iPhone the matter client developper profile as indicate on the apple documentation Adding Matter support to your ecosystem | Apple Developer Documentation (To test your app on the iOS or macOS device that initiates the pairing, download the developer profile now, then install it.) When I do that it works perfectly. Otherwise the documentation says that the profile is only needed for development but when I want to use my app from the apple store (validate by Apple) and when I remove the profile it doesn't work anymore. What do I have to do to paire Matter device on iphone without the Matter client developer profile.
9
0
1.3k
Dec ’23
[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
509
Dec ’23
CHIP Stack is not running
I tried to add my Eve Weather and Door & Window. It failed continuously and immediately with below log. Nov 23 16:24:50 iPhone-2 homed(HomeKitMatter)[173] <Error>: [589021415/1061261160] CHIP Stack is not running Nov 23 16:24:50 iPhone-2 homed(HomeKitMatter)[173] <Error>: [589021415/1061261160] CHIP Accessory pairing failed with error Error Domain=HAPErrorDomain Code=3 Nov 23 16:24:50 iPhone-2 homed(HomeKitDaemon)[173] <Error>: [188914BD-5163-425C-9E59-CAE9BFA1A288] Failed to stage CHIP accessory pairing for request UUID <private>: Error Domain=HMErrorDomain Code=18 "Pairing Failed" UserInfo={NSLocalizedDescription=Pairing Failed, NSUnderlyingError=0xc508b7df0 {Error Domain=HAPErrorDomain Code=3}} Nov 23 16:24:50 iPhone-2 homed(HomeKitDaemon)[173] <Notice>: Answering incoming message HMASC.m.stageCHIPAccessoryPairingInSteps (2D3E9A84-52E8-4614-8B79-A23A5DBC245D) from client 'HomeUIService' that does expect a response with error Error Domain=HMErrorDomain Code=18 "Pairing Failed" UserInfo={NSLocalizedDescription=Pairing Failed, NSUnderlyingError=0xc508b7df0 {Error Domain=HAPErrorDomain Code=3 "(null)"}} Nov 23 16:24:50 iPhone-2 homed(HomeKitMetrics)[173] <Error>: [188914BD-5163-425C-9E59-CAE9BFA1A288] tag="stagedPairingFailure" desc="Failed to stage CHIP accessory for request UUID" errorDomain="HMErrorDomain" errorCode="18" underlyingErrorDomain="HAPErrorDomain" underlyingErrorCode="3" Nov 23 16:24:50 iPhone-2 HomeUIService(HomeKit)[521] <Error>: [CF47D609-EF2F-44E3-96EC-89906F4F33C4] Failed to stage CHIP accessory pairing in steps: Error Domain=HMErrorDomain Code=18 UserInfo={NSLocalizedDescription=<private>, NSUnderlyingError=0x283431fe0 {Error Domain=HAPErrorDomain Code=3}}
0
0
517
Nov ’23
[Matter] homed always raise error in case of multi fabric scenario
Hello. I'd like to ask below issue. I have two SmartThings hub and one Matter device. After I add it to the first hub, and then share this to the second hub with QR code, it always fails with below log. (SmartThings app shows both MPC and QR code when sharing a device) with MPC code, it works fine with QR code, it always fails in HomeUIService default 23:15:16.895670+0900 homed >>> [E:42896i S:51446 M:229068112 (Ack:46785785)] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:09 (IM:InvokeCommandResponse) default 23:15:16.897723+0900 homed Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0001 default 23:15:16.897753+0900 homed Failsafe disarmed default 23:15:16.897789+0900 homed Successfully finished commissioning step 'Cleanup' default 23:15:16.897823+0900 homed DeviceControllerDelegate Commissioning complete. NodeId 965088193 Status ../../../../../../../../Sources/CHIPFramework/connectedhomeip/src/controller/CHIPDeviceController.cpp:1405: CHIP Error 0x0000007E: Trying to add a NOC for a fabric that already exists default 23:15:16.897892+0900 proximitycontrold < 91167F44>: Needs to restart ranging session as guest default 23:15:16.897933+0900 homed SecureSession[0xda63c2b50]: Moving from state 'kActive' --> 'kPendingEviction' error 23:15:16.898150+0900 homed Creating NSError from ../../../../../../../../Sources/CHIPFramework/connectedhomeip/src/controller/CHIPDeviceController.cpp:1405: CHIP Error 0x0000007E: Trying to add a NOC for a fabric that already exists error 23:15:16.899257+0900 homed [965088193/1870446891] CHIP Accessory pairing failed: Error Domain=MTRErrorDomain Code=11 "The device is already a member of this fabric." UserInfo={NSLocalizedDescription=The device is already a member of this fabric.} error 23:15:16.901186+0900 homed [188914BD-5163-425C-9E59-CAE9BFA1A288] Failed to stage CHIP accessory pairing for request UUID <private>: Error Domain=HMErrorDomain Code=13 "Accessory is already paired" UserInfo={NSLocalizedDescription=Accessory is already paired, NSUnderlyingError=0xda63f4600 {Error Domain=HAPErrorDomain Code=18}} error 23:15:16.901587+0900 HomeUIService [34760036-B05B-475C-9C00-592445A9A053] Failed to stage CHIP accessory pairing in steps: Error Domain=HMErrorDomain Code=13 UserInfo={NSLocalizedDescription=<private>, NSUnderlyingError=0x2824bac70 {Error Domain=HAPErrorDomain Code=18}} default 23:15:16.901762+0900 homed Answering incoming message HMASC.m.confirmDeviceCredential (795677CF-21ED-4E60-A5D5-3A7BF67BACCB) from client 'HomeUIService' that does expect a response with error Error Domain=HMErrorDomain Code=13 "Accessory is already paired" UserInfo={NSLocalizedDescription=Accessory is already paired, NSUnderlyingError=0xda63f4600 {Error Domain=HAPErrorDomain Code=18 "(null)"}} default 23:15:16.902126+0900 HomeUIService -[HSSetupStateMachineCHIPPartnerConfiguration stageCHIPAccessory]_block_invoke Staged CHIP accessory without stagedCHIPAccessoryPairingIdentifier as it is already paired. error 23:15:16.902254+0900 homed [188914BD-5163-425C-9E59-CAE9BFA1A288] tag="stagedPairingFailure" desc="Failed to stage CHIP accessory for request UUID" errorDomain="HMErrorDomain" errorCode="13" underlyingErrorDomain="HAPErrorDomain" underlyingErrorCode="18" error 23:15:16.975718+0900 homed Creating NSError from /Library/Caches/com.apple.xbs/Sources/CHIPFramework/connectedhomeip/src/darwin/Framework/CHIP/MTRDeviceController.mm:701: CHIP Error 0x00000003: Incorrect state error 23:15:16.975922+0900 homed [965088193/1870446891] Error: Error Domain=MTRErrorDomain Code=6 "Invalid object state." UserInfo={NSLocalizedDescription=Invalid object state.}. Failed to establish a connection to the device for unpairing. The device will not be notified of removal error 23:15:16.979939+0900 homed Failed to remove keychain entry for accessory <HMDUnpairedHAPAccessory> - error Error Domain=HMErrorDomain Code=13 "Accessory is already paired" UserInfo={NSLocalizedDescription=Accessory is already paired, NSUnderlyingError=0xda63f4600 {Error Domain=HAPErrorDomain Code=18}}
0
0
588
Nov ’23
[Matter] Abnormal behavior of Apple Keychain fabric in iOS
Hello. I'd like to report something different behavior with before. In previous versions of iOS (16.1~), after completing Apple Home app → SmartThings iOS app Multi Fabric onboarding, there was only one iOS system fabric in the device's fabric list as shown below. Apple Home app Apple Keychain (iOS system fabric commissioned by the Apple Home app or SmartThings iOS app) SmartThings In iOS 16.6.1, after completing Apple Home app → ST iOS app Multi Fabric onboarding, the device's fabric list has been changed to include two iOS system fabrics as shown below. Apple Home app Apple Keychain (iOS system fabric commissioned by the Apple Home app) Apple Keychain (iOS system fabric commissioned by the SmartThings iOS app) SmartThings At this time, if the user removes the device from the SmartThings iOS app, only SmartThings fabric (4) will be deleted and Apple Keychain (3) will remain. Apple Home app Apple Keychain (iOS system fabric commissioned by the Apple Home app) Apple Keychain (iOS system fabric commissioned by the SmartThings iOS app) I'm afraid that it will fail if I try to add my device to Google Home or Alexa. Because max fabric count is 5 and it counts Apple keychain also. Is this behavior expected? Thanks.
0
0
558
Nov ’23