This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Use ZTool + Z-Stack 3.0 ZNP to set up a basic Zigbee 3.0 network

Other Parts Discussed in Thread: Z-STACK, CC2531EMK

首先感谢YK Chen的分享,这个帖子主要讲述的是使用Z-Stack3.0去建立一个ZigBee3.0的网络。

Use ZTool + Z-Stack 3.0 ZNP to set up a basic Zigbee 3.0 network

The following steps show you how to use ZTool + Z-Stack 3.0 ZNP to set up Zigbee 3.0 network:

1. You have to prepare two CC253x EVBs (CC2530DK, CC2531EMK, or CC2538EM) and run Z-Stack ZNP 3.0 FW on it.

2. You can run the following MT commands (TX in red) to setup Zigbee 3.0 coordinator.

10:36:58.53 COM1 SYS_OSAL_NV_WRITE (0x2109) --> Write startup option to clear NV when reset
    Id: 0x0003
    Offset: 0x00
    Len: 0x01
    Value: . (0x03)

10:36:58.55 COM1 SYS_OSAL_NV_WRITE_SRSP (0x6109)
    Status: SUCCESS (0x0)

10:37:06.11 COM1 SYS_RESET (0x4100) --> Do reset to clear NV
    Type: 0x00 (HARD RESET) (0x0)

10:37:08.18 COM1 SYS_RESET_RESPONSE (0x4180)
    Reason: 0x02
    TransportRev: 0x02
    Product: 0x00
    MajorRel: 0x02
    MinorRel: 0x07
    HwRev: 0x00

10:37:42.94 COM1 SYS_OSAL_NV_WRITE (0x2109) --> Write ZCD_NV_LOGICAL_TYPE to 0 which means coordinator
    Id: 0x0087
    Offset: 0x00
    Len: 0x01
    Value: . (0x00)

10:37:42.97 COM1 SYS_OSAL_NV_WRITE_SRSP (0x6109)
    Status: SUCCESS (0x0)


10:38:32.55 COM1 APP_CNF_BDB_SET_CHANNEL (0x2F08) --> Set Primary channel mask to channel 13 only
    isPrimary: TRUE (0x1)
    Channel: CHNL_0x00002000 (0x2000)

10:38:32.55 COM1 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
    Status: SUCCESS (0x0)

10:38:34.43 COM1 APP_CNF_BDB_SET_CHANNEL (0x2F08) --> Set Secondary channel to 0x0 to disable secondary channel mask
    isPrimary: FALSE (0x0)
    Channel: NONE (0x0)

10:49:01.44 COM1 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
    Status: SUCCESS (0x0)

10:38:45.58 COM1 APP_CNF_BDB_START_COMMISSIONING (0x2F05) --> Start commissioning using network formation as parameter to start coordinator
    CommissioningMode: (0x04) Network Formation (0x4)

10:38:47.35 COM1 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
    Status: SUCCESS (0x0)

10:38:47.35 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:47.36 COM1 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
    Status: 1 (0x1)
    Commissioning Mode: 0x02 (Formation) (0x2)
    Commissioning Mode: 254 (0xFE)

10:38:47.62 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:47.88 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:48.15 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:48.41 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:48.68 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:48.94 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 8 (0x8)

10:38:49.49 COM1 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 9 (0x9)

10:38:49.49 COM1 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
    Status: 0x00 (Success) (0x0)
    Commissioning Mode: 0x02 (Formation) (0x2)
    Commissioning Mode: 69 (0x45)

10:39:11.49 COM1 UTIL_GET_DEVICE_INFO (0x2700) --> Get device info to confirm coordinator is setup correctly

10:39:11.5 COM1 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B0001025822
    ShortAddress: 0x0000
    DeviceType: COORDINATOR, ROUTER, END_DEVICE (0x7)
    DeviceState: DEV_ZB_COORD (0x9)
    NumAssocDevices: 0x00
    AssocDevicesList

10:39:26.7 COM1 SYS_OSAL_NV_WRITE (0x2109) --> Write ZCD_NV_ZDO_DIRECT_CB to 1 to receive ZDO related messages
    Id: 0x008F
    Offset: 0x00
    Len: 0x01
    Value: . (0x01)

10:39:26.71 COM1 SYS_OSAL_NV_WRITE_SRSP (0x6109)
    Status: SUCCESS (0x0) 

10:44:16.54 COM1 APP_CNF_BDB_START_COMMISSIONING (0x2F05) --> Start commissioning using network steering as parameter to be ready for device to join
    CommissioningMode: (0x02) Network Steering (0x2)

10:44:16.55 COM1 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
    Status: SUCCESS (0x0)

10:44:16.56 COM1 ZDO_MGMT_PERMIT_JOIN_RSP (0x45B6)
    SrcAddr: 0x0000
    Status: ZDP_SUCCESS (0x0)

10:44:16.57 COM1 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
    Status: 0x00 (Success) (0x0)
    Commissioning Mode: 0x01 (Network Steering) (0x1)
    Commissioning Mode: 67 (0x43)

3. You can run the following MT commands to setup Zigbee 3.0 router.

10:43:43.75 COM99 SYS_OSAL_NV_WRITE (0x2109) --> Write ZCD_NV_LOGICAL_TYPE to 1 which means router
    Id: 0x0087
    Offset: 0x00
    Len: 0x01
    Value: . (0x01)

10:43:59.35 COM1 APP_CNF_BDB_SET_CHANNEL (0x2F08) --> Set Primary channel mask to channel 13 only
    isPrimary: TRUE (0x1)
    Channel: CHNL_0x00002000 (0x2000)
10:43:59.35 COM1 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
    Status: SUCCESS (0x0)

10:44:11.43 COM1 APP_CNF_BDB_SET_CHANNEL (0x2F08) --> Set Secondary channel to 0x0 to disable secondary channel mask
    isPrimary: FALSE (0x0)
    Channel: NONE (0x0)
10:44:11.45 COM1 APP_CNF_BDB_SET_CHANNEL_SRSP (0x6F08)
    Status: SUCCESS (0x0)

10:44:26.46 COM99 APP_CNF_BDB_START_COMMISSIONING (0x2F05) --> Start commissioning using network steering as parameter to make device to start scan Zigbee network to join
    CommissioningMode: (0x02) Network Steering (0x2)

10:44:26.46 COM99 APP_CNF_BDB_START_COMMISSIONING_SRSP (0x6F05)
    Status: SUCCESS (0x0)

10:44:26.56 COM99 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
    Status: 1 (0x1)
    Commissioning Mode: 0x01 (Network Steering) (0x1)
    Commissioning Mode: 0 (0x0)

10:44:26.8 COM99 ZDO_STATE_CHANGE_IND (0x45C0)
    State: INVALID_PARAMETER (0x2)

10:44:27.11 COM99 ZDO_STATE_CHANGE_IND (0x45C0)
    State: INVALID_PARAMETER (0x2)

10:44:27.37 COM99 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 3 (0x3)

10:44:27.88 COM99 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 5 (0x5)

10:44:28.24 COM99 ZDO_STATE_CHANGE_IND (0x45C0)
    State: 7 (0x7)

10:44:28.9 COM99 APP_CNF_BDB_COMMISSIONING_NOTIFICATION (0x4F80)
    Status: 0x00 (Success) (0x0) --> Router joins coordinator successfully
    Commissioning Mode: 0x01 (Network Steering) (0x1)
    Commissioning Mode: 0 (0x0)

11:03:22.81 COM99 UTIL_GET_DEVICE_INFO (0x2700)--> Get device info to confirm router is setup correctly

11:03:22.81 COM99 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B0000E50127
    ShortAddress: 0x4EE6
    DeviceType: COORDINATOR, ROUTER, END_DEVICE (0x7)
    DeviceState: DEV_ROUTER (0x7)
    NumAssocDevices: 0x00
    AssocDevicesList
 
4. On Ztool of coordinator, you should see ZDO_END_DEVICE_ANNCE_IND pops when router joins coordinator.

10:44:28.84 COM1 ZDO_END_DEVICE_ANNCE_IND (0x45C1)
    SrcAddr: 0x4EE6
    NwkAddr: 0x4EE6
    IEEEAddr: 0x00124B0000E50127
    Capabilities: 0x8E
转自:sunmaysky.blogspot.com/.../use-ztool-z-stack-30-znp-to-set-up.html