training:using_xbee

Here is a general guide on how to use an Xbee. If more help is needed go to Team Quasar's wiki page.

2 Xbees
2 Xbee USB Explorer Board(with cables)
1 Arduino with Xbee Shield(or Bare Arduino with Xbee Breakout Board)
Download XCTU and the Xbee Arduino Library.

The goal of this tutorial is to get two Xbees(Coordinator API and Router API) to communicate with one another.

Connect two Xbee Explorers to your computer and open up XCTU. Click the icon in the top left corner and select the port of one of the Xbee's are using. If none are found restart your computer and try again.

Once the Xbee is selected, click finish. You should then see a configuration page on the right side of the window.

If a window tells you to restart the Xbee then get a wire and make a connection from GND to RST for 5 seconds and then take it off.

If it still cannot recognize the Xbee then go Tools → Xbee Recovery. Select the port of the Xbee, if you are using a Xbee Pro S2B then the product family is “XBP24BZ7”, function set should either be Zigbee Coordinator API or Zigbee Router API, and select the latest firmware edition.

You need to have one router Xbee and one coordinator Xbee, so if you want to overwrite the previous firmware just click the button update on the config side and select the firmware you want. On the config page change the PANID to any letters or digits, but remember it because you will need to put the same PANID into the other Xbee. Press the write button to save your changes.

Click the monitor icon on the top right and click open for both Xbees. Go to the router and add a frame. Change the frame to “Transmit Request” from “AT Command”. Write a message in the RF section and save the frame. Now click send the frame and hopefully when you check your Coordinator a package was sent.

Go to the config page of your Router Xbee and note the High and Low Destination Address(Should be 0 by default, I change it to High:0, Low:FFFF). Make sure the High and Low Destination Addresses are the same for both XBees.

Set up the Router Xbee on the Arduino shield and connect it to your computer.
Open the Arduino IDE and open the sketch “Series2_Tx” example from the Xbee Library.

Change the line“XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x403e0f30);” to include your address that you noted earlier. For example, for my high and low I would insert “XBeeAddress64 addr64 = XBeeAddress64(0x0, 0xFFFF);

Open the the Coordinator that is still open in XCTU and upload the sketch to the Arduino.(Note: On the Xbee shield there is a switch that has two sides, UART and DLINE. When you upload the sketch to the Arduino the switch needs to be on DLINE or else it won't upload. Switch it back to UART after the sketch uploads);

If everything goes correctly you should be seeing packets on the Coordinator in XCTU monitor.

Authors

Contributing authors:

aobatake klauritzen

Created by aobatake on 2016/06/30 06:38.

  • training/using_xbee.txt
  • Last modified: 2021/09/19 21:59
  • (external edit)