Other Parts Discussed in Thread: Z-STACK
Summary
1. The Linux Gateway is failing on this query, apparently because it does not find the IEEE Address, which is strange because the Gateway was up and running for a while already without any devices associated to it. It is failing for a newly associated device!
Question:
- What can be done to make the Linux Gateway's work for this case.
Detail
I am developing an End Device and carefully checking that it is correctly implemented.
I noticed during the association process that the End Devices sends an "Identify Query" to the Coordinator without a payload.
The End Device sends a Identify Command, apparently during its BDB procedure:
ZStatus_t bdb_SendIdentifyQuery( uint8 endpoint )
Which send a query to the Broadcast Endpoint 0xFF, which is exactly what is sniffed:
ZigBee Application Support Layer Data, Dst Endpt: 255, Src Endpt: 1 Frame Control Field: Data (0x08) .... ..00 = Frame Type: Data (0x0) .... 10.. = Delivery Mode: Broadcast (0x2) ..0. .... = Security: False .0.. .... = Acknowledgement Request: False 0... .... = Extended Header: False Destination Endpoint: 255 Cluster: Identify (0x0003) Profile: Home Automation (0x0104) Source Endpoint: 1 Counter: 6 ZigBee Cluster Library Frame Frame Control Field: Cluster-specific (0x11) .... ..01 = Frame Type: Cluster-specific (0x1) .... .0.. = Manufacturer Specific: False .... 0... = Direction: Client to Server ...1 .... = Disable Default Response: True Sequence Number: 1 Command: Identify Query (0x01)
This command is time-correlated to the next messages in the Linux Gateway Log that reports that the command fails because the IEEE Address is not found for this newly (!) associated device:
[2020-10-16 21:17:09] [21:17:06.835,127] [Z_STACK/HNDL] INFO : [DBG] Clearing @ 0xB6A00678 (processed 36 messages)... [2020-10-16 21:17:09] [21:17:06.835,156] [Z_STACK/HNDL] INFO : [MUTEX] Wait for AREQ semaphore [2020-10-16 21:17:09] [21:17:06.835,390] [Z_STACK/MAIN] INFO : ...sent 60 bytes to Client [2020-10-16 21:17:09] [21:17:06.835,604] [GATEWAY/READ] INFO : Received 56 bytes, subSys 0x51, cmdId 0x92 [2020-10-16 21:17:10] [21:17:06.835,688] [GATEWAY/READ] INFO : RPC_CMD_AREQ cmdId: 0x92 [2020-10-16 21:17:10] [21:17:06.835,716] [GATEWAY/READ] INFO : [DBG] Allocated @ 0xB6A00560 (received 9 messages)... [2020-10-16 21:17:10] [21:17:06.835,742] [GATEWAY/READ] INFO : Filling new message (@ 0xB6A00560)... [2020-10-16 21:17:10] [21:17:06.835,804] [GATEWAY/HNDL] INFO : [MUTEX] Mutex for AREQ unlocked [2020-10-16 21:17:10] [21:17:06.835,845] [GATEWAY/HNDL] INFO : [DBG] Processing @ 0xB6A00560 [2020-10-16 21:17:10] [21:17:06.835,872] [GATEWAY/HNDL] INFO : [MUTEX] AREQ Calling asynchMsgCback (Handle)... [2020-10-16 21:17:10] [21:17:06.835,897] [GATEWAY/HNDL] INFO : [DBG] asyncCB: subSys:0x00000011, cmdId:0x00000092, len:0x00000038, pData:0xB6A00568 [2020-10-16 21:17:10] [21:17:06.836,048] [GATEWAY/HNDL] MISC1 : Processing Af Incoming Message Indication [2020-10-16 21:17:10] [21:17:06.836,111] [GATEWAY/HNDL] DEBUG : isEndpointClusterExistOnGw(1, 0x0003, ClientToServer) [2020-10-16 21:17:10] [21:17:06.836,145] [GATEWAY/HNDL] DEBUG : isEndpointClusterExistOnGw(): EP/Cluster Found [2020-10-16 21:17:10] [21:17:06.836,170] [GATEWAY/HNDL] DEBUG : zcl_HdlIncoming: Processing abstracted ZCL command [2020-10-16 21:17:10] [21:17:06.836,196] [GATEWAY/HNDL] DEBUG : zcl_HdlIncoming: Processing generic ZCL command [2020-10-16 21:17:10] [21:17:06.842,796] [GATEWAY/HNDL] INFO : preparing to send 6 bytes, subSys 0x19, cmdId 0x00, pData: [2020-10-16 21:17:10] [21:17:06.842,936] [GATEWAY/HNDL] INFO : [MUTEX] Lock SRSP Transaction Mutex [2020-10-16 21:17:10] [21:17:06.843,017] [GATEWAY/HNDL] PKT_HEX: [ NWK_MGR<<GATEWAY ] [SREQ] 06:00:39:00:08:00:10:E6:CD:02 [2020-10-16 21:17:10] [21:17:06.843,132] [GATEWAY/HNDL] PKTTYPE: [ NWK_MGR<<GATEWAY ] SrvrGetIeeeAddressReq [2020-10-16 21:17:10] [21:17:06.843,194] [GATEWAY/HNDL] PKTBODY: cmdId = SRVR_GET_IEEE_ADDRESS_REQ [2020-10-16 21:17:10] [21:17:06.843,233] [GATEWAY/HNDL] PKTBODY: shortAddress = 0x0000A6E6 (42726) [2020-10-16 21:17:10] [21:17:06.843,482] [GATEWAY/HNDL] INFO : Waiting for synchronous response... [2020-10-16 21:17:10] [21:17:06.843,526] [GATEWAY/HNDL] INFO : [MUTEX] Lock SRSP Mutex [2020-10-16 21:17:10] [21:17:06.843,554] [GATEWAY/HNDL] INFO : [MUTEX] Wait for SRSP Cond signal... [2020-10-16 21:17:10] [21:17:06.844,578] [NWK_MGR/LSTN] INFO : Receive message... [2020-10-16 21:17:10] [21:17:06.844,744] [NWK_MGR/LSTN] MISC1 : [2020-10-16 21:17:10] SRVR_GET_IEEE_ADDRESS_REQ: shortAddr: A6E6 [2020-10-16 21:17:10] [21:17:06.844,962] [NWK_MGR/LSTN] PKT_HEX: [ NWK_MGR>>GATEWAY ] [ucst] 0D:00:79:01:08:01:10:01:19:00:00:00:0 [2020-10-16 21:17:10] [21:17:06.845,021] [NWK_MGR/LSTN] PKTTYPE: [ NWK_MGR>>GATEWAY ] SrvrGetIeeeAddressCnf [2020-10-16 21:17:10] [21:17:06.845,070] [NWK_MGR/LSTN] PKTBODY: cmdId = SRVR_GET_IEEE_ADDRESS_CNF [2020-10-16 21:17:10] [21:17:06.845,109] [NWK_MGR/LSTN] PKTBODY: status = STATUS_FAILURE [2020-10-16 21:17:10] [21:17:06.845,147] [NWK_MGR/LSTN] PKTBODY: ieeeAddress = 00:00:00:00:00:00:00:00 [2020-10-16 21:17:10] [21:17:06.845,305] [NWK_MGR/LSTN] INFO : ...sent 17 bytes to Client [2020-10-16 21:17:10] [21:17:06.845,356] [NWK_MGR/LSTN] INFO : !Done [2020-10-16 21:17:10] [21:17:06.845,583] [GATEWAY/READ] INFO : Received 13 bytes, subSys 0x79, cmdId 0x01 [2020-10-16 21:17:10] [21:17:06.845,665] [GATEWAY/READ] INFO : [MUTEX] SRSP Cond signal set [2020-10-16 21:17:10] [21:17:06.845,692] [GATEWAY/READ] INFO : Client Read: (len 17): [2020-10-16 21:17:10] [21:17:06.846,799] [GATEWAY/HNDL] INFO : [MUTEX] Unlock SRSP Mutex [2020-10-16 21:17:10] [21:17:06.846,902] [GATEWAY/HNDL] MISC1 : [2020-10-16 21:17:10] P2P: Get IEEE Address Failed, status: 1 [2020-10-16 21:17:10] [21:17:06.846,975] [GATEWAY/HNDL] MISC1 : ZCL Process Message Failed, Message Status: 8 [2020-10-16 21:17:10] [21:17:06.847,018] [GATEWAY/HNDL] INFO : [MUTEX] AREQ (Handle) (message @ 0xB6A00560)... [2020-10-16 21:17:10] [21:17:06.847,048] [GATEWAY/HNDL] INFO : [DBG] Clearing @ 0xB6A00560 (processed 9 messages)... [2020-10-16 21:17:10] [21:17:06.847,080] [GATEWAY/HNDL] INFO : [MUTEX] Wait for AREQ semaphore [2020-10-16 21:17:10] [21:17:06.840,635] [OTASRVR/READ] INFO : Received 51 bytes, subSys 0x51, cmdId 0x92 [2020-10-16 21:17:10] [21:17:06.850,220] [OTASRVR/READ] INFO : RPC_CMD_AREQ cmdId: 0x92 [2020-10-16 21:17:10] [21:17:06.850,276] [OTASRVR/READ] INFO : [DBG] Allocated @ 0xB6B004B0 (received 1 messages)... [2020-10-16 21:17:10] [21:17:06.850,305] [OTASRVR/READ] INFO : Filling new message (@ 0xB6B004B0)... [2020-10-16 21:17:10] [21:17:06.850,408] [OTASRVR/HNDL] INFO : [MUTEX] Mutex for AREQ unlocked [2020-10-16 21:17:10] [21:17:06.850,457] [OTASRVR/HNDL] INFO : [DBG] Processing @ 0xB6B004B0 [2020-10-16 21:17:10] [21:17:06.850,484] [OTASRVR/HNDL] INFO : [MUTEX] AREQ Calling asynchMsgCback (Handle)... [2020-10-16 21:17:10] [21:17:06.850,510] [OTASRVR/HNDL] INFO : [DBG] asyncCB: subSys:0x00000011, cmdId:0x00000092, len:0x00000033, pData:0xB6B004B8 [2020-10-16 21:17:10] [21:17:06.856,803] [OTASRVR/HNDL] INFO : [MUTEX] AREQ (Handle) (message @ 0xB6B004B0)... [2020-10-16 21:17:10] [21:17:06.856,938] [OTASRVR/HNDL] INFO : [DBG] Clearing @ 0xB6B004B0 (processed 1 messages)... [2020-10-16 21:17:10] [21:17:06.856,975] [OTASRVR/HNDL] INFO : [MUTEX] Wait for AREQ semaphore [2020-10-16 21:17:10] [21:17:06.960,394] [Z_STACK/READ] INFO : Received 14 bytes, subSys 0x45, cmdId 0xFF [2020-10-16 21:17:10] [21:17:06.960,562] [Z_STACK/READ] INFO : RPC_CMD_AREQ cmdId: 0xFF [2020-10-16 21:17:10] [21:17:06.960,594] [Z_STACK/READ] INFO : [DBG] Allocated @ 0xB6A00490 (received 37 messages)... [2020-10-16 21:17:10] [21:17:06.960,655] [Z_STACK/READ] INFO : Filling new message (@ 0xB6A00490)... [2020-10-16 21:17:10] [21:17:06.961,171] [Z_STACK/HNDL] INFO : [MUTEX] Mutex for AREQ unlocked [2020-10-16 21:17:10] [21:17:06.961,249] [Z_STACK/HNDL] INFO : [DBG] Processing @ 0xB6A00490 [2020-10-16 21:17:10] [21:17:06.961,281] [Z_STACK/HNDL] INFO : [MUTEX] AREQ Calling asynchMsgCback (Handle)...
The BDB Specification says first:
Set IdentifyTime to ≥ bdbMinCommissioningTime
which IMHO refers to the duration of the "self-identification" and is likely unrelated to the above observations.
It further says
Broadcast identify query
In the simplified Figure for the Finding&Binding procedure for an initiator endpoint.
This seems to match, as the query to sent to all nodes using the Broadcast address 0xFFFF.
It seems that this resumes to the Linux Gateway is misbehaving for a reason that still needs to be identified.
Note, this question was edited to correct myself because the Identify Query Command #1 does not have a payload, the queried device replies with a payload. Teh specification has the same title for figure 3-6 as 3-8 which is confusing. the title for 3-6 is obviously wrong. In fact the copy/paste error is repeated several times in 3.5.2.3.1.1.