Xbee Configuration? (SOLVED.)

Hey all,

I just bought two Xbee S2, a Sparkfun Arduino Uno Shield, and an Xbee Explorer dongle and I am trying to set them up for the first time.

I am using a tutorial on this webpage provided by Sparkfun: XBee Shield Hookup Guide - SparkFun Learn

It tells me to go to this page ( Exploring XBees and XCTU - SparkFun Learn ) to configure the network settings.

So that's what I did. I had no problem configuring PAN ID, the DH, or the DL. But I can not configure the CH, or MY, as those are 'read only'. In the tutorial, it says to set my operating channel on the two xbees to 'C', but my Xbees are defaulted to random numeric values.

Lastly, what should the firmware be updated to on both xbees? Does there need to be a coordinator and a router, or can there be two routers? Or does there have to be a coordinator and an end point? And API mode or AT mode?

I know this is a lot but I'd appreciate if someone could shed some light on this.

Thanks!

Marco.
(S

Update:

I was able to configure the settings correctly. I took this sketch:

/*****************************************************************
XBee_Serial_Passthrough.ino

Set up a software serial port to pass data between an XBee Shield
and the serial monitor.

Hardware Hookup:
  The XBee Shield makes all of the connections you'll need
  between Arduino and XBee. If you have the shield make
  sure the SWITCH IS IN THE "DLINE" POSITION. That will connect
  the XBee's DOUT and DIN pins to Arduino pins 2 and 3.

*****************************************************************/
// 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(9600);
  Serial.begin(9600);
}

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());
  }
}

And uploaded it to my Arduino Uno with the Xbee shield on top. The shield was in the 'DLINE' position as instructed, and Tools > Port and Tools > Board had the correct settings. But, I received this error:

Arduino: 1.6.9 (Mac OS X), Board: "Arduino/Genuino Uno"

Sketch uses 3,612 bytes (11%) of program storage space. Maximum is 32,256 bytes.
Global variables use 297 bytes (14%) of dynamic memory, leaving 1,751 bytes for local variables. Maximum is 2,048 bytes.
avrdude: ser_open(): can't open device "/dev/cu.usbmodem621": Resource busy
ioctl("TIOCMGET"): Inappropriate ioctl for device
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Update 2:

I already had that code uploaded to the board and the Xbee was connected to the XCTU software, so that is why I got that error message.

Update three: I seem to get one way communication here. My coordinator can read what my router says, but my router doesn't seem to read what my coordinator says. My Coordinator is the Xbee on the arduino shield, with the code above. The router is on the explorer dongle.

Here is what I have configured:

Coordinator:

PAN ID: D7D9
Operating Channel: D
16-bit Network Address: 0
Destination Address High: 0
Destination Address Low: 5817

Router:

PAN ID: D7D9
Operating Channel: D
16-bit Networking Address: 5817
Destination Address High: 0
Destination Address Low: 0

Update #4:

I was able to get the two Xbees communicating together by setting the SH and SLs to the DH and DLs together, however, I couldn't get the Arduino Serial Monitor to communicate, only the XCTU software serial monitors displayed the characters.

Update #5:

SOLVED! :slight_smile:

I had to open the serial connection on the Xbee connected to the explorer, but not on the xbee connected to the Arduino.