Home/Support/Support Forum/Arduino Xbee programming using Xbee SHield

Arduino Xbee programming using Xbee SHield

0 votes
Hi all, i have this configuration in my zigbee network:

1- Coordinator: Xbee series 2 connect with Xbee Board USB in my computer
1- Router: Arduino Uno + Xbee Shield + Xbee Series2

I set PANID and the address in correct way, my xbee are setting usi API mode.


I want to try to send a simple packet from router to coordinator but when i try to send somethings using Arduino monitor serial, my coordinator dont receive anything in its console.

This is my code:
// We'll use SoftwareSerial to communicate with the XBee: #include <SoftwareSerial.h> // XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX) // XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX) SoftwareSerial XBee(2,3); // RX, TX void setup() { // Set up both ports at 9600 baud. This value is most important // for the XBee. Make sure the baud rate matches the config // setting of your XBee. XBee.begin(115200); Serial.begin(115200); } void loop() { if (Serial.available()) { // If data comes in from serial monitor, send it out to XBee XBee.write(Serial.read()); } if (XBee.available()) { // If data comes in from XBee, send it out to serial monitor Serial.write(XBee.read()); } }[\code] Thanks all for help.[code]// We'll use SoftwareSerial to communicate with the XBee:
#include <SoftwareSerial.h>
// XBee's DOUT (TX) is connected to pin 2 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 3 (Arduino's Software TX)
SoftwareSerial XBee(2,3); // RX, TX

void setup()
{
// Set up both ports at 9600 baud. This value is most important
// for the XBee. Make sure the baud rate matches the config
// setting of your XBee.
XBee.begin(115200);
Serial.begin(115200);
}

void loop()
{
if (Serial.available())
{ // If data comes in from serial monitor, send it out to XBee
XBee.write(Serial.read());
}
if (XBee.available())
{ // If data comes in from XBee, send it out to serial monitor
Serial.write(XBee.read());
}
}[\code]

Thanks all for help.
asked Oct 27, 2016 in XBee Programmable Development by Auron691 New to the Community (0 points)

Please log in or register to answer this question.

1 Answer

0 votes
check the DH,DL of both your device

i think its 0,0 set 0,ffff for both device and check once
answered Nov 8, 2016 by csreddy Seasoned Professional (194 points)
...