edit: I thought I would add communications between AT Router and API Coordinator. I have modified the code in the Router to receive a constructed packet from the Coordinator via the XCTU software.
#define LED 13
boolean serialComplete = false;
char bufferIn[64];
char bufferOut[5];
int count=0;
void setup() {
pinMode(13, OUTPUT);
Serial.begin(9600);
Serial.println("\nXBee AT communications test");
}
void loop() {
static unsigned long previous = millis()/1000;
if(serialComplete) {
Serial.println(bufferIn);
serialComplete=false;
count = 0;
memset(bufferIn,0,sizeof(bufferIn));
digitalWrite(LED,!digitalRead(LED));
}
if(previous != millis()/1000){
previous = millis()/1000;
sprintf(bufferOut,"%04u",(uint16_t)previous);
Serial.println(bufferOut);
}
}
void serialEvent() {
while (Serial.available()) {
char inChar = (char)Serial.read();
if (inChar == '\n' || inChar == '\0') {
bufferIn[count++]=0;
serialComplete = true;
} else {
bufferIn[count++] = inChar;
}
}
}
Then in XCTU construct a packet for the Coordinator. I'm using version 6.1.0.

and click "the create frame using form generator tool"

here is the packet being received by the router. I am only sending 9999 nul terminated.

Then once the pair are running, you can send the constructed packet from the XCTU software and it will be received by the router.
