Issue With GikFun Xbee Shield.

Hi. I’m having trouble reading data from an Xbee with the Gikfun Xbee shield (

When I use XCTU’s serial monitors, I can communicate from one Xbee to the other, but when I try to read the data from the Xbee by using the shield, it does not work. I’m using this code, which is a basic example from Sparkfun’s website:


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.

void loop()
if (Serial.available())
{ // If data comes in from serial monitor, send it out to XBee
if (XBee.available())
{ // If data comes in from XBee, send it out to serial monitor

Now, since there’s no documentation for the shield that I can find, I’m not sure that pin 2 is the shield’s RX pin. I tried cycling through all the pins, but I still do not get any output in the serial monitor. Sometimes, if I restart my computer, reset the arduino and the shield and unplug the xbees and plug them in and start the code, I will see the first character that I type in CXTU show up on the serial monitor. That’s it… Nothing else shows up no matter what I do…

If anyone could offer me some advice I would be very grateful!

The link to amazon is less than useless. Post a link to the manufacturer’s site.

What position is the switch in?