Using XBee Series 2 with AT parameters

I am new to the XBee world, that is why I thought AT parameters could be a good way to begin with. Unfortunately I am experiencing some problems I can’t understand.

I’ve been given three Xbee Series 2 modules: a Coordinator AT and two Routers AT. I am controlling the Coordinator by means of a PC running X-CTU. The routers are connected to a PIC microcontroler each with which they exchange AT commands. First I succeeded in communicating the coordinator and one of the routers. Then I wanted the third device to join in… and my nightmares began!

The third device would not connect. All the three of them defined a PAN ID 0, but the channel was chosen by means of a scan (SC=1FFE). I noticed the two devices “talking” had CH=12, whereas the one not connecting had CH=13. I never understood this, for the three devices were together on the same table!

I tried to be smarter than the modules and made them scan only one channel (SC=80). Thus, only channel 12h would be scanned and, therefore, chosen. I succeeded in this, but I must have changed something else: nothing worked from that moment on.

I tried to go back to the preliminary value of SC, but it’s not working either. Whenever I check the AT parameters in both modules I see:
AI=0 (which means a network has been created)

AI=0 (which means the device has joined a network)

Moreover, pin 15 of each module is blinking as described in the manual, indicating right performance. However, the data input to the router through the PIC never reach the coordinator and those input to the coordinator never reach the router.

Might I have changed some other parameter(s) and spoil it all? Might I have ruined them? I don’t know. I keep reading the manuals, but I can’t find out what I have done wrong…

At this point, I must confess there are some basics I don’t quite understand. For instance:

  • Can a coordinator device be programmed to be a router/end device (or vice versa)?
  • How come there are so many options in the pop-up menu of the “Function Set”? Well, it doesn’t matter now. I guess that, in my case, my modules can only be Coordinator AT, Router AT or End Device AT. Am I right?
  • How important is the version of the Modem XBee in order to guarantee the communication is successful?
  • Are the Xbee Series 2 modules better for a beginner like me, or would you advise me to get the “Series 1” instead?

I’d be very grateful if some of you could find some time to give me some insight on how to solve this out.

Thanks a lot.

First of all, by setting ID to 0, you are specifying to the coordinator to create a random PAN and to the router to join any PAN. Try reading the OP parameter: this is the operating PAN. See if they differ for the two. If you want to ensure they are on the same PAN, set the ID parameter on both devices to that PAN.

What has likely happened is that when you specified 0 for ID to the coordinator, it went and created a new, random PAN. However, your router was likely on another PAN at the time, and here’s the kicker: once your router has joined a PAN formed by the coordinator, it will not leave that PAN, even through power cycles! UNLESS, you set the JV parameter to 1 - this will ensure that your router will join whatever PAN the coordinator is on every power cycle.

Dear Corey,

Thank you very much for your quick answer. I did not know a random PAN was created by setting ID=0. That is definitely a very important piece of information!

I’ll try modifying this parameter as soon as I get back to the lab and let you know.

Thank you again.