Serial communication between Arduino and Computer via XBee

I configured two XBees using XCTU, connected them to the computer and sent Bytes back and forth. Works.

This is the current, non-working setup:

• 1 XBee, connected to an Arduino Mega using SparkFun XBee Explorer USB

• 1 XBee, connected to an Arduino Mega using SparkFun XBee Explorer Regulated

  • GND to GND

  • 5V to 5V on the Arduino

  • DOUT to RX1 on the Arduino

  • DIN to TX1 on the Arduino

    void setup() {
      Serial1.begin(9600);
      pinMode(13, OUTPUT);

      //After 3 seconds the XBee should send out a couple of "A"s coming from the serial port
      delay(3000);
      int i = 0;
      while (i < 10) {
        Serial1.print("A");
        delay(100);
        i++;
      }
    }

    void loop() {

      //If anything is sent to the XBee it should appear in the Arduino's serial buffer
      //making the LED on pin 13 turn on
      if (Serial1.available() > 0) {
        digitalWrite(13, HIGH);
      }
    }

The DIN LED on the Explorer Regulated flashes as supposed to but nothing is received on the computer where my Terminal application is listening.

Same when I send something from the Terminal, the LED on pin 13 of the Arduino does not indicate any bytes in the buffer, meaning that the XBee probably never received anything.

A picture of your wiring would be useful.

On the side with the USB board, there is no reason to connect the 5V pin to the Arduino.

Why not use Serial, to see what the XBee is receiving, if anything?