# unable to receive datas from one arduino to another via xbee S2

**URL:** <https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498>\
**Category:** Other RF Products\
**Tags:** arduino, send-data, xbee\
**Created:** [March 28, 2016, 2:14pm UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498 "2016-03-28T14:14:23Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 28, 2016, 2:14pm UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/1 "2016-03-28T14:14:23Z")

</div>

(Hi  
I spend the whole day trying to configure my xbees module to make them communicate. I have followed a tutorial on the net : I have configured one of my module as coordinateur (AT mode) and the other router (AT).  
With two modules connected to the computer with usb cables, IfI open 2 serial console (in two different session of xctu), it works well, when I write in one, I can the the same in the other.  
I have followed the next step of the tutorial : two modules on two arduino. One arduino is sending data and the other arduino is reading. I can’t receive datas in this case.

Here’s my 2 programs :  
the first one for the router  
#include  
SoftwareSerial XBee(1,0);

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

void loop() {  
Serial.println(“Hello World!”);  
delay(5000);  
}

the second one for the coordinator :  
#include  
SoftwareSerial XBee(1,0);

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

void loop() {  
if (Serial.available() \> 0) {  
Serial.write(Serial.read());  
}  
}

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [March 28, 2016, 3:08pm UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/2 "2016-03-28T15:08:07Z")

</div>

May I suggest you take the radios out of the picture and simply wire DI from one to DO of the other. Then get that working. Once you have that working, then add the radios in transparent mode.

---

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 29, 2016, 8:09am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/3 "2016-03-29T08:09:40Z")

</div>

I made as you said. When connectin the 2 arduinos rx to tx and tx to rx, I can seed my hello world on the two sides.  
I have set my modules for direct connection :  
SL to DL and SH to DH and vice versa.  
It still doen’s work. ☹

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [March 29, 2016, 10:26am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/4 "2016-03-29T10:26:22Z")

</div>

Do you have one of them Configured as a Coordinator AT and the other as Router AT?

---

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 29, 2016, 10:33am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/5 "2016-03-29T10:33:24Z")

</div>

yes of course. You can see my configuration with this link : [https://www.dropbox.com/s/wu3yw11er6oxskk/xbee3.jpg?dl=0](https://www.dropbox.com/s/wu3yw11er6oxskk/xbee3.jpg?dl=0)

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [March 29, 2016, 10:38am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/6 "2016-03-29T10:38:05Z")

</div>

Looks like there are a few commands you missed that are important.

First is CH. This command tells you what channel the module has come up on.

Next is the AI. This command tells you if you are associated or not. In a Zigbee network, if you are not associated, then you can’t communicate.

SC should be no more than 1FFE for most Non S2C modules.

The DH value should actually be 0013A200 and not 13A200.

---

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 29, 2016, 12:59pm UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/7 "2016-03-29T12:59:39Z")

</div>

results of my at commands :  
ATCH : 15  
ATAI : 0  
so it seems that I have joined a network. So why I can’t communicate ?

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [March 29, 2016, 1:01pm UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/8 "2016-03-29T13:01:38Z")

</div>

Are you connecting the XBee’s to an Arduino Shield or direct?

Do the two radios pass a range test without the Arduino connected? That is connect them to a PC and a remote interface board with Tx and Rx crossed on the remote.

---

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 30, 2016, 12:56am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/9 "2016-03-30T00:56:08Z")

</div>

I have usb adapter with 5 pins . VDD GND RX RX and RST.  
I connect the VDD and GND with 5v and GND of arduino and RX to arduino TX and TX to arduino RX

---

<div class="post-metadata">

**Author:** ![chrisg1970](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@chrisg1970](https://forums.digi.com/u/chrisg1970)\
**Post date:** [March 30, 2016, 8:10am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/10 "2016-03-30T08:10:22Z")

</div>

Problem solved ! I bought an arduino shield ihead. All works fine ! But I still don’t understand why previous connection failed.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [March 30, 2016, 8:18am UTC](https://forums.digi.com/t/unable-to-receive-datas-from-one-arduino-to-another-via-xbee-s2/16498/11 "2016-03-30T08:18:18Z")

</div>

That is because they were no doing the level shifting that was required.
