XBee®/XBee-PRO® ZB RF Modules ZigBee RF Modules by Digi International Models: XBEE2, XBEEPRO2, PRO S2B Hardware: S2 and S2B Firmware Versions: - 20xx - Coordinator - AT/Transparent Operation - 21xx - Coordinator - API Operation - 22xx - Router - AT/Transparent Operation - 23xx - Router - API Operation - 28xx - End Device - AT/Transparent Operation - 29xx - End Device - API Operation Draft Digi International Inc. 11001 Bren Road East Minnetonka, MN 55343 877 912-3444 or 952 912-3444 http://www.digi.
XBee®/XBee‐PRO® ZB RF Modules © 2011 Digi International, Inc. All rights reserved No part of the contents of this manual may be transmitted or reproduced in any form or by any means without the written permission of Digi International, Inc. ZigBee® is a registered trademark of the ZigBee Alliance. XBee® and XBee‐PRO® are registered trademarks of Digi International, Inc. Technical Support: Phone: (866) 765-9885 toll-free U.S.A. & Canada (801) 765-9885 Worldwide 8:00 am - 5:00 pm [U.S.
XBee®/XBee‐PRO® ZB RF Modules Contents Overview 6 What's New in 2x7x 6 Firmware 6 Manual 7 Key Features 8 Worldwide Acceptance 8 Specifications 9 Hardware Specs for Programmable Variant 10 Mechanical Drawings 10 SIF Header Interface 11 Mounting Considerations 12 Pin Signals 13 EM250 Pin Mappings 14 Design Notes 14 Power Supply Design 14 Recommended Pin Connections 15 Board Layout 15 Electrical Characteristics 17 Module Operation for Programmable Variant 17 XBEE Programmable Bootloader 19 Overview 19 Bootlo
XBee®/XBee‐PRO® ZB RF Modules Contents Managing Multiple ZigBee Networks 50 PAN ID Filtering 50 Preconfigured Security Keys 50 Trust Center 73 Forming and Joining a Secure Network 73 Implementing Security on the XBee 73 Permit Joining 51 Enabling Security 74 Application Messaging 51 Setting the Network Security Key 74 Transmission, Addressing, and Routing 52 Addressing 52 64-bit Device Addresses 52 16-bit Device Addresses 52 Application Layer Addressing 52 Data Transmission 52 Broadcast Transmissions
XBee®/XBee‐PRO® ZB RF Modules Contents Transmission Timeout 91 Putting it all Together 92 Short Sleep Periods 92 Extended Sleep Periods 92 Sleep Examples 92 XBee Analog and Digital IO Lines 94 IO Configuration 94 IO Sampling 94 with the API 123 Sending Public Profile Commands with the API 125 XBee Command Reference Tables 128 Module Support 138 Power up Module at 9600 Baud 138 X-CTU Configuration Tool 138 Customizing XBee ZB Firmware 138 Queried Sampling 96 Design Considerations for Digi Drop-In Network
1. Overview This manual describes the operation of the XBee/XBee-PRO ZB RF module, which consists of ZigBee firmware loaded onto XBee S2 and S2B hardware, models: XBEE2, XBEEPRO2 and PRO S2B. The XBee/XBee-PRO ZB RF Modules are designed to operate within the ZigBee protocol and support the unique needs of low-cost, low-power wireless sensor networks. The modules require minimal power and provide reliable delivery of data between remote devices. The modules operate within the ISM 2.
XBee®/XBee‐PRO® ZB RF Modules Manual The XBee/XBee-PRO/S2B ZB 2x7x manual includes the following corrections over the 2x6x manual: •Descriptions and specification for the PRO S2B. •SIF Header Interface, pin 8 relabeled as pin 10. •Pin mappings for pins 22 and 24 updated. •New modem status codes were added. •Corrections to the ZigBee Receive Packet description. •Description changes for the SC, PL, PP, AO, IR, %V, and PO commands. •Updates to Appendix B. © 2011 Digi International, Inc.
XBee®/XBee‐PRO® ZB RF Modules Key Features High Performance, Low Cost XBee Low Power XBee • Indoor/Urban: up to 133’ (40 m) • TX Peak Current: 40 mA (@3.3 V) • Outdoor line-of-sight: up to 400’ (120 m) • RX Current: 40 mA (@3.
XBee®/XBee‐PRO® ZB RF Modules Specifications Specifications of the XBee®/XBee‐PRO® ZB RF Module Specification XBee XBee-PRO (S2) XBee-PRO (S2B) Indoor/Urban Range up to 133 ft. (40 m) Up to 300 ft. (90 m), up to 200 ft (60 m) Up to 300 ft. (90 m), up to 200 ft (60 m) international variant international variant Outdoor RF line-of-sight Range up to 400 ft.
XBee®/XBee‐PRO® ZB RF Modules Specifications of the XBee®/XBee‐PRO® ZB RF Module Specification XBee XBee-PRO (S2) XBee-PRO (S2B) Australia C-Tick C-Tick C-Tick Japan R201WW07215215 R201WW08215142 (international variant) R201WW10215062 (international variant) RoHS Compliant Compliant Compliant Hardware Specs for Programmable Variant The following specifications need to be added to the current measurement of the previous table if the module has the programmable secondary processor.
XBee®/XBee‐PRO® ZB RF Modules Mechanical Drawings for the RPSMA Variant SIF Header Interface The XBee/XBee-PRO ZB modules include a SIF programming header that can be used with Ember's programming tools to upload custom firmware images onto the XBee module. The SIF header orientation and pinout are shown below. A male header can be populated on the XBee that mates with Ember's 2x5 ribbon cable.
XBee®/XBee‐PRO® ZB RF Modules Mounting Considerations The XBee module was designed to mount into a receptacle (socket) and therefore does not require any soldering when mounting it to a board. The XBee-PRO Development Kits contain RS-232 and USB interface boards which use two 20-pin receptacles to receive modules. XBee‐PRO Module Mounting to an RS‐232 Interface Board. The receptacles used on Digi development boards are manufactured by Century Interconnect.
XBee®/XBee‐PRO® ZB RF Modules Pin Signals Pin Assignments for the XBee/XBee‐PRO Modules (Low‐asserted signals are distinguished with a horizontal line above signal name.
XBee®/XBee‐PRO® ZB RF Modules EM250 Pin Mappings The following table shows how the EM250 pins are used on the XBee. EM250 Pin Number XBee Pin Number 13 (Reset) 5* 19 (GPIO 11) 16* 20 (GPIO 12) 12* 21 (GPIO 0) 15 Other Usage Connected to pin 8 on 2x5 SIF header. 22 (GPIO 1) XBee Tied to ground (module identification) XBee-PRO (S2) Low-asserting shutdown line for output power compensation circuitry. XBee-PRO (S2B) Used to communicate with Temp Sensor and control Shutdown for low power mode.
XBee®/XBee‐PRO® ZB RF Modules Recommended Pin Connections The only required pin connections are VCC, GND, DOUT and DIN. To support serial firmware updates, VCC, GND, DOUT, DIN, RTS, and DTR should be connected. All unused pins should be left disconnected. All inputs on the radio can be pulled high with 30k internal pull-up resistors using the PR software command. No specific treatment is needed for unused outputs.
XBee®/XBee‐PRO® ZB RF Modules © 2011 Digi International, Inc.
XBee®/XBee‐PRO® ZB RF Modules Electrical Characteristics DC Characteristics of the XBee/XBee‐PRO Symbol Parameter Condition Min Typical Max Units VIL Input Low Voltage All Digital Inputs - - 0.2 * VCC V VIH Input High Voltage All Digital Inputs 0.8 * VCC - - V VOL Output Low Voltage VCC >= 2.7 V - - 0.18*VCC V VOH Output High Voltage VCC >= 2.7 V 0.82*VCC - - V IIIN Input Leakage Current VIN = VCC or GND, all inputs, per pin - - 0.
2. RF Module Operation Serial Communications The XBee RF Modules interface to a host device through a logic-level asynchronous serial port. Through its serial port, the module can communicate with any logic and voltage compatible UART; or through a level translator to any serial device (for example: through a RS-232 or USB interface board). UART Data Flow Devices that have a UART interface can connect directly to the pins of the RF module as shown in the figure below.
XBee®/XBee‐PRO® ZB RF Modules TInternal Data Flow Diagram Serial Receiver Buffer DIN RF TX Buffer Transmitter RF Switch CTS Antenna Port Processor DOUT Serial Transmit Buffer RF RX Buffer Receiver RTS Serial Receive Buffer When serial data enters the RF module through the DIN Pin (pin 3), the data is stored in the serial receive buffer until it can be processed. Under certain conditions, the module may not be able to process data in the serial receive buffer immediately.
XBee®/XBee‐PRO® ZB RF Modules periods of time to avoid filling the serial transmit buffer. If an RF data packet is received, and the serial transmit buffer does not have enough space for all of the data bytes, the entire RF data packet will be discarded. Note: If the XBee is sending data out the UART when RTS is de-asserted (set high), the XBee could send up to 5 characters out the UART after RTS is de-asserted.
XBee®/XBee‐PRO® ZB RF Modules A Comparison of Transparent and API Operation The following table compares the advantages of transparent and API modes of operation: Transparent Operation Features Simple Interface All received serial data is transmitted unless the module is in command mode. Easy to support It is easier for an application to support transparent operation and command mode API Operation Features Transmitting RF data to multiple remotes only requires changing the address in the API frame.
XBee®/XBee‐PRO® ZB RF Modules Modes of Operation Idle Mode When not receiving or transmitting data, the RF module is in Idle Mode.
XBee®/XBee‐PRO® ZB RF Modules When data is transmitted from one node to another, a network-level acknowledgement is transmitted back across the established route to the source node. This acknowledgement packet indicates to the source node that the data packet was received by the destination node. If a network acknowledgement is not received, the source node will re-transmit the data.
XBee®/XBee‐PRO® ZB RF Modules When a command is sent to the module, the module will parse and execute the command. Upon successful execution of a command, the module returns an “OK” message. If execution of a command results in an error, the module returns an “ERROR” message. Applying Command Changes Any changes made to the configuration command registers through AT commands will not take effect until the changes are applied.
3. XBee ZigBee Networks Introduction to ZigBee ZigBee is an open global standard built on the IEEE 802.15.4 MAC/PHY. ZigBee defines a network layer above the 802.15.4 layers to support advanced mesh routing capabilities. The ZigBee specification is developed by a growing consortium of companies that make up the ZigBee Alliance. The Alliance is made up of over 300 members, including semiconductor, module, stack, and software developers.
XBee®/XBee‐PRO® ZB RF Modules A router has the following characteristics: it •Must join a ZigBee PAN before it can transmit, receive, or route data •After joining, can allow routers and end devices to join the network •After joining, can assist in routing data •Cannot sleep--should be mains powered. •Can buffer RF data packets for sleeping end device children.
XBee®/XBee‐PRO® ZB RF Modules the same 16-bit PAN ID. If such a conflict is detected, the ZigBee stack can perform PAN ID conflict resolution to change the 16-bit PAN ID of the network in order to resolve the conflict. See the ZigBee specification for details. To summarize, ZigBee routers and end devices should be configured with the 64-bit PAN ID of the network they want to join. They typically acquire the 16-bit PAN ID when they join a network.
XBee®/XBee‐PRO® ZB RF Modules Each cluster has an associated 2-byte cluster identifier (cluster ID). The cluster ID is included in all application transmissions. Clusters often have associated request and response messages. For example, a smart energy gateway (service portal) might send a load control event to a load controller in order to schedule turning on or off an appliance. Upon executing the event, the load controller would send a load control report message back to the gateway.
XBee®/XBee‐PRO® ZB RF Modules (broadcast) transmission on each potential channel. All nearby coordinators and routers (that have already joined a ZigBee network) will respond to the beacon request by sending a beacon back to the coordinator. The beacon contains information about the PAN the device is on, including the PAN identifiers (16-bit and 64-bit). This scan (collecting beacons on the potential channels) is typically called an active scan or PAN scan.
XBee®/XBee‐PRO® ZB RF Modules These behaviors are configurable using the following commands: Command Description NJ Sets the permit-join time on the coordinator, measured in seconds. D5 Enables the Associate LED functionality. LT Sets the Associate LED blink time when joined. Default is 1 blink per second. If any of the command values in the network formation commands table changes, the coordinator will leave its current network and start a new network, possibly on a different channel.
XBee®/XBee‐PRO® ZB RF Modules Replacing a Coordinator (Security Disabled Only) In rare occasions, it may become necessary to replace an existing coordinator in a network with a new physical device. If security is not enabled in the network, a replacement XBee coordinator can be configured with the PAN ID (16-bit and 64-bit), channel, and stack profile settings of a running network in order to replace an existing coordinator.
XBee®/XBee‐PRO® ZB RF Modules 6. Reading the AI command (association status) will return a value of 0, indicating a successful startup. 7. Reading the MY command (16-bit address) will return a value of 0, the ZigBee-defined 16-bit address of the coordinator. After startup, the coordinator will allow joining based on its NJ value. Example: Replacing a Coordinator (security disabled) 1. Read the OP, OI, CH, and ZS commands on the running coordinator. 2.
XBee®/XBee‐PRO® ZB RF Modules Persistent Data Once a router has joined a network, it retains the following information through power cycle or reset events: •PAN ID •Operating channel •Security policy and frame counter values •Child table (end device children that are joined to the coordinator). The router will retain this information indefinitely until it leaves the network. When the router leaves a network, the previous PAN ID, operating channel, and child table data are lost.
XBee®/XBee‐PRO® ZB RF Modules The following commands control the router joining process. Command Description ID Sets the 64-bit PAN ID to join. Setting ID=0 allows the router to join any 64-bit PAN ID. SC Set the scan channels bitmask that determines which channels a router will scan to find a valid network. SC on the router should be set to match SC on the coordinator. For example, setting SC to 0x281 enables scanning on channels 0x0B, 0x12, and 0x14, in that order.
XBee®/XBee‐PRO® ZB RF Modules These behaviors are configurable using the following commands: Command Description NJ Sets the permit-join time on the router, or the time that it will allow new devices to join the network, measured in seconds. If NJ=0xFF, permit joining will always be enabled. D5 Enables the Associate LED functionality. LT Sets the Associate LED blink time when joined. Default is 2 blinks per second (router).
XBee®/XBee‐PRO® ZB RF Modules Network Watchdog The NW command (network watchdog timeout) can be used for a powered router to periodically check for the presence of a coordinator to verify network connectivity. The NW command specifies a timeout in minutes where the router must receive communication from the coordinator or data collector.
XBee®/XBee‐PRO® ZB RF Modules Network Watchdog Behavior Clear Network Watchdog Failure Count Restart Network Watchdog Timer Yes Received RF Communication from Coordinator or Data Collector No No Network Watchdog Timer Expired? Yes Discover Coordinator Network Watchdog Failure Count =3? Yes Coordinator Found? No Network Watchdog Failure Count +=1 No Yes Leave Leaving a Network There are a couple of mechanisms that will cause the router to leave its current PAN and attempt to discover and join
XBee®/XBee‐PRO® ZB RF Modules •Issue a network leave command. Note that changes to ID, SC, ZS, and security command values only take effect when changes are applied (AC or CN commands). Resetting the Router When the router is reset or power cycled, it checks its PAN ID, operating channel and stack profile against the network configuration settings (ID, SC, ZS). It also verifies the saved security policy is valid based on the security configuration commands (EE, KY).
XBee®/XBee‐PRO® ZB RF Modules requirements, the end device will attempt up to 9 scans per minute for the first 5 minutes, and 3 scans per minute thereafter. Note: The XBee ZB end device will not enter sleep until it has completed scanning all SC channels for a valid network. Joining a Network Once the end device discovers a valid network, it joins the network, similar to a router, by sending an association request (to the device that sent a valid beacon) to request a join on the ZigBee network.
XBee®/XBee‐PRO® ZB RF Modules If the orphaned end device receives a coordinator realignment command, it is considered joined to the network. Otherwise, it will attempt to discover and join a valid network. XBee: ZB End Device Joining When an end device is powered on, if it is not joined to a valid ZigBee network, or if the orphan scan fails to find a parent, it immediately attempts to find and join a valid ZigBee network. Note: The DJ command can be set to 1 to disable joining.
XBee®/XBee‐PRO® ZB RF Modules Command Description D5 Enables the Associate LED functionality. LT Sets the Associate LED blink time when joined. Default is 2 blinks per second (end devices). SM, SP, ST, SN, SO Parameters that configure the sleep mode characteristics. (See Managing End Devices chapter for details.) Parent Connectivity The XBee ZB end device sends regular poll transmissions to its parent when it is awake. These poll transmissions query the parent for any new received data packets.
XBee®/XBee‐PRO® ZB RF Modules 3. If SC or ID is changed from the default, apply changes (make SC and ID changes take effect) by issuing the AC or CN command. 4. The Associate LED will start blinking once the end device has joined a PAN. 5. If the Associate LED is not blinking, the AI command can be read to determine the cause of join failure. 6. Once the end device has joined, the OP and CH commands will indicate the operating 64-bit PAN ID and channel the end device joined. 7.
XBee®/XBee‐PRO® ZB RF Modules Permit Joining The Permit Joining parameter can be disabled in a network to prevent unwanted devices from joining. When a new device must be added to a network, permit-joining can be enabled for a short time on the desired network. In the XBee firmware, joining is disabled by setting the NJ command to a value less than 0xFF on all routers and coordinator devices.
4. Transmission, Addressing, and Routing Addressing All ZigBee devices have two different addresses, a 64-bit and a 16-bit address. The characteristics of each are described below. 64-bit Device Addresses The 64-bit address is a unique device address assigned during manufacturing. This address is unique to each physical device. The 64-bit address includes a 3-byte Organizationally Unique Identifier (OUI) assigned by the IEEE. The 64-bit address is also called the extended address.
XBee®/XBee‐PRO® ZB RF Modules Broadcast Transmissions Broadcast transmissions within the ZigBee protocol are intended to be propagated throughout the entire network such that all nodes receive the transmission. To accomplish this, the coordinator and all routers that receive a broadcast transmission will retransmit the packet three times.
XBee®/XBee‐PRO® ZB RF Modules 16-bit address is obtained after joining a network. The 16-bit address can also change under certain conditions. When sending a unicast transmission, the ZigBee network layer uses the 16-bit address of the destination and each hop to route the data packet. If the 16-bit address of the destination is not known, the ZigBee stack includes a discovery provision to automatically discover the destination device's 16-bit address before routing the data.
XBee®/XBee‐PRO® ZB RF Modules The application should always update the 16-bit address in the address table when one of these frames is received to ensure the table has the most recently known 16-bit address. If a transmission failure occurs, the application should set the 16-bit address in the table to 0xFFFE (unknown). Fragmentation Each unicast transmission may support up to 84 bytes of RF payload. (Enabling security or using source routing can reduce this number. See the NP command for details.
XBee®/XBee‐PRO® ZB RF Modules Alternatively, if the coordinator's 64-bit address is known, DH and DL can be set to the coordinator's 64-bit address. Suppose the coordinator's address is 0x0013A200404A2244. 1. Enter command mode ('+++') 2. After receiving an OK\r, issue the following commands: a. ATDH13A200\r b. ATDL404A2244\ c. ATCN\r 3. Verify that each of the 3 commands returned an OK\r response. 4.
XBee®/XBee‐PRO® ZB RF Modules Routing Approach Description When to Use Ad hoc On-demand Routing paths are created between source and Use in networks that will not scale beyond about Distance Vector (AODV) destination, possibly traversing multiple nodes 40 destination devices. Mesh Routing (“hops”).
XBee®/XBee‐PRO® ZB RF Modules This mechanism enables devices A and B to recognize that the link is not reliable in both directions and select a different neighbor when establishing routes. (Such links are called asymmetric links, meaning the link quality is not similar in both directions.) When a router or coordinator device powers on, it sends link status messages every couple seconds to attempt to discover link qualities with its neighbors quickly.
XBee®/XBee‐PRO® ZB RF Modules network (refer to the Broadcast Transmission), each node that re-broadcasts the message updates the path cost field and creates a temporary entry in its route discovery table. Sample Route Request (Broadcast) Transmission Where R3 is Trying to Discover a Route to R6 When the destination node receives a route request, it compares the ‘path cost’ field against previously received route request commands.
XBee®/XBee‐PRO® ZB RF Modules direction. If the originator fails to receive this Ack, it will retransmit the data, up to 2 times until an Ack is received. This Ack is called the ZigBee APS layer acknowledgment. Refer to the ZigBee specification for more details. Many-to-One Routing In networks where many devices must send data to a central collector or gateway device, AODV mesh routing requires significant overhead.
XBee®/XBee‐PRO® ZB RF Modules The data collector sends a Many-to-One route request broadcast to create reverse routes on all devices. A remote device sends an RF data packet to the data collector. (This is prefaced by a route record transmission to the data collector.) After obtaining a source route, the data collector sends a source routed transmission to the remote device.
XBee®/XBee‐PRO® ZB RF Modules 1. If the application on remote devices periodically sends data to the data collector, each transmission will force a route record to occur. 2. The data collector can issue a network discovery command (ND command) to force all XBee devices to send a network discovery response. Each network discovery response will be prefaced by a route record. 3. Periodic IO sampling can be enabled on remotes to force them to send data at a regular rate.
XBee®/XBee‐PRO® ZB RF Modules Where: 0x0012 - length 0x21 - API ID (create source route) 0x00 - frame ID (set to 0 always) 0x0013A200 404A1234 - 64-bit address of R3 (destination) 0xEEFF - 16-bit address of R3 (destination) 0x00 - Route options (set to 0) 0x02 - Number of intermediate devices in the source route 0xCCDD - Address of furthest device (1-hop from target) 0xAABB - Address of next-closer device 0x5C - Checksum (0xFF - SUM (all bytes after length)) Repairing Source Routes It is possible in a netwo
XBee®/XBee‐PRO® ZB RF Modules •Broadcast transmissions can support 8 bytes more than unicast transmissions. •If source routing is used, the 16-bit addresses in the source route are inserted into the RF payload space. For example, if NP returns 84 bytes, and a source route must traverse 3 intermediate hops (3 16-bit addresses), the total number of bytes that can be sent in one RF packet is 78. •Enabling APS encryption (API tx option bit set) will reduce the number of payload bytes by 4.
XBee®/XBee‐PRO® ZB RF Modules LQI Request 0x0031 Request data from a neighbor table of a remote device. Routing Table Request 0x0032 Request to retrieve routing table entries from a remote device. Network Address Response 0x8000 Response that includes the 16-bit address of a device. Cluster Name Cluster ID Description LQI Response 0x8031 Response that includes neighbor table data from a remote device.
XBee®/XBee‐PRO® ZB RF Modules 0x00 - Broadcast radius 0x00 - Tx Options 0x76 - Transaction sequence number 0x00 - Required payload for LQI request command 0xCE - Checksum (0xFF - SUM (all bytes after length)) Description: This API frame sends a ZDO LQI request (neighbor table request) to a remote device to obtain data from its neighbor table. Recall that the AO command must be set correctly on an API device to enable the explicit API receive frames in order to receive the ZDO response.
XBee®/XBee‐PRO® ZB RF Modules The XBee API includes a transmit options bit that can be set to specify if the extended timeout should be used for a given transmission. If this bit is set, the extended timeout will be used when sending RF data to the specified destination.
XBee®/XBee‐PRO® ZB RF Modules Transmission Examples Example 1: Send a unicast API data transmission to the coordinator using 64-bit address 0, with payload "TxData".
XBee®/XBee‐PRO® ZB RF Modules 0x08 - API ID (at command) 0x01 - frame ID (set to a non-zero value to enable AT command response frames) 0x414F - ASCII representation of 'A','O' (the command being issued) 0x01 - Parameter value 0x65 - Checksum (0xFF - SUM (all bytes after length)) Description: Setting AO=1 is required for the XBee to use the explicit receive API frame (0x91) when RF data packets are received.
5. Security ZigBee supports various levels of security that can be configured depending on the needs of the application. Security provisions include: •128-bit AES encryption •Two security keys that can be preconfigured or obtained during joining •Support for a trust center •Provisions to ensure message integrity, confidentiality, and authentication.
XBee®/XBee‐PRO® ZB RF Modules Frame Counter The network header of encrypted packets includes a 32-bit frame counter. Each device in the network maintains a 32-bit frame counter that is incremented for every transmission. In addition, devices track the last known 32bit frame counter for each of its neighbors. If a device receives a packet from a neighbor with a smaller frame counter than it has previously seen, the packet is discarded. The frame counter is used to protect against replay attacks.
XBee®/XBee‐PRO® ZB RF Modules Message integrity Code If APS security is enabled, the APS header and data payload are authenticated with 128-bit AES. A hash is performed on these fields and appended as a 4-byte message integrity code (MIC) to the end of the packet. This MIC is different than the MIC appended by the network layer. The MIC allows the destination device to ensure the message has not been changed.
XBee®/XBee‐PRO® ZB RF Modules Trust Center ZigBee defines a trust center device that is responsible for authenticating devices that join the network. The trust center also manages link key distribution in the network. Forming and Joining a Secure Network The coordinator is responsible for selecting a network encryption key. This key can either be preconfigured or randomly selected. In addition, the coordinator generally operates as a trust center and must therefore select the trust center link key.
XBee®/XBee‐PRO® ZB RF Modules Enabling Security To enable security on a device, the EE command must be set to 1. If the EE command value is changed and changes are applied (e.g. AC command), the XBee module will leave the network (PAN ID and channel) it was operating on, and attempt to form or join a new network. If EE is set to 1, all data transmissions will be encrypted with the network key. When security is enabled, the maximum number of bytes in a single RF transmission will be reduced.
XBee®/XBee‐PRO® ZB RF Modules Updating the Network Key with a Trust Center If the trust center has started a network and the NK value is changed, the coordinator will update the network key on all devices in the network. (Changes to NK will not force the device to leave the network.) The network will continue to operate on the same channel and PAN ID, but the devices in the network will update their network key, increment their network key sequence number, and restore their frame counters to 0.
XBee®/XBee‐PRO® ZB RF Modules e. WR (save networking parameters to preserve them through power cycle) 2. Configure one or more routers or end devices with the following settings: a. ID=2235 b. EE=1 c. KY=0 d. WR (save networking parameters to preserve them through power cycle) 3. Read the AI setting on the coordinator and joining devices until they return 0 (formed or joined a network). In this example, EE, ID, and KY are set the same on all devices.
6. Network Commissioning and Diagnostics Network commissioning is the process whereby devices in a mesh network are discovered and configured for operation. The XBee modules include several features to support device discovery and configuration. In addition to configuring devices, a strategy must be developed to place devices to ensure reliable routes. To accommodate these requirements, the XBee modules include various features to aid in device placement, configuration, and network diagnostics.
XBee®/XBee‐PRO® ZB RF Modules API Firmware Send an Explicit Addressing ZigBee Command API frame (0x11) using 0x12 as the cluster ID and 0xE8 as the source and destination endpoint. Data packets received by the remote will be echoed back to the sender. RSSI Indicators It is possible to measure the received signal strength on a device using the DB command. DB returns the RSSI value (measured in –dBm) of the last received packet. However, this number can be misleading.
XBee®/XBee‐PRO® ZB RF Modules Push button 20 XBee 15 R Associate LED A pushbutton and an LED can be connected to module pins 20 and 15 respectively to support the commissioning pushbutton and associate LED functionalities. Commissioning Pushbutton The commissioning pushbutton definitions provide a variety of simple functions to aid in deploying devices in a network. The commissioning button functionality on pin 20 is enabled by setting the D0 command to 1 (enabled by default).
XBee®/XBee‐PRO® ZB RF Modules The node identification frame is similar to the node discovery response frame – it contains the device’s address, node identifier string (NI command), and other relevant data. All API devices that receive the node identification frame send it out their UART as an API Node Identification Indicator frame (0x95). Associate LED The Associate pin (pin 15) can provide indication of the device’s network status and diagnostics information.
XBee®/XBee‐PRO® ZB RF Modules Broadcast Node Identification Transmission Associate Pin (D5 = 1) AD0/DIO0 Pin (Remote Device) A single button press on a remote device causes a broadcast node identification transmission to be sent. All devices that receive this transmission blink their associate pin rapidly for one second if the associate LED functionality is enabled. (D5 = 1) © 2011 Digi International, Inc.
7. Managing End Devices ZigBee end devices are intended to be battery-powered devices capable of sleeping for extended periods of time. Since end devices may not be awake to receive RF data at a given time, routers and coordinators are equipped with additional capabilities (including packet buffering and extended transmission timeouts) to ensure reliable data delivery to end devices.
XBee®/XBee‐PRO® ZB RF Modules The parent can buffer one broadcast transmission for all of its end device children. When a broadcast transmission is received and buffered, the parent sets a flag in its child table when each child polls and retrieves the packet. Once all children have received the broadcast packet, the buffered broadcast packet is discarded.
XBee®/XBee‐PRO® ZB RF Modules If a non-parent device does not know the destination is an end device, it will use the standard unicast timeout for the transmission. However, provisions exist in the Ember ZigBee stack for the parent to inform the message sender that the destination is an end device. Once the sender discovers the destination device is an end device, future transmissions will use the extended timeout. See the XBee Router / Coordinator Configuration section in this chapter for details.
XBee®/XBee‐PRO® ZB RF Modules In the figure above, t1, t2, and t3 represent the following events: •T1 - Time when Sleep_RQ is asserted (high) •T2 - Time when the XBee enters sleep (CTS state change only if hardware flow control is enabled) •T3 - Time when Sleep_RQ is de-asserted (low) and the module wakes. The time between T1 and T2 varies depending on the state of the module.
XBee®/XBee‐PRO® ZB RF Modules Demonstration of Pin Sleep Parent and remote devices must be configured to buffer data correctly and to utilize adequate transmission timeouts. See the XBee Router / Coordinator Configuration section in this chapter for details. Cyclic Sleep Cyclic sleep allows the module to sleep for a specified time and wake for a short time to poll its parent for any buffered data messages before returning to sleep again. Cyclic sleep mode is enabled by setting the SM command to 4 or 5.
XBee®/XBee‐PRO® ZB RF Modules In the figure above, t1, t2, and t3 represent the following events: •T1 - Time when the module wakes from cyclic sleep •T2 - Time when the module returns to sleep •T3 - Later time when the module wakes from cyclic sleep. The wake time and sleep time are configurable with software commands as described in the sections below. Wake Time (Until Sleep) In cyclic sleep mode (SM=4 or 5), if serial or RF data is received, the module will start a sleep timer (time until sleep).
XBee®/XBee‐PRO® ZB RF Modules DIN ST = Time Awake On/Sleep A cyclic sleep end device enters sleep mode when no serial or RF data is received for ST time . Legend On/Sleep Transmitting Poll Request Sleep Period The sleep period is configured based on the SP, SN, and SO commands. The following table lists the behavior of these commands. Command Range Description SP 0x20 - 0xAF0 (x 10 ms) (320 - 28,000 ms) Configures the sleep period of the module.
XBee®/XBee‐PRO® ZB RF Modules On/Sleep (SN = 3) On/Sleep (SN = 1) ∆t = SP * SN Transmitting poll request to parent ∆t = SP ∆t = SP * SN Transmitting poll request to parent ∆t = SP Setting SN > 1 allows the XBee to silently poll for data without asserting On /Sleep. If RF data is received when polling, On/Sleep will immediately assert . Legend Sleep_RQ Transmitting Poll Request Note: SP controls the packet buffer time on routers and coordinators.
XBee®/XBee‐PRO® ZB RF Modules The XBee ZB 2x6x firmware includes an adaptive polling enhancement where, if an end device receives RF data from its parent, it sends another poll after a very short delay to check for more data. The end device continues to poll at a faster rate as long as it receives data from its parent. This feature greatly improves data throughput to end devices. When the end device no longer receives data from its parent, it resumes polling every 100ms.
XBee®/XBee‐PRO® ZB RF Modules The value of these timeouts depends on the sleep time used by the end devices. Each of these timeouts are discussed below. RF Packet Buffering Timeout When a router or coordinator receives an RF data packet intended for one of its end device children, it buffers the packet until the end device wakes and polls for the data, or until a packet buffering timeout occurs. This timeout is settable using the SP command. The actual timeout is (1.2 * SP), with a minimum timeout of 1.
XBee®/XBee‐PRO® ZB RF Modules Putting it all Together Short Sleep Periods Pin and cyclic sleep devices that sleep less than 30 seconds can receive data transmissions at any time since their parent device(s) will be able to buffer data long enough for the end devices to wake and poll to receive the data. SP should be set the same on all devices in the network.
XBee®/XBee‐PRO® ZB RF Modules IR = 0x258 (600 decimal). Set IR to a value greater than (2 seconds / 4) to get 4 samples in 2 seconds. The end device sends an IO sample at the IR rate until the sleep timer has expired. At least one analog or digital IO line must be enabled for IO sampling to work. To enable pin 19 (AD1/DIO1) as a digital input line, the following must be set: D1 = 3 All router and coordinator devices on the network should set SP to match SP on the end device.
8. XBee Analog and Digital IO Lines XBee ZB firmware supports a number of analog and digital IO pins that are configured through software commands. Analog and digital IO lines can be set or queried. The following table lists the configurable IO pins and the corresponding configuration commands.
XBee®/XBee‐PRO® ZB RF Modules •Queried Sampling •Periodic Sampling •Change Detection Sampling. IO sample data is formatted as shown in the table below Bytes 1 Name Sample Sets Description Number of sample sets in the packet. (Always set to 1.) Indicates which digital IO lines have sampling enabled. Each bit corresponds to one digital IO line on the module.
XBee®/XBee‐PRO® ZB RF Modules The reading in the sample frame represents voltage inputs of 1143.75 and 342.1875mV for AD0 and AD1 respectively. Queried Sampling The IS command can be sent to a device locally, or to a remote device using the API remote command frame (see chapter 8 for details). When the IS command is sent, the receiving device samples all enabled digital IO and analog input channels and returns an IO sample. If IS is sent locally, the IO sample is sent out the UART.
XBee®/XBee‐PRO® ZB RF Modules RSSI (in dBm) is converted to PWM counts using the following equation: PWM counts = (41 * RSSI_Unsigned) - 5928 IO Examples Example 1: Configure the following IO settings on the XBee. Configure AD1/DIO1 as a digital input with pullup resistor enabled Configure AD2/DIO2 as an analog input Configure DIO4 as a digital output, driving high. To configure AD1/DIO1 as an input, issue the ATD1 command with a parameter of 3 ("ATD13").
9. API Operation As an alternative to Transparent Operation, API (Application Programming Interface) Operations are available. API operation requires that communication with the module be done through a structured interface (data is communicated in frames in a defined order). The API specifies how commands, command responses and module status messages are sent and received from the module using a UART Data Frame.
XBee®/XBee‐PRO® ZB RF Modules Data bytes that need to be escaped: •0x7E – Frame Delimiter •0x7D – Escape •0x11 – XON •0x13 – XOFF Example - Raw UART Data Frame (before escaping interfering bytes): 0x7E 0x00 0x02 0x23 0x11 0xCB 0x11 needs to be escaped which results in the following frame: 0x7E 0x00 0x02 0x23 0x7D 0x31 0xCB Note: In the above example, the length of the raw data (excluding the checksum) is 0x0002 and the checksum of the non-escaped data (excluding frame delimiter and length) is calculated
XBee®/XBee‐PRO® ZB RF Modules Checksum To test data integrity, a checksum is calculated and verified on non-escaped data. To calculate: Not including frame delimiters and length, add all bytes keeping only the lowest 8 bits of the result and subtract the result from 0xFF. To verify: Add all bytes (include checksum, but not the delimiter and length). If the checksum is correct, the sum will equal 0xFF.
XBee®/XBee‐PRO® ZB RF Modules API UART Exchanges AT Commands The following image shows the API frame exchange that takes place at the UART when sending an AT command request to read or set a module parameter. The response can be disabled by setting the frame ID to 0 in the request. Transmitting and Receiving RF Data The following image shows the API exchanges that take place at the UART when sending RF data to another device.
XBee®/XBee‐PRO® ZB RF Modules Source Routing The following image shows the API frame exchanges that take place at the UART when sending a source routed transmission. Supporting the API Applications that support the API should make provisions to deal with new API frames that may be introduced in future releases.
XBee®/XBee‐PRO® ZB RF Modules Frame Fields Start Delimiter Offset Example Description 0 0x7E Length MSB 1 0x00 A P Frame-specific Data Frame Type I Frame ID P a c k e t AT Command LSB 2 0x04 3 0x08 4 0x52 (R) 5 0x4E (N) 6 0x4A (J) Identifies the UART data frame for the host to correlate with a subsequent ACK (acknowledgement). If set to 0, no response is sent. Command Name - Two ASCII characters that identify the AT Command.
XBee®/XBee‐PRO® ZB RF Modules The broadcast radius can be set from 0 up to NH. If set to 0, the value of NH specifies the broadcast radius (recommended). This parameter is only used for broadcast transmissions. The maximum number of payload bytes can be read with the NP command. Note: if source routing is used, the RF payload will be reduced by two bytes per intermediate hop in the source route. This example shows if escaping is disabled (AP=1).
XBee®/XBee‐PRO® ZB RF Modules 0x7E 0x00 0x16 0x10 0x01 0x00 0x7D 0x33 0xA2 0x00 0x40 0x0A 0x01 0x27 0xFF 0xFE 0x00 0x00 0x54 0x78 0x44 0x61 0x74 0x61 0x30 0x41 0x7D 0x33 The checksum is calculated (on all non-escaped bytes) as [0xFF - (sum of all bytes from API frame type through data payload)]. Example: Send a transmission to the coordinator without specifying the coordinator's 64-bit address.
XBee®/XBee‐PRO® ZB RF Modules Frame Fields Start Delimiter Offset Example Description 0 0x7E Length MSB 1 0x00 LSB 2 0x1A Frame-specific Data Frame Type Frame ID Number of bytes between the length and the checksum 3 0x11 4 0x01 Identifies the UART data frame for the host to correlate with a subsequent ACK (acknowledgement). If set to 0, no response is sent. MSB 5 0x00 6 0x00 64-bit Destination Address 7 0x00 8 0x00 9 0x00 10 0x00 Set to the 64-bit address of the destination device.
XBee®/XBee‐PRO® ZB RF Modules Remote AT Command Request Frame Type: 0x17 Used to query or set module parameters on a remote device. For parameter changes on the remote device to take effect, changes must be applied, either by setting the apply changes options bit, or by sending an AC command to the remote.
XBee®/XBee‐PRO® ZB RF Modules Create Source Route Frame Type: 0x21 This frame creates a source route in the module. A source route specifies the complete route a packet should traverse to get from source to destination. Source routing should be used with many-to-one routing for best results. Note: Both the 64-bit and 16-bit destination addresses are required when creating a source route. These are obtained when a Route Record Indicator (0xA1) frame is received.
XBee®/XBee‐PRO® ZB RF Modules AT Command Response Frame Type: 0x88 In response to an AT Command message, the module will send an AT Command Response message. Some commands will send back multiple frames (for example, the ND (Node Discover) command).
XBee®/XBee‐PRO® ZB RF Modules ZigBee Transmit Status Frame Type: 0x8B When a TX Request is completed, the module sends a TX Status message. This message will indicate if the packet was transmitted successfully or if there was a failure. Frame Fields Start Delimiter Offset Example Length MSB 1 0x00 LSB 2 0x07 Frame Type 3 0x8B Frame ID 4 0x01 5 0x7D Identifies the UART data frame being reported. Note: If Frame ID = 0 in AT Command Mode, no AT Command Response will be given.
XBee®/XBee‐PRO® ZB RF Modules ZigBee Receive Packet Frame Type: (0x90) When the module receives an RF packet, it is sent out the UART using this message type. Frame Fields Start Delimiter Offset Example Description 0 0x7E Length MSB 1 0x00 LSB 2 0x11 Frame Type Number of bytes between the length and the checksum 3 0x90 MSB 4 0x00 5 0x13 64-bit Source Address 6 0xA2 7 0x00 8 0x40 9 0x52 A P I 64-bit address of sender.
XBee®/XBee‐PRO® ZB RF Modules ZigBee Explicit Rx Indicator Frame Type:0x91 When the modem receives a ZigBee RF packet it is sent out the UART using this message type (when AO=1). Frame Fields Offset Start Delimiter Example Description 0 0x7E Length MSB 1 0x00 Number of bytes between the length and the checksum LSB 2 0x18 Frame Type 3 0x91 MSB 4 0x00 5 0x13 64-bit Source Address 6 0xA2 7 0x00 8 0x40 64-bit address of sender.
XBee®/XBee‐PRO® ZB RF Modules ZigBee IO Data Sample Rx Indicator Frame Type: 0x92 When the module receives an IO sample frame from a remote device, it sends the sample out the UART using this frame type (when AO=0). Only modules running API firmware will send IO samples out the UART.
XBee®/XBee‐PRO® ZB RF Modules Example: Suppose an IO sample is received with analog and digital IO, from a remote with a 64bit address of 0x0013A200 40522BAA and a 16-bit address of 0x7D84. If pin AD1/DIO1 is enabled as an analog input, AD2/DIO2 and DIO4 are enabled as a digital inputs (currently high), and AD3/ DIO3 is enabled as a digital output (low) the IO sample is shown in the API example in the table above.
XBee®/XBee‐PRO® ZB RF Modules T = 0x016A To convert these to temperature and humidity values, the following equations should be used. Temperature (°C) = (T / 16), for T < 2048 = - (T & 0x7FF) / 16, for T >= 2048 Vsupply = (AD2 * 5.1) / 255 Voutput = (AD3 * 5.1) / 255 Relative Humidity = ((Voutput / Vsupply) - 0.16) / (0.0062) True Humidity = Relative Humidity / (1.0546 - (0.00216 * Temperature (°C))) Looking at the sample data, we have: Vsupply = (234 * 5.1 / 255) = 4.68 Voutput = (82 * 5.1 / 255) = 1.
XBee®/XBee‐PRO® ZB RF Modules Node Identification Indicator Frame Type: 0x95 This frame is received when a module transmits a node identification message to identify itself (when AO=0). The data portion of this frame is similar to a network discovery response frame (see ND command).
XBee®/XBee‐PRO® ZB RF Modules Remote Command Response Frame Type: 0x97 If a module receives a remote command response RF data frame in response to a Remote AT Command Request, the module will send a Remote AT Command Response message out the UART. Some commands may send back multiple frames--for example, Node Discover (ND) command.
XBee®/XBee‐PRO® ZB RF Modules Over-the-Air Firmware Update Status Frame Type: 0xA0 The Over-the-Air Firmware Update Status frame provides a status indication of a firmware update transmission attempt. If a query command (0x01 0x51) is sent to a target with a 64-bit address of 0x0013A200 40522BAA through an updater with 64-bit address 0x0013A200403E0750 and 16-bit address 0x0000, the following is the expected response.
XBee®/XBee‐PRO® ZB RF Modules Route Record Indicator Frame Type: 0xA1 The route record indicator is received whenever a device sends a ZigBee route record command. This is used with many-to-one routing to create source routes for devices in a network.
XBee®/XBee‐PRO® ZB RF Modules Many-to-One Route Request Indicator Frame Type: 0xA3 The many-to-one route request indicator frame is sent out the UART whenever a many-to-one route request is received Frame Fields Start Delimiter Offset Example Description 0 0x7E MSB 1 0x00 Length LSB 2 0x0C Frame Type Number of bytes between the length and the checksum 3 0xA3 MSB 4 0x00 A P I 5 0x13 P a c Frame-specific Data k e t 64-bit Source Address 7 0x00 8 0x40 64-bit address of the device that sent the
XBee®/XBee‐PRO® ZB RF Modules Sending ZigBee Device Objects (ZDO) Commands with the API ZigBee Device Objects (ZDOs) are defined in the ZigBee Specification as part of the ZigBee Device Profile. These objects provide functionality to manage and map out the ZigBee network and to discover services on ZigBee devices.
XBee®/XBee‐PRO® ZB RF Modules Frame Fields Offset Start Delimiter Example Description 0 0x7E Length MSB 1 0x00 LSB 2 0x17 Frame Type 3 0x11 Frame ID 4 0x01 Number of bytes between the length and the checksum Identifies the UART data frame for the host to correlate with a subsequent transmit status. If set to 0, no transmit status frame will be sent out the UART.
XBee®/XBee‐PRO® ZB RF Modules Sending ZigBee Cluster Library (ZCL) Commands with the API The ZigBee Cluster Library defines a set of attributes and commands (clusters) that can be supported in multiple ZigBee profiles. The ZCL commands are typically required when developing a ZigBee product that will interoperate in a public profile such as home automation or smart energy, or when communicating with ZigBee devices from other vendors.
XBee®/XBee‐PRO® ZB RF Modules The following table shows how the Explicit API frame can be used to read the hardware version attribute from a device with a 64-bit address of 0x0013A200 40401234 (unknown 16-bit address). This example uses arbitrary source and destination endpoints. Recall the hardware version attribute (attribute ID 0x0003) is part of the basic cluster (cluster ID 0x0000). The Read Attribute general command ID is 0x00.
XBee®/XBee‐PRO® ZB RF Modules In the above example, the Frame Control field (offset 23) was constructed as follows: Name Bits Example Value Description Frame Type 0-1 00 - Command acts across the entire profile Manufacturer Specific 2 0 - The manufacturer code field is omitted from the ZCL Frame Header. Direction 3 0 - The command is being sent from the client side to the server side. Disable Default Response 4 0 - Default response not disabled Reserved 5-7 Set to 0.
XBee®/XBee‐PRO® ZB RF Modules Frame Fields Offset Start Delimiter Example Description 0 0x7E Length MSB 1 0x00 LSB 2 0x19 Frame Type 3 0x11 Frame ID 4 0x01 Number of bytes between the length and the checksum Identifies the UART data frame for the host to correlate with a subsequent transmit status. If set to 0, no transmit status frame will be sent out the UART.
XBee®/XBee‐PRO® ZB RF Modules Frame Fields Offset Example 26 0x78 4-byte unique identifier. Note the 4-byte ID is sent in little endian byte order (0x78563412). The event ID in this example (0x12345678) was arbitrarily selected. 27 0x56 Issuer Event ID 28 0x34 29 0x12 30 0x14 Device Class Utility Enrollment Group Description to apply the load control event. A bit value of 0x0014 enables smart appliances and water heaters. Note the 2-byte bit field value is sent in little endian byte order.
10. XBee Command Reference Tables Addressing Addressing Commands AT Name and Description Command Node Type1 Parameter Range Default DH Destination Address High.Set/Get the upper 32 bits of the 64-bit destination address. When combined with DL, it defines the 64-bit destination address for data transmission. CRE Special definitions for DH and DL include 0x000000000000FFFF (broadcast) and 0x0000000000000000 (coordinator). 0 - 0xFFFFFFFF 0 DL Destination Address Low.
XBee®/XBee‐PRO® ZB RF Modules Networking Networking Commands AT Name and Description Command Node Type1 Parameter Range Default [read-only] CH Operating Channel. Read the channel number used for transmitting and receiving between RF modules. Uses 802.15.4 channel numbers. A value of 0 means the device CRE has not joined a PAN and is not operating on any channel.
XBee®/XBee‐PRO® ZB RF Modules Networking Commands AT Name and Description Command Node Type1 Parameter Range Default 0 - 0xFF [x 1 sec] 0xFF (always allows joining) NJ Node Join Time. Set/Read the time that a Coordinator/Router allows nodes to join. This value can be changed at run time without requiring a Coordinator or Router to restart. The time starts once the Coordinator or Router has started. The timer is reset on power-cycle or when NJ changes.
XBee®/XBee‐PRO® ZB RF Modules Security Security Commands AT Name and Description Command Node Parameter Range Type1 EE Encryption Enable. Set/Read the encryption enable setting. CRE EO Encryption Options. Configure options for encryption. Unused option bits should be set to 0. Options include: CRE 0x01 - Send the security key unsecured over-the-air during joins 0x02 - Use trust center (coordinator only 0 - 0xFF NK Network Encryption Key. Set the 128-bit AES network encryption key.
XBee®/XBee‐PRO® ZB RF Modules Serial Interfacing (I/O) Serial Interfacing Commands AT Name and Description Command AP AO API Enable. Enable API Mode. The AP command is only supported when using API firmware: 21xx (API coordinator), 23xx (API router), 29xx (API end device). API Options. Configure options for API. Current options select the type of receive API frame to send out the Uart for received RF data packets.
XBee®/XBee‐PRO® ZB RF Modules I/O Commands I/O Commands AT Name and Description Command Node Parameter Range Type1 Default IR IO Sample Rate. Set/Read the IO sample rate to enable periodic sampling. For periodic sampling to be enabled, IR must be set to a non-zero value, and at least one module pin CRE must have analog or digital IO functionality enabled (see D0-D8, P0-P2 commands). The sample rate is measured in milliseconds. 0, 0x32:0xFFFF (ms) 0 IC IO Digital Change Detection.
XBee®/XBee‐PRO® ZB RF Modules I/O Commands AT Name and Description Command D3 D4 AD3/DIO3 Configuration. Select/Read function for AD3/DIO3. DIO4 Configuration. Select/Read function for DIO4. Node Parameter Range Type1 Default CRE 0, 2-5 0 – Disabled 2 - Analog input, single ended 3 – Digital input 4 – Digital output, low 5 – Digital output, high 0 CRE 0, 3-5 0 – Disabled 3 – Digital input 4 – Digital output, low 5 – Digital output, high 0 D5 DIO5 Configuration.
XBee®/XBee‐PRO® ZB RF Modules Diagnostics Diagnostics Commands AT Name and Description Command Node Parameter Range Type1 Default CRE 0 - 0xFFFF [read-only] Factory-set CRE 0 - 0xFFFF [read-only] Factory-set 0 - 0xFF [read-only] -- Firmware Version. Read firmware version of the module. The firmware version returns 4 hexadecimal values (2 bytes) "ABCD". Digits ABC are the main release number and D is the revision number from the main release. "B" is a variant designator.
XBee®/XBee‐PRO® ZB RF Modules Sleep Commands Sleep Commands Node Parameter Range Type1 AT Name and Description Command Default SM Sleep Mode Sets the sleep mode on the RF module. An XBee loaded with router firmware can be configured as either a router (SM set to 0) or an end device (SM > 0). RE Changing a device from a router to an end device (or vice versa) forces the device to leave the network and attempt to join as the new device type when changes are applied.
XBee®/XBee‐PRO® ZB RF Modules Execution Commands AT Name and Description Command Node Type1 Parameter Range Default CB Commissioning Pushbutton. This command can be used to simulate commissioning button presses in software. The parameter value should be set to the number of button presses to be simulated. For example, sending the ATCB1 command will execute the action associated with 1 commissioning button press.
11. Module Support This chapter provides customization information for the XBee/XBee-PRO ZB modules. In addition to providing an extremely flexible and powerful API, the XBee and XBee-PRO ZB modules are a robust development platform that have passed FCC and ETSI testing. Developers can customize default parameters, or even write or load custom firmware for Ember's EM250 chip.
XBee®/XBee‐PRO® ZB RF Modules 1. Set DTR / SLEEP_RQ low (TTL 0V) and RTS high. 2. Send a serial break to the DIN pin and power cycle or reset the module. 3. When the module powers up, DTR / SLEEP_RQ and DIN should be low (TTL 0V) and RTS should be high. 4. Terminate the serial break and send a carriage return at 115200bps to the module. 5. If successful, the module will send the Ember bootloader menu out the DOUT pin at 115200bps. 6. Commands can be sent to the bootloader at 115200bps.
XBee®/XBee‐PRO® ZB RF Modules Hex Error Code Description 0x23 The bootloader encountered an error while trying to parse the high byte of the CRC in the XModem frame. 0x24 The bootloader encountered an error while trying to parse the low byte of the CRC in the XModem frame. 0x25 The bootloader encountered an error in the sequence number of the current XModem frame. 0x26 The frame that the bootloader was trying to parse was deemed incomplete (some bytes missing or lost).
XBee®/XBee‐PRO® ZB RF Modules Enabling GPIO 1 and 2 Most of the remaining sections in this chapter describe how to configure GPIO 1 and 2 to function correctly in custom applications that run on the XBee and XBee-PRO modules. In order for GPIO pins 1 and 2 to be configurable, the application must set the GPIO_CFG register to enable GPIO 1 and 2. Bits 4 - 7 in the GPIO_CFG register control the functionality of various GPIO lines. The following table lists values for these bits that enable GPIO 1 and 2.
XBee®/XBee‐PRO® ZB RF Modules XBee-PRO Applications: emberSetTxPowerMode(EMBER_TX_POWER_MODE_ALTERNATE); or emberSetTxPowerMode(EMBER_TX_POWER_MODE_BOOST_AND_ALTERNATE); XBee-PRO modules must also set a couple of IO lines to enable output power compensation. This is shown below. Once the IO lines are initialized (after powerup), the XBee will enable the power amplifier and LNA as needed. On Powerup: /* GPIO 2 should be set low for at least 10 milliseconds when coming up from power cycle.
XBee®/XBee‐PRO® ZB RF Modules © 2011 Digi International, Inc.
Appendix A: Definitions Definitions ZigBee Node Types Coordinator A node that has the unique function of forming a network. The coordinator is responsible for establishing the operating channel and PAN ID for an entire network. Once established, the coordinator can form a network by allowing routers and end devices to join to it. Once the network is formed, the coordinator functions like a router (it can participate in routing packets and be a source or destination for data packets).
XBee®/XBee‐PRO® ZB RF Modules ZigBee Protocol PAN Personal Area Network - A data communication network that includes a coordinator and one or more routers/end devices. Joining The process of a node becoming part of a ZigBee PAN. A node becomes part of a network by joining to a coordinator or a router (that has previously joined to the network). During the process of joining, the node that allowed joining (the parent) assigns a 16-bit address to the joining node (the child).
Appendix B: Agency Certifications United States FCC The XBee RF Module complies with Part 15 of the FCC rules and regulations. Compliance with the labeling requirements, FCC notices and antenna usage guidelines is required. To fulfill FCC Certification, the OEM must comply with the following regulations: 1.The system integrator must ensure that the text on the external label provided with this device is placed on the outside of the final product. 2.
XBee®/XBee‐PRO® ZB RF Modules If this equipment does cause harmful interference to radio or television reception, which can be determined by turning the equipment off and on, the user is encouraged to try to correct the interference by one or more of the following measures: Re-orient or relocate the receiving antenna, Increase the separation between the equipment and receiver, Connect equipment and receiver to outlets on different circuits, or Consult the dealer or an experienced radio/TV technician for hel
XBee®/XBee‐PRO® ZB RF Modules Antennas approved for use with the XBee RF Module YAGI CLASS ANTENNAS for Channels 11 - 26 Part Number Type (Description) Gain Application* Min. Separation Cable-loss Required A24-Y6NF A24-Y7NF A24-Y9NF A24-Y10NF A24-Y12NF A24-Y13NF A24-Y15NF A24-Y16NF A24-Y16RM A24-Y18NF Yagi (6-element) Yagi (7-element) Yagi (9-element) Yagi (10-element) Yagi (12-element) Yagi (13-element) Yagi (15-element) Yagi (16-element) Yagi (16-element, RPSMA connector) Yagi (18-element) 8.
XBee®/XBee‐PRO® ZB RF Modules Antennas approved for use with the XBee‐PRO (S2) RF Module YAGI CLASS ANTENNAS for Channels 11 - 24 Part Number Type (Description) Gain Application* Min.
XBee®/XBee‐PRO® ZB RF Modules Antennas approved for use with the XBee‐PRO (S2B) RF Module YAGI CLASS ANTENNAS for Channels 11 to 24 Part Number Type (Description) Gain Application* Min. Separation Minimum Cable Loss/ Power Reduction/ Attenuation Required for 18dBm Output A24-Y6NF A24-Y7NF A24-Y9NF A24-Y10NF A24-Y12NF A24-Y13NF A24-Y15NF A24-Y16NF A24-Y16RM A24-Y18NF 8.8 dBi 9.0 dBi 10.0 dBi 11.0 dBi 12.0 dBi 12.0 dBi 12.5 dBi 13.5 dBi 13.5 dBi 15.
XBee®/XBee‐PRO® ZB RF Modules Europe (ETSI) The XBee RF Modules have been certified for use in several European countries. For a complete list, refer to www.digi.com If the XBee RF Modules are incorporated into a product, the manufacturer must ensure compliance of the final product to the European harmonized EMC and low-voltage/safety standards. A Declaration of Conformity must be issued for each of these standards and kept on file as described in Annex II of the R&TTE Directive.
XBee®/XBee‐PRO® ZB RF Modules - Integral PCB Antenna (-0.5 dBi) XBee-PRO (S2) RF Module The following antennas are approved for use with the embedded XBee-PRO S2 RF Module: - Dipole (2.1 dBi, Omni-directional, Articulated RPSMA, Digi part number A24-HABSM) - Chip Antenna (-1.5 dBi) - Attached Monopole Whip (1.5 dBi) - Integral PCB Antenna (-0.5 dBi). XBee-PRO (S2B) RF Module The following antennas are approved for use with the embedded XBee-PRO RF S2B Module: - Dipole (2.
XBee®/XBee‐PRO® ZB RF Modules Detachable Antenna Under Industry Canada regulations, this radio transmitter may only operate using an antenna of a type and maximum (or lesser) gain approved for the transmitter by Industry Canada. To reduce potential radio interference to other users, the antenna type and its gain should be so chosen that the equivalent isotropically radiated power (e.i.r.p.) is not more than that necessary for successful communication.
Appendix C: Migrating from ZNet 2.5 to XBee ZB The following paragraph contains the significant differences in XBee ZB compared to its predecessor, ZNet 2.5. •Command Set •Firmware Versions •New Features. Command Set The following ZNet 2.5 commands have changed for XBee ZB: •ZA - Set / read the ZigBee Addressing enable command. This command was required in ZNet 2.5 to enable application level addressing commands SE, DE, CI. XBee ZB does not support ZA.
Appendix D:Additional Information 1-Year Warranty XBee RF Modules from Digi International, Inc. (the "Product") are warranted against defects in materials and workmanship under normal use, for a period of 1-year from the date of purchase. In the event of a product failure due to materials or workmanship, Digi will repair or replace the defective product. For warranty service, return the defective product to Digi International, shipping prepaid, for prompt repair or replacement.