mesh network between xbee pro s2b

Hi everyone,

I am using 2 xbee pro s2b modules and I would like to configure them to work in a mesh network(NOT peer-to-peer) using the X-CTU program.

The one module will be remote and connected on an Arduino, which will be the transmitter. The other one will be connected on a computer, which will be the receiver.

I have searched a lot and the closest i could get was to get them broadcasting.

I am new to this, but i believe i am getting the hand of it, so if you could be as detailed as possible on how to configure them it would be most appreciated.

Regards,
gabys

A network is needed when you have 3 or more devices. Why do you need a network for 2 devices?

What have you tried? What worked? What didn't?

First of all, i only have 2 xbee pro s2b for the time being, but i want to create a mesh network between them in case i want to extend the range of the transmission later on.

Secondly, the closest information i could get for this was how to make it broadcast the information and i surely searched for endless hours. I couldn't find anything regarding mesh network.

I haven't tried anything special until now because i simply didn't have any information to guide me on how to implement it.

A link to the XBees would be useful - and not a e-bay resellers site.

The XBees automatically create the mesh network, you don't need to do anything special to have it happen. Be sure to get a copy of the Digi Product Manual and become familiar with it. This is one of the best sources of information.

Here is the simplest way that I have found to get them talking in AT (transparent) mode.

Check out the book Building Wireless Sensor Networks by Rob Faludi. It contains all of the documentation you will need to setup a mesh network in the future.

As Jack said, the series 2 XBees set up the mesh network automatically, but let me expand on this a bit. You don't have to do anything. All you have to do is set one of them up as a coordinator and the other as a router and they will take care of everything else related to the network---even if you don't want them to. So, follow Jacks example of setting them up for AT (transparent) mode to get things started. Realizing that behind the scenes there is a full blown mesh network running to take care of things for you.

I recommend using modem type XB24-ZB and the Zigbee software. I always choose the highest version from the version list, just in case they fixed some bug or other. With Series 2 and above you have to choose the firmware for AT or API mode and what kind of device you want it to be (coordinator, router, end device), but that's not hard, just a little confusing at first.

Once you get two of them talking to each other, you're ready to expand to three or fifty. When you get ready to add your third XBee, think carefully about where you're going to put the coordinator. For example if you choose to hook it to a laptop, the network dies (yes, it quits working entirely) when you close the lid on the laptop. The coordinator can be hooked to any machine you want, it actually doesn't need to be hooked to anything except power. I have my coordinator in my attic hooked to a GPS based clock that supplies the correct time to my network. I never mess with it.

So, use Jack's example to get started. Expand your experience a bit with them by playing with distance, loop backs etc. Then decide what you want to do with them and go for it. I have a page of various devices and examples on my blog here. You can steal any of the examples or code and have fun with it.

draythomp:
When you get ready to add your third XBee, think carefully about where you're going to put the coordinator. For example if you choose to hook it to a laptop, the network dies (yes, it quits working entirely) when you close the lid on the laptop.

Actually not! The coordinator is only needed for new devices to join the network. The coordinator can go offline and other devices that are already associated to the network keep operating.
See: ZB-Pro Router issue in large network - #4 by JChristensen - Networking, Protocols, and Devices - Arduino Forum

Of course this still doesn't make hooking the coordinator to a laptop a good idea! (except maybe for testing purposes)

I just shut down my coordinator, and sure enough, the other devices kept working. Then I shut down one of the other devices (a router) and turned it back on, it couldn't connect. I let it try while I crawled back up into the attic and turned on the coordinator and the disconnected router hooked up in a few seconds. There was an end device sleeping and waking up the entire time that kept working just fine through the whole episode. WTF??

You learn something new about these little things every darn day. I have suffered through hundreds of power failures and the network doesn't come back up until the coordinator does, I guess that's why. I never thought to just turn off the coordinator and see what happened.

Thank you so much guys for you help!

I have set up the configuration on both modules, something that was a piece of cake i have to admit. Now all i have to do is connect the xbee shield with the Arduino and program it to send the data.

draythomp i have a feeling that your blog will be like ambrosia to me :slight_smile:

Thank you again guys!!

Oh yeah! I just noticed that the mesh network documentation was written by you Jack. Good work! You are a "mesh network" saver!! XD

gabys:
Oh yeah! I just noticed that the mesh network documentation was written by you Jack. Good work! You are a "mesh network" saver!! XD

And sometimes I'm just a mesh. But glad to help in some small way :smiley:

draythomp:
I just shut down my coordinator, and sure enough, the other devices kept working. Then I shut down one of the other devices (a router) and turned it back on, it couldn't connect. I let it try while I crawled back up into the attic and turned on the coordinator and the disconnected router hooked up in a few seconds. There was an end device sleeping and waking up the entire time that kept working just fine through the whole episode. WTF??

Sorry to make you crawl through the attic :astonished: When you say the router couldn't connect after being turned back on, what was the specific symptom? Are JV or NW set to non-default values?

...the network doesn't come back up until the coordinator does...

When is the network considered "up"?

Most of my XBees have an "associated" LED, the meaning of which I misinterpreted for some time. What it doesn't mean is that "I am actively connected to a network and can transmit and receive." Consider a two-node network, a coordinator and a router. Configure them and get them talking. Then power both off. Now power up the router only. The "associated" LED will still blink, indicating that the router is still associated to a network, and when it can again connect to that network, it will then be able to transmit and receive.

What the associated LED does mean is more like "I joined a network (coordinator required for that) and nothing has happened to cause me to leave it." It's just an internal status in the individual module that doesn't necessarily reflect the current ability of the device to actually function on the network.

I was sniffing the network and looking for actual transmissions; didn't even bother to look at the lights because they are inside a box. I have to sniff them because most of them don't broadcast anymore, they have specific addresses to transmit to. When the coordinator was unplugged, nothing changed except the time transmissions that the coordinator is in charge of. Then I took down the router, which is an outside sensor for temperature; I popped the GFI it's plugged into. When I turned on the router, it didn't come back. I waited quite a while, well many, many commercials on the TV, and it never sent anything. It's not in the path of any other XBees, so I couldn't tell if it would relay.

Crawled up and turned the coordinator back on and it started working really quickly, then I noticed transmissions from the temperature sensor start up a couple of seconds later. All the time a couple of battery monitors that are configured as end devices and sleep for around a minute between transmissions were just talking away like they didn't notice anything.

So, it certainly wasn't a scientific test, but it did prove the coordinator can be turned off after the entire network is established. Don't know about the router, but it was sure silent from the time I turned it off until a second or two after the coordinator came back on.