ZigBee快速入门

合集下载

《zigbee快速入门》

《zigbee快速入门》

– 处理MPDU;
– 提供MAC层数据传输机制:CSMA-CA、应答机
制 ED:信道能量检测
– 三种扫描机制(ED、ACATIVCET: 检IV索E周/边P双A亲S信S息IVnEon、-beacon-enabled
ORPHAN)
PASSIVE:监听周边双亲信息 beacon-enabled ORPHAN:孤儿重新检索原关联双亲
ZigBee快速入门
主要内容:
1.ZigBee是什么? 2.ZigBee协议栈 3.ZigBee网络 4.应用规范,簇和端点 gBee安全
.
1.ZigBee是什么?
• ZigBee和IEEE802.15.4是基于标准的协议 ,它们为无线传感器网络应用提供所需要 的网络基础设施。
• 802.15.4定义了物理层(PHY)和媒体访问 控制(MAC)层,ZigBee定义了网络( NWK)层和应用层(APL)。
– 允许ZigBee设备对象处 理为网络访问和安全的来自应用的请求, 使用ZDP(ZigBee设备规范)信息。
• 应用支持(APS)子层
– 负责提供一个数据服务给应用和ZigBee设备规 范。它也提供一个管理服务以维护绑定链接和 它自己绑定表的存储。
– 数据服务负责设备间APDU传输; – 管理服务负责维护绑定表、实现绑定、设备发
– 关联与退出关联;CSMA-CA:载波检测机制和随机退避规则
2.2 IEEE 802.15.4 (PHY)
• 物理层(PHY) • 提供接口给物理传输介质,物理层由两个层组成
,它们运行在不同 的频率范围。868MHz /915MHz、2.4GHz。 • 主要功能:
– 信道选择; – 信道能量检测(energy detect, ED); – 空闲信道评估(clear channel assessment, CCA); – 无线信道收发数据(PHY Protocol Data Unit, PPDU)

ZigBee入门指导_1-4

ZigBee入门指导_1-4

Zigbee入门指导(一)——基于CC2430的Zigbee开发环境的建立logiclimit 写在前面的话:临近毕业,把之前做过的一些项目的内容加以整理,和大家一起分享,请高手指教,欢迎同辈间交流,希望后来者能少走一些弯路。

Zigbee入门指导源于大三时的课程设计《无线心电采集系统》中的Zigbee网络部分。

Zigbee入门指导预定为三篇,分为:1、开发环境的建立;2、运行Zigbee例程;3、基于Zigbee的一主多从的数据采集系统,大概在一个月内整理完毕。

文章版权为原创者logiclimit所有,转载时请注明出处。

Zigbee是一种近距离低功耗低速率无线网络,使用免费的2.4GHz频段,主要用于无线传感器网络、智能家居等方面。

很多公司都推出了自己的Zigbee芯片和模块,我使用的是基于Ti 公司CC2430,由无线龙公司生产的Zigbee模块,使用的Zigbee 协议栈版本为TI_ZStack-1.4.3-1.2.1(对应标准的Zigbee 2006)。

本篇主要讲述其开发环境的建立方面的内容。

使用的开发环境为:windows7、IAR 8051 7.30B。

需要指出的是,Ti目前主推的是其CC2530模块,使用IAR 8051 7.50版本,支持Zigbee 2006 pro及Zigbee 2007,由于笔者没有CC2530及IAR 8051 7.50,故无法保证本文中的内容适用于CC2530及相关的开发环境和协议栈。

之前开发时使用的操作系统是Win XP,故本文所说的内容同样适用于win XP系统。

本文已假定读者了解IAR软件和cc2430单片机功能的使用,具有一定的C语言基础和嵌入式开发经验。

由于之前只有一个学期时间,还要完成相关模拟采集电路的设计,故Zigbee部分只完成网络的建立、数据的收发及控制的内容,稍显粗鄙,请勿见笑。

一、安装IAR 8051 7.30B使用管理员权限运行安装程序EW8051-EV-730B.exe,根据提示输入相应的注册码,完成相关的安装。

ZigBee基础知识

ZigBee基础知识

ZigBee基础知识一、ZigBee特点ZigBee技术就是一种新兴得短距离、低功耗、低成本、低数据传输率得无线通信技术。

它得主要特点如下:1)低功耗:在低功耗待机模式下,两节普通5号干电池可使用6~24个月。

2)低速率:数据传输速率只有10kb/s~ 250 kb/s,专注于低速数据传输应用。

3)低成本:因为ZigBee数据传输速率低,协议简单,降低了对通信控制器得要求,所以大大降低了成本。

4)短距离:传输距离一般介于10~100m之间,在增加RF发射功率后,亦可增加到1~3km。

这指得就是相邻节点间得距离,如果通过路由与节点间通信得接力,传输距离将可以更远。

5)短时延:Zigbee得响应速度较快,一般从睡眠转入工作状态只需15ms,节点连接进入网络只需30ms,进一步节省了电能。

6)容量大:Zigbee可采用星状、簇状与网状网络结构,一个主节点可管理254个子节点,同时主节点还可由上一层网络节点管理,这样可组成65000多个节点。

7)安全:ZigBee提供了数据完整性检查与鉴权功能,采用AES-128加密算法,各个应用可灵活确定其安全属性。

8)工作频段灵活:使用得频段分别为全球得2、4GHz ISM频段(16个信道)、欧洲得868MHz频段(1个信道),以及美国得915MHz频段(10个信道),均为免执照频段。

二、ZigBee工作频率表1 ZigBee工作频率表三、ZigBee得设备类型ZigBee网络支持两种功能类型得网络节点:全功能器件(Full FunctionDevice, FFD)与精简功能器件(Reduce Function Device,RFD)。

全功能器件拥有完整得协议功能,在网络中可以作为协调器(Coordinator),路由器(Router)与普通节点(Device);而精简功能器件旨在实现最简单得协议功能而设计,只能作为普通节点存在于网络中。

全功能器件可以与精简功能器件或其她得全功能器件通信,而精简功能器件只能与全功能器件通信,精简功能器件之间不能直接通信。

zigbee基础知识笔记.docx

zigbee基础知识笔记.docx

1. 基础知识 (1)1.1IEEE 地址 (1)1.2 簇 (2)1.3 Profile ID (4)1.4网络地址与端点号、节点 (4)1.5 PANID (5)1.6 zigbee设备 (5)2. 绑定机制 (7)2.1 描述符绑定 (7)2.2 设备绑定 (23)1.基础知识1.1IEEE 地址IEEE 地址是 64 位,在设备进入网络之前就分配好了的,应该在全球是唯一的,而网络地址是在网络建立后,设备加入网络时,它的父节点给它分配的,在设备通信时,首先由ieee地址找到设备的网络地址,然后根据网络地址实现设备之间的通信,这样可以减少帧头长度,多传有效数据通俗的说IEEE 地址相当于你的手机号(11 位的那个),短地址就相当于你们公司的小号(3 、4) 位,一个公司的互打电话就用小号噻。

假设你的手机号138xxxxx666 ,这个是唯一的,但你的小号,假设是 666,在你的公司网中是唯一的,但是在另一个网中,可能别人的小号也是666。

1.2 簇簇就是相当于端点房间里面的人,是接收最终的目标。

这东西是 2 个字节编号,在射频发送的时候,必须要指定接收模块的镞,发送模块不需要指定。

首先每一个端点可以看成是一个 1 个字节数字编号的开有一扇门的房间,数据最终的目标是进入到无线数据包指定的目标端点房间,而取无线数据这个相关的代码在任务事件处理函数里,TI 协议栈有那么多的任务事件处理函数,所以必须要指定在哪个任务事件处理函数来取这个无线数据包里面的有用数据。

端点就相当于一个房间的门牌号!!!SimonApp_epDesc.endPoint= 10;//SimonApp_ENDPOINT;此端点编号为10SimonApp_epDesc.task_id = &SimonApp_TaskID;和我们应用层任务挂钩完成了簇信息表的构建,因为簇信息封装在SimonApp_SimpleDesc 里面,这里面却只是起到一个信息表的作用!方便数据到来的时候查询相关信息表!const cId_t SimonApp_ClusterList[SimonApp_MAX_CLUSTERS] ={SimonApp_CLUSTERID};const SimpleDescriptionFormat_t SimonApp_SimpleDesc = {SimonApp_ENDPOINT,// int Endpoint;SimonApp_PROFID,//uint16 AppProfId[2];SimonApp_DEVICEID,//uint16 AppDeviceId[2];SimonApp_DEVICE_VERSION,//int AppDevVer:4;SimonApp_FLAGS,//int AppFlags:4;SimonApp_MAX_CLUSTERS,//byte AppNumInClusters;(cId_t*)SimonApp_ClusterList,//byte *pAppInClusterList;SimonApp_MAX_CLUSTERS,//byte AppNumInClusters;(cId_t*)SimonApp_ClusterList//byte *pAppInClusterList;};接收到数据以后,判断是属于哪一个端点、属于哪一个簇1.3 Profile ID这个是由Zigbee 组织来分配的应用ID 号,比如无线开关用0x0001 ,智能电表用ox0002,万用遥控器用0x0003 等等。

ZigBee编程基础入门

ZigBee编程基础入门

zigbee基本概念及协议术语1. 逻辑设备类型协调器(coordinator),路由器(router),终端设备(end-device)•ZigBee 协调者—coord为协调者节点*–每各ZigBee网络必须有一个.–初始化网络信息.协调器是一种特殊的路由器(待确认)•ZigBee 路由器—router为路由节点*–路由信息•ZigBee 终端节点—rfd为终端节点*–没有路由功能–低价格2 . 2.4GHz射频信道分为16个独立信道。

3. 绑定应用设备之间信息流的控制机制。

有直接绑定(OTA)、间接绑定、直接绑定(通过串口)4. 配置文件profile 应用程序框架5. 端点endpoint 每个ZigBee设备支持多达240个端点6. NWK寻址地址类型:ZigBee设备有一个64位IEEE长地址(MAC地址)通常用一个16位短地址表识网络地址分配由协调器完成相关参数:5 max_depth 网络的最大深度6 Max_children 路由器或协调器节点连接子节点最大个数20 Max_router 路由器或协调器处理的具有路由能力的子节点最大个数它是max_children的子集数据包传送单点unicast 多点multicast 广播broadcast路由:经过路由器的每个数据帧寻找一条最佳传输路径,并将该数据有效地传送到目的节点。

F8wconfig.cfg配置路由看了下面就不用纠结了。

配置文件(profile):Zigbee协议的配置文件是对逻辑组件及其相关接口的描述,是面向某个应用类别的公约、准则.通常没有程序代码与配置文件相关联.属性(attribute):设备之间通信的每一种数据像开关的状态或温度计值等皆可称为属性.每个属性可得到唯一的ID值.簇(cluster):多个属性的汇集形成了簇,每个簇也拥有一个唯一的ID.虽然个体之间传输的通常是属性信息,但所谓的逻辑组件的接口指的却是簇一级的操作,而非属性一级.终端(endpoint):每个支持一个或多个簇的代码功能块称为终端.不同的设备通过它们的终端及所支持的簇来进行通信.Cluster: is a container for one or more attributes. (一个或更多属性的集合)Attribute: a data entity which represents a physical quantity or state.(反映物理特性或状态的一个数据实体)Cluster是逻辑设备之间的事务关系Cluster定性Attribute则是某种事务关系的具体特例Attribute定量Endpoint是一个逻辑设备(个人理解为入口地址)。

Zigbee入门指导经典教程

Zigbee入门指导经典教程
OSAL任务调度流程图
Figure . The Flow Chart of OSAL Scheduler
OSAL任务
OSAL是协议栈的核心,Z-stack的任何一个子系统都作为OSAL的一个任务,因此在开发应用层的时候,必须通过创建OSAL任务来运行应用程序。通过osalInitTasks( )函数创建OSAL任务,其中TaskID为每个任务的唯一标识号。任何OSAL任务必须分为两步:一是进行任务初始化;二是处理任务事件。任务初始化主要步骤如下:
每个Zigbee网络节点(FFD和RFD)可以可支持多到31个的传感器和受控设备,每一个传感器和受控设备终可以有8种不同的接口方式。可以采集和传输数字量和模拟量。
Zigbee技术的应用领域:
Zigbee技术的目标就是针对工业,家庭自动化,遥测遥控,汽车自动化、农业自动化和医疗护理等,例如灯光自动化控制,传感器的无线数据采集和监控,油田,电力,矿山和物流管理等应用领域。另外它还可以对局部区域内移动目标例如城市中的车辆进行定位。(成都西谷曙光数字技术公司的专利技术)。
8.使用现存移动网络进行低数据量传输的遥测遥控系统。
9.使用GPS效果差,或成本太高的局部区域移动目标的定位应用。
Zigbee技术的特点:
省电:两节五号电池支持长达6个月到2年左右的使用时间可靠:采用了碰撞避免机制,同时为需要固定带宽的通信业务预留了专用时隙,避免了发送数据时的竞争和冲突;节点模块之间具有自动动态组网的功能,信息在整个Zigbee网络中通过自动路由的方式进行传输,从而保证了信息传输的可靠性、时延短:针对时延敏感的应用做了优化,通信时延和从休眠状态激活的时延都非常短。
第一步:复制GenericApp文件夹修改文件名为HawsnAppCoor。

BestU eNet -ZBP113 ZigBee 无线传感网络模块快速入门指南说明书

BestU eNet -ZBP113 ZigBee 无线传感网络模块快速入门指南说明书

eNet-ZB ZigBee Module Quick Start GuideBestU eNet-ZBP113 Module-Networking Firmware VersioneNet-ZBP113 Quick Start GuideV1.0 – August 16,2014BestU/enZigBee Wireless sensor network moduleCopyright Statement:●Unless otherwise noted, the eNet-ZB Serials includes but not limit to eNet-ZBP113,eNet-ZBP111, eNet-ZBP211, eNet-ZBP213.●eNet、eNet-ZB Serials ZigBee wireless module and its related Intellectual Propertyowned by Shenzhen BestU Intelligent Technology Co.,Ltd.●Without the permission of Shenzhen BestU Intelligent Technology Co.,Ltd ,No one canmodify, distribute or copy any part of this document.Legal Disclaimer:●The source code, software, documents in company with eDuino UNO, Shenzhen BestUIntelligent Technology Co.,Ltd does not provide any guarantee; Not matter specific,connotative , including but not limited to specific purpose, all the risk should beundertook by end user; If coming out bug in the program, end user undertakes the allthe necessary fee of service, modification, amends.Version Updated:Version Updated Date Description1.0 2014-08-16 ReleasedZigBee Wireless sensor network moduleCatalogue1Overview (3)2Development Kit s (4)2.1 eDuino UNO Wireless Kit (4)2.2 Simple Wireless Kit (5)3Preparation (6)3.1 CP2102 driver Installation (6)3.2 Configuration Software Installation (7)3.3 Hardware Installation (8)3.3.1 eDuino UNO Wireless Kit (8)3.3.2 Simple Wireless Kit (10)3.3.1 Parameter Configuration (12)4Network Establishing (18)4.1 Coordinator settings (18)4.2 Router settings (19)4.3 Joining Network (20)4.4 Network Communication Test (21)5Contact Us (22)ZigBee Wireless sensor network module1OverviewThis document gives a description on how to get started with the eNet-ZBP113 development kits. This document provides a step by step guide to the installation procedure of the software and the hardware.If you buy only the eNet-ZBP113 module, the eNet-ZBP113 User Manual will be helpful when you get started with the module.Chapter 5 shows how to configure the module. Chapter 6 shows how to implement the data transmission between modules. Chapter 7 shows how to establish a network.ZigBee Wireless sensor network module2 Development Kit sThere are two available development kits for eNet-ZBP113, eDuino UNO wireless kit and Simple Wireless kit.2.1 eDuino UNO Wireless KiteNet-ZBP113 ModuleeDuino UNOeDuino UNO kitWhat ’s included in the eDuino UNO kit:Figure 2-1 eDuino UNO KitZigBee Wireless sensor network module2.2 Simple Wireless KiteNet-Test-AeNet-ZBP113 Module Simple Wireless kitWhat’s included in the Simple Wireless kit:Figure 2-2 Simple Wireless KitZigBee Wireless sensor network module3Preparation3.1CP2102 driver InstallationThe first time you connect the development kits to PC, the CP2102 driver need to be installed. Please download the driver from/Support%20Documents/Software/CP210x_VCP_Windows.zipZigBee Wireless sensor network module3.2Configuration Software InstallationBefore you install the configuration software for eNet-ZBP113, you first need to install the Microsoft .Net Framework if your PC has never installed one. The version, v4.0.30319 or later version is OK. Microsoft .Net Framework 4.5 can be downloaded from/en-us/download/details.aspx?id=30653Please download the configuration software from/uploads/soft/Document/ZigBee%20Module%20Config%20Tool.rarZigBee Wireless sensor network module3.3 Hardware Installation 3.3.1eDuino UNO Wireless Kit1) Install the antenna.2) Connect the eNet-ZBP113 module.Caution: Please take care to connect the module in the right way! See the next picture for more information.3) In order to make the USB-UART connect to eNet-ZBP113 module, jumpers should be fittedas follow figure shown.Figure 3-1 eNet-ZBP113 ModuleFigure 3-2 eDuino UNO KitZigBee Wireless sensor network module4)Plug Micro USB cable into PC and power the board.5)Check the available interface (COM) in Device Manager Window.Figure 3-3 Available Interface (COM)6)The kits start to work.Figure 3-4 eDuino UNO KitZigBee Wireless sensor network module3.3.2Simple Wireless Kit1)Install the antenna.Figure 3-5 eNet-ZBP113 Module2)Connect the eNet-ZBP113 module.Caution: Please take care to connect the module in the right way! See the next picture for more information.Figure 3-6 Simple Wireless Kit3)Connect the kit to PC with Micro USB cable and power the board.4)Check the available interface (COM) in Device Manager window.ZigBee Wireless sensor network moduleFigure 3-7 Available Interface (COM)7)The kits start to work.Figure 3-8 Simple Wireless KitZigBee Wireless sensor network module3.3.1Parameter ConfigurationThis section shows how to quickly configure module parameters with ZigBee Config Tool, a convenience, easy-to-use PC Software.1)Connect the module to PC through USB-UART.Figure 3-9 Connect the ModuleZigBee Wireless sensor network module2)Get the parameters from the Module.Click on the Get Para to get the current parameters of the module.Figure 3-10 Get the parametersZigBee Wireless sensor network module3)Set the network parameters.Set the PANID or change the Point type. Click on Setting button to finish the setting.Figure 3-11 Set the network parametersZigBee Wireless sensor network module4)Set the Radio parameters.Set the channel or TX Power and click on Setting to finish the setting.Figure 3-12 Set the Radio parametersZigBee Wireless sensor network module5)Set the UART parameters.Set the Baud Rate and click the Setting to finish the Setting.Figure 3-13 Set the UART parametersZigBee Wireless sensor network module6)Restart the module.Click the Restart to make the module work with the parameters set by steps before.Figure 3-14 Restart module7)Connect the module. The parameters have been set and shown by click Get Para.ZigBee Wireless sensor network module4Network EstablishingeNet-ZBP113 can act as Coordinator and Router. A ZigBee Network contain one Coordinator and one or more Router. All the nodes in a same network share the same PANID. The default settings of eNet-ZBP113 shown in Appendix I Default Settings of eNet-ZBP113 User Manual.Please note that more than one eNet-ZBP113 need for establish network.4.1Coordinator settingsHere is an example that shows how to configure a module as a Coordinator.Figure 4-1 Coordinator SettingsZigBee Wireless sensor network module4.2Router settingsHere is an example that shows how to configure a module as a Router.Figure 4-2 Router SettingsZigBee Wireless sensor network module4.3Joining NetworkPower the Coordinator before the Router. P0_6 of both modules will output a 1Hz pulse to indicate network establishing complete. Check the Short Add of the Router by click on Get para button. If the Short Add isn’t 0xFFFE, the Router has joined the network.Figure 4-3 Router have joined the networkZigBee Wireless sensor network module4.4Network Communication TestWhen the network is available, data can transfer between the Coordinator and Router.Open HyperTerminal on PC. S end strings “hello Router” from Coordinator and the Router received the strings. Both the Coordinator and Router can send or receive data.Figure 4-4 Network Communication TestZigBee Wireless sensor network module5Contact UsTechnical SupportTel:+86-755-22360817/130****2937Email: ******************Sale SupportTel: +86-755-22360817Email: ****************/130****2937About BestUHi, we are BestU, we believe that you will be more happy and better with our products and services.Our technology focused on IoT and open hardware.We own the“Brain”, the microcontroller module for Industry Area, like a brain to manipulate the various branches.We own the “Brick”, providing base IOT modules like WIFI/ZigBee/NFC/BLE etc. to bring down your development threshold, to quickly build your product prototypeWe own the “Low Kit”, providing the lowest hardware for you to evaluate and build your product. Better because of your good, we hope the products and services we have can make you be more excellent!More info please visit /en。

E18系列ZigBee模块快速操作方法

E18系列ZigBee模块快速操作方法

E18 系列ZigBee模块快速操作方法1. E18系列ZigBee模块简介E18 系列模块是成都亿佰特电子科技有限公司设计生产的一款2.4G ZigBee无线模块。

采用美国德州仪器(TI)公司原装进口的CC2530F256射频芯片。

E18 模块根据型号不同,可分为4.5dBm和20dBm最大功率输出。

内置组网固件,其固件采用TI 经典ZigBee协议栈Z-stack2.5.1a,支持串口数据传输。

该组网固件支持低功耗,角色切换,广播、组播、点播等多种功能。

并支持串口指令操作。

可轻松对模块进行配置和使用。

2. 快速入门•ZigBee自组网模块具有简单易用的特点。

通信模式分为模式1(透传模式),模式2(半透传模式),模式3(协议模式)。

在模式1、2 下还可指定输出为短地址,MAC地址,RSSI等信息。

为了让用户能快速熟悉模块,本此实验将引导用户经过简单的配置实现各种模式下的配置和通信,工作模式为模式3(协议模式),波特率为默认波特率115200。

用户可将P1.6引脚拉低,进行HEX指令设置,为方便上位机观察,本次实验用HEX指令格式,AT指令用户不在本次试验中测试。

(AT指令模式下不能用于上位机配置。

)另外,用户可以不使用底板而使用外部微控制器(MCU)直接连模块UART进行串口指令通信,实现二次开发。

•备注【建立网络】:①.通过USB转串口模块将出厂的ZigBee自组网模块连接。

②.打开上位机软件“Zigbee_Setting_V1.1”,并选择端口号,并设置串口波特率(默认115200),打开串口;③.点击读取参数,读取相应模块参数。

④.选择节点类型为协调器,并写入参数。

等待协调器开始组建网络,用户可查看模块参数。

配置网络参数:(PAN ID为FFFF时为自动PAN ID)网络组建好读取参数:⑤.选择另一个模块,按照相同步骤设置为路由器或者终端(模块出厂默认为终端,可不进行设置,本实验为终端)。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档