SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By Farny3d
#190307
So Im trying to make a simple network with my Xbee units using the Sparkfun Xbee USB Explorer, the Sparkfun Xbee Arduino Breakout board (with prototyping area) and an Ardiuno Uno R3.

I am simply trying to have the Arduino, that will eventually be connected to an RFID reader, send messages to the the Xbee connected to the USB explorer. Im using XCTU to communicate program the XBEE radio modules and have this code loaded to the Arduino board copied from the Sparkfun website

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


The serial monitor of the Arduino that is supposed to send the data shows the loop of numbers repeating over and over but I can not seem to get the other xbee that is connected to the USB explorer sheild to recognize the signal and read it. IVe followed about 9 different toutorial and tried multiple types of Xbee break out shields, the Uno, a Mega, and a sparkfun redboard. Still not getting anything.
Do I need to write in the code where it says if data comes in from serial monitor, send it out to Xbee Xbee.Write(Serial.read());

Ive gone through 6 Xbee radios because frustration led me to smashing 4 of them with a hammer.