Xbee Help!!!!

I am trying to read data printed in an arduino on my computer terminal. I have an xbee connected to the arduino via an xbee explorer regulated. The other xbee is connected to the computer via an Xbee explorer. Is it possible to read data printed in the remoted arduino on the computer and what would be the code to do this?

::slight_smile:
Did you do any research?

A simple Google search for “Arduino Xbee” brought up a few decent links…:

http://www.arduino.cc/en/Guide/ArduinoXbeeShield

http://www.ladyada.net/make/xbee/arduino.html

Yes, I've actually looked at all of those already. I can get it to send data from the computer to the arduino with no problem but cannot figure out for the life of me how to print data from the arduino to the computer. Any help would be greatly appreciated.

So the Arduino is receiving data from the XBee just fine, and you can't figure out how to show the data on your computer? A simple print() or println() will do that, with the data showing up in the serial terminal (or in another terminal program, if you prefer to use that).

The Arduino sample programs are full of examples - just take a look at a few of those.

That's what I thought, the only thing, on the computer side of things I only have an Xbee Explorer Serial with the Xbee attached it, I do not have an arduino there, do I need an Arduino there too to be able to see the data?

So you want to see data from the receiving XBee to the computer, not from an Arduino. Okay.

To directly answer your question, no, you do not need an Arduino on the receiving end to see the data on your computer.

Presumably you have the XBee Explorer Serial connected to a serial port on the computer, possibly through a converter that switches it to USB. Right? And presumably an appropriate power supply powering the Explorer? (if there's any doubt about that, you can test for 3.3V between the 3.3V pin and the GND pin on the lower right column of pins next to the XBee headers).

The XBee by default will communicate at 9600 8N1. You need to start up a terminal program on your computer, connect to whatever COM port the XBee Explorer is attached to, with 9600 8N1 as the settings. If the XBee is receiving data, you should see data appearing in your terminal window.

If not, you might not be receiving any data. When receiving, the DIN LED on the Explorer should blink (I believe). If it's blinking, your XBee is receiving, and the problem is further down the line. If not, the problem is before your XBee Explorer/Computer setup.

Tell us more about what's happening (or not happening), and how you have it set up.

Here's the setup I currently have.

Arduino connected to the Xbee Pro using an Xbee explorer. The DOUT pin is connected to the rx pin on the arduino and the DIN pin is connected to the tx pin on the arduino.

On the other end I have an Xbee Pro connected to the computer using an Xbee Explorer Serial using a converter that switches to USB as you said. I am powering this explorer with a 9V battery so it is being powered correctly.

I have used the XCTU program both of the Xbees to be on the same network. I have confirmed that they are talking to eachother because I can type a character in the terminal window on XCTU through the Xbee Explorer Serial port and print the character in the Arduino IDE using the following code.

void setup()
{

// set the data rate for the SoftwareSerial port
Serial.begin(9600);
Serial.println("Hello, world?");
}

void loop() // run over and over again
{

if (Serial.available())
{
Serial.print((char)Serial.read());
}

}

My problem is getting it to send data the other way, from the arduino to the terminal on the computer. I tried using a simple Serial.print command in the arduino code and see if I could see that in the terminal. I know it is doing something because a dot is printed in the terminal window everytime the Serial.print command is used, once a second in my case because i used the following code.

void setup()
{

// set the data rate for the SoftwareSerial port
Serial.begin(9600);
Serial.println("Hello, world?");
}

void loop() // run over and over again
{

Serial.print("hello world");
delay(1000);

}

I think the problem is that the Xbee on the arduino is not sending data, I believe this because the DIN light blinks on the Xbee Explorer connected to the Arduino everytime the Serial.print command is called and the DOUT light blinks at the same on the Xbee Explorer connected to the computer. Thanks for the help, you don't know how much I appreciate it, trying to get this all working for a senior design project.