Zigbee Commissioning

Original address of this article: https://blog.csdn.net/jason_lm/article/details/80886617

1 Overview

       People who are engaged in the development of zigbee equipment should be familiar with the word commission, which can be translated as "servicing". It probably means the right thing, but it's not clear. It is defined in the HA specification document as:

to put a device in an operational state 
          It means that the device becomes operable state (behavior). This is clear now, that is, some behavioral norms for making the device from a certain state to a user-usable state. These behaviors can be roughly divided into two stages: one is to create a network or join a network, and the other is to find a match and bind.

        This article will introduce the commissioning specifications in HA and zigbee3.0. The specifications in HA are relatively simple and easy for readers to understand. zigbee3.0 is integrated and compatible with different specifications of different application profiles (HA, ZLL, SE, etc.), such as touchlink, ez-mode. And it supports more flexible commissioning collocation, so the commissioning specification in zigbee3.0 is more complicated, but, most of them will be implemented in the protocol stack, and there is no need to implement it by yourself.

2. Commissioning in HA

        There are two commissioning modes in HA, ez-mode and Centralized commissioning.

2.1 non-mode

        ez-mode includes two processes: network steering and finding and binding. In the network steering process, the device must complete the network access and allow other devices to access the network. The execution process is shown in Figure 1.

        

   Figure 1 Network steering process of ez-mode

        In the finding and binding process, it is completed to find the endpoints in the ez-mode state in the network, and confirm whether the cluster matches with these endpoints, and then bind. In this process, the endpoint that is actively searched is called the initiator, and the endpoint being searched is called the target. The execution flow is shown in Figure 2 and Figure 3. Normally, the controller belongs to the initiator, and the corresponding controlled endpoint is the target. For example, the Doorlock controler belongs to the initiator, and the Doorlock belongs to the target. For details, please refer to [1] : ez-mode commissioning chapter.

   

Figure 2 Initiator find and binding process


Figure 3 Target find and binding process

2.2 Centralized commissioning

        Refers to the configuration of a device through a gateway or other devices that have the ability to configure the device, usually manual configuration.

3 commissioning in zigbee3.0

      The most important content in zigbee3.0 is the addition of bdb (Base-Device-Behavior-Specification), which describes the device environment variables, commissioning, network reset, security, reports, etc. In order to be compatible with the commissioning specifications of different application profiles (HA, ZLL, SE, etc.), many attributes are added to bdb to control and indicate the status and results of the commissioning. The attributes related to the commissioning are shown in Table 1, and the values ​​of the commissioningStatus attribute are shown in Table 2.
         The commissioning in zigbee3.0 has the following four methods: Network steering, Network formation, Finding & binding and Touchlink. Network steering is necessary for all nodes, Touchlink is optional for all nodes, and the remaining two are necessary for specific devices. zigbee3.0 introduces the top level commissioning process for the management of the four supported methods.
        
Table 1-attributes related to commissioning in bdb    
Attribute
Data type
Range
Default value
Used by
bdbCommissioningGroupID
Unsigned 16-bit
0x0001 – 0xffff
0xffff
Initiator nodes,
per endpoint
bdbCommissioningMode
8-bit bitmap
0b0000 xxxx
0b0000 0000
All nodes,
per endpoint
bdbCommissioningStatus
Enumeration
See table 2
SUCCESS
All nodes,
per endpoint
bdbNodeCommissioning-Capability
8-bit bitmap
0b0000 xxx1
0b0000 0001
All nodes
bdbNodeIsOnANetwork
Boolean
TRUE or FALSE
FALSE
All nodes
bdbPrimaryChannelSet
32-bit
bitmap
0x00000800 –
0x07fff800
0x02108800
All nodes
bdbSecondaryChannelSet
32-bit
bitmap
0x00000800 –
0x07fff800
0x07fff800 XOR
bdbPrimary-
ChannelSet
All nodes
Table 2-bdbCommissioningStatus attribute values
value
description
SUCCESS
The commissioning sub-procedure was successful.
The sub-process is executed successfully
IN_PROGRESS
One of the commissioning sub-procedures has
started but is not yet complete.
A certain sub-process is in execution
NOT_AA_CAPABLE
The initiator is not address assignment capable
during touchlink.
The initiator does not have the ability to allocate addresses during touchlink
NO_NETWORK
A network has not been found during network
steering or touchlink.
No network found during network steering or touchlink
TARGET_FAILURE
A node has not joined a network when requested
during touchlink.
FORMATION_FAILURE
A network could not be formed during network
formation.
Failed to create network
NO_IDENTIFY_QUERY_-
RESPONSE
No response to an identify query command has been
received during finding & binding.
finding & binding期间没有收到identify query command响应
BINDING_TABLE_FULL
A binding table entry could not be created due to
insufficient space in the binding table during finding
& binding.
finding & binding期间由于绑定表满失败
NO_SCAN_RESPONSE
No response to a scan request inter-PAN command
has been received during touchlink.
NOT_PERMITTED
A touchlink (steal) attempt was made when a node
is already connected to a centralized security
network.
TCLK_EX_FAILURE
The Trust Center link key exchange procedure has
failed attempting to join a centralized security
network.
        

3.1 Top level

        The upper-level process of commissioning is determined according to the environment variables, which is used to coordinate the commissioning methods supported by the device, as shown in Figure 4.
   

                                                                                    Figure 4 top level process

3.2 Network steering

        This process is divided into the call in the case of network access and the call in the case of non-network access, and the processes are shown in Figure 5 and Figure 6, respectively.

                                             

                                                        Figure 5 The steering process in the case of network access


                                                                Figure 6 Non-networked steering process

3.3 network formation

       The way to create a network, the coordinator needs to support, the process is shown in Figure 7.

     

                                                                               Figure 7 Create network process

3.4 finding & binding

        This process divides the initiator endpoint and target endpoint of the intiator, and uses the attributes in the identify cluster. Non-zero means that the device is in the finding & binding mode.

3.4.1 initiator

          The initiator flow is shown in Figure 8.


                                                                       Figure 8 Process of finding & binding initiator

3.4.2 Target process

        The target endpoint process is shown in Figure 9.

            

                                                                   图9 finding & binding target流程

3.5 touchlink

        touchlink本来为ZLL专属,特点像其名称一样:接触式连接。支持在initiator端点与target端点靠近时相互连接,并绑定,这个连接是双向的,即双方都可能为对方父节点。

3.5.1 touchlink initiator


                                                                        图10 touchlink initiator流程

3.5.2 touchlink target


                                                                        图11 touchlink target流程

参考文档

[1]. 《ZigBee Home Automation Public Application Profile, v1.2》zigbee alliance

[2]. 《ZigBee Base Device Behavior Specification, v1.0》zigbee alliance


转载请注明出处:https://blog.csdn.net/jason_lm/article/details/80886617

1. 概述

       从事zigbee设备开发的人对commission这个词应该不陌生,可译为"使服役",大概意思对了,但是不太明朗。在HA的规范文档中将其定义为:

to put a device in an operational state 
          意思是 使设备变成可操作状态(的行为) 。这下清晰了,就是让设备从某个状态变成用户可使用状态的一些行为规范,这些行为大致可分为两阶段:一是创建网络或者加入网络,二是查找匹配和绑定。

        本文将介绍在HA与zigbee3.0中的commissioning规范,HA中的规范较为简单,便于读者理解。zigbee3.0整合兼容了不同application profile(HA、ZLL、SE等)的不同规范,如touchlink、ez-mode。并且支持更加灵活的commissioning搭配,因此zigbee3.0中的commissioning规范更加复杂,但是咯,协议栈中都会实现大部分的,无需完全自己实现。

2. HA中的commissioning

        HA中包含两种commissioning方式,ez-mode和Centralized commissioning。

2.1 ez-mode

        ez-mode包含network steering和finding and binding两个流程。network steering流程中设备要完成入网和允许其他设备入网的操作,执行流程如图1。

        

   图1 ez-mode的network steering流程

        finding and binding流程中完成查找网络中处于ez-mode状态的端点,并与这些端点的确认cluster是否匹配,是则进行绑定。这个过程中主动查找的端点称为initiator,被查找端点称为target,其执行流程分别见图2、图3。通常情况下,控制器属于initiator,对应被控制端点为target,如Doorlock controler属于initiator,Doorlock属于target,详见[1]:ez-mode commissioning章节。

   

图2  initiator find and binding流程


图3  target find and binding流程

2.2 Centralized commissioning

        指通过网关或其他具有对设备进行配置能力的设备对设备进行配置,通常是人为配置。

3 zigbee3.0中的commissioning

      zigbee3.0中最重要的内容就是增加了bdb(Base-Device-Behavior-Specification),描述了设备环境变量、commissioning、网络重置、安全、报告等内容。为了兼容不同application proflle(HA、ZLL、SE等)的commissioning规范,bdb中新增很多属性用于控制和表示commissioning的状态和结果,与commissioning相关属性如 表1,commissioningStatus属性的值见 表2。
         zigbee3.0中的commissioning有以下Network steering、Network formation、Finding & binding 和 Touchlink四种方式。Network steering对所有节点都是必须的,Touchlink对所有节点都是可选的,剩余两者对于特定设备是必须的。 zigbee3.0引入top level commissioning流程用于所支持四种方式的管理。
        
表1 – bdb中与commissioning相关的属性    
Attribute
Data type
Range
Default value
Used by
bdbCommissioningGroupID
Unsigned 16-bit
0x0001 – 0xffff
0xffff
Initiator nodes,
per endpoint
bdbCommissioningMode
8-bit bitmap
0b0000 xxxx
0b0000 0000
All nodes,
per endpoint
bdbCommissioningStatus
Enumeration
见 表2
SUCCESS
All nodes,
per endpoint
bdbNodeCommissioning-Capability
8-bit bitmap
0b0000 xxx1
0b0000 0001
All nodes
bdbNodeIsOnANetwork
Boolean
TRUE or FALSE
FALSE
All nodes
bdbPrimaryChannelSet
32-bit
bitmap
0x00000800 –
0x07fff800
0x02108800
All nodes
bdbSecondaryChannelSet
32-bit
bitmap
0x00000800 –
0x07fff800
0x07fff800 XOR
bdbPrimary-
ChannelSet
All nodes
表2 - bdbCommissioningStatus 属性值
描述
SUCCESS
The commissioning sub-procedure was successful.
子流程执行成功
IN_PROGRESS
One of the commissioning sub-procedures has
started but is not yet complete.
某个子流程在执行中
NOT_AA_CAPABLE
The initiator is not address assignment capable
during touchlink.
touchlink期间发起者不具备地址分配能力
NO_NETWORK
A network has not been found during network
steering or touchlink.
network steering or touchlink期间没发现网络
TARGET_FAILURE
A node has not joined a network when requested
during touchlink.
FORMATION_FAILURE
A network could not be formed during network
formation.
创建网络失败
NO_IDENTIFY_QUERY_-
RESPONSE
No response to an identify query command has been
received during finding & binding.
finding & binding期间没有收到identify query command响应
BINDING_TABLE_FULL
A binding table entry could not be created due to
insufficient space in the binding table during finding
& binding.
finding & binding期间由于绑定表满失败
NO_SCAN_RESPONSE
No response to a scan request inter-PAN command
has been received during touchlink.
NOT_PERMITTED
A touchlink (steal) attempt was made when a node
is already connected to a centralized security
network.
TCLK_EX_FAILURE
The Trust Center link key exchange procedure has
failed attempting to join a centralized security
network.
        

3.1 Top level

        根据环境变量确定commissioning的上层流程,用于协调设备支持的commissioning方式,如图4。
   

                                                                                    图4 top level 流程

3.2 Network steering

        该过程分入网络情况下调用与非入网情况下调用,流程分别如图5与图6。

                                             

                                                        图5 已入网情况下的steering流程


                                                                图6  未入网steering流程

3.3 network formation

       创建网络的方式,协调器需要支持,流程如图7。

     

                                                                               图7  创建网络流程

3.4 finding & binding

        该过程分intiator发起者端点与target目标端点,并使用到identify cluster中的属性,非0表示设备正处于finding & binding模式下。

3.4.1 initiator

          initiator流程如图8.


                                                                       图8 finding & binding initiator 流程

3.4.2 target 流程

        target 端点流程如图9.

            

                                                                   图9 finding & binding target流程

3.5 touchlink

        touchlink本来为ZLL专属,特点像其名称一样:接触式连接。支持在initiator端点与target端点靠近时相互连接,并绑定,这个连接是双向的,即双方都可能为对方父节点。

3.5.1 touchlink initiator


                                                                        图10 touchlink initiator流程

3.5.2 touchlink target


                                                                        图11 touchlink target流程

参考文档

[1]. 《ZigBee Home Automation Public Application Profile, v1.2》zigbee alliance

[2]. 《ZigBee Base Device Behavior Specification, v1.0》zigbee alliance


转载请注明出处:https://blog.csdn.net/jason_lm/article/details/80886617

Guess you like

Origin blog.csdn.net/qq_27575841/article/details/115290413