Xbee Setup

I am trying to set up a system to send data wirelessly from an arduino to a computer using two Xbee Pros.

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.

Are you using Series 1 or Series 2 (2.5) modules? I believe both can have pro designations indicating further range.

When your saying

I have confirmed that they are talking to each other 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

Do you have an arduino and xbee connected together and both connected to the computer? Because if that is the case, it doesn't mean anything is being sent out the XBee radio. The arduino ide is just mirroring the Xctu terminal.

Here is a step by step for the series 2.5 chips.

www.humboldt.edu/~cm19/XBee%20setup.pdf

Ive never used series 1 but I hear they are much easier to use, just no mesh networking.

I've had the Xbee and Arduino set up on different computers and seen the character so I know it is being over the radio. My problem is that I have an Xbee Pro 900 so it does not allow me to set one as a coordinator and the other as a router like in that tutorial. Do you know how I can make the radio connected to the arduino send out data and not the other way around?

Ive never used any of the other ones versions besides the series 2.5. I would think they would work the same for just a serial print.

Just so I have it straight, you have an arduino loaded with a sketch that just prints some characters with a 1 second delay. The arduino is connected to the XBee using an explorer breakout. You have the TX from the arduino going to the DIN on the xbee explorer, and the ground and 5v from the arduino also going to the ground and 5v on the Explorer. You don't need the RX/Dout connected to test this.

On the other side you have another XBee of the same model plugged into the Explorer which is then plugged into your computer with the XCTU terminal open.

You might want to check what the baud rate on the xbees are set to. They might be higher for the Pro model.

[edit]NM default setting for BD is 3 which is 9600. You might still want to check that parameter through X-CTU though[/edit]

I'll check the baud rate but I currently have both of them set to 9600 as you said and yes that is the setup I have right now, I know the XCTU is recieving something because a dot is printed out everytime I use the Serial.print command on the arduino but I cannot get it to print out the characters I am printing with the Serial.print command.

Try viewing the data as HEX in XCtu, there is a checkbox on the terminal screen. Just curious what it is recieving.

Also try Serial.println("..."); so it prints the carriage return.

Ok I'll give that a try tonight and let you know what happens, thanks so much for the help.

So I tried what you said and the Serial.println("..."); did the same thing as before and when I view it in Hex it is printing 00 00 00 00 00 00 everytime the Serial.print command is used. I think the problem is that for some reason on the Xbee Explorer attached the arduino the DIN is blinking and on the Xbee Explorer attached to the computer the DOUT is blinking, I believe I want this to go the other way. Do you have any more suggestions?

Actually I have a couple series 2's hooked up right not, and that is the way it should be. Those DIN/DOUT leds are connected to the serial UART not the Radio. So when you are sending something from the arduino through its TX into the XBee DIN, the DIN light will blink. Then when the other xbee receives the data, it sends it out its DOUT pin which causes the DOUT led to blink.

Does that make sense?

That does make sense after I think about it, have you used the series 2 Xbees to send data like I am trying to do...my goal to have the arduino with the xbee send data back from sensors to the computer. So if it sending data why can't I view it on the computer through XCTU, should I be using another program to view the data sent back?..or use other commands to send the data?

What doesn't make sense to me is why it seems to be sending and receiving correctly, however you don't get anything on the terminal.

Do you have another arduino that you could hook the DOUT pin from the computers explorer chip into the RX pin on an unchiped arduino that is attached to ur computer?

Im thinking it might be a problem with the serial to usb converter

Yeah I have that test program running that I had linked to earlier. It sends the string "Testing..." from my remote arduino to my computer and I can view it in XCTU. I have my computers xbee attached a USB Explorer instead of a serial explorer though.

I do but I also have a straight serial cable, should I try that out first?

The more I think about it, they way you have it now should be working assuming you can use that setup to configure the xbees.

If you disconnect the TX from your remote xbee but leave it powered though the arduino and type into the Xctu termina: +++ (wait for OK) then type ATND. You should get a reply with the remotes 64bit address and some other info. Does this work?

Yes I did that and got the following...

+++OK
ATND
FFFE
0013A200
404B3474

FFFE
01
00
C105
101E

FFFE
0013A200
404B3451

FFFE
01
00
C105
101E

Hmm its a little different format than mine prolly because your using pro.
Do you know if those responses match the 16bit address of your remote xbee? You can check if you read the remotes modem parameters. it should be under Addressing (SH Serial High, and SL serial Low)

If those numbers match then its not making sense why it isn't printing anything out. It seems to be communicating correctly.

There might be a quirk with the modules that your using that are different than the ones im using. If I think of anything Ill let you know. Its probably going to be something simple we are both missing.

Yeah I checked the 16bit addresses and they did match for both of the modules, yeah please let me know if you think of anything else...Thanks again for all the help, I'm doing this for a school project and have been stuck for a good couple of weeks.

Yeah no problem, Ive been there with the school projects.

Its wierd that you are recieving 00 hex in X-ctu. That is NULL. Im still going back to hooking the Dout pin to an arduino's RX pin and trying to view the incoming data that way. I think it should work because a logic level high I think is 3V. Just don't hook it up with the TX going directly to the Xbee. Im not sure however if you will need to take the Atmega chip out or not. Try just plugging the arduino board in and starting the Arduino software then going to the serial port. Make sure the arduino IDE is set to 9600 baud. Then plug the DOUT into the RX.

I tested the code you were using last night and it came accross fine on my computer. I havn't tested it with the setup described above however, and I won't be home to test it for about 9 hours.

Let me know if your going to try this. You might just get a bunch of random crap if the voltage out of the xbee isn't high enough. Im learning as we go as well.

I've tried your idea with connecting the DOUT pin to the arduino and it did not print anything. Someone suggested trying to use hyperterm instead of XCTU so I am going try that tonight and see if I can get anywhere with that.