Go Down

Topic: Xbee Communication with my PC (Read 1 time) previous topic - next topic

DeathByToast

Mar 06, 2012, 03:41 am Last Edit: Mar 08, 2012, 07:25 am by DeathByToast Reason: 1
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: [Select]
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!

PaulS

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

DeathByToast

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!  :)

DeathByToast

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!

DeathByToast

#4
Mar 12, 2012, 12:08 am Last Edit: Mar 12, 2012, 12:11 am by DeathByToast Reason: 1
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?

Jack Christensen

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.
MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

DeathByToast

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?

DeathByToast

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!

DeathByToast

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.


PaulS

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.

Go Up