4
\$\begingroup\$

I have been looking at xbees recently but can't seem to find a tutorial on configuring and programming for 3 xbees on the same network - 1 to act as a master the other 2 respond as slaves, but the slaves will do separate functions such as one could be a device for turning on a light the other could be a sensor. So here are a couple of questions:

  • Is this possible?
  • What terminology should I be using when searching for this as i feel that this where my research is going wrong.
  • How are the 2 slaves addressed across the network?
\$\endgroup\$
  • \$\begingroup\$ Why the downvote? \$\endgroup\$ – Dean Nov 23 '12 at 22:25
  • \$\begingroup\$ Nothing to do with electronic design. \$\endgroup\$ – Leon Heller Nov 23 '12 at 22:36
  • 4
    \$\begingroup\$ Actually XBee questions are on-topic \$\endgroup\$ – geometrikal Nov 23 '12 at 23:57
6
\$\begingroup\$

My answer here may help: The appropriate code (Arduino) of Xbee

Once you have one master and one slave like in that answer, repeat the slave configuration steps for the second slave. Then:

  • To send from slave to master, just send the data.
  • To send from master to a slave, set the master's DH and DL to the slave's SH and SL respectively, then exit command mode (ATCN) and send the data. To send to the second slave, do the same but using the second slave's SH/SL.

Note that when you use AT mode and the slaves send simultaneously, the bytes may become mixed at the master. E.g Slave1 sends "hello", Slave2 sends "there", master gets something like "hethelrloe" (painful own experience. :) At some point you will end up needing API mode, but AT mode is a very good, simple, way to start.

The tools and tutorials I found useful on XBee, I gathered them here: http://erion.elmasllari.com/2012/06/in-the-trenches-with-xbee-resources-and-tips/

Good luck!

\$\endgroup\$
  • \$\begingroup\$ I have the same need but having one master and 5 slaves, can I use Series 1 for this? Thanks \$\endgroup\$ – VAAA May 14 '17 at 12:48
2
\$\begingroup\$

Is this possible?

Yep, XBees use Zigbee, a wireless mesh networking protocol. The protocol is most definitely designed for more than 2 devices. In fact, devices can talk to each other via other devices. e.g. if A cannot talk directly to C, but A can talk to B and B can talk to C, then A can talk to C via B, so long as they have the same network identifier.

What terminology should I be using when searching for this as i feel that this where my research is going wrong.

Try xbee network configuration. xbee arduino setup, etc.

How are the 2 slaves addressed across the network?

XBees have two modes of communication, an AT command set and an API. AT mode is a little bit easier.

For devices to talk to each other they must have the same network ID. This can be setup using the X-CTU software, or using AT commands. To talk to different slaves, one simply changes the master's destination address. This can be done inside a program using AT commands.

\$\endgroup\$
0
\$\begingroup\$
  1. Set the master xbee as coordinator.
  2. Set its DH as 00 and DL as FFFF.
  3. Set the slaves as router.
  4. Set the DH and DL as 00 for both the xbees.
  5. Set NI some value you want for the two routers.

Enjoy. It worked for us.

\$\endgroup\$
  • \$\begingroup\$ Welcome to EE.SE! This answer seems useful but if you wanted to improve it further a brief explanation of the various register values and why they should be set that way would be good. \$\endgroup\$ – PeterJ Jan 21 '15 at 9:46
-1
\$\begingroup\$

You don't mention what you are planning on the remote side. If you are planning on using a microcontroller, you can just build a protocol that includes the device number in it.

\$\endgroup\$
  • 1
    \$\begingroup\$ uC not necessary, Xbees can be used without one. Xbee protocol includes full support for Dean's situation \$\endgroup\$ – Erion Nov 24 '12 at 2:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.