Pages: [1]   Go Down
Author Topic: Xbee Communication with my PC  (Read 1478 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I am currently trying to communicate FROM my laptop TO my arduino uno and have it working backwards.  When I type in the serial monitor the text shows up in X-CTU (listening to the Xbee connected via USB to my laptop) but when I type in X-CTU the arduino serial monitor completely ignores the message.  I am wondering why this isn't working both ways?  My code is quite basic, but is below:

Code:
void setup()
{
  Serial.begin(9600);
}

void loop()
{
  while (Serial.available() > 0)
  {
    char serialByte = Serial.read();
    Serial.print(serialByte);
  }
}


In the image above, I typed "Hello World!" in the arduino serial monitor and it showed up in X-CTU just fine, yet when I typed "Goodbye Moon" it does not show up in the serial monitor.

This has been puzzling me for far too long now...hopefully it makes sense to someone out there.  Thanks in advance for any help!
« Last Edit: March 08, 2012, 01:25:37 am by DeathByToast » Logged

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

What kind of XBees are you using? How are they configured?
Logged

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

The Xbee's we are using are series 1, we ordered two of these: http://www.sparkfun.com/products/8665

One is connected via this dongle: http://www.sparkfun.com/products/9819 and the other is connected to my arduino uno via this shield: http://www.amazon.com/dp/B006TQ30TW/ref=pe_175190_21431760_cs_sce_dp_2

The PANID they are using is 1111, and ATMY/ATID are 1001 and 1000 (and set up that they are opposite of each other).

Hopefully that paints a clearer picture of this.  If not, just let me know what other info you would find useful.

Thanks for the time!  smiley
Logged

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

I edited the first post a bit to hopefully make the wording less confusing (and to make it better match the picture).  If anyone has any insight as to why these aren't communicating properly I would greatly appreciate the help.  Thanks in advance!
Logged

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

Hello once again everyone.

I am still having trouble getting my laptop to talk to my arduino via serial through the xbees, and I think I have boiled down the problem to one of two areas of concern.

The first is that I have no actual program sending the serial to the arduino.  I'm not sure if using PuTTy/X-CTU's terminal feature is enough to send serial to my arduino or if I need to write/implement a C++ program similar to this one: http://arduino.cc/playground/Interfacing/CPPWindows#VisualStudio2008

The second area for concern is that my Xbee Shield doesn't allow my Xbee radio to sit flush to the shield as shown below:


However the red light on the shield flashes once I lay the Xbee radio into the shield, as shown here:


I have checked pins 2 & 3 of the radio and they are connected (they are Rx and Tx I believe) yet pin 20 for instance is not connected.  Which pins are vital for communication?



Also, here's a pic of the other Xbee connected via USB to my laptop:


It's red light is always on.

I would greatly appreciate any insight as to what I am missing.  Thank you!

tl;dr:
Do I need to have a C++ program to send serial from my Windows 7 PC to my arduino?
What pins on the Xbee are vital to communication?
« Last Edit: March 11, 2012, 06:11:07 pm by DeathByToast » Logged

Grand Blanc, MI, USA
Online Online
Faraday Member
**
Karma: 95
Posts: 4091
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just a comment on the shield. If it came pre-assembled, I'd send it back. The XBee should seat completely. If too much solder is applied to those 2mm sockets, it can wick up into the contact area and prevent the XBee from seating properly.

The antenna is shipped bent down against the board. For the best signal, carefully bend it up until it is perpendicular to the top of the XBee.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

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

Thanks for the tips, I am in the process of contacting the company for a replacement.

Is it possible that because it isn't seated properly the shield will only allow the Xbee to send but not receive serial data?
Logged

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

I've now replaced the shield and the chip fits just fine now: http://i.imgur.com/5L1hP.jpg

However I am still having the same issue.  Going to try replacing the board this weekend, unless anyone else has any other suggestions?

Thanks everyone for reading!
Logged

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

After much searching I have solved my problem, it was due to the jumpers on the board being in the wrong position (duh): http://electronics.stackexchange.com/questions/25574/xbee-shield-turning-jumper-settings-into-on-off-xbee-usb-manual-switch

I had them in the "USB" setting, not the "Xbee" setting.  Now it works.  I don't know what the "USB" setting is for, but I am avoiding it for now.

Logged

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

Quote
I don't know what the "USB" setting is for, but I am avoiding it for now.
The USB setting is so that you can upload sketches to the Arduino without having to remove the XBee shield.
Logged

Pages: [1]   Go Up
Jump to: