XBEE PRO S3B Project - Need some help

Let me first start off by saying I am nowhere near an expert Xbee's, but the sole purpose of what I want my Xbee's to do is serial communication with my Arduino. The model # of my xbee is XBP9B-DMUTB002 revE. At this point using the xctu software I'm able to get the two to talk to each other, but once I try to Implement with Arduino I fail to get the two to talk with one another. My whole goal is just to get the two to talk over serial.

Is it even possible with these types of Xbees or am I using the wrong type?

Your help is really appreciate it! I've been racking my brain for two weeks and I'm getting ready to pull the hammer out JK

A circuit is always a good place to start when asking a question like this.

Weedpharma

You probably swapped rx and tx between arduino and xbee.

Let me start off by saying thank you for the reply's! The way i have it wired is as followed

Xbee 1 (Transparent mode / with xbee 2 DH,DL)
Pin 14 --> Tx
Pin 15 --> Rx
3.3v --> VCC
GND --> GND

Xbee 2 (Transparent mode, with xbee 1 DH,DL)
At this point connected to XCTU monitoring incoming messages from arduino.

The Code im useing for Xbee 1 is

#include <SoftwareSerial.h>

SoftwareSerial mySerial(14, 15); // RX, TX

void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}

Serial.println("Goodnight moon!");

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

void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
if (Serial.available()) {
mySerial.write(Serial.read());
}
}

How are you connecting xbee with arduino, using any shield?

I'm connecting the xbee's useing a Xbee explorer (XBee Adapter kit [v1.1] : ID 126 : $10.00 : Adafruit Industries, Unique & fun DIY electronics and kits)

This thread will be of interest since you are using the S3B and the Adafruit adapter. You'll want to make the fix contained around posts 14/15 in the thread. XBee Pro Constantly Streaming Data - Networking, Protocols, and Devices - Arduino Forum

It won't fix your current issue, but will be a problem for you later (or perhaps you addressed it already?)

These XBees work just fine with Arduino if the wiring and code is correct. Reversing TX/RX often cures XBee problems, even when you think you had it right the first time (been there...).

EDIT: Just realized you are not using the XSC S3B, so my link/warning is likely not applicable. I am curious as to why you are using a programmable XBee (according to the model# you gave it has a 32K programmable chip on it), then hooking it up to an Arduino?

I followed the Adafruit XBee tutorial and they worked first time right out of the box. It is here:

You said that the xbee worked without arduino. Were you using two such adapters and FTDI cable/adapter to connect them to your computer?

Can you post a picture of how you wired the adapter to arduino?

@madmattd Yes my Xbee has a 32K programmable chip. Does that make it unusable with arduino?

@liudr Yes I used 2 XBee Adapter and 2 FTDI cable's and im able to type on one and see the respone on the other.

ipecacd:
@madmattd Yes my Xbee has a 32K programmable chip. Does that make it unusable with arduino?

No, more than likely it should be fine. A serial port is a serial port. It just seems odd to put a radio with a programmable microprocessor on it (the XBee) onto another programmable microprocessor (the Arduino) :wink: If it were me, I'd be saving myself the couple dollars apiece and using the non-programmable XBee, but there should be no harm in using what you have.

Your issue on the Arduino end is almost certainly a wiring one.

Actually, you never said which Arduino you are using. Pins 14 and 15 sounds like a Mega?

Are you seeing the "goodnight moon!" print on your Serial monitor?

madmattd:
No, more than likely it should be fine. A serial port is a serial port. It just seems odd to put a radio with a programmable microprocessor on it (the XBee) onto another programmable microprocessor (the Arduino) :wink: If it were me, I'd be saving myself the couple dollars apiece and using the non-programmable XBee, but there should be no harm in using what you have.

Your issue on the Arduino end is almost certainly a wiring one.

Actually, you never said which Arduino you are using. Pins 14 and 15 sounds like a Mega?

Are you seeing the "goodnight moon!" print on your Serial monitor?

When I bought the xbee I didn't realize it was programmable until after it shipped :sunglasses:. Yes i am useing 2 arduino mega's. Once i plug in the mega i see "goodnight moon!" but nothing after nor if i send anything over the serial.

You should use other pins. 14 and 15 have hardware serial port hardware (although not connected) and should be used as hardware serial ports (why not using the hardware serial?)

Your VCC on the adapter should be connected to arduino 5V.

Ok, so i have switched from pin 14 & 15 to 52 & 53. Change from VCC--> 3.3v to VCC--> 5v

Now I getting this from the Com Port

Goodnight moon!
G>ÿ±ÿ½ÿ�)µÊRF-Update App
T-Timeout
V-BL Ver.
A-App Ver.
R-Reset
w

Ok guys, made some progress here I think. So this is where im at, i got to the point where the xbee talk... kind of talk. I have one xbee(Lets call this one Xbee1) hooked up to arduino using the code shown in the picture below, you can also see that I have received the message from the other xbee(Lets call this one Xbee2) connected to the computer.

The Xbee2 is connected to the Computer via FTDI, and you can also see in the next picture that I have received the message from the xbee1 connected to the arduino.

Here the kicker, looking at my arduino code and also seeing that both xbee(1 & 2) are config right(I could be wrong on that) I should be able to upload the code to 2 separate arduino Mega and have them talk....Right?

Well, at this point when i try to do that nothing comes up through the serial. I do notice that when i type in the xbee1's serial the status light on both boards goes solid(im guessing this means they connected?), but when type in the xbee2 serial the light never goes on...

I guess I think one of my biggest issues right now is I'm not 100% sure I have the two XBee configured correctly. should I be using API 1 or 2 or transparent? also should I be putting in the DH and the DL of the opposite XBee or should I just leave them blank? Should I be leaving both xbee's in router mode or should I have one router and one coordinator?

Can't "see" code from picture. You should check your picture yourself. Impossible to read the code. Transparent mode, and have each other's address in DH DL. Can't you use other pins than 52 and 53? They have special functions. Why not using hardware serial port Serial1 2 or 3 that mega has?

Ok, well here is the code that is in the picture. If you would like to view the picture in a bigger view you can right-click and view the image

#include <SoftwareSerial.h>
SoftwareSerial XBee(2, 3); // RX, TX

char letter;
char letter2;

void setup()
{
delay(2000);
XBee.begin(9600);
Serial.begin(9600);
Serial.println("Connected!");
}

void loop(){
if(Serial.available())
{
letter=Serial.read();
XBee.print(letter);
}
if(XBee.available())
{
letter2=XBee.read();
Serial.print(letter2);
}
}

This morning I switched to pin's 2,3 and reset both xbee to factory only changing the DH & DL, also both were in transparent mode. I had no luck in any try of chat(made sure i hade the Tx and Rx correct)

You should use write instead of print.
Since this code seems to serve your purpose, I'll ask you to do a test. Use arduino serial monitor and type in +++ (no line break) and see if your xbee module enters AT mode. If not, you have again managed to screw up your wiring. If the xbee enters AT mode, try the same on the other module. Try ATDL and ATDH commands on both to see if the addresses are set to each other. If you have time, use XCTU to check if the firmware versions are the same.

So firmware are the same on XCTU, i am unable you see anything when i write "+++" in serial, but what i have found is using the xbee library i am able you send to the other xbee but it the data is messed up. Here is the code im using

#include <XBee.h>

uint8_t text[] = {'H', 'e', 'l', 'l', 'o'};

XBee xbee = XBee();
XBeeAddress64 remoteAddress = XBeeAddress64(0x0013a200, 0x40e2e833);
ZBTxRequest zbTx = ZBTxRequest(remoteAddress, text, sizeof(text));

void setup () {
delay(1000);
Serial.begin(9600);
xbee.begin(Serial);
}

void loop () {
xbee.send(zbTx);
delay(2000);
}

Im also attaching 2 images and putting both link here too so you can view i picture in full size.



What is the baudrate of your xbee module? Check it with your XCTU. If you don't see OK after typing in +++, you are not using transparent mode, or you're using the wrong baudrate.