Adafruit xbee adapter v1.1 to send and receive data

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
umar khalid
 
Posts: 11
Joined: Sun Nov 11, 2012 9:00 am

Adafruit xbee adapter v1.1 to send and receive data

Post by umar khalid »

I am using xbee series 1 with adafruit xbee adapter v1.1. I have connected one adapter to the computer and other one is connected to Arduino Leonardo. When I use Arduino Serial Monitor to send data (“cool”), I can see it in x-ctu terminal as shown in the image below. But when I try to use x-ctu terminal to transmit data like ”writehere”. I cannot see anything in the serial monitor of the Arduino. I am using following code. Please can you help?

Code: Select all

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);


void setup()  {
  pinMode(13, OUTPUT);
  Serial.begin(9600);
  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 again
{

  if (mySerial.available()) {
      Serial.print((char)mySerial.read());
  }
  if (Serial.available()) {
      mySerial.print((char)Serial.read());
  }
  delay(100);
} 
Attachments
typing data from Arduino Serial monitor to send it to Xbee connected to PC
typing data from Arduino Serial monitor to send it to Xbee connected to PC
sen2.jpg (135.04 KiB) Viewed 803 times
Data received by xbee connected to the PC from Arduino Serial Monitor
Data received by xbee connected to the PC from Arduino Serial Monitor
send.jpg (136.96 KiB) Viewed 803 times
Trying to send data from PC Xbee to Arduino but Arduino do not receive anything on serial monitor
Trying to send data from PC Xbee to Arduino but Arduino do not receive anything on serial monitor
sending.jpg (136.74 KiB) Viewed 803 times

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by adafruit_support_bill »

How do you have the adapters connected to the computer and Leonardo? A photo(s) would be good.

Do you get the same behavior if you swap modules/adapters?

User avatar
umar khalid
 
Posts: 11
Joined: Sun Nov 11, 2012 9:00 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by umar khalid »

Yes I get the same behaviour when I switch the xbee modules. On the PC side I am using “USB XBee Adapter” and here is the photo of how I have connected Arduino to xbee module.
Attachments
Arduino xbee adapter connection
Arduino xbee adapter connection
arduino with xbee.jpg (872.93 KiB) Viewed 773 times

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by adafruit_support_bill »

The wiring looks right, and if swapping modules doesn't change things then the modules themselves are OK. Post photos of the front and back of the adapter (module removed) and we'll check over the assembly.

User avatar
umar khalid
 
Posts: 11
Joined: Sun Nov 11, 2012 9:00 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by umar khalid »

Please have a look at the front and back photo of the module.
Attachments
FRONT OF THE module
FRONT OF THE module
2.jpg (792.68 KiB) Viewed 768 times
back of the module
back of the module
1.jpg (716.03 KiB) Viewed 768 times

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by adafruit_support_bill »

Assembly looks good. But the solder joint on the Tx wire (pink) looks like a cold joint. Touch that up and see if that helps.

User avatar
umar khalid
 
Posts: 11
Joined: Sun Nov 11, 2012 9:00 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by umar khalid »

I tried soldering the pink wire again but it does not work. when I send data from PC red led "turns on" on the adapter connected to arduino but I can not see anything on the serial monitor. I think may be the code I am using is not compatible with arduino Leonardo.

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by adafruit_support_bill »

Aha - the Leonardo! That is likely your problem. You should be able to make it work on a different set of pins.

http://arduino.cc/en/Reference/SoftwareSerial
Not all pins on the Leonardo support change interrupts, so only the following can be used for RX: 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).

User avatar
umar khalid
 
Posts: 11
Joined: Sun Nov 11, 2012 9:00 am

Re: Adafruit xbee adapter v1.1 to send and receive data

Post by umar khalid »

Thanks a lot. Now it is working!!!!!!!!!!!!!!!!! Adafruit products and customer support are the best in the world!!!!! Thanks thanks and thanks a lot again! :D :D :D :D

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”