Let's Make Robots!

What's proper way to make multiple XBee controller?

I am not so familiar with XBee module. Only know how to communicate one to one and I am planning to make one controller that able to control multiple devices with XBee. What I can think of is have all remote devices with different PAN ID and switching PAN ID on controller every time. However I don't feel that's the proper way to do it. So, I am here to search for help and advices. Thanks for anyone who can help.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

First, thanks for your input. Correct me if I misunderstand your idea. In this case when all devices are ON, they still know who I am talking to right? so, I guess I need to program that in all robots to filter the signal to who I am sending to.

You need to set your own protocol in software. It will almost work like a I2C interface protocol, that is all robots have to listen for their own address (R1, R2, etc.) and discard anything they receive for different addresses. So when sending data from the computer to the robots, you need to send the address first, then the command and whatever else you need to send them. They can respond back to the computer using the computer's address (C0 for example). This way, only the computer initiates the contact, never the robots. Just like in an I2C interface. In my MiniEric robot, I am using a standard protocol that lets me switch easy from I2C to serial. All I have to do is replace the functions I2C_send(address, command, value1, value2) with Serial_send(address, command, value1, value2). The Serial_send will issue several Serial.print(variable_name) commands, just like the I2C_send is issuing the proper I2C commands. You can wait to receive an acknowledge signal from the robot before you send the command and parameters if you feel it's necessary. To make things simple, address, command and parameters are one byte size each.


Thanks X, again. I was thinking of that. I guess I have to study more programming on arduino. BTW, do you know any place like SITE3 up Markham area? Downtown is a bit far for me afterwork. Or any personal tutor or classes etc. My foundation is way too weak. That's my major issue. I couldn't even get my AXON2 working because of that 64-bit bootloader issue. *sigh*~

You're welcome. Unfortunately I don't know about such places outside Toronto. I live in North York, and downtown is far for me too, that's why I don't go there as much as I would like. To get around that 64 bit issue, you have to install Win XP in a window in VMware, then run your fboot. That's what I did and it works fine. The only thing is that I like to program in Arduino more than in AVRStudio, so I would like to be able to program and upload cod in Arduino for my Axon. Of course, to take advante of WebbotLib, I still need to use AVRStudio.

Personally what i would do is just have the controller send a different starting command for each different device you are controlling. Use a switch or buttons to change what device you are talking to. 

So for instance say you have a switch in position 1 communicating to a robot.

Have the controller send "R1" and the robot will recognize you are talking to it and accept the commands that follow.


When the switch is in position 2 communicating to a different robot

have the controller send "R2", ending the communication with the first robot and starting it with the second.

There is an application, only for Windows, which can be used to configure them to work a certain way and have specific addresses:


Those settings can also be adjusted with the AT commands in the documentation for whichever model you get.

But like Patrick, I chose to create my own protocol. I use only printable ASCII and use CR/LF as the command terminator, so I can watch conversations using an SFE xBee USB Explorer on the PC and make sense of them. Where I have multiple devices that run the same code, I wrote an address value into EEPROM (unique for each one).