Home/Support/Support Forum/Two arduinos don't communicate to each other but will communicate to xctu.

Two arduinos don't communicate to each other but will communicate to xctu.

0 votes
I cannot get two Arduinos to communicate over Xbee, even though they work properly using xctu.

2 xbee pro s2b devices after firmware update and factory default
2 xbee shleld(sic) v03 (also tested with arduinoxbee v1.1 shield from libelium)
2 arduino unos

Device one setting changes

Function: Zigbee Coordinator AT
PAN ID:2015
Serial Number High: 13A200
Serial Number Low: 40F327E0
Destination Address High:13A200
Destination Address Low: 40F327D6

Device two setting changes

Function: Zigbee Router AT
PAN ID:2015
Serial Number High: 13A200
Serial Number Low: 40F327D6
Destination Address High:0
Destination Address Low: 0


In the xctu console window, anything I type sends from one of the Xbees to the other without incident. If I have one xbee connected to the xctu software,
and the other device connected to my arduino running code, it works perfectly. I can happily send and receive the signals I expect from the arduino and monitor it from the software.
To be specific, I send 001001 to tell it to turn on a light from xtcu. It turns on. I hit a switch on the arduino to say the light is off, and I get 001002 that
says the light is off. I can do this for either device, so it isn't one of the devices. Now, when I connect the Xbee to both arduinos the arduinos appear to send the signals they are supposed to be sending, but they never receive or process the signal on the other end. I believe this because I can watch the devices with the serial monitor and they are indeed sending out, based on the documentation they send both out the usb and the xbee serial, the signals I expect. I can also see the tx light on the arduino flash when I trigger a signal. On the receiving end, it does nothing. I have been at this problem for 20 hours and I just cannot figure out what I'm missing. Any help is greatly appreciated!

//example read. Serial.begin(9600); is set in setup()
if(Serial.available() >0)
{
transmission = Serial.readString();
if(transmission=="something")
{
//do something
}
}
asked Aug 27, 2016 in ZigBee PRO Featureset (and legacy ZNet 2.5) by beardfiercely New to the Community (3 points)

Please log in or register to answer this question.

2 Answers

+1 vote
Well, I figured out the problem. I was sending a newline character from the Arduino that was not present when sending through xctu. I believed that the receiving end was not getting the signal because there was no RX light on the board. However, I was seeing the TX light for the USB cable and not the Xbee transmission. The lights on the board do not illuminate for xbee transmissions.

I had that feeling that it was something simple that I was overlooking, and it was.
answered Aug 29, 2016 by beardfiercely New to the Community (3 points)
Hi I am having the same problem. I got one of the Arduino/Xbee pairs to communicate with the second Xbee, but when I'm hooking up both Arduino's there is no communication. How did you solve this problem?
XTCU was not sending the newline character, but the arduino was sending it. I was looking for "command" and the arduino was sending "command(newline)". Either change your arduino code to not send the newline character, or do a substring search for your command. I should point out that as your communication distance gets longer, you will definitely miss transmissions or get partial transmissions. So, I'd recommend putting some logic in your code to acknowledge receipt of the commands and to resend if they were not delivered. Hope this helps!
0 votes
hello

can you please set the address of second module DH and DL value dh=0 and dl=ffff and check it once
answered Aug 29, 2016 by csreddy Seasoned Professional (194 points)
Hi CSReddy!  Thanks for answering.  They will work with the configuration you posted, as well as telling the coordinator to explicitly talk to the router instead of broadcasting to all routers.
...