~simple\栎 2026-03-31 18:38 采纳率: 0%
浏览 7

linux matter配网问题

我学习了你的 Matter开发环境搭建:Linux/ESP32/Thread设备快速上手 这篇文章
想要请教一下,我在ubuntu系统中使用./out/debug/chip-lighting-app 创建一个虚拟照明设备,在同一台设备上用chip-tool工具测试配网控制都是成功的,但是我尝试了很多手机app,例如涂鸦、苹果的home app等,发现安卓手机上的app配网失败,ubuntu的虚拟设备没有收到任何消息,苹果的home app配网时,ubuntu的虚拟设备收到消息,并且有日志,但是在配网最后阶段还是失败了。如下是ubuntu上的log
[1774921699.742] [1610702:1610702] [DMG] Read request on unknown cluster - no data version available
[1774921699.742] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0046 e=0 p=v r=r
[1774921699.742] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.742] [1610702:1610702] [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
[1774921699.742] [1610702:1610702] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0002err = src/app/data-model-provider/ActionReturnStatus.cpp:104: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1774921699.742] [1610702:1610702] [DMG] RE:Run Cluster 46, Attribute 1 is dirty
[1774921699.742] [1610702:1610702] [DMG] Read request on unknown cluster - no data version available
[1774921699.742] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0046 e=0 p=v r=r
[1774921699.742] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
[1774921699.743] [1610702:1610702] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0001err = src/app/data-model-provider/ActionReturnStatus.cpp:104: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1774921699.743] [1610702:1610702] [DMG] RE:Run Cluster 46, Attribute 0 is dirty
[1774921699.743] [1610702:1610702] [DMG] Read request on unknown cluster - no data version available
[1774921699.743] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0046 e=0 p=v r=r
[1774921699.743] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
[1774921699.743] [1610702:1610702] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0000err = src/app/data-model-provider/ActionReturnStatus.cpp:104: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1774921699.743] [1610702:1610702] [DMG] RE:Run Cluster 46, Attribute 7 is dirty
[1774921699.743] [1610702:1610702] [DMG] Read request on unknown cluster - no data version available
[1774921699.743] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0046 e=0 p=v r=r
[1774921699.743] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
[1774921699.743] [1610702:1610702] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0007err = src/app/data-model-provider/ActionReturnStatus.cpp:104: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1774921699.743] [1610702:1610702] [DMG] RE:Run Cluster 46, Attribute 6 is dirty
[1774921699.743] [1610702:1610702] [DMG] Read request on unknown cluster - no data version available
[1774921699.743] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0046 e=0 p=v r=r
[1774921699.743] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
[1774921699.743] [1610702:1610702] [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: 0x0000_0006err = src/app/data-model-provider/ActionReturnStatus.cpp:104: IM Error 0x000005C3: General error: 0xc3 (UNSUPPORTED_CLUSTER)
[1774921699.743] [1610702:1610702] [DMG] RE:Run Cluster 30, Attribute 4 is dirty
[1774921699.743] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0030 e=0 p=v r=r
[1774921699.743] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0030 e=0 p=v r=r
[1774921699.743] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.743] [1610702:1610702] [DMG] Reading attribute: Cluster=0x0000_0030 Endpoint=0x0 AttributeId=0x0000_0004 (expanded=0)
[1774921699.743] [1610702:1610702] [DMG] Sending report (payload has 150 bytes)...
[1774921699.743] [1610702:1610702] [EM] <<< [E:18883r S:64105 M:224381343] (S) Msg TX from 0000000000000000 to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:05 (IM:ReportData) (B:180)
[1774921699.743] [1610702:1610702] [DMG] OnReportConfirm: NumReports = 0
[1774921699.743] [1610702:1610702] [DMG] ReportsInFlight = 0 with readHandler 0, RE has no more messages
[1774921699.743] [1610702:1610702] [DMG] IM RH moving to [AwaitingDestruction]
[1774921699.743] [1610702:1610702] [DMG] All ReadHandler-s are clean, clear GlobalDirtySet
[1774921699.800] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921699.802] [1610702:1610703] [DL] C1 WriteHandlerCallback received 70 bytes
[1774921699.802] [1610702:1610703] [BLE] Write request received: conn=0x7fc224039ce0
[1774921699.802] [1610702:1610702] [EM] >>> [E:18884r S:64105 M:265556223] (S) Msg RX from 0:FFFFFFFB00000000 [0000] to 0000000000000000 --- Type 0001:08 (IM:InvokeCommandRequest) (B:65)
[1774921699.802] [1610702:1610702] [EM] Handling via exchange: 18884r, Delegate: 0x55d4b0212968
[1774921699.802] [1610702:1610702] [DMG] InvokeRequestMessage =
[1774921699.802] [1610702:1610702] [DMG] {
[1774921699.802] [1610702:1610702] [DMG] suppressResponse = false,
[1774921699.802] [1610702:1610702] [DMG] timedRequest = false,
[1774921699.802] [1610702:1610702] [DMG] InvokeRequests =
[1774921699.802] [1610702:1610702] [DMG] [
[1774921699.802] [1610702:1610702] [DMG] CommandDataIB =
[1774921699.802] [1610702:1610702] [DMG] {
[1774921699.802] [1610702:1610702] [DMG] CommandPathIB =
[1774921699.802] [1610702:1610702] [DMG] {
[1774921699.802] [1610702:1610702] [DMG] EndpointId = 0x0,
[1774921699.802] [1610702:1610702] [DMG] ClusterId = 0x30,
[1774921699.802] [1610702:1610702] [DMG] CommandId = 0x0,
[1774921699.802] [1610702:1610702] [DMG] },
[1774921699.802] [1610702:1610702] [DMG]
[1774921699.802] [1610702:1610702] [DMG] CommandFields =
[1774921699.802] [1610702:1610702] [DMG] {
[1774921699.802] [1610702:1610702] [DMG] 0x0 = 60 (unsigned),
[1774921699.802] [1610702:1610702] [DMG] 0x1 = 4 (unsigned),
[1774921699.802] [1610702:1610702] [DMG] },
[1774921699.802] [1610702:1610702] [DMG] },
[1774921699.802] [1610702:1610702] [DMG]
[1774921699.802] [1610702:1610702] [DMG] ],
[1774921699.802] [1610702:1610702] [DMG]
[1774921699.802] [1610702:1610702] [DMG] InteractionModelRevision = 11
[1774921699.802] [1610702:1610702] [DMG] },
[1774921699.802] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0030 e=0 p=a r=i
[1774921699.802] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.802] [1610702:1610702] [DMG] Received command for Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0000
[1774921699.802] [1610702:1610702] [FS] GeneralCommissioning: Received ArmFailSafe (60s)
[1774921699.802] [1610702:1610702] [DMG] Command handler moving to [NewRespons]
[1774921699.802] [1610702:1610702] [DMG] Command handler moving to [ Preparing]
[1774921699.802] [1610702:1610702] [DMG] Command handler moving to [AddingComm]
[1774921699.802] [1610702:1610702] [DMG] Command handler moving to [AddedComma]
[1774921699.802] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 1
[1774921699.802] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 0
[1774921699.802] [1610702:1610702] [DMG] Command handler moving to [AwaitingDe]
[1774921699.802] [1610702:1610702] [EM] <<< [E:18884r S:64105 M:224381344] (S) Msg TX from 0000000000000000 to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse) (B:66)
[1774921699.802] [1610702:1610702] [DMG] Command response sender moving to [AllInvokeR]
[1774921699.921] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921699.922] [1610702:1610703] [DL] C1 WriteHandlerCallback received 75 bytes
[1774921699.922] [1610702:1610703] [BLE] Write request received: conn=0x7fc224039ce0
[1774921699.922] [1610702:1610702] [EM] >>> [E:18885r S:64105 M:265556224] (S) Msg RX from 0:FFFFFFFB00000000 [0000] to 0000000000000000 --- Type 0001:08 (IM:InvokeCommandRequest) (B:70)
[1774921699.922] [1610702:1610702] [EM] Handling via exchange: 18885r, Delegate: 0x55d4b0212968
[1774921699.923] [1610702:1610702] [DMG] InvokeRequestMessage =
[1774921699.923] [1610702:1610702] [DMG] {
[1774921699.923] [1610702:1610702] [DMG] suppressResponse = false,
[1774921699.923] [1610702:1610702] [DMG] timedRequest = false,
[1774921699.923] [1610702:1610702] [DMG] InvokeRequests =
[1774921699.923] [1610702:1610702] [DMG] [
[1774921699.923] [1610702:1610702] [DMG] CommandDataIB =
[1774921699.923] [1610702:1610702] [DMG] {
[1774921699.923] [1610702:1610702] [DMG] CommandPathIB =
[1774921699.923] [1610702:1610702] [DMG] {
[1774921699.923] [1610702:1610702] [DMG] EndpointId = 0x0,
[1774921699.923] [1610702:1610702] [DMG] ClusterId = 0x30,
[1774921699.923] [1610702:1610702] [DMG] CommandId = 0x2,
[1774921699.923] [1610702:1610702] [DMG] },
[1774921699.923] [1610702:1610702] [DMG]
[1774921699.923] [1610702:1610702] [DMG] CommandFields =
[1774921699.923] [1610702:1610702] [DMG] {
[1774921699.923] [1610702:1610702] [DMG] 0x0 = 0 (unsigned),
[1774921699.923] [1610702:1610702] [DMG] 0x1 = "CN" (2 chars),
[1774921699.923] [1610702:1610702] [DMG] 0x2 = 5 (unsigned),
[1774921699.923] [1610702:1610702] [DMG] },
[1774921699.923] [1610702:1610702] [DMG] },
[1774921699.923] [1610702:1610702] [DMG]
[1774921699.923] [1610702:1610702] [DMG] ],
[1774921699.923] [1610702:1610702] [DMG]
[1774921699.923] [1610702:1610702] [DMG] InteractionModelRevision = 11
[1774921699.923] [1610702:1610702] [DMG] },
[1774921699.923] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_0030 e=0 p=a r=i
[1774921699.923] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.923] [1610702:1610702] [DMG] Received command for Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0002
[1774921699.926] [1610702:1610702] [DL] Wrote settings to /tmp/chip_config.ini
[1774921699.926] [1610702:1610702] [DL] NVS set: chip-config/regulatory-location = 0 (0x0)
[1774921699.928] [1610702:1610702] [DL] Wrote settings to /tmp/chip_config.ini
[1774921699.928] [1610702:1610702] [DL] NVS set: chip-config/country-code = "CN"
[1774921699.928] [1610702:1610702] [DMG] Command handler moving to [NewRespons]
[1774921699.928] [1610702:1610702] [DMG] Command handler moving to [ Preparing]
[1774921699.928] [1610702:1610702] [DMG] Command handler moving to [AddingComm]
[1774921699.928] [1610702:1610702] [DMG] Command handler moving to [AddedComma]
[1774921699.928] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 1
[1774921699.928] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 0
[1774921699.928] [1610702:1610702] [DMG] Command handler moving to [AwaitingDe]
[1774921699.928] [1610702:1610702] [EM] <<< [E:18885r S:64105 M:224381345] (S) Msg TX from 0000000000000000 to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse) (B:66)
[1774921699.929] [1610702:1610702] [DMG] Command response sender moving to [AllInvokeR]
[1774921699.981] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921699.982] [1610702:1610703] [DL] C1 WriteHandlerCallback received 67 bytes
[1774921699.982] [1610702:1610703] [BLE] Write request received: conn=0x7fc224039ce0
[1774921699.982] [1610702:1610702] [EM] >>> [E:18886r S:64105 M:265556225] (S) Msg RX from 0:FFFFFFFB00000000 [0000] to 0000000000000000 --- Type 0001:08 (IM:InvokeCommandRequest) (B:62)
[1774921699.982] [1610702:1610702] [EM] Handling via exchange: 18886r, Delegate: 0x55d4b0212968
[1774921699.982] [1610702:1610702] [DMG] InvokeRequestMessage =
[1774921699.983] [1610702:1610702] [DMG] {
[1774921699.983] [1610702:1610702] [DMG] suppressResponse = false,
[1774921699.983] [1610702:1610702] [DMG] timedRequest = false,
[1774921699.983] [1610702:1610702] [DMG] InvokeRequests =
[1774921699.983] [1610702:1610702] [DMG] [
[1774921699.983] [1610702:1610702] [DMG] CommandDataIB =
[1774921699.983] [1610702:1610702] [DMG] {
[1774921699.983] [1610702:1610702] [DMG] CommandPathIB =
[1774921699.983] [1610702:1610702] [DMG] {
[1774921699.983] [1610702:1610702] [DMG] EndpointId = 0x0,
[1774921699.983] [1610702:1610702] [DMG] ClusterId = 0x3e,
[1774921699.983] [1610702:1610702] [DMG] CommandId = 0x2,
[1774921699.983] [1610702:1610702] [DMG] },
[1774921699.983] [1610702:1610702] [DMG]
[1774921699.983] [1610702:1610702] [DMG] CommandFields =
[1774921699.983] [1610702:1610702] [DMG] {
[1774921699.983] [1610702:1610702] [DMG] 0x0 = 2 (unsigned),
[1774921699.983] [1610702:1610702] [DMG] },
[1774921699.983] [1610702:1610702] [DMG] },
[1774921699.983] [1610702:1610702] [DMG]
[1774921699.983] [1610702:1610702] [DMG] ],
[1774921699.983] [1610702:1610702] [DMG]
[1774921699.983] [1610702:1610702] [DMG] InteractionModelRevision = 11
[1774921699.983] [1610702:1610702] [DMG] },
[1774921699.983] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_003E e=0 p=a r=i
[1774921699.983] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921699.983] [1610702:1610702] [DMG] Received command for Endpoint=0 Cluster=0x0000_003E Command=0x0000_0002
[1774921699.983] [1610702:1610702] [ZCL] OpCreds: Certificate Chain request received for PAI
[1774921699.983] [1610702:1610702] [DMG] Command handler moving to [NewRespons]
[1774921699.983] [1610702:1610702] [DMG] Command handler moving to [ Preparing]
[1774921699.983] [1610702:1610702] [DMG] Command handler moving to [AddingComm]
[1774921699.983] [1610702:1610702] [DMG] Command handler moving to [AddedComma]
[1774921699.983] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 1
[1774921699.983] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 0
[1774921699.983] [1610702:1610702] [DMG] Command handler moving to [AwaitingDe]
[1774921699.983] [1610702:1610702] [EM] <<< [E:18886r S:64105 M:224381346] (S) Msg TX from 0000000000000000 to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse) (B:527)
[1774921699.984] [1610702:1610702] [DMG] Command response sender moving to [AllInvokeR]
[1774921700.041] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921700.101] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921700.161] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921700.162] [1610702:1610703] [DL] C1 WriteHandlerCallback received 67 bytes
[1774921700.162] [1610702:1610703] [BLE] Write request received: conn=0x7fc224039ce0
[1774921700.163] [1610702:1610702] [EM] >>> [E:18887r S:64105 M:265556226] (S) Msg RX from 0:FFFFFFFB00000000 [0000] to 0000000000000000 --- Type 0001:08 (IM:InvokeCommandRequest) (B:62)
[1774921700.163] [1610702:1610702] [EM] Handling via exchange: 18887r, Delegate: 0x55d4b0212968
[1774921700.163] [1610702:1610702] [DMG] InvokeRequestMessage =
[1774921700.163] [1610702:1610702] [DMG] {
[1774921700.163] [1610702:1610702] [DMG] suppressResponse = false,
[1774921700.163] [1610702:1610702] [DMG] timedRequest = false,
[1774921700.163] [1610702:1610702] [DMG] InvokeRequests =
[1774921700.163] [1610702:1610702] [DMG] [
[1774921700.163] [1610702:1610702] [DMG] CommandDataIB =
[1774921700.163] [1610702:1610702] [DMG] {
[1774921700.163] [1610702:1610702] [DMG] CommandPathIB =
[1774921700.163] [1610702:1610702] [DMG] {
[1774921700.163] [1610702:1610702] [DMG] EndpointId = 0x0,
[1774921700.163] [1610702:1610702] [DMG] ClusterId = 0x3e,
[1774921700.163] [1610702:1610702] [DMG] CommandId = 0x2,
[1774921700.163] [1610702:1610702] [DMG] },
[1774921700.163] [1610702:1610702] [DMG]
[1774921700.163] [1610702:1610702] [DMG] CommandFields =
[1774921700.163] [1610702:1610702] [DMG] {
[1774921700.163] [1610702:1610702] [DMG] 0x0 = 1 (unsigned),
[1774921700.163] [1610702:1610702] [DMG] },
[1774921700.163] [1610702:1610702] [DMG] },
[1774921700.163] [1610702:1610702] [DMG]
[1774921700.163] [1610702:1610702] [DMG] ],
[1774921700.163] [1610702:1610702] [DMG]
[1774921700.163] [1610702:1610702] [DMG] InteractionModelRevision = 11
[1774921700.163] [1610702:1610702] [DMG] },
[1774921700.163] [1610702:1610702] [DMG] AccessControl: checking f=0 a=p s=0xFFFFFFFB00000000 t= c=0x0000_003E e=0 p=a r=i
[1774921700.163] [1610702:1610702] [DMG] AccessControl: implicit admin (PASE)
[1774921700.163] [1610702:1610702] [DMG] Received command for Endpoint=0 Cluster=0x0000_003E Command=0x0000_0002
[1774921700.163] [1610702:1610702] [ZCL] OpCreds: Certificate Chain request received for DAC
[1774921700.163] [1610702:1610702] [DMG] Command handler moving to [NewRespons]
[1774921700.163] [1610702:1610702] [DMG] Command handler moving to [ Preparing]
[1774921700.163] [1610702:1610702] [DMG] Command handler moving to [AddingComm]
[1774921700.163] [1610702:1610702] [DMG] Command handler moving to [AddedComma]
[1774921700.163] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 1
[1774921700.163] [1610702:1610702] [DMG] Decreasing reference count for CommandHandlerImpl, remaining 0
[1774921700.163] [1610702:1610702] [DMG] Command handler moving to [AwaitingDe]
[1774921700.163] [1610702:1610702] [EM] <<< [E:18887r S:64105 M:224381347] (S) Msg TX from 0000000000000000 to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse) (B:555)
[1774921700.164] [1610702:1610702] [DMG] Command response sender moving to [AllInvokeR]
[1774921700.221] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921700.311] [1610702:1610703] [DL] Indication confirmation: conn=0x7fc224039ce0
[1774921700.432] [1610702:1610703] [DL] INFO: socket disconnected in WriteHandlerCallback
[1774921700.432] [1610702:1610703] [DL] INFO: socket disconnected in NotifyHandlerCallback
[1774921700.435] [1610702:1610703] [DL] BLE connection closed: conn=0x7fc224039ce0
[1774921700.435] [1610702:1610702] [IN] Clearing BLE pending packets.
[1774921700.435] [1610702:1610702] [DL] Freeing BLE connection: conn=0x7fc224039ce0

有这个日志错误,home app上显示与配件配对失败,请问下可以帮我看看是什么原因吗?

  • 写回答

3条回答 默认 最新

  • 檀越@新空间 2026-03-31 18:45
    关注

    晚上好🌙🌙🌙
    本答案参考通义千问

    你遇到的问题是关于 Matter 设备在 Ubuntu 上运行的虚拟照明设备安卓手机 APP(如涂鸦)苹果 Home App 配网失败的情况。根据你的描述,以下是详细分析和解决方案:


    🧠 问题分析

    1. 日志中的关键错误信息

    从你提供的日志中可以看到以下关键错误:

    [DMG] Failed to read attribute: UNSUPPORTED_CLUSTER(195)
    [DMG] Fail to retrieve data, roll back and encode status on clusterId: 0x0000_0046, attributeId: ...
    

    这表明设备尝试访问一个它不支持的 Cluster (0x0000_0046),即 OTA 升级集群(OTA Upgrade Cluster)。这通常发生在设备未正确配置或没有实现该集群时。

    2. 配网失败的原因

    • 安卓 APP(如涂鸦):可能需要特定的 Matter 固件格式厂商 ID、产品 ID 等信息,而你的虚拟设备可能缺少这些配置。
    • 苹果 Home App:虽然可以识别到设备并收到消息,但最终配网失败,可能是由于:
      • 设备未完全实现 Matter 协议标准
      • 缺少必要的 Cluster(如 OTA、设备信息等)
      • 配网流程中的某些步骤未完成

    ✅ 解决方案

    1. 确认设备是否实现了所有必需的 Cluster

    Matter 设备必须至少实现以下 Cluster:

    | Cluster Name | Cluster ID | |--------------|------------| | Device Information | 0x0000000C | | On/Off | 0x00000006 | | Power Source | 0x0000000D | | OTA Upgrade | 0x0000001A | | General Commissioning | 0x0000000F |

    🔧 修改代码(以 ESP32 为例)

    如果你使用的是 ESP32 + Matter SDK,请确保你的设备实现了上述 Cluster。例如,在 CHIP_DEVICE_CONFIG_* 的定义中设置正确的 Vendor IDProduct IDDevice Type 等。

    #include "CHIP_DEVICE_CONFIG.h"
    
    // 设置设备信息
    CHIP_DEVICE_CONFIG_DEFINE(
        "MyLight",
        CHIP_DEVICE_CONFIG_DEVICE_TYPE_LIGHT,
        CHIP_DEVICE_CONFIG_DEVICE_VENDOR_ID(0x0001),
        CHIP_DEVICE_CONFIG_DEVICE_PRODUCT_ID(0x0001),
        CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_VERSION(1),
        CHIP_DEVICE_CONFIG_DEVICE_FIRMWARE_VERSION_STRING("1.0"),
        CHIP_DEVICE_CONFIG_DEVICE_SERIAL_NUMBER("1234567890")
    );
    

    注意: 如果你使用的是 虚拟设备(chip-lighting-app),请检查其配置文件或源码,确认是否启用了所有必需的 Cluster。


    2. 确保设备支持 PASE 配网协议

    PASE 是 Matter 的一种安全配网方式,适用于无 Wi-Fi 的设备(如传感器、灯泡)。如果设备没有正确实现 PASE,则可能导致配网失败。

    🛠️ 检查 PASE 实现

    确保你的设备支持以下功能:

    • PASE 配网密钥生成
    • 配网过程中的身份验证
    • 设备认证(如使用二维码或手动输入 PIN)

    3. 检查设备是否发送了正确的配网响应

    配网过程中,设备需要发送以下消息:

    • Pairing Request
    • Pairing Response
    • Committed Data
    • Confirm

    你可以通过 Wireshark 或其他网络抓包工具捕获设备的通信数据,确认设备是否发送了这些消息。


    4. 使用 chip-tool 测试配网流程

    你已经验证过 chip-tool 可以成功配网,说明设备本身是正常的。因此,问题可能出在 APP 与设备之间的兼容性

    📱 苹果 Home App 配网失败

    • 确保设备支持 HomeKit 的 Matter 兼容性
    • 在 Home App 中尝试重新配网,确保没有遗漏任何步骤
    • 尝试更新 Home App 到最新版本

    📱 安卓 APP(如涂鸦)配网失败

    • 检查 APP 是否支持 Matter 协议
    • 确认设备是否具有有效的 Matter 设备证书
    • 检查设备是否被注册到 APP 的设备列表中

    5. 修改代码以支持更多 Cluster

    如果你的设备没有实现某些 Cluster,可以通过以下方式添加:

    示例:添加 OTA 升级 Cluster

    #include "CHIP_DEVICE_CONFIG.h"
    #include "CHIP_DEVICE_INFO.h"
    #include "CHIP_OTA_CLIENT.h"
    
    // 初始化 OTA Client
    CHIP_OTA_CLIENT_INIT();
    
    // 注册 OTA 升级 Cluster
    CHIP_REGISTER_CLUSTER_HANDLER(OTAUpgradeClusterHandler);
    

    🧪 测试建议

    1. 使用 chip-tool 手动测试设备是否能响应命令(如 onoff set 1)。
    2. 使用 Wireshark 抓取设备与手机之间的通信,查看是否有异常。
    3. 尝试在设备上启用调试日志,查看是否有关于配网失败的更详细信息。

    🧩 总结

    | 问题 | 原因 | 解决方法 | |------|------|----------| | 安卓 APP 配网失败 | 设备未实现必要 Cluster 或未配置 Vendor/ProductId | 确保设备实现所有必要 Cluster,并正确配置 Vendor/ProductId | | 苹果 Home App 配网失败 | 设备未正确支持 PASE 或未发送完整配网响应 | 检查 PASE 实现,确保配网流程完整 | | 日志显示 UNSUPPORTED_CLUSTER | 设备未实现指定 Cluster(如 OTA) | 添加缺失 Cluster 的实现代码 |


    📌 最终建议

    • 确保你的设备符合 Matter 标准,尤其是 Cluster 和配网协议
    • 如果你是从头开始开发,建议参考 Matter 官方文档
    • 如果你使用的是开源项目(如 chip-lighting-app),请查看其文档或 GitHub 仓库的 issue,看是否有类似问题的讨论

    如果你需要我帮助你修改具体的代码片段,请提供你的代码或项目结构,我可以进一步帮你定位问题。

    评论

报告相同问题?

问题事件

  • 创建了问题 3月31日