can't establish connection between 2 arduino uno boards with xbee modules

Hi, i’m working on a project of my institute. i want to make an xbee network with one coordinator and many end devices. Every end device will read data from sensors attached to them and after the reading it will send the info to the coordinator.

I’m actually trying to make a connection test between 2 xbees. i have them connected to the arduino with arduino xbee shields. One arduino module has a dth11 temperature sensor connected (which is the data of this sensor that i want to send to the other xbee) and the other xbee module is the one that should receive the data coming from the other xbee.

i have configured them with the X-ctu software to have them the same PAN ID and i configured one module as the coordinator AT with destination high = 0 and destination low = FFFF so it can enter into broadcast mode and send response to all the modules. The second xbee module i configured it as an end device with the destination high = 13a200 and the destination low = 4090C47D which is the address high of the coordinator module.

the Problem is that the coordinator doesn’t receive any package and when i check the serial monitor of the end device i see some rare symbols and letters and then the readings of my sensor (temperature and humidity). i have checked the baudrate and it seems to be fine…

Please help me :c

this is the code of the coordinator:

#include <XBee.h>//Used for xbee

/CONFIGURACION DEL XBEE COORDI***/
XBee xbee = XBee();
XBeeResponse response = XBeeResponse();
// create reusable response objects for responses we expect to handle
ZBRxResponse rx = ZBRxResponse();
ModemStatusResponse msr = ModemStatusResponse();
XBeeAddress64 address;
/*********************************************************/

float temp,ph;

union u_sensor{
int8_t value[4];
float fsensor;
}sensor;

void setup() {
Serial.begin(9600);
// start the Ethernet connection and the server:
Serial.println(“starting…”);

}

void loop() {
// the program is alive…for now.

//Ethernet.begin(mac,ip,dns_server,gateway,subnet);
xbee.readPacket();
if (xbee.getResponse().isAvailable()) {
// got something
if (xbee.getResponse().getApiId() == ZB_RX_RESPONSE) {

Serial.println(“paquete disponible…”);
// got a zb rx packet
// now fill our zb rx class
Serial.println(“recibimos un paquete”);
xbee.getResponse().getZBRxResponse(rx);
// I check both bytes (or)

getData();
putData();
}

}
delay(1000);
}

void getData(){
temp= 0;ph = 0;
//Obtenemos el valor de la temperatura
for(int i = 0;i<4;i++){
sensor.value = rx.getData(i);

  • }*

  • temp=sensor.fsensor;*

  • Serial.print(temp);*

  • //Obtenemos el valor del ph*

  • for(int i = 0;i<4;i++){*
    _ sensor.value = rx.getData(i+4);_
    * }*
    * ph=sensor.fsensor;*
    * Serial.print(ph); *

}
void putData(){
* Serial.print(temp);*

* Serial.print(ph);*

}
and this is the end device code with the dht11 sensor:
#import “DHT.h”
#include <XBee.h>
#define DHT11Pin 2
DHT dht(DHT11Pin, DHT11);
XBee xbee = XBee();
uint8_t payload[8] = { 0, 0 ,0 ,0 ,0 ,0 ,0 ,0};
union u_temp {
* uint8_t b[4];
_
float ftemp;_
_
}t;_
union u_hum{
uint8_t b[4];
_
float fhum;_
_
}h;_
XBeeAddress64 addr64 = XBeeAddress64(0x0013a200, 0x4090C47D);
ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
ZBTxStatusResponse txStatus = ZBTxStatusResponse();
void setup() {
_
// put your setup code here, to run once:_
_
Serial.begin(9600);_
_
xbee.setSerial(Serial);_
_
dht.begin();*_

}
void DHTsensor(){
* // obtaingin temperature*
* t.ftemp=dht.readTemperature(); *
* for (int i=0; i<4;i++){*
payload_=t.b*;
}*_

* //obtaining humidity*
* t.ftemp = dht.readHumidity();*
* for (int i=0;i<4;i++){*
_ payload[i+4]=t.b*;
}
}
void loop() {
DHTsensor();
xbee.send(zbTx);
// wait 2 seconds between readings*

* delay(2000);
// get humidity*

* float humidity = dht.readHumidity();
// get temperature as C*

* float celsius = dht.readTemperature();
// get temperature as F*

* float fahrenheit = dht.readTemperature(true);
Serial.print("lector de arreglo: ");
Serial.print(payload[0]);
Serial.print(payload[1]);
Serial.print(payload[2]);
Serial.print(payload[3]);
Serial.print(payload[4]);*_

* Serial.print("++++");*
* Serial.print(payload[5]);*
* Serial.print(payload[6]);*
* Serial.print(payload[7]);*

* // print results*

* Serial.print("Humidity: ");*
* Serial.print(humidity);*
* Serial.print(" Celsius: ");*
* Serial.print(celsius);*
* Serial.print(" Fahrenheit: ");*
* Serial.println(fahrenheit);*
* indicatorAck();*
}
void indicatorAck(){
* // flash TX indicator*

* // after sending a tx request, we expect a status response*
* // wait up to half second for the status response*
* if (xbee.readPacket(500)) {*
* // got a response!*
* // should be a znet tx status *
* if (xbee.getResponse().getApiId() == ZB_TX_STATUS_RESPONSE) {
_ xbee.getResponse().getZBTxStatusResponse(txStatus);
// get the delivery status, the fifth byte*

* if (txStatus.getDeliveryStatus() == SUCCESS) {
// success. time to celebrate*

* Serial.print(“Bien se recibio el paquete :D”);
} else {
// the remote XBee did not receive our packet. is it powered on?*_

* }*
* }*
* } else if (xbee.getResponse().isError()) {*
* //nss.print("Error reading packet. Error code: "); *
* Serial.println(xbee.getResponse().getErrorCode());*
* } else {*
* // local XBee did not provide a timely TX Status Response – should not happen*
* Serial.print(“hay un error tio :O”);*
* }*
}