XBEE Data Sending Problem XCTU to XBEE

Hi Everyone,I hope you are all well.

I am very new at XBEE's and need your help.My coordinator receives message but it does send to itself.

Coordinator(XCTU) End Device(Arduino)

I have 2 XBEE PRO S2C(AT MODE),one connected to the pc via USB, and the other one connected to the Arduino Mega 2560.

The coordinator(DH =0 DL=2 MY=1,ID=3332 CH=C) XBEE and an end device (DH=0 DL=1 MY=2 ID=3332 CH=C)

Product family=XBP24C///Function Set=802.15.04 TH PRO//Firmware=2001

I connected end device to pin 0,1 which are rx and tx in the mega.

void setup() {
  
  Serial.begin(9600);
  Serial.print("Hello");  
  pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
 while(Serial.available()){
  char x=Serial.read();
  if(x=='g'){
    digitalWrite(LED_BUILTIN, HIGH);
    delay(10000);
    digitalWrite(LED_BUILTIN,LOW);

}
  }
}

My coordinator receives message but it does send to itself.

Why should any radio talk to itself?

There are 4 hardware serial ports on the Mega. Serial (0, 1) is connected to the USB-To-Serial converter, which lets you talk to the PC. Why would you use that one to talk to the XBee, preventing debugging?

Post a link to the XBees. Series 1 devices do not have coordinator and end device roles. Series 2 devices use DH/DL and SH/SL, not MY, to determine who talks to whom.

The problem is sending itself,not to end device,by the way I set DH/DL to end devices SH/SL and did same thing for coordinator as I understand from your comment.

And MY setted different at each XBEE.

I changed the pins to 18,19.

Now I am not receiving any message from end device.And I am not sending any data to arduino.

Thank you for your interest.

I still do not know what kind of XBees you have.

I changed the pins to 18,19.

What else did you change? Just moving the XBee to different pins is not sufficient.

I already mentioned it above.I have 2 XBEE PRO S2C

I already mentioned it above.I have 2 XBEE PRO S2C

I asked for a link. You did not provide one. I still don’t know what kind of XBees you have, so I can’t help you.

Good luck with your project.

I am so sorry about my misunderstanding :frowning:

I hope I understand well.Here is a link.

https://www.amazon.com/XBee-6-3mW-Wire-Antenna-ZigBee/dp/B01EYKUYBG/ref=sr_1_1?ie=UTF8&qid=1481046697&sr=8-1&keywords=xbee+s2c

OK. So, they are indeed Series 2 models.

Now, I need to know how you have configured them. One at a time, tell me what DH, DL, SH, SL, and PAN are, and what kind of device it is (coordinator, router, or end device).

Then, show how the XBee is connected to the Arduino, using Fritzing, some other schematic software, or a pencil on paper and then take a picture.

Finally, show your current code.

Hi again Paul,

I set DH/DL values to each other's addresses like 13A200(DH)40EB55F5(DL) .On the coordinator side,coordinator enable set 1 and router side it is set to 0.

char letter;

void setup() {
  Serial.begin(9600);
}

void loop() {  
  Serial.println('a');
  delay(400); 

  if(Serial.available())
  {         
    letter=Serial.read();
    Serial.print(letter);
  }
}

With this code I can send from arduino to pc but I can not send from pc to arduino,the coordinator sends whatever I wrote from XCTU serial.

As shown in the attachment

With this code I can send from arduino to pc but I can not send from pc to arduino

It isn't clear what the left side of the screen shot picture is showing. Is the data in the first field what was sent or what was received or something else.

The circuit picture is useless. It appears that the XBee ground is not connected to the Arduino ground.

You can see it from the attachment now,

From the XCTU panel,as you see when I type something it sends it self.As an example I typed (blue) sda and it sent to itself(next line written in red).

with the serial.write(‘a’);, arduino sends charachter always.

The exact problem is I can not send data from xctu to remote xbee, but I can send from remote xbee to xctu.

arduinoxbee.png

That picture shows only two connections between the XBee and the Arduino. There is a minimum of three needed (RX, TX, Gnd). Somewhere, the XBee needs power, too.

And, I am not convinced that the XBees are configured correctly. Screenshots of XCTU, with each XBee's configuration showing would be good.

I connected external ground and power attached them.

For configuration,I set DH to SH(other XBee) and DL to SL(other Xbee). And I did vice verca.

In one of the Xbee, I set coordinator enable to 1 and in other I did not.