Home/Support/Support Forum/unable to receive datas from one arduino to another via xbee S2

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

0 votes
(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.h>
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.h>
SoftwareSerial XBee(1,0);

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

void loop() {
if (Serial.available() > 0) {
Serial.write(Serial.read());
}
}
asked Mar 28, 2016 in Miscellaneous Hardware and Software by chrisg1970 New to the Community (3 points)

Please log in or register to answer this question.

2 Answers

+1 vote
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.
answered Mar 28, 2016 by mvut Veteran of the Digi Community (12,351 points)
0 votes
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. :(
answered Mar 29, 2016 by chrisg1970 New to the Community (3 points)
Do you have one of them Configured as a Coordinator AT and the other as Router AT?
yes of course. You can see my configuration with this link : https://www.dropbox.com/s/wu3yw11er6oxskk/xbee3.jpg?dl=0
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.
results of my at commands :
ATCH :  15
ATAI :   0
so it seems that I have joined a network. So why I can't communicate ?
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.
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
Problem solved ! I bought an arduino shield ihead. All works fine ! But I still don't understand why previous connection failed.
That is because they were no doing the level shifting that was required.
...