【ember zigbee】第二章:ug103-02-fundamentals-zigbee 学习笔记(上)

写在前面

1、Introduction

    Zigbee refers both to:

  • An open standard for reliable, cost-effective, low power, wireless device-to-device communication.
  • An alliance of over 400 companies who together are defining and using the standard to communicate in a variety of applications such as smart energy and commercial building automation.

    The ZigBee Alliance is led by a set of promoter member companies that make up the board of directors. Silicon Labs is one of the companies on the board of directors. Zigbee also has a large number of participant and adopter members that work within the technical and marketing workgroups to create and maintain the standards. The Alliance activities are accomplished through workgroups dedicated to specific areas of the technology. These include a network group, a security group, an application profile group, and several others. All Zigbee documents are available on the Zigbee website www.zigbee.org. Zigbee Alliance membership is required to access current specification documents. To use the Zigbee technology within a product, companies are required to become members of the Alliance.

    Silicon Labs is active in a variety of areas within the Alliance and with helping customers adopt Zigbee technology through its Ember® Zigbee solutions. The Ember Zigbee platform has been a Golden Unit for testing and certification for all new revisions of the standard to date. Ember Corporation, which was acquired by Silicon Labs in July 2012, was a founding member of the Zigbee Alliance.

  • 主要谈及zigbee联盟致力于制定和维护zigbee标准,所有Zigbee文档都可以在Zigbee网站www.zigbee.org上找到。其中Ember作为zigbee董事会成员,Zigbee联盟的创始成员之一,参与到上述的工作中去,Ember公司于2012年7月被Silicon Labs收购。
1.1、zigbee联盟的三个主要项目
  1. Zigbee networking – The basic levels of network interaction, including acceptable RF behavior, methods of creating and joining the network, discovering routes, and using routes to transmit traffic over the network. The Zigbee Alliance offers other networking specifications such as RF4CE and GreenPower, but the focus of this document is Zigbee PRO.
  2. Zigbee application layer – Describe a set of messages and network settings for a Zigbee application. All devices adhering to these settings may interoperate. Before Zigbee 3.0, individual application profiles, either public or private, had their own certification program.
    With Zigbee 3.0, one common application layer certification program applies to every Zigbee product. The following figure displays some of the original separate Zigbee application profiles
  3. Certification – Zigbee applications are certified by the Alliance to indicate to end users that the device(s) are compliant. Applications using private profiles receive certification that they are using a properly operating Zigbee stack and will not adversely affect other Zigbee networks during operation. For more information, see section 7. Zigbee Compliance.
  • Zigbee网络 : 网络层的交互,包括接受信号,创建和加入网络的方法,发现路由以及使用路由通过网络传输流量。
    Zigbee联盟提供其他网络规范,如RF4CE和GreenPower,但本文档的重点是Zigbee PRO
  • Zigbee应用程序层 描述Zigbee应用程序的msg格式和网络设置。遵守这些设置的zigbee设备都可以相互通信和控制。在Zigbee 3.0之前,个人申请资料(公共或私人)都有自己的认证计划。
    使用Zigbee 3.0,一个通用的应用层认证计划适用于每个Zigbee产品。下图显示了一些原始的独立Zigbee profile,例如:Home automation、smart energy等相关的profile。
  • 认证 Zigbee应用程序经联盟认证,向最终用户表明设备符合要求。使用私有配置文件的应用程序会获得使用正确运行的Zigbee堆栈的认证,并且在运行期间不会对其他Zigbee网络产生负面影响。有关更多信息,请参阅7. Zigbee合规性一节。
    在这里插入图片描述

    Because Zigbee is committed to open and interoperable devices, standards have been either adopted where they existed, or developed, from the physical layer through the application layer, as shown in the following figure. At the physical and MAC (medium access control) layer, Zigbee adopted the IEEE 802.15.4 standard. The networking, security and application layers have all been developed by the Zigbee Alliance. An ecosystem of supporting systems such as gateways and commissioning tools has also been developed to simplify the development and deployment of Zigbee networks.

  • 由于Zigbee致力于开放和可互操作的设备,因此从物理层到应用层存在或开发的标准都已采用,如下图所示。 在物理和MAC(媒体访问控制)层,Zigbee采用IEEE 802.15.4标准。 网络,安全和应用层都是由Zigbee联盟开发的。 还开发了一个支持系统(如网关和调试工具)的生态系统,以简化Zigbee网络的开发和部署。
  • Silicon Labs将继续致力于支持这些标准的扩展和增加。
    在这里插入图片描述
1.2、zigbee的特性

        Zigbee is intended as a cost-effective and low power solution. It is targeted to several markets including home automation, building automation, sensor networks, smart energy, and personal health care monitoring. The general characteristics for a Zigbee network are as follows:

  • Low power – Devices can typically operate for several years on AA type batteries using suitable duty cycles. With extremely careful design and special battery technologies, some Zigbee devices such as gas meters can achieve 20 years of battery life.
  • Low data rate – The 2.4 GHz band supports a radio data rate of 250 kbps. Actual sustainable traffic through the network is lower than this theoretical radio capacity. As such, Zigbee is better used for sampling and monitoring applications or basic control applications. See AN1138: Zigbee Mesh Network Performance and AN1142: Mesh Network Performance Comparison
  • Small and large networks – Zigbee networks vary from several devices to thousands of devices communicating seamlessly. The networking layer is designed with several different data transfer mechanisms (types of routing) to optimize the network operation based on the expected use.
  • Range – Typical devices provide sufficient range to cover a normal home. Readily available designs with power amplifiers extend the range substantially. A distributed spread spectrum is used at the physical layer to be more immune to interference.
  • Simple network installation, start up and operation – The Zigbee standard supports several network topologies. The simple protocols for forming and joining networks allow systems to self-configure and fix routing problems as they occur.
  • Zigbee旨在成为一种经济高效的低功耗解决方案。它面向多个市场,包括家庭自动化,楼宇自动化,传感器网络,智能能源和个人医疗保健监控。 Zigbee网络的一般特征如下:
    • 低功耗 - 使用合适的工作周期,设备通常可以在AA型电池上运行数年。通过极其谨慎的设计和特殊的电池技术,一些Zigbee设备(如燃气表)可以实现20年的电池寿命。
    • 低数据速率 - 2.4 GHz频段支持250 kbps的无线电数据速率。通过网络的实际可持续流量低于理论无线电容量。因此,Zigbee更适用于采样和监控应用或基本控制应用。参见AN1138:Zigbee Mesh网络性能和AN1142:网状网络性能比较
    • 小型和大型网络 - Zigbee网络从多个设备到数千个无缝通信的设备不等。网络层设计有多种不同的数据传输机制(路由类型),以根据预期用途优化网络操作。
    • 范围 - 典型设备提供足够的范围来覆盖普通家庭。随时可用的功率放大器设计大大扩展了范围。在物理层使用分布式扩频,以更好地抵抗干扰。
    • 简单的网络安装,启动和操作 - Zigbee标准支持多种网络拓扑。用于形成和加入网络的简单协议允许系统在发生路由问题时自行配置和修复路由问题。
1.3、802.15.4

  Zigbee networks are based on the IEEE 802.15.4 MAC and physical layer. The 802.15.4 standard operates at 250 kbps in the 2.4 GHz band and 40 kbps/20 kbps in the 900/868 MHz bands. A number of chip companies provide solutions in the 2.4 GHz band with a smaller number supporting the 900/868 MHz band. Zigbee PRO uses 802.15.4-2003.
  The 802.15.4 MAC layer is used for basic message handling and congestion control. This MAC layer includes mechanisms for forming and joining a network, a CSMA mechanism for devices to listen for a clear channel, as well as a link layer to handle retries and acknowledgment of messages for reliable communications between adjacent devices. The Zigbee network layer builds on these underlying mechanisms to provide reliable end-to-end communications in the network.
  The 802.15.4 standard is available from www.ieee.org. The 802.15.4 standard provides some options within the MAC layer hat are not used by Zigbee in any current stack profiles. An example of such an unused feature is guaranteed time slots (GTS), which would be employed by a network to synchronize radio activity across devices. As such, these items are not normally include in the Zigbee software stack to save code space.

  • Zigbee网络层是基于IEEE 802.15.4 MAC和物理层。 802.15.4标准在2.4 GHz频段以250 kbps运行,在900/868 MHz频段以40 kbps / 20 kbps运行。许多芯片公司提供2.4 GHz频段的解决方案,其中较小的数字支持900/868 MHz频段。 Zigbee PRO使用802.15.4-2003。
  • 802.15.4 MAC层用于基本消息处理和拥塞控制。该MAC层包括用于形成和加入网络的机制,用于监听空闲信道的设备的CSMA机制,以及用于处理重试和用于相邻设备之间的可靠通信的消息确认的链路层。 Zigbee网络层建立在这些底层机制的基础上,得以在网络中提供可靠的端到端通信。
  • 802.15.4标准可从www.ieee.org获得。 802.15.4标准提供了MAC层中的一些选项,Zigbee在任何当前堆栈配置文件中都不使用这些选项。这种未使用的特征的一个例子是保证时隙(GTS),它将被网络用来跨设备同步无线电活动。因此,这些项目通常不包括在Zigbee软件堆栈中以节省代码空间。
1.4、 Hardware and Software Elements

  A Zigbee solution requires implementation of a Zigbee radio and associated microprocessor (together in a single chip or separately), and implementation of an application on top of a Zigbee stack. EmberZNet PRO is the Silicon Labs implementation of the Zigbee PRO stack.
  Typically a developer can purchase a Zigbee radio and software as a bundled package, although some third party software stacks have been developed. In general, the hardware and software provider includes reference designs for the hardware and sample applications for the software. Based on these, hardware developers can customize the hardware to their specific needs. Alternatively, a number of module providers can deliver compact and low cost custom modules.
  Because of the embedded nature of typical Zigbee applications, software application development is typically interrelated with the hardware design to provide an optimal solution. Silicon Labs provides both a standard networking API based on the Zigbee specification and an application framework, which gives customers a way to rapidly develop their applications based on Zigbee application profiles and the Zigbee cluster library (ZCL), as described below. Alternatively, a number of third party software development firms specialize in developing Zigbee applications and can assist in new product development.

  • Zigbee解决方案需要实现Zigbee无线传输和相关的微处理控制器(在一个芯片中或单独一起),以及在Zigbee堆栈顶部实现应用程序。 EmberZNet PRO是Silicon Labs实现的基于Zigbee PRO堆栈的协议栈。
  • 通常,开发人员可以购买ZigbeeZigbee无线传输模块和软件作为捆绑包,尽管已经开发了一些第三方软件堆栈。通常,硬件和软件提供商包括用于软件的硬件和样本应用的参考设计。基于这些,硬件开发人员可以根据自己的特定需求定制硬件。或者,许多模块提供商可以提供紧凑且低成本的定制模块。
  • 由于典型Zigbee应用程序的嵌入特性,软件应用程序开发通常与硬件设计相互关联,以提供最佳解决方案。 Silicon Labs提供基于Zigbee规范的标准网络API和应用程序框架,为客户提供基于Zigbee应用程序配置文件和Zigbee集群库(ZCL)快速开发应用程序的方法,如下所述。或者,许多第三方软件开发公司专门开发Zigbee应用程序,并可以协助新产品开发。
1.4.1 关于zigbee的应用框架(AF层)

  Any application may be built from scratch, but this is a slow and sometimes tedious process. The alternative is to take working code and modify it to meet the requirements of your application. Adapting a working design is an easier and more efficient approach to building an application, especially your first application using a new technology. To assist with this, Silicon Labs supplies not only example application code but also one or more application frameworks as part of their development platforms. Application frameworks contain a body of Silicon Labs-supplied code stored in libraries and plugins Silicon Labs also provides Simplicity Studio, which includes an Integrated Development Environment (IDE) based on Application Builder (AppBuilder). AppBuilder is an interactive GUI tool that allows you to configure the libraries and plugins contains in the application framework to implement devices, such as a ZigBee Smart Energy meter, within an application profile.

  • 任何应用程序都可以从头开始构建,但这是一个缓慢且有时乏味的过程。 为了解决这个问题,Silicon Labs不仅提供示例应用程序代码,还提供一个或多个应用程序框架作为其开发平台的一部分。 应用程序框架包含一系列Silicon Labs提供的代码,存储在库和插件中Silicon Labs还提供Simplicity Studio,其中包括基于Application Builder(AppBuilder)的集成开发环境(IDE)。 AppBuilder是一个交互式GUI工具,允许您配置应用程序框架中包含的库和插件,以在应用程序配置文件中实现设备。
  • silicon的应用程序框架目前有两种样式或版本,版本2和版本6.可参考 :《UG102:应用程序框架用户指南》中更详细地描述了这两个版本之间的差异。 EmberZNet PRO堆栈包括两个版本的应用程序框架。 Zigbee PRO应用程序框架称为ZCL Application Framework V2,是一个版本2框架,通常称为AFV2。而网络协处理器应用程序框架也随EmberZNet PRO堆栈一起提供,使用版本6开发。
  • AFV2基于ZCL(ZigBee集群库),用于开发ZigBee PRO应用程序。它提供了一组嵌入式代码,用于实现基于ZCL的集群处理,所需的网络任务和典型的ZigBee应用程序状态机,并包括对Zigbee 3.0应用程序层的支持,以及许多传统的Zigbee配置文件(智能家居)(HA),Smart Energy(SE)和Zigbee Light Link(ZLL))。此代码是根据Silicon Labs推荐的最佳实践和不同ZigBee应用程序配置文件的规范开发的,可作为一种“软件参考设计”,可在片上系统(如EFR32)上运行或连接到基于EZSP(EmberZNet串行协议)的网络控制处理器的主机处理器
  • Ps:这小章大概都在讲他们自己的协议栈多好多好。不过确实挺好用的,可以节省很多造轮子的时间。
1.4.2其他工具和实用程序

  As well as Simplicity Studio and AppBuilder, Silicon Labs also offers a number of utilities and tools that are available to developers during the application process including:

  • Over-the-air (OTA) bootloaders to allow upgrades to system software after deployment
  • Gateway interfaces to interface the Zigbee network to other systems
  • Programming tools for the microprocessor
  • Network sniffer and debug tools to allow viewing and analysis of network operations.
  • Processor debug tools through partnerships with leading firms.
  • 除了Simplicity Studio和AppBuilder,Silicon Labs还提供了许多开发人员可用的实用程序和工具,在申请过程中包括:
    • 无线(OTA)引导加载程序,允许在部署后升级系统软件。
    • 网关接口,用于将Zigbee网络连接到其他系统。
    • 微处理器的编程工具。
    • 网络抓包器和调试工具,允许查看和分析网络操作。
    • 通过与其他公司合作的处理器调试工具。

2、Zigbee网状网络

   Embedded mesh networks make radio systems more reliable by allowing radios to relay messages for other radios. For example, if a node cannot send a message directly to another node, the embedded mesh network relays the message through one or more intermediary nodes.
   EmberZNet PRO supports three types of mesh network topologies, as shown in the following figure:

  • 嵌入式设备网状网络允许无线电中继其他无线电的消息,从而使无线电系统更加可靠。 例如,如果节点不能直接向另一节点发送消息,则嵌入式网状网络通过一个或多个中间节点中继消息。
    EmberZNet PRO支持三种类型的网状网络拓扑,如下图所示:
    • 星空网络
    • 全网状网络
    • 混合网状网络
  • 注意:上图中的蓝色设备是终端设备
2.1星空网络

   In a star network, one hub is the central point of all communications. The hub can become bottlenecked with network/processing bandwidth. This topology is not very mesh-like, and transmission is limited by the hub’s communication radius. Outlying nodes can be battery powered. In the EmberZNet PRO stack, this topology is formed by a group of end devices with a coordinator node as their parent. The coordinator node serves as network hub.

  • 在星形网络中,一个协调器是所有通信的中心点。协调器可能会成为网络/处理带宽的瓶颈。这种拓扑结构不是很像网状,传输受到协调器通信半径的限制。外围节点可以由电池供电。在EmberZNet PRO堆栈中,此拓扑由一组终端设备组成,其中一个协调器节点作为其父节点。协调器节点充当网络集线器。
2.2全网状网络

   In a full mesh network, all nodes are router nodes, including the coordinator after it forms the network. Because all nodes can relay information for all other nodes, this topology is least vulnerable to link failure; it is highly unlikely that one device might act as a single point of failure for the entire network.

  • 在全网状网络中,所有节点都是路由器节点,包括形成网络后的协调器。由于所有节点都可以为所有其他节点中继信息,因此该拓扑最不容易受到链路故障的影响;一个设备极不可能充当整个网络的单点故障。
2.3混合网状网络

   A hybrid mesh network topology combines star and mesh strategies. Several star networks exist, but their hubs can communicate as a mesh network. A hybrid network allows for longer distance communication than a star topology and more capability for hierarchical design than a mesh topology. This topology is formed by the EmberZNet PRO stack, using router devices as hubs for the star subnetworks, where each hub can have end devices attached to it. The choice of topology must take into consideration which nodes are line-powered or battery-powered, expected battery lifetime, amount of network traffic required, latency requirements, the cost of the solution, as well as other factors. See UG103.3: Software Design Fundamentals, for more information.

  • 混合网状网络拓扑结合了星形和网格策略。存在多个星型网络,但它们的协调器可以作为网状网络进行通信。混合网络允许比星形拓扑更长距离的通信,并且比网状拓扑具有更多的分层设计能力。此拓扑由EmberZNet PRO堆栈组成,使用路由器设备作为星型子网络的协调器,其中每个协调器可以连接到终端设备。拓扑的选择必须考虑哪些节点是线路供电的或电池供电的,预期的电池寿命,所需的网络流量,延迟要求,解决方案的成本以及其他因素。有关更多信息,请参阅UG103.3:软件设计基础知识。

3、网络节点类型

  • Zigbee规范在单个网络中最多支持一个协调器,多个路由器和多个终端设备。以下各节介绍了这些节点类型。
3.1 Coordinator(协调器)

   A Zigbee coordinator (ZC) is responsible for forming a centralized network. A coordinator is a router with some additional functionality and uses a hardcoded network address of 0x0000. Zigbee coordinator functions include selecting an appropriate channel after scanning available channels, and selecting an extended PAN ID (see section 5.4 Extended PAN IDs for more information about extended PAN IDs). After forming the network, the coordinator acts as a router.
   The coordinator also has added responsibilities, such as being the
trust center or network manager. The trust center manages the security settings and authorizations for the network. The network manager monitors and corrects network issues such as PAN ID conflicts or channel changing due to interference. These choices are up to the application developer, and in some cases are made by an application layer, such as Zigbee 3.0, being used.
   Note: Only a network coordinator can be designated as a centralized trust center for security purposes when starting a network.

  • Zigbee协调器(ZC)负责组建集中式网络。协调器是具有一些附加功能的路由器,并使用0x0000的硬编码网络地址。 Zigbee协调器功能包括在扫描可用信道后选择适当的信道,以及选择扩展的PAN ID(有关扩展PAN ID的更多信息,请参见5.4扩展PAN ID)。在形成网络之后,协调器充当路由器。
  • 协调器还多了一些任务,例如作为信任中心或网络管理员。信任中心管理网络的安全设置和授权。网络管理器监视并纠正网络问题,例如PAN ID冲突或由于干扰导致的信道变化。这些选择取决于应用程序开发人员,在某些情况下由应用程序层(如Zigbee 3.0)使用。
  • 注意:在启动网络时,出于安全考虑,只能将网络协调员指定为集中式信任中心。

3.2 Routers(路由设备)

   Zigbee router devices provide routing services to network devices. Routers can also serve as end devices. Unlike end devices, routers are not designed to sleep and should generally remain on as long as a network is established.

  • Zigbee路由器设备为网络设备提供路由服务。路由器也可以作为终端设备。与终端设备不同,路由器不是为休眠而设计的,只要网络建立就应该保持打开状态。

3.3 End Devices(终端设备)

     End devices (ZED) are leaf nodes. They communicate only through their parent nodes and, unlike router devices, cannot relay messages intended for other nodes.
Depending on the network stack, end devices can be of several types:

  • Sleepy end devices (EmberNodeType EMBER_SLEEPY_END_DEVICE) power down their radio when idle, and thus conserve resources. However, they must poll their parent node to receive incoming messages and acknowledgments; no data is sent to the sleepy end device until the end device requests it. Sleepy end devices are also sometimes known as rx-off-when-idle devices. This is a standard Zigbee device type.
  • Non-sleepy end devices (EmberNodeType EMBER_END_DEVICE) do not route messages for other devices but they remain powered during operation. These devices are known as Rx-on-when-idle devices. This is a standard Zigbee device type.

     The EmberZNet PRO stack supports sleepy and non-sleepy end devices. The choice of node type must also be considered carefully. For example, in a very dense network, it is not always advantageous for all line powered nodes to be routers due to possible interference issues which may occur when a child node tries to find a parent node to communicate with. It is important to try to create a balanced network where all nodes have redundant paths, but without too many routers in close proximity to create interference.

  • 终端设备(ZED)是子节点。它们仅通过其父节点进行通信,与路由器设备不同,它不能中继用于其他节点的消息。
  • 根据网络堆栈,终端设备可以有以下几种类型:
    • 睡眠终端设备(EmberNodeType EMBER_SLEEPY_END_DEVICE)在空闲时关闭其无线电,从而节省资源。但是,他们必须轮询其父节点以接收传入的消息和确认;在终端设备请求之前,不会向睡眠终端设备发送数据。困倦的终端设备有时也被称为rx-off-idle-idle设备。这是标准的Zigbee设备类型。
    • 非睡眠终端设备(EmberNodeType EMBER_END_DEVICE)不会为其他设备路由消息,但在操作期间仍保持供电状态。这些设备称为Rx-on-idle-idle设备。这是标准的Zigbee设备类型。
  • EmberZNet PRO堆栈支持睡眠和非睡眠的终端设备。还必须仔细考虑节点类型的选择。例如,在非常密集的网络中,由于当子节点试图找到与之通信的父节点时可能发生的干扰问题,所有线路供电的节点都不是总是有利的。重要的是尝试创建一个平衡的网络,其中所有节点都具有冗余路径,但没有太多的路由器靠近以产生干扰。
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值