Bee ZigBee HowTo.docx

Embed Size (px)

Citation preview

  • 7/27/2019 Bee ZigBee HowTo.docx

    1/5

    Bee ZigBee HowToPosted on13. December 2012byTom

    Setup

    This first setup describes how to configure two XBee Series 2 modules in order to communicate with

    each other.

    Background

    In contrast to XBee Series 1 nodes that use a simple 802.15.4 MAC layer protocol to communicate

    with each other (just point to point or point to multipoint), Series 2 nodes use the much more

    powerful ZigBee protocol that builds on top of the 802.15.4 protocol. Because series 1 devices cant

    address their destination node within the payload, they must be flashed with a destination address

    using the X-CTU Tool or a serial terminal program and AT commands. Series 2 devices do not only

    send pure data, they encapsulate their payload in a protocol structure similar to many others (e.g.

    TCP/IP). This way they can provide a much broader functionality and can be used for building

    complex mesh sensor networks. Each node within a ZigBee network must have one of three roles:

    Coordinator: Exactly one for each network Router: None or many, additionally route packets to other devices End Device : None or many

    XBee Device Configuarion

    Each XBee device must be flashed and configured with a certain firmware depending on its

    role in the network. Due to the XBee microcontrollers memory constraints not all functions

    can be supported by a single firmware. In our scenario one device should be flashed

    as Coordinator in API mode and the other as Router in ATmode. Both must be in the same

    network (same PAN ID) and there must be only one coordinator. The first XBee device has

    to be put on the Sparkfun Explorer and connected via USB to the Desktop Computer. A

    COM-Port should be automatically installed (remember the port number). Now install the

    latest version of the X-CTU tool from the digi.com website[1]and run it.

    http://blog.hcilab.org/gadgeteer/2012/12/xbee-zigbee-howto/http://blog.hcilab.org/gadgeteer/2012/12/xbee-zigbee-howto/http://blog.hcilab.org/gadgeteer/2012/12/xbee-zigbee-howto/http://blog.hcilab.org/gadgeteer/author/kubitzts/http://blog.hcilab.org/gadgeteer/author/kubitzts/http://blog.hcilab.org/gadgeteer/author/kubitzts/http://c/Users/Thomas/Desktop/Gadgeteer/Doku/XBee-HowTo.docx%23_ftn1http://c/Users/Thomas/Desktop/Gadgeteer/Doku/XBee-HowTo.docx%23_ftn1http://c/Users/Thomas/Desktop/Gadgeteer/Doku/XBee-HowTo.docx%23_ftn1http://c/Users/Thomas/Desktop/Gadgeteer/Doku/XBee-HowTo.docx%23_ftn1http://blog.hcilab.org/gadgeteer/author/kubitzts/http://blog.hcilab.org/gadgeteer/2012/12/xbee-zigbee-howto/
  • 7/27/2019 Bee ZigBee HowTo.docx

    2/5

    API and AT Mode

    The configuration described in the next part will enable each ZigBee device configured as

    Router or End Device to send data that was received over its serial port to the Coordinator

    Node (Router/End Device in AT mode). The Coordinator can send data to all other devices

    in the same PAN or address each device individually (Coordinator in API mode).

    This centralized topology enables End Device to send and receive data through a

    transparent serial interface without the need of addressing. If dynamic peer-to-peer

    communication is needed, Routers and End Devices must also be set to API mode. In this

    case the API mode protocol must be supported by the microcontroller connected to the

    serial interface of the ZigBee Router or End Device. In a configuration with only two ZigBee

    devices the Router/End Device will send all data to the Coordinator and the Coordinator canbroadcast all data to all Router/End Devices (in this case only one). An even easier way to

    connect two ZigBee modules is to set both to AT mode. The Coordinator must then be

    configured with the destination address of the receiving module (DH/DL setting). The

    following configuration describes the mixed mode variant which can be for example used

    with theXBee Internet Gateway(XIG) in order to give ZigBee Router/End Devices Internet

    access.

    C O O R D I N A TO R C O N FI G U R A TI O N :

    Select the correct COM port and press Test/Query. If this works, go to the ModemConfiguration Tab and start with flashing the newest firmware onto your device. After

    updating firmware (Modem: XB24-ZB, Function Set: ZIGBEE COORDINTOR API, Version

    21A7 (or newer)) press the Write button. Then press Restore to reset all default values

    and get a clean configuration. Now set all values as follows and press Write again.

    Congratulations, you have set up the coordinator module!

    PAN ID = 1 (or another) API AP = 2 (enable API with escaping) NI = MCI-BEE-1 (human readable name)

    If your modem (here XB24-ZB) can not be found within X-CTU, try to updated the tool

    automatically or download the missing modem driver (a .zip-file) from Digis repository and install it

    manually (X-CTU->Modem Configuration->Download new versions->File).

    http://code.google.com/p/xig/http://code.google.com/p/xig/http://code.google.com/p/xig/http://code.google.com/p/xig/
  • 7/27/2019 Bee ZigBee HowTo.docx

    3/5

    R O U T E R C O N F I G U R A TI O N :

    After updating firmware (Modem: XB24-ZB, Function Set: ZIGBEE ROUTER AT, Version 20A7

    (or newer)) press the Write Button. Afterwards press Restore to reset to default values. Now set

    all values as follows and press Write again:

    PAN ID = 1 (MUST be same as the coordinator!) Destination High DH = 0 Destination Low DL = 0 (means coordinator address) JV = 1 (means router tries to rejoin with coordinator after startup) NI = MCI-BEE-2 (human readable name)

  • 7/27/2019 Bee ZigBee HowTo.docx

    4/5

  • 7/27/2019 Bee ZigBee HowTo.docx

    5/5

    Optionally our MCI-BEE-2 could have been configured as end device.Your XBees should

    be configured know. This can checked by connecting the coordinator in API mode using the

    SparkFun Explorer to a USB port and starting the Terminal tab within the X-CTU tool. Data

    received from other modules in the same PAN will be displayed in the window enclosed

    by the API mode protocol structure.