Mesh Network Configuration Using Xbee S2

Hi Everyone
I would like to create a Self Healing Mesh Network Using Xbee S2 with 2mW Wire antenna module. There will be 4 Xbees, 1 acting as a coordinator, 2 routers and an end device. Could some please advice me as how can i configure each of them using X-CTU so that if one router fails, the other one joins the network and completes the transmission of sensor data from the end device as shown in the diagram… The sensor will be LM35 Analog sensor form DFRobot.


Hi rajeev1986

ZigBee network itself has the ability to self-heal the network. If the radio at point C was removed for some reason, a new path A – D-- B would be used to route messages.

But if both routers are active then B will be connected to only one out of A, C and D node at single point of time.

Thanks for your advice killer32. Can you please provide me the X-CTU parameters for Xbee S2 which i should set in order to achieve the above?

thanks once again.


As I mentioned earlier, its a self-healing process completly taken care by modules.

You just setup a coordinator with unique PAN ID and provide this ID to all routers and EDs.
The ED can join any one of the router and may even join the coordinator directly. If you want ED to join only router then follow these steps:

first power up coordinator with unique PAN ID –> then provide the same ID to both routers –> then power down the coordinator –> then provide the PAN ID to ED. The ED will only be in position to join any one of the router –> after this, power up the coordinator again.

Killer32 is correct - this is pretty much automatic on the S2 (which means you have ZigBee not DigiMesh).

If you set the DH/DL in your node B to all zeros, then it sends all response back to the coordinator (node A). Oversimplifying what happens, when A wants to talk to B, it finds either C or D to route. You have no control over which. I think B will use the same route back, but it doesn’t matter. Normally, the system will continue to use the SAME route until a delivery fails, the A will find a new route to B (or B to A). This new route will be used even if the lost node recovers - until a failure occurs again, then new ‘route discovery’ is done.

You have NO ability to confiure the S2 to prefer certain routes. This is not an old-fashioned store-n-forward network where you need to manually define your routes.

Thanks alot Killer32 and lynnl. I was just confused before but its all clear now. I thought that I might actually have to configure parameters in order to achieve self healing network.

Thanks for your support.

Hi I have same project with raajev1986
I still confuse about the setting in X-CTU
what are settings must be set in X-CTU to activate self-healing??
I still confuse what the meaning unique PAN ID as killer32 said, Could you give explanation ?

Hi roisakbar
First of all i would like to suggest to you that you should start off with this nice book on WSN. I, myself started with this and now i have learned things about Xbee which i had no idea before. Download it from here:

More info can be found at:

Now getting on the question that you have asked previously. PAN is the Personal Area Network ID which is different for each network. In order to communicate with the Xbees in your local network you will have to give some value such as 5689 which should be same for all xbee under that network…

Again download X-CTU from Idigi and check out this application. Connect a Xbee and under configuration you will see all the AT commands where PAN ID is one of them.

For self healing, you do not have to do any manual setting or configuration. Its inbuilt with the zigbee module.

Hope i have answered your question.

hai everyone, please help me about configuration xbee, i have same problem, i need building mesh protocol, my xbee series 2,
i have 1 coordinator, 1 router, and 1 end device.
first, i set PAN ID 2015 to all xbee, and then i set coordinator DH = 0, DL=FFFF, router DH = 0, DL = 0, end device DH = 0, DL = 0…
when i try communication my xbee, just coordinator with end device is work, if i add router, is not work, what happen guys??
give me explanation please…
thanks before (note: i set coordinator AT,router AT, end device AT)

i set coordinator AT, router AT, and end device AT

I thought that I might actually have to configure parameters in order to achieve self healing network.



Try setting the DL and DH of the Coordinator to match the SL and SH of the End device or Router you want to send the data out the UART of. This is called Unicast addressing.

If you want to force an End device to send data via a Router and then to the Coordinator, you need to first turn off Joining on the Coordinator. That can be done by setting the NJ parameter to 0. Then on the End device, Enter command mode and issue the Local Network Reset command (ATNR0). This will cause the end device to drop its current parent information and join the router. Now when you send data to or from the end device, the data will be sent via the router.

exceause me, may i have your program code for EC, router, and coordinator please ?

why we put DL and DH of the Coordinator to match the SL and SH of the End device or Router because End device node send data to coordinator via router in this manner
End Device->Router–> coordinator

Nope. It will do it all on its own. You only need to tell the module the address of who it is you want the data to come out the UART of.