XBee Series 2 Point to Point Communication

Introduction

XBee is very easy and popular wireless device. It is a transceiver, it can transmits data wirelessly and it can also receives data wirelessly. There are several types of XBee module and it might be confusing. The very popular XBee isSeries 1 (802.15.4), comes with the firmware to create connection for point to point or star network. But bear in mind, many people actually thought it is using ZigBee protocol, but it is not compliance to ZigBee because it uses the low layer of ZigBee protocol only. Therefore XBee Series 1 (S1) cannot communicate with ZigBee device in the market. Anyway I don think many care because they just want to communicate among XBee, or wanted to have simple wireless communication. The XBee or XBee PRO is basically the same protocol, just PRO module have better transmit power and better receiver sensitivity. So I will be talking about XBee only, not the PRO.

 XBee Series 2 (ZB) does not offer any 802.15.4-only firmware; it is always running ZigBee mesh firmware. It is the new XBee module that we are carrying now. XBee S2 have better performance when you talk about mesh networking where it involve quite a lot of nodes: Coordinators, Routers and End Devices. You can read the datasheet if you want to, but I am going to talk about point to point only :) Bear in mind, XBee S2 CANNOT communicate with XBee S1, it is not compatible in term of wireless communication.

DSCF6313

Left is XBee Series 1, Right is XBee Series 2

Point to point two way communication

The major question, can XBee S2 perform point to point communication?

OK, you want to do simple remote control between your control panel, computer or microcontroller to your robot. Besides sending control command to it, you also want to have feedback such as light, temperature, battery voltage, etc. Can I do that with XBee S2? Those that familiar with XBee S1, I am sure you know you will need to configure the Destination Address and Source Address correctly in order to do this, right? For XBee S2, it is similar procedure, just that you need to make one of the XBee S2 as Coordinator, another as Router.

So get yourself XBee S2, you will need to have two units in order to get communication up. As mentioned earlier, XBee S1 and S2 cannot communicate, so you need to have a pair of XBee S2. Do not mix them up.

Setup

DSCF6309

If you order from Cytron Technologies, the price is similar with XBee S1 (at the time I write this), and it comes with sponge and BB-XBee, the breakout board for XBee. How to use the breakout? Refer to this tutorial. Now, I am not going to use the breakout board because XBee module is 3.3V and you will need to hook up to computer for communication in order to configure it. I will use the SKXBee without module.

 

XBee Starter Kit without Module

Plug the XBee S2 module on to SKXBee socket. Mind the polarity. Plug the USB cable to it and computer. You will need to have X-CTU software, I am using version 5.2.7.5, you can get it from here.

DSCF6316 DSCF6317

If this is the first time you use SKXBee, you will need to install the driver. Please download the driver from here and refer to the method to install it.

Assuming you have done installing USB driver and X-CTU, and the USB of SKXBee is plug in properly, you should see the POWER LED on SKXBee ON. There are two XBee S2 modules needed to be setup. I will show the 1st XBee S2 module setup, which I named it Coordinator 1. 2nd XBee S2 module will be Router 1.

Coordinator

You can choose either one of the XBee S2 to configure as coordinator. At the end, the host do not know which is which as XBee will become transparent once it is setup correctly.

Launch X-CTU

X-CTU choose com

Choose the COM Port, normally is the largest number. Easily you will see it because it is label as USB Serial Port (COM X). In this example is COM10. Your COM port might be different than mine, just choose those that being label as USB Serial port and click “Test/Query”.

X-CTU test

If the baudrate and COM port number is correct, the X-CTU will display simple information such as modem type, firmware version and serial number. If there is no response, choose the other COM port and ensure the baudrate is 9600 (default).

0Coordinator SH edited

Proceed to the right tab on X-CTU, Modem Configuration. Click “Always Update Firmware” and click “Read” to grab data from XBee S2 module.

Choose

ZIGBEE COORDINATOR AT” under Function Set,

Set a preferable PAN ID, I simply set “1234”.

You can also set the Node ID, I set “COORDINATOR1” as node ID, this is not critical.

Record the SH and SL ID on this XBee S2 module, you will need it to set Router module. In my case, the SH is13A200, SL is 408C1470. This is Coordinator Source Address.

Click “Write” and X-CTU will start loading the parameter you just set.

Load Firmware Coordinator

It will take around 30 seconds to 1 minute to complete the loading.

Coordinator Done program

We will need to configure Coordinator again when you get the SH and SL of router :). For the time being, we are done for Coordinator. You can close X-CTU now.

 

Router

If you have another SKXBee, connect it to your computer with another XBee S2 plug in. I will be using the same SKXBee, so I actually exchange the XBee 2S on it.

Launch X-CTU

Choose the COM Port, should be different number than the earlier SKXBee. Your COM port might be different than mine, just choose those that being label as USB Serial port and click “Test/Query”.

Router Test

If the baudrate and COM port number is correct, the X-CTU will display simple information such as modem type, firmware version and serial number. If there is no response, choose the other COM port and ensure the baudrate is 9600 (default).

Proceed to the right tab on X-CTU, Modem Configuration. Click “Always Update Firmware” and click “Read” to grab data from XBee S2 module.

Router Set DH DL edited

Choose

ZIGBEE ROUTER AT” under Function Set,

Set a preferable PAN ID, I simply set “1234”.

You can also set the Node ID, I set “ROUTER1” as node ID. This is not critical.

Record the SH and SL ID on this XBee S2 module, you will need it to set Coordinator module. In my case, the SH is13A200, SL is 4086A429.

Key in the DH and DL address using the SH and SL from Coordinator module. My case is DH: 13A200, DL:408C1470.

Click “Write” and X-CTU will start loading the parameter you just set.

It will take around 30 seconds to 1 minute to complete the loading.

OK, we are done with Router module. If you like to check, you can go to Terminal tab and key in this command.

Router Terminal

Typing “+++” will ask XBee module to enter command mode and will response with “OK”.

ATVR request for firmware version, and XBee will reply, my is 22A7

ATID  request for PAN ID

ATNI request for Node ID, which is ROUTER1 that I just set

ATDL request for Destination Low Address

ATSL request for Source Low Address

ATCN force XBee module to exit command mode. Is fine if you don enter ATCN, after 5 seconds if there is no UART activity, XBee module automatic exit command mode 

Again, Coordinator

Do not forget, we need to set the DH and DL on Coordinator XBee S2 module. Again, plug in Coordinator XBee S2 module, open X-CTU, read the information, and set the DH and DL that you grab from router’s SH and SL. Click write to load the parameters into XBee module.

Coordinator set DH DL

Done

OK, now both this XBee S2 modules are setup and linked together, once they are powered, they are paired. sending data via UART to one of the XBee module will automatically being transmitted wirelessly to the other XBee module and further transmit out from the UART, and this apply for both way.

Here I have install two SKXBee with Coordinator and Router that we setup. Connected to COM10 and COM25.

Xbee SEries 2

If you notice, the DL and SL is paired up. I enter command mode to grab the information we configured and exit the command mode with ATCN. the following text after ATCN and OK is actually happening in transparent mode. The text you type in Router1 XBee will transmit to Coordinator1 XBee and display on terminal and vise versa.

Now, you can use this pair of XBee S2 as wireless point to point communication. It has become same as the XBee S1 if you configure the DL and SL correctly. I hope the tutorial is simple to understand.

We have yet to explore the mesh and complicated communication, if you wanted to do that, do come to our technical forum and discuss.