SparkFun Forums 

Where electronics enthusiasts find answers.

All things pertaining to wireless and RF links
By JNajarian
#161173
Hello Sparkfun community,

I have recently bought two Series 1, XB24-AUI-001 Xbee's, and two Arduino shields similar to this. I am attempting to use these to establish wireless communications between an Arduino Mega, and an Arduino Duemilanove. I have followed the instructions here, but got no success.

I thought that maybe I need to reset the chips, I placed both jumpers to USB, wrote an empty code to the Arduino, I opened up X-CTU, went to Modem Configuration, and clicked restore. On the bottom it wrote
"Resetting AT Commands...
Restore Defaults..complete".
I did the same to the other chip too. Still no communications in between them.

Next I tried to download new versions for the Function Set 802.15.4(Currently both are on 10E8). After a while it successfully downloaded all the way up to 10ED. Then I tried to write 10ED to one of them, it said

"Getting modem type....OK
Programming modem...Lost communication with modem
Write Parameters...Failed"

Some other information.

When the Xbee is placed on the shield a red LED starts blinking.

When I do a Query it says:
Communication with modem...OK
Modem firmware version = 10E8
Modem type = XB24

Serial Number = 13A2004062C846
Serial Number(For the second one)= 13A2004048dCE0

In Terminal it seems like +++ and all AT commands work.

Do I have to change the modem(currently XB24), or the Function Set(currently XBEE 802.15.4)?

Any help or pointers in the correct direction are much appreciated.
By waltr
#161228
Start by getting the Arduino to communicate with the PC (use X-CTU terminal or other terminal emulator) without the XBees.
Get the Arduino code working so it sends data the the PC and you see the correct data on the screen.

Next connect the two Arduinos together without the XBees.
Connect wires between the shields from ground to ground, TX to RX, RX to TX. The directly connects the serial lines of the Arduino's to each other.
Now get the communication between the Arduinos working (Arduino code).

Ensure that the Arduino's Baud rate is the same that the XBees are set to (what you used in X-CTU).
Once this works correctly you can remove the wires and re-install the XBees.

From what you posted about the XBees and X-CTU the XBees are working. XB24 with firmware 10E8 is good so leave this alone (this also tells me these are XBee Series 1 modules and perfect for your project).
By JNajarian
#161230
Thank you for the reply, it got me on the right track. After replacing the wires with the Xbee, the LED started blinking, but I had both Arduinos next to my laptop. I was confused to why they worked since I had not changed a thing on the code, so I took the Mega back to the robot, and it stopped working again. It turns out that the range is severely damaged, and I have already asked for an antenna or a replacement. Thanks again for your help, it has saved me hours if not days of headache.
By waltr
#161231
Check that both XBees are using the same RF channel. They may need to be told to re-establish the RF link when they are not too close together, more than 5 feet. If they are too close then they can 'talk' on different RF channels and the range is then severely limited.
By JNajarian
#161232
Both XBee's channels are set to C Pan ID's are 3332 Destination Address High, Low, and Source Address are all 0.

When you say re-establish the RF link, is that something that needs to happen in code, or happens automatically?
By waltr
#161234
In the Series 2 XBees a few commands must be issued. I'm not sure how this is done in the Series 1 XBees. Check any of the tutorials you found and see if there is anything in the XBee document on how a Series 1 establishes a network and does an RF scan.

You can use the AT CH command (page 40 of 90000982_B manual)it see which RF channel is being used.
Also see the AT A1 and A2 commands about association.
By JNajarian
#161498
It turned out that all setting were correct, but the Xbee's were both lacking antenna. Once I got some and attached them, the Xbee's worked perfectly.

Thanks again for the help, and getting me on the right track.