Home  >  Support  >  Support Forum  >  Transmit AND receive data from two XBee (ZigBee) S2 radios in ROUTER mode

Transmit AND receive data from two XBee (ZigBee) S2 radios in ROUTER mode

0 votes
I currently have a 3 XBee (ZigBee) module network I am trying to troubleshoot.

I want to ideally have 4 XBees, but that's later.

So my current 3 XBee module network has 1 coordinator, 2 routers. I followed this guide: https://sites.google.com/site/xbeetutorial/xbee-introduction/zigbee_setup

It works perfect for 1 coordinator, 1 router.

Now each router is connected to an Arduino Uno with 3-4 sensors each. It transmits/broadcasts 3-4 lines, 1 for each sensor every second or so. So does my other router (2 routers total).

Now my coordinator (hooked up to an XBee USB board to my PC) can see the data being received in the X-CTU terminal. However, there is an issue with the data/lines being jumbled up between Router 1 and Router 2 (R1 and R2 from now on).

I ASSUME that R1/R2 can talk to my coordinator (C), and it can. I have tried to sent data from C to R1 or R2, it recognizes it. I have received data from R1 or R2 to C (obviously), and I can see it.

However my solution for the "synchronization" or data is summarized as having a flag that broadcasts "I'm done" from R1 which I want R2 to read/receive and then start broadcasting/transmitting R2's sensor data. Then R2 says "I'm done" to R1 and repeat for infinity.

I have tried to implement this with NO luck.

This is what I can get out of my situation.

1. I can transmit/receive from coordinator (C) to router (R1 or R2). I can do it from both simultaneously obviously, which is my main issue I want to fix.
2. I CANNOT get my routers (R1 and R2) to recognize anything they broadcast, but it will recognize anything C broadcasts (when I try to send something via Terminal in X-CTU).

I want to ultimately poll/sync the outputs of my Arduinos + Routers so they don't output at the same time
Get my XBee Routers (R1/R2/R3/etc) to receive broadcasts they send out. They only recognize coordinator (C) broadcasts.

If anyone has an alternative solution, I would appreciate it.

asked Apr 17 in XBee Programmable Development by refinery New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
The default configuration for ZigBee is as follows:

Coordinator's destination address is a broadcast (DH=0, DL=FFFF)
Router/End Device's destination address is a unicast to the coordinator. (DH=0, DL=0)

0 is a reserved address for the coordinator, FFFF is a reserved address for a broadcast. So if you want a router to talk to someone other than the coordinator, you just have to set the destination address accordingly.

The radio's address is the serial number. It's a 64-bit number broken into two halves (Serial High, and Serial Low). The easiest way to find this is to do a read and note the SH and SL. On the opposing router, put these two numbers in as your destination address (DH=SH, DL=SL). Alternatively, you could put in a broadcast address (DH=0, DL=FFFF) and everyone will hear your message.

The other option is to use API mode. This way you specify the destination address on a per-packet basis. This is a lot more complicated because you also have to format all of your data into a particular format. If you are using an Arduino, there's a library out there that will do all of the heavy lifting for you. You can have a mix of API and transparent (AT) radios on the network, which can make things easier...

Since you are concerned with the coordinator getting jumbled data from the routers, you could set the coordinator to be in API mode, and leave the routers in AT. The data you receive will be in a frame that will include the source address. So you can more easily parse who sent what.

Page 23 of this guide can describe it better than I can: http://ftp1.digi.com/support/documentation/90002168_A.pdf
answered Apr 21 by Chiablo Community Contributor (109 points)
Contact a Digi expert and get started today! CONTACT US