Home  ›  Product Guides  ›  Wireless Device  ›  XBee  ›  XBee Series 2 Point to Point Communication

Tags: , , , , , ,

XBee Series 2 Point to Point Communication

Introduction

XBee is very easy and popular wireless device. It is a transceiver, it can transmit data wirelessly and it can also receive data wirelessly. There are several types of XBee module and it might be confusing. The very popular XBee is Series 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 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).

Coordinator 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 is 13A200, 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 is 13A200, 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.


38 Responses to “XBee Series 2 Point to Point Communication”

  1. saint says:

    hey, i was wondering, can you do a tutorial on series 1 also ? i’m having problem in setting the values for both modules.

  2. bhugun belal says:

    Dear Sir,

    i have actually bought two xbee S1 modules, i have well downloaded the latest firmware but i cant see neither coordinator not router in function set?

    can you please tell me whats wrong?

    kind regards,

    Belal

  3. Tejaswi says:

    I’m getting an error while writing the for coordinator at. I’m unable to see the SH, SL address in the coordinator window, though I could read the values when I read in router window.
    the error i’m getting is

    Could not open output file.
    System error: Access is denied.

  4. ober says:

    This tutorial is aiming at XBee Series 2 as highlighted at the title and in the beginning of the post. XBee S1 does not have coordinator nor router function. Anyway, to set up XBee Series 1 you can refer to another post: http://tutorial.cytron.com.my/2011/07/30/xbeexbee-pro-wireless-communicate-with-microcontroller/

  5. ober says:

    This error does not seem to be from the XBee module, it might be your X-CTU is not installed correctly or the COM port is not installed properly.

  6. bdia says:

    hi, please i need a module that works on the zigbee protocol. for transmission and reception of signals.
    thanks

  7. ober says:

    Series 2 is ZigBee compliance.

  8. mary says:

    hi
    i have a problem with my bee pro moudule.
    it dosent respond ATNI command!!!!! whaat can i do?!!!
    may it is in sleep mode?!!
    also the Read buttom in “tab configuration” dosnt read my xbee properly!!!
    how can i upgraid my XCTU software?

  9. Wow! Thank you for a straight-forward explanation of how to configure two XBee Series 2 modules for point-to-point communication. Of the dozen different explanations for configuring XBees that I have read today, yours is the only one that makes sense (your obvious status as an English-as-a-second-language speaker notwithstanding) and yielded results. Keep up the great work!

  10. MOK says:

    When the Router cannot send a message to the Coordinator, it did not receive. Instead the router receive the message it self. What can be wrong?

    Thanks

  11. alsad.mohamed says:

    hi can i know if the xbee support aknowledgments or not, am setting up a network and the error rate is not good

  12. Clear, concise and accurate description of how to link up two modules. Well explained and laid out. Well done!

    A paragraph on why a router and coordinator are needed would have made it perfect but not really necessary.

  13. ober says:

    You might want to install the latest version of X-CTU. Just uninstall existing X-CTU and re-install with latest version

  14. ober says:

    MOK, sorry, I am yet to study that part. My guess would be the nature of router, it is to let the host know that the message does not reach Coordinator. Yet, that is just my guess

  15. ober says:

    In API mode, you can configure it to have acknowledge, in transparent mode, there is no ack. However, that is series 1, I am not sure about series 2.

  16. ober says:

    Thanks for the feedback, I will look into it and add in accordingly.

  17. dennis says:

    my xbee s2 is detected while test/query, it gives me all details, serial number, comport and firmware version 22A0, however, when i go to modem config, the modem is [UNKNOWN] and when i select to read, it prompts to search for firmware online. I havent been able to set up my xbee s2. Please help

  18. rafael says:

    Good tutorial it was uselful. I need some help with setting up a mesh if it’s possible. thanks

  19. Prasad says:

    how to communicate between xbee S2 and microcontroller without using any software???,
    (I just want to use my xbee s2,hyperterminal and controller)
    pls reply me asap…

  20. Tom says:

    Hi, excellent article on setting up two series 2 xbees in AT mode (one coordinator and one router) Your the only one I think that mentions you have to reprogram the coordinator destination address to that of the router. I have followed you instruction and they work great.

    My question is can three series 2 xbees be setup in AT mode ? (one coordinator and two routers or maybe one coordinator, one router, and one end pt), I would like to do point to multipoint communications.

    If yes what are the steps to setup the addresses?

    Thanks

  21. YUN says:

    hi.. thank for the tutorial

    wanna ask when i type ATVR why the xbee not reply anything?? but the word still display on another xbee.. is it ok?

  22. Ram Kumar says:

    I configure Xbee series 2 module as Router AT with (BR-9600;None-parity) and after that that module is not communicating with X-CTU, And even after hardware reset. How to slove this issue??

  23. kumar66 says:

    thanks a lot

  24. Alvaro says:

    Excellent explanation, thank you.
    I’d like to add something: for some reason if you set the PAN ID to 2345 (as I did first), the pairing does not work. I set it to 1111 and it worked (and I guess 1234 also work). I could not find any other difference in the configuration. 2345 just don’t work. I don’t know the reason, but I hope this may prevent some hair pulling..

  25. ober says:

    Thanks for the sharing.

  26. raditya says:

    hello,
    i have a problem with my xbee series 2 2mW.
    my problem is my xbee range work only 2 to 3 meter max But my problem is not about the obstructions between the two antennas, because i already try my xbee range outdoor, still the range work only in 3-4 meter, increasing 1 meter only from indoor trial.
    but from the datasheet xbee can work in 40 meter indoor, and 120 meter outdoor. and i havent get the solution yet
    so i hope you can answer my problem sir.
    my spesification is, i use 2 laptops, with xbee-usb adapter v.2 in each laptops, and x-ctu software.
    please reply this as soon as you can.
    thanks

  27. ober says:

    The range test in datasheet is being test under line of sight and in a chamber where no other RF source, example WiFi, Bluetooth, Microwave, etc. All these RF sources will greatly interfere with the XBee series 1 or 2 because they are all using 2.4GHz.

  28. mokoko says:

    2-3 meter real good my xbees can communicate in 20 cm
    it seems xbee series 2 are useless devices

  29. mokoko says:

    is this possible to baud rate problem?

  30. midhun says:

    I use xbee series s2 and serial adapter board and when press test and query button it can not communicate with modem? why? plz help iam in acritical stage

  31. ober says:

    Please discuss in our technical forum, there are too many possibilities that might cause the problem.

  32. Mike MCNaughton says:

    Thanks for the great piece. I followed your instructions exactly and got my project moving after banging my head against the wall for 2 full days.
    Regards

  33. Hajeur says:

    Hello,
    Since I am novice in embedded sofware development,I m asking for your help .
    i am working on domotic project.I try to design an encapsulation for [the industrial protocol M-bus(based on RS485 half duplex)]in [ the point to point serial link RS232/UART(full duplex) ](in order to send the data afterward over an xbee) .
    Honnestly,i’s been three days since i was searching on the net for a way to get that done but right now i’m wondering if that is even possible to design .
    Hajeur

  34. Hajeur says:

    I forgot to thank all of you for that amazing forum. :)

  35. Heya! I realize this is sort of off-topic however I needed to ask.
    Does building a well-established blog like yours take a massive amount
    work? I’m brand new to blogging but I do write in my journal every
    day. I’d like to start a blog so I can easily share my own experience and views online.
    Please let me know if you have any kind of recommendations or tips for new
    aspiring bloggers. Thankyou!

  36. Rafael Coronel says:

    Hi,

    I’m using a pair of Xbee Pro S2. I followed the tutorial. Congrats for it by the way.

    All sounds fine with modules, except for the fact that coordinator can’t send messages. It sends (blue) and immediately receives back (red) whatever I type. No message is received by router also. Isn’t that supposed to work? In the other hand, when coordinator receives all messages from router.

    Any hint?

    Regards,

    Rafael C.

  37. 0043 says:

    Is there a tutorial on how to configure Xbee API mode?

Leave a Reply

Help us improve the wiki Send Your Comments