Other Parts Discussed in Thread: Z-STACK
Now that the NWKMGR's memory accesses have be fixed, I can concentrate on issues related to core functionnality.
In this test, I associate a device in the network - the gateway announce 0 known devices at the start.
I tried this multiple times (i.e., I did the association process multiple times in row without success)
The device 00:15:8d:00:04:7b:83:69 get the NWK address 0xd596 and transport key, announces itself and reports attributes. It also responds to an extended address request.
Despite that the device does not show up in the device list, the IEEE address reported by the NWK server is 0 and this does not resolve at all.
What has to be changed in the gateway to fix this? [Why does the device announcement does not have its desired effect, etc.]
Logs are below, but separate in the attached zip - there is a timeshift due to local time and utc time for some logs. I do not have the ZLS log.
****** The Device 0xD596 corresponds to a TI SampleLight that must be acting as a router. ****** It was associated in an old session, but is it apparently still allowed to act in the network. ****** This is the entry in an old DbDeviceInfo: ****** DbHistoryFull/20201113_200112.DbDeviceInfo.csv: 00:12:4B:00:01:DD:7A:D7 , 0xD596 , 0x01, 0x0000 , 3, 00:12:4B:00:10:22:82:77, 0x0E 5966 2020-11-14 16:35:24.850816 0xd596 â~F~R 0x0000 ZigBee 47 Route Record, Dst: 0x0000 5967 2020-11-14 16:35:24.851426 â~F~R IEEE 802.15.4 5 Ack 5968 2020-11-14 16:35:24.856837 0xd596 â~F~R 0x0000 ZigBee 51 Update Device 5969 2020-11-14 16:35:24.857179 â~F~R IEEE 802.15.4 5 Ack 5970 2020-11-14 16:35:24.861240 0xd596 â~F~R 0x0000 ZigBee 47 Route Record, Dst: 0x0000 5971 2020-11-14 16:35:24.861692 â~F~R IEEE 802.15.4 5 Ack 5972 2020-11-14 16:35:24.869705 0xd596 â~F~R 0x0000 ZigBee 68 Update Device ****** The device I was adding performs an association request. 5979 2020-11-14 16:35:26.648403 00:15:8d:00:04:7b:83:69 â~F~R 0xd596 IEEE 802.15.4 21 Association Request, RFD 5980 2020-11-14 16:35:26.649119 â~F~R IEEE 802.15.4 5 Ack 5981 2020-11-14 16:35:27.097013 0xd596 â~F~R Broadcast ZigBee 53 Link Status ****** One of these RF packets (or the next) result in the gateway starting a new statemachine [2020-11-14 17:35:27.134553] [Z_STACK/HNDL] INFO : zstackpb Sending TC Device Ind: nwkAddr:0x3F7C, extAddr:0x00158D00047B8369, parentAddr:0xD596 [2020-11-14 17:35:27.135175] [NWK_MGR/HNDL] MISC1 : Processing ZDO TC Device Ind: 00158D00047B8369 [2020-11-14 17:35:27.135184] [NWK_MGR/HNDL] INFO : NwkMgr AddDevice State Machine Started on 0x00158d00047b8369 [2020-11-14 17:35:27.135191] [NWK_MGR/HNDL] INFO : nwkAddr 3F7C, parent D596 [2020-11-14 17:35:27.135199] [NWK_MGR/HNDL] INFO : AddDevice: No state machines, extending list to 16 5982 2020-11-14 16:35:27.141273 00:15:8d:00:04:7b:83:69 â~F~R 0xd596 IEEE 802.15.4 18 Data Request 5983 2020-11-14 16:35:27.141755 â~F~R IEEE 802.15.4 5 Ack ****** The router responds first (the gateway's MAC has LSBs 0x8277) 5984 2020-11-14 16:35:27.144715 00:12:4b:00:01:dd:7a:d7 â~F~R 00:15:8d:00:04:7b:83:69 IEEE 802.15.4 27 Association Response, PAN: 0xeb67 Addr: 0x3f7c 6000 2020-11-14 16:35:27.849043 0x0000 â~F~R 0xd596 ZigBee 102 Transport Key 6001 2020-11-14 16:35:27.849169 â~F~R IEEE 802.15.4 5 Ack 6002 2020-11-14 16:35:27.963248 0x3f7c â~F~R 0xd596 IEEE 802.15.4 12 Data Request 6003 2020-11-14 16:35:27.963728 â~F~R IEEE 802.15.4 5 Ack 6004 2020-11-14 16:35:27.971736 0xd596 â~F~R 0x3f7c ZigBee 73 Transport Key 6005 2020-11-14 16:35:27.972234 â~F~R IEEE 802.15.4 5 Ack 6006 2020-11-14 16:35:28.038986 0x3f7c â~F~R Broadcast ZigBee ZDP 57 Device Announcement, Nwk Addr: Jennic_00:04:7b:83:69 6007 2020-11-14 16:35:28.039482 â~F~R IEEE 802.15.4 5 Ack ****** The device sends a Report to the coordinator 6011 2020-11-14 16:35:28.084210 0x3f7c â~F~R 0x0000 ZigBee HA 68 ZCL: Report Attributes, Seq: 0 6012 2020-11-14 16:35:28.084335 â~F~R IEEE 802.15.4 5 Ack ****** There's likely an offset of about 0.6 to 1 second with between the sniffer and the PC's time: ****** The gateway requests the IEEE address for 3F7C [2020-11-14 17:35:27.419,690] [GATEWAY/HNDL] PKT_HEX: [ NWK_MGR<<GATEWAY ] [SREQ] 05:00:39:00:08:00:10:FC:7E [2020-11-14 17:35:27.419,702] [GATEWAY/HNDL] PKTTYPE: [ NWK_MGR<<GATEWAY ] SrvrGetIeeeAddressReq [2020-11-14 17:35:27.419,713] [GATEWAY/HNDL] PKTBODY: cmdId = SRVR_GET_IEEE_ADDRESS_REQ [2020-11-14 17:35:27.419,722] [GATEWAY/HNDL] PKTBODY: shortAddress = 0x00003F7C (16252) ****** And gets back 0, whiile the device has announced itself BEFORE sending the attributes! [2020-11-14 17:35:27.419834] [NWK_MGR/LSTN] MISC1 : SRVR_GET_IEEE_ADDRESS_REQ: shortAddr: 3F7C [2020-11-14 17:35:27.419916] [NWK_MGR/LSTN] PKT_HEX: [ NWK_MGR>>GATEWAY ] [ucst] 0D:00:79:01:08:01:10:01:19:00:00:00:00:00:00:00:00 [2020-11-14 17:35:27.419953] [NWK_MGR/LSTN] PKTTYPE: [ NWK_MGR>>GATEWAY ] SrvrGetIeeeAddressCnf [2020-11-14 17:35:27.419977] [NWK_MGR/LSTN] PKTBODY: cmdId = SRVR_GET_IEEE_ADDRESS_CNF [2020-11-14 17:35:27.419990] [NWK_MGR/LSTN] PKTBODY: status = STATUS_FAILURE [2020-11-14 17:35:27.420000] [NWK_MGR/LSTN] PKTBODY: ieeeAddress = 00:00:00:00:00:00:00:00 [2020-11-14 17:35:27.420,277] [GATEWAY/HNDL] MISC1 : Processing Attribute Report Indication [2020-11-14 17:35:27.420,336] [GATEWAY/HNDL] PKT_HEX: [ GATEWAY>>SMPLAPP] [bcst] 35:00:53:1A:08:1A:10:00:1A:0F:08:00:11:00:00:00:00:00:00:00:00:28:01:30:01:20:00:2A:13:08:05:10:42:1A:0D:0C:6C:75:6D:69:2E:77:65:61:74:68:65:72:2A:07:08:01:10:20:1A:01:05 [2020-11-14 17:35:27.420,354] [GATEWAY/HNDL] PKTTYPE: [ GATEWAY>>SMPLAPP] GwAttributeReportingInd [2020-11-14 17:35:27.420,369] [GATEWAY/HNDL] PKTBODY: cmdId = GW_ATTRIBUTE_REPORTING_IND [2020-11-14 17:35:27.420,378] [GATEWAY/HNDL] PKTBODY: status = STATUS_SUCCESS [2020-11-14 17:35:27.420,392] [GATEWAY/HNDL] PKTBODY: srcAddress : [2020-11-14 17:35:27.420,408] [GATEWAY/HNDL] PKTBODY: addressType = UNICAST ****** The IEEE adress reported for this data is 00. [2020-11-14 17:35:27.420,422] [GATEWAY/HNDL] PKTBODY: ieeeAddr = 00:00:00:00:00:00:00:00 [2020-11-14 17:35:27.420,437] [GATEWAY/HNDL] PKTBODY: endpointId = 0x00000001 (1) [2020-11-14 17:35:27.420,461] [GATEWAY/HNDL] PKTBODY: gwendpointid = 0x00000001 (1) [2020-11-14 17:35:27.420,474] [GATEWAY/HNDL] PKTBODY: clusterId = 0x00000000 (0) [2020-11-14 17:35:27.420,483] [GATEWAY/HNDL] PKTBODY: attributeRecordList : [2020-11-14 17:35:27.420,491] [GATEWAY/HNDL] PKTBODY: [000] : [2020-11-14 17:35:27.420,499] [GATEWAY/HNDL] PKTBODY: attributeId = 0x00000005 (5) [2020-11-14 17:35:27.420,508] [GATEWAY/HNDL] PKTBODY: attributeType = <NOT_FOUND> [2020-11-14 17:35:27.420,524] [GATEWAY/HNDL] PKTBODY: attributeValue (hex string) = 0C:6C:75:6D:69:2E:77:65:61:74:68:65:72 [2020-11-14 17:35:27.420,532] [GATEWAY/HNDL] PKTBODY: [001] : [2020-11-14 17:35:27.420,540] [GATEWAY/HNDL] PKTBODY: attributeId = 0x00000001 (1) [2020-11-14 17:35:27.420,555] [GATEWAY/HNDL] PKTBODY: attributeType = ZCL_DATATYPE_UINT8 [2020-11-14 17:35:27.420,565] [GATEWAY/HNDL] PKTBODY: attributeValue (hex string) = 05 6026 2020-11-14 16:35:31.314915 0x0000 â~F~R 0xd596 ZigBee ZDP 50 Extended Address Request, Nwk Addr: 0xd596 6027 2020-11-14 16:35:31.315365 â~F~R IEEE 802.15.4 5 Ack 6028 2020-11-14 16:35:31.332029 0xd596 â~F~R 0x0000 ZigBee 47 Route Record, Dst: 0x0000 6029 2020-11-14 16:35:31.332505 â~F~R IEEE 802.15.4 5 Ack 6030 2020-11-14 16:35:31.339265 0xd596 â~F~R 0x0000 ZigBee ZDP 57 Extended Address Response, Status: Success, Nwk Addr: 0xd596 = TexasIns_00:01:dd:7a:d7 6031 2020-11-14 16:35:31.339329 â~F~R IEEE 802.15.4 5 Ack
The setup for the debug above is:
- NPI server running on the embedded platform with AM335x and CC2530;
- All other servers running on a Ubuntu 16.04 VM, "manually started";
All servers, except the NWKMGR, built for x86 using the provided scripts;
The NWK is built under Qt, without Qt functionnality, to enable easier debugging.
Messages like:
[2020-11-14 17:35:27.135212] [NWK_MGR/HNDL] DEBUG : Lock PSTATE 0 (zNwkSrv_AD_GetStateMachineAndLock) [2020-11-14 17:35:27.135221] [NWK_MGR/HNDL] DEBUG : Unlock PSTATE 0 (zNwkSrv_AddDevice)
correspond to the locking and unlocking of a state. Lock/Unlocks in the timer loop on unexpired states are not shown.
Usually the function that locks the machine is called from zNwkSrv_AD_GetStateMachineAndLock, and the unlock shows the function that performed the unlock (and that normally also requested the lock).
So the lock above corresponds to the zNwkSrv_AddDevice requesting a statemachine for new device management.
The zip file holds several logs as usual.