Pages: [1]   Go Down
Author Topic: Xbee to Xbee Communication Issues  (Read 766 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I think I am in a mess!  My program tells the Arduino board to send a numbered code to the computer 1 time per second.  When viewed on a serial monitor it should look like:

12345
12345
12345
12345
...

When the Arduino board receives any number in return it begins sending voltage signals from a load cell at 25 times per second. looking like this:

12345
12345
12345
100
100
101
100
100
101
100
100
102
99
...

However, when I hookup the Xbee units (using a USB dongle on the computer and the Xbee sheild on the board, I get this (on all baud rates):

1ag532
d7399
g
 
along with a few other symbols not of this world  smiley-lol  At some point, a communication seems to be sent, because it will start sending voltage data, but not on multiple lines, but on one long line...

Help? 
Please?

Thanks a bunch,
Ryan
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"When I run some code I'm not going to show you, the code doesn't work. What is wrong?"

Did I paraphrase that correctly?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ahh, some how I knew that was coming  smiley-razz 

int loadcell;
int compRESPONSE;

void setup()
{
     Serial.begin(9600);
     Serial.println("12345");
     delay(1000);
     compRESPONSE = Serial.read();
     while (compRESPONSE < 0)
      {
          Serial.println("12345");
          delay(1000);
          compRESPONSE = Serial.read();
      }
}

void loop()
{
     loadcell = analogRead(0);
     Serial.println(loadcell);
     delay(25);
}
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which XBees are they? Which XBee shield are you using? How are the XBees configured?

I'd suspect a mismatch in the baud rate between the two XBees.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Paul,
Using two XBee Series 1 (802.15.4) with the 1mW antenna.  Shield is the Spark Fun sheild for Arduino (using it on a Uno).  Computer hookup is the Spark Fun USB Dongle.  I have checked the Xbees (I think), and believe them to be each on 9600.  Could you help me on checking the Xbees?  The X-CTU was a little confusing for me.

Thanks,
Ryan
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 928
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

For the series 2 XBees: serial baud rate doesn't matter in the communication between the devices.  One of them can be set for 9600 and the other 19K and they will still communicate just fine.  The path between the two of them is set by the XBees themselves and is not controlled by the setup.  The baud rate is only related to the speed of the serial port on the XBee.  So, if your arduino and its XBee are both at 9600, you're fine on that end.  Similarly, if the PC and it's XBee are at the same rate, you are fine there also.  I believe this is true for the Series 1 XBees as well.  I have a couple of XBees set for really high speed just because I can and it was fun; they communicate just fine with the rest of the network.

However, Paul is correct in that this looks like a baud rate mismatch.  The easiest way to tell if the baud rate is correct, is to simply type AT commands into the terminal window on XCTU.  Just type in an AT command and see if it responds, and that you can read the response.  If you can, you got the baud rate right.  Do this for both XBees by switching them out in the USB dongle.  This is assuming that you are using transparent mode.  If you're using API mode, then you will have a very different problem (it won't work at all).  If you find that the baud rate is wrong, just change the baud rate on XCTU until you can talk to it and proceed from there.

Since I've never used a series 1 XBee (I want the latest and greatest to help delay obsolescence) I can't exactly describe how it looks in XCTU, but you can find about 10,000 examples of how to set the baud rate up on an XBee by doing a search.
Logged

Trying to keep my house under control http://www.desert-home.com/

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Since I've never used a series 1 XBee (I want the latest and greatest to help delay obsolescence) I can't exactly describe how it looks in XCTU, but you can find about 10,000 examples of how to set the baud rate up on an XBee by doing a search.
Series 1 and Series 2 radios are for completely different purposes. One is NOT a newer/more modern replacement for the other one.
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 19
Posts: 928
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Obsolescence can come from many causes, not just the manufacturer stopping production.  In my case, I would have outgrown the series 1 in a few months because they don't mesh and store forward.  The third XBee I installed was too far away from the controller to talk.  That would mean that they were obsolete to me.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks guys,
will take a look. smiley
Logged

Pages: [1]   Go Up
Jump to: