Home/Support/Support Forum/Arduino program failed when xbee s2 is plug with funduino shield

Arduino program failed when xbee s2 is plug with funduino shield

0 votes
First post on this forum

I have followed a simple example on arduino's forum to light a led when pushing a button. It work well. I have included in this program a message to send via Xbee modules to test my connection When I plug on my Arduino the Xbee module (standard S2) using funduino xshield, after few seconds the program fails, the led doesn't light when pushing the button. If I reset, it works untils xBee initialization it completed and then not work.
Is it a pb of hardware compatibility ? should I change my shield ?
Here's my program :
int LED=12;
int BUTTON=4;
#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3); // RX, TX
void setup() {
XBee.begin(9600);
Serial.begin(9600);
pinMode(LED,OUTPUT);
pinMode(BUTTON,INPUT);
}

void loop() {
if(digitalRead(BUTTON) == HIGH)
{
digitalWrite(LED,HIGH);
XBee.write ("ON");
} else {
digitalWrite(LED,LOW);
XBee.write ("OFF");
}

}

thks for your help I
asked Mar 24, 2016 in RF Solutions and XBee by chrisg1970 New to the Community (3 points)

Please log in or register to answer this question.

1 Answer

0 votes
Do you have your XBee modules with the API code and one of them Coordinator API?
answered Mar 24, 2016 by mvut Veteran of the Digi Community (11,362 points)
yes, the modules plugged on the Arduino is configured as router API and the one linked to computer is Coordinator API. The two modules can communicate, I have launched successfully a range test .
Can you verify that your router is associated with the Coordinator? You can do that by checking the CH, AI, II and ID values. They should be the same on both radios.
I will verify tomorrow, hardware is as office... But if coordinator and router have not the same values how can I have succeded to perform range test ?
Due to a bug in the EM250 processor, you can be 12 channels off and communicate and then only part of the time.  Yet it will shows as associated. That is why the SC value is not using all possible channels on the S2 and S2PRO modules.
All the parameters are the same, AI=0 CH=16 and I have specified the same PAN ID for the two modules.
I didn't find II parameter, what is it ?
One thing I didn't specify : on my Arduino's shield it's written "XBEE PRO" and my xbee module is Standard S2.
I read that there's interoperability between PRO and Standard Version ...
Yes they are inter-operable.

The II command is a hidden command.  You must access it via the ATII command direct via AT command mode or from the proper API frame on the Coordinator.

From the sounds of it, the nodes are associated so it must be an addressing issue.  Make sure that your Destination address high is equal to 0x0013A200 and not 0x13A200.
I just checked II parameter
on coordinator side : AT II  return FFFF
on router side : AT II return ERROR ! and if it try
AT IIFFFF    I still have error I'm not able to set the value.
That is because II is a Coordinator only command.

Have you verified the DH value yet?

Have you connected to the two radios to a PC and simply ran a range test to eliminate the radios?
...