[Xbee S1] Communication with two Xbee S1 over 2 arduino nano doesn't work

Hello, I need to use Xbee communication in my project and I am facing a problem, I set up a reader part and a writer part then I want both to communicate, but it doesn't work.

  • I plugged both Xbee S1 devices in my PC, I used XCTU and I could communicate with both of them.
  • I plugged one Xbee S1 device in an arduino controller as a listener and the other in my computer as the writer, and I can see the messages on my Serial Monitor.
    But when I try to do it with 2 arduinos, it just doesn't work.
    I put the same PAN ID and the same channel, both are end points, I tried with coordinator too but no change. I did it with broadcast first, then I also tried to put the specific address.
    At some point when I reset the controller, I get the first bytes of the protocol, like when I send "HI", I get the 126, 0, 2, 138, 0, 117 (I guess the 2 is for the message length ) but no trace of my message.

Here's the reader code

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(A3, A4); // CONNECT BT RX PIN TO ARDUINO 11 PIN | CONNECT BT TX PIN TO ARDUINO 10 PIN

void setup() 
{

  Serial.begin(9600);
  BTSerial.begin(9600);  
  Serial.println("zigbee reader");
}

void loop()
{
  while(BTSerial.available()>0){
    Serial.println(BTSerial.read());
  }
}

Here's the writer part

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(A3, A4); // CONNECT BT RX PIN TO ARDUINO 11 PIN | CONNECT BT TX PIN TO ARDUINO 10 PIN

void setup() 
{

  Serial.begin(9600);
  BTSerial.begin(9600);  
  BTSerial.print("HI");
  Serial.println("zigbee writer");
}

void loop()
{
  BTSerial.print("HI");

  delay(2000);
}

If anyone can has any idea about this, I'd appreciate your help, thanks

Put both xbees back to the factory default configuration and then try using two Arduinos again.

Although custom configuration of the XBees can enhance things (speed, accuracy, range, etc), they are designed to be able to communicate with other nearby XBees by default. Since your a newbie at this, it's best to simplify things at first.

Thank you, I now have the right bytes when I put both devices on standard param.
Solved.

Any idea of why it doesn't work otherwise ? Default PAN ID is 3332 and the one I put before was 2357, same channel but it didn't work.