Corrdinator - Router - End Device Communication ALL (abe olmuyo bea)

Hi everyone,

I am working on Xbee (XB24-Z7UIT-004) nowadays. I got 3 xbee, 3 arduino. I want to send a massege from one arduino to the others.

When I configured the coordinator as "Coordinator AT" and the other as "Router AT", everything is OK.
But when I configured them "Coordinator API" and the other as "Router API", it is not OK. After all, I configured the other arduino as "End Device API". But I failed again.

I can see the comminication between 3 arduinos as below. But I could not send message.
Is there anybody who can help me?

You can see the code below

// TRANSMITTER

#include <XBee.h>
XBee xbee = XBee();

void setup() 
{
 pinMode(13, OUTPUT);
 Serial.begin(9600);
 Serial.flush();
 xbee.setSerial(Serial);
 xbee.begin(Serial); 
}

void loop() 
{
 // Create an array for holding the data you want to send.
 uint8_t payload[] = { 255, 128 };
 
 // Specify the address of the remote XBee (this is the SH + SL)
 XBeeAddress64 addr64 = XBeeAddress64(0x0013A200, 0x40BAA50C);
 
 // Create a TX Request
 ZBTxRequest zbTx = ZBTxRequest(addr64, payload, sizeof(payload));
 
 // Send your request
 xbee.send(zbTx);

 digitalWrite(13, HIGH);
 delay(100);
 digitalWrite(13, LOW);
 delay(100);
}

// RECEIVER

#include <XBee.h>

XBee xbee = XBee();
ZBRxResponse ZBRx16 = ZBRxResponse();
#define MAX_FRAME_DATA_SIZE 110

bool toggle = false;
void setup() 
{
 pinMode(13, OUTPUT);
 Serial.begin(9600);
 Serial.flush();
 xbee.begin(Serial); 
}

void loop() 
{
   xbee.readPacket();   
   if (xbee.getResponse().isAvailable()) 
   {
      toggle = !toggle;
      // got something
      xbee.getResponse().getZBRxResponse(ZBRx16);

      //if (ZBRx16.getData(1) == 255)
        digitalWrite(13, toggle);  
   } 
   
}

AT mode and API mode really mean something only when the XBee is collecting/using sensor data. If the XBee is JUST acting as a radio, use AT mode.

The XBee library does the packeting stuff to make API packets.

Thank you for your reply Paul.

Can I use XBee library on AP mode? or it just for API modes?

You can use the XBee library when the XBees are in AT mode.

thank you.

I changed the modes to AT (coordşnator AT - router AT and router AT)

I am sending 2 byte message from coordinators to 2 routers. Routers get values. But these values are not same with coordinator sent. Routers get zero values. Do you know why?

Do I have to use "End Device AT" too by the way?

These are my configurations.
My Coordinator DH = 0, DL = FFFF
1st Router DH = 0, DL = 0
2nd Router DH = 0, DL = 0

Do I have to use "End Device AT" too by the way?

If your coordinator sends message in French, don't you think the receiver should expect messages in French? Expecting messages in Swedish seems a bit unrealistic.