当前位置: 代码迷 >> 综合 >> Zigbee Commissioning
  详细解决方案

Zigbee Commissioning

热度:98   发布时间:2023-09-14 19:11:15.0

本文原地址: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。

        Zigbee Commissioning

   图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章节。

   Zigbee Commissioning

图2  initiator find and binding流程

Zigbee Commissioning

图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。
Zigbee Commissioning

                                                                                    图4 top level 流程

3.2 Network steering

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

                                             Zigbee Commissioning

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

Zigbee Commissioning

                                                                图6  未入网steering流程

3.3 network formation

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

     Zigbee Commissioning

图7  创建网络流程

3.4 finding & binding

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

3.4.1 initiator

          initiator流程如图8.

Zigbee Commissioning

                                                                       图8 finding & binding initiator 流程

3.4.2 target 流程

        target 端点流程如图9.

            Zigbee Commissioning

                                                                   图9 finding & binding target流程

3.5 touchlink

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

3.5.1 touchlink initiator

Zigbee Commissioning

                                                                        图10 touchlink initiator流程

3.5.2 touchlink target

Zigbee Commissioning
                                                                        图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