Simple XBee to XStick communications[help needed]
mlee49
Posts: 5
Hi, I'm beginning a new project using a Basic Stamp 2, XBee 802, and a XStick. The end goal is to connect a sensor and stream data to the XStick's computer, but I'm running into trouble with basic configuration.
Here's what I know so far:
The XBee will be in AT mode and transmit
The XStick will be in AT mode as well and receive
The basic stamp 2 will assist with sensor calculations[unimportant at this time]
Here's what I dont know:
How can I establish basic communications between the two?
Do I need to program the XBee off the stamp 2?
Where is some starter/basic comm code for simple terminal access from one to another?
I really want to understand this application because I find the material very applicable. Any help would be greatly appreciated.
Thanks!
Here's what I know so far:
The XBee will be in AT mode and transmit
The XStick will be in AT mode as well and receive
The basic stamp 2 will assist with sensor calculations[unimportant at this time]
Here's what I dont know:
How can I establish basic communications between the two?
Do I need to program the XBee off the stamp 2?
Where is some starter/basic comm code for simple terminal access from one to another?
I really want to understand this application because I find the material very applicable. Any help would be greatly appreciated.
Thanks!
Comments
Also, has anyone ran the XBee directly to a USB without the SIP board? I have a USB breakout cable and know the +5 and ground, but not sure how the data in/data out get connected to the XBee.
Thanks a ton for the help!
You have to assign a unique node address to each xBee. Assuming you have the IEEE 802.15.4 xBees, you assign the other xBee's node address as the destination for each of the xBees, so xBee #1 connects to xBee #2 and xBee #2 connects to xBee #1. When they power up, they'll automatically connect to each other and you'll have a ready-to-go full duplex serial wireless link.
I cant seem to access the XBee from XCTU when it's in the Board of Education/stamp 2. I should have bought the USB adapter board, but I think I can make shift a cable. I'm not sure if a standard USB cable will do, stepping down the 5 V to 3.3 with a voltage divider. Do I need to use a specific USB cable, or will an old iPod cable work?
If I can get the XBee to configure in the XCTU software I'll be so stoked. This RF/wireless realm is so amazing! Thanks again!
The FTDI cable I mentioned is a USB to serial adapter built into the USB connector end of the cable. The FTDI chip inside it includes a voltage regulator and the necessary logic level translation to 3.3V. It's equivalent to Parallax's USB adapter board.
Follow the startup guide examples and configure your xBee using the Stamp. It's not hard. Page 49 shows how to turn on flow control, but the same technique can be used with any of the other configuration commands or a series of them.
I'll hit the manual again a while, see how far I can make it.
On a positive note, I did configure the XStick with it's own Network ID. Now if I can get the XBee configured I should be able to establish basic communications.
First I read the XBee RF Module Manual(800kB pdf: ftp://ftp1.digi.com/support/documentation/90000982_E.pdf)
Next I read on the differences between AT and API modes, from there I found out that there are only a few parameters to change to establish communication.
1) The Channel must be the same
2) The PAN ID must be the same
3) The MY or Source address must be different for each module
4) The DL or destination address will be each others MY address
5) Simply program these values and write to each module and BAM! Instant communication.
After rereading the Getting Started with the XBee guide(http://www.parallax.com/go/XBee#downloads) I looked at the Basic Stamp 2 code and saw how they were simply entering command mode. A simple SEROUT is the same as entering the terminal and using the four letter commands. I cant wait to program the XBee through the stamp and complete this project! Thanks for helping and I hope this helps someone else!!!
Things can certainly get more complicated, but it can be really simple to start. This applies to the 802.15.4 XBees.