Unable to transmit request frame.

Hi.

I'm trying to send a simply message by RF using two xbee (one is a coordinator and the other a router) but I'm struggling on it. Both nodes are in the same network since I already checked Operating channel, Operating network and association status is 0. Besides, I already send successfully Node discovery from the router (I know that is useless in this case since there are only two nodes in my network but I want to create in the future a mesh network so started off from the basic) receiving the proper respond.

This is my packet that I send from my router.
byte Request_Frame[] = {0x7E,0x00,0X13,0X10,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X48,0X65,0X6C,0X6C,0X6F,0X92};

As the message is going to be transmitted to my coordinator, my 64bits address, as well as 16bit address should be 0 for what I read in the guide.

This is router's code

#include <Arduino.h>

#define OK "OK"
#define ERROR "ERROR"
#define CR '\r'
#define LR '\n'
unsigned long t = 0;
byte nodeDiscovery[] = {0x7E,0x00,0x04,0x08,0x01,0x4E,0x44,0x64};
byte Request_Frame[] = {0x7E,0x00,0X13,0X10,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X48,0X65,0X6C,0X6C,0X6F,0X92};

int sendATCommands(char AT[], char *expected1, char *expected2, long unsigned int timeout = 1000){
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(AT);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
      else if ((i > 0))
      {
        if ((memcmp(response, "OK",2) == 0)){
          Serial.println("OK");
          return 1;
        }
        else if ((memcmp(response, "ERROR",5) == 0)){
          Serial.println("Error");
          return 2;
        } 
      }
    }
  }while (millis() - last < timeout);
  Serial.println("NULL");
  return 0;
}

char* readPANID(char PANID[]){
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(PANID);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 1000);
  Serial.println((String)response);
  return response;
}

void readOperatingPAN(char PANID[]){
  char response[20];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(PANID);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 2000);
  Serial.println((String)response);
}

void readOperatingID_16bits(char ATOI[]){
  char response[20];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(ATOI);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 2000);
  Serial.println((String)response);
}

void readMYID(char MYID[]){
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(MYID);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 2000);
  Serial.println((String)response);
}

void readOperatingChannel(){
  Serial.print("Operating Channel:");
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print("ATCH\r");
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 1000);
  Serial.println((String)response);
}

void Association_Report(){
  Serial.print("Association Report:");
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print("ATAI\r");
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
    }
  }while (millis() - last < 2000);
  Serial.println((String)response);
}

unsigned int GetLength(uint8_t *raw_data){
  byte MSB = (byte)raw_data[0];
  byte LSB = (byte)raw_data[1];
  unsigned int length = (((unsigned int)MSB << 8) | (unsigned int)LSB);
  Serial.print("Lenght is:");
  Serial.println(length);
  return length;
}

void Checksum_Verify(uint8_t *message, unsigned int size){
  uint16_t total = 0;
  byte LSB;
  for (register int i = 0; i <= size; ++i)
    total += message[i];
  LSB = total & 0xFF;
  if (LSB == 255)
    Serial.println("Checksum Correct");
}

void NodeDiscovery(){
  bool Waiting_Message = true;
  unsigned int size_message = 0;
  uint8_t length [2];
  register int cont = 0;
  while (Serial2.available() > 0)
    Serial2.read();
  for (int c=0; c < 8;c++) 
    Serial2.write(nodeDiscovery[c]);
  unsigned long t = millis();
  do{
  while (Serial2.available()){
    if (Waiting_Message){
      char aux = Serial2.read();
      Serial.println(aux,HEX);
      if (aux == 0x7E ){
        Serial.println("Received Started byte");
        Waiting_Message = false;
      }
    }
    else{
      if (cont == 0){
        Serial2.readBytes(length,2);
        Serial.print(length[0]);
        Serial.print(" ");
        Serial.println(length[1]);
        size_message = GetLength(length);
        ++cont;
        continue;
      }
      else if (cont == 1){
        uint8_t *p = (uint8_t*)malloc((size_message+1)*sizeof(uint8_t));
        Serial2.readBytes(p,size_message+1);
        Checksum_Verify(p, size_message);
        return;
      }
    }
  }
  } while (millis() - t < 10000);
  return;
}

void SendATFrame(){
  unsigned int size = sizeof(Request_Frame);
  Serial.print("Sending ...");
  while (Serial2.available() > 0)
    Serial2.read();
  for (int c=0; c < size;c++){
    Serial2.write(Request_Frame[c]);
  }
}

void AT_Mode(){
  if (sendATCommands("+++",OK,ERROR,10000) != 1){
    Serial.println("Error AT Mode"); 
    AT_Mode();
  }
  return;
}

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
  //Enter to AT Mode
  AT_Mode();
  //Set or read the 64-bit extended PAN ID
  char *PANID = readPANID("ATID\r");
  //Read the 64-bit extended PAN ID. The OP value reflects the operating extended PAN ID where the
  //device is running. If ID > 0, OP equals ID.
  readOperatingPAN("ATOP\r");
  readMYID("ATMY\r");
  readOperatingID_16bits("ATOI\r");
  readOperatingChannel();
  Association_Report();
  if (sendATCommands("ATJV 1\r", OK, ERROR)!= 1)
    Serial.println("Error JV");
  if (sendATCommands("ATAP 1\r", OK, ERROR) != 1)
    Serial.println("Error JV");
  if (sendATCommands("ATDH 0\r", OK, ERROR)!= 1)
    Serial.println("Error DH");
  if (sendATCommands("ATDL 0F\r", OK, ERROR) != 1)
    Serial.println("Error DL");
  if (sendATCommands("ATDL 0F\r", OK, ERROR) != 1)
    Serial.println("Error DL");
  Serial.print("ATAC:");
  sendATCommands("ATAC\r",OK,ERROR);
  Serial.print("ATWR:");
  sendATCommands("ATWR\r",OK,ERROR);
  Serial.print("ATCN:");
  sendATCommands("ATCN\r",OK,ERROR);
  NodeDiscovery();
  delay(10000);
  SendATFrame();
}

void loop() {
  static unsigned long t = 0;
  if (millis() - t > 60000L){
    SendATFrame();
    t = millis();
  }
  while (Serial2.available()){
    char c = Serial2.read();
    Serial.println(c,HEX);
  }

}

This is my coordinator's code

#include <Arduino.h>
#define OK "OK"
#define ERROR "ERROR"
#define CR '\r'
#define LR '\n'

String PANID_16 = "C7F6";
String PAIND_64 = "A8E4F62D42AB6EE1C";

uint8_t  PANID[8] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88};

char response[150];


int sendATCommands(char AT[], char *expected1, char *expected2, long unsigned int timeout = 1000){
  char response[10];
  memset(response, '\0', sizeof(response));
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.print(AT);
  delay(300);
  int i = 0;
  unsigned long last = millis();
  do{
    while (Serial2.available() > 0){
      response[i++] = Serial2.read();
      if (((i == 2) && (response[0] == CR) && (response[1] == LR)) ||((i == 1) && (response[0] == LR)))
        i = 0;
      else if ((i > 0))
      {
        if ((memcmp(response, "OK",2) == 0)){
          Serial.println("OK");
          return 1;
        }
        else if ((memcmp(response, "ERROR",5) == 0)){
          Serial.println("Error");
          return 2;
        } 
      }
    }
  }while (millis() - last < timeout);
  Serial.println("NULL");
  return 0;
}

void readPANID(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.println("ATOP");
  String ID = Serial2.readStringUntil(LR);
  Serial.println(ID);
  /*Serial2.println("ATID");
  ID = Serial2.readStringUntil(LR);
  Serial.println(ID);*/
}

void readPANID16(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.println("ATOI");
  String ID = Serial2.readStringUntil(LR);
  Serial.println(ID);
  /*Serial2.println("ATMY");
  ID = Serial2.readStringUntil(LR);
  Serial.println(ID);*/
}

void SetChannels(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial.print("ATSC 3FF:");
  Serial2.println("ATSC 3FF");
  String S = Serial2.readStringUntil(LR);
  Serial.println(S);
  while (Serial2.available() > 0)
    Serial2.read();
  Serial.print("ATSD 4:");
  Serial2.println("ATSD 4");
  String S1 = Serial2.readStringUntil(LR);
  Serial.println(S1);
}

void ScanChannels(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial.print("ATSC:");
  Serial2.println("ATSC");
  String ID = Serial2.readString();
  Serial.println(ID);
}

void GetOperating16PANID(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial.println("ATII1234:");
  Serial2.println("ATII4AAA");
  String S = Serial2.readString();
  Serial.println(S);
}

void GetOperating64PANID(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial.print("ATID A8E4F62D42AB6EE1:");
  Serial2.println("ATID A8E4F62D42AB6EE1");
  String S = Serial2.readString();
  Serial.println(S);
}

void readMY(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.println("ATMY");
  String S = Serial2.readString();
  Serial.println(S);
}

void OperatingChannel(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.println("ATCH");
  String S = Serial2.readString();
  Serial.println(S);
}

void AssociationStatus(){
  while (Serial2.available() > 0)
    Serial2.read();
  Serial2.println("ATAI");
  String S = Serial2.readString();
  Serial.println(S);
}

void EnterAT_Mode(){
  Serial.print("Enter AT Mode:");
  if (sendATCommands("+++",OK,ERROR,10000) != 1){
    Serial.println("Error AT Mode");
    EnterAT_Mode();
  }
  return;
}

void setup() {
  Serial.begin(9600);
  Serial2.begin(9600);
  delay(1000);
  EnterAT_Mode();
  Serial.print("AT:");
  if (sendATCommands("",OK,ERROR) != 1)
    Serial.println("Error AT Mode");
  Serial.print("ATCE 1:");
  sendATCommands("ATCE 1\r",OK,ERROR);
  Serial.print("Enter API Mode:");
  if (sendATCommands("ATAP 1\r", OK, ERROR) != 1)
    Serial.println("Error API Mode");
  Serial.print("PAN ID 64:");
  readPANID();
  Serial.print("ATSC:");
  ScanChannels();
  SetChannels();
  Serial.print("ATAC:");
  sendATCommands("ATAC\r",OK,ERROR);
  GetOperating16PANID();
  GetOperating64PANID();
  Serial.print("Change to PAN ID 16:");
  readPANID16();
  Serial.print("MY Address:");
  readMY();
  Serial.print("Change to PAN ID 64:");
  readPANID();
  Serial.print("Operating Channel:");
  OperatingChannel();
  Serial.print("Association status");
  AssociationStatus();
  if (sendATCommands("ATAP 1\r", OK, ERROR) != 1)
    Serial.println("Error Enter API Mode");
  if (sendATCommands("ATDH 0\r", OK, ERROR)!= 1)
    Serial.println("Error DH");
  //Enables API Mode. The device ignores this command when using SPI. API mode 1 is always used.
  if (sendATCommands("ATDL 0F\r", OK, ERROR) != 1)
    Serial.println("Error DL");
  Serial.print("ATAC:");
  sendATCommands("ATAC\r",OK,ERROR);
  Serial.print("ATWR:");
  sendATCommands("ATWR\r",OK,ERROR);
  Serial.print("ATCN:");
  sendATCommands("ATCN\r",OK,ERROR);
  delay(1000);
}

void loop() {
  while (Serial2.available()){
    char S = Serial2.read();
    Serial.println(S);
  }
}