Hussain in the membrane

XBee Series 1 Serial Communication Set up

Posted in thesis by teenybreeny on April 12, 2009

lilypad circuitry

lilypad circuitry 2

two Arduino boards

The parts that are needed to go wireless:

1. wireless dongle carrier… available at new micros (http://newmicros.com/)

2. 2 Series 1 (series 2 for some reason has a ridic. impossible protocol to work with) XBee modules… I chose the chip antenna just because I am thinking of the comfort of a wearable garment, but you are free to purchase either of these:

http://www.sparkfun.com/commerce/product_info.php?products_id=8664

http://www.sparkfun.com/commerce/product_info.php?products_id=8665

—————

Step 1.

Download the FTDI Driver software (available when you goto newmircos.com — click on usb xbee dongle— scroll down to section that says “usb drivers” — click on “download direct from FTDI” and choose appropriate driver to match computer).

Step 2.

Plug in your dongle to a usb port on your computer.

Step 3.

Open Terminal and type in:

ls /dev/tty.* (for Mac OS X)

ls /dev/tty* (for Linux)

Then press “Enter” key.

Step 4:

You will see a list of all your available serial ports. Choose the one that has the xbee on it. and type in

screen portname datarate. (ie. screen dev/tty/serialportA7007-pga 9600)

Press “Enter” key.

Step 5.

Now you are ready to set the XBee’s destination address. Type in “+++”  to go into command mode. You should see Terminal say “OK”

Step 6.

This gets tricky. When you are typing, it will not show on the screen, so make sure the following commands are printed exactly as stated with capital letters by holding down the shift key.

For module 1, type in the following:

ATMY 1234 (<— this is stating its status as sender)

Press “Enter” (you should see the screen say ok)

ATDL 5678 (<— and saying it should receive from a module whose ATMY is this destination address)

Press “Enter” (screen says ok)

ATID 1111WR (<—this can be any ID name… we default to 1111, but you can also default to toy1, or garment1, whatever of your liking. This is just set to the parameters of communication.)

Press “Enter”

“Ctrl-A”  “Ctrl-\” to quit out of command mode.

step 7.

This takes you out of command mode. To check if these values were saved press “Enter” again, and then back into command mode by pressing: “+++”.

Now type in ATMY, “Enter” to see the value it holds onto the module.

Continue checking with this manner. (ATDL, “Enter”, ATID,  “Enter”)

Ctrl-a Ctrl-\ to exit out of the command mode.

For module 2, continue the same steps.

Step 8.

Take out module 1 insert module 2 onto the dongle.

Step 9.

Open terminal, type in:

ls /dev/tty.* (for Mac OS X)

ls /dev/tty* (for Linux)

and then press “Enter”

Step 10.

You will see a list of all your available serial ports. Choose the one that has the XBee on it. and type in

screen portname datarate. (ie. screen dev/tty/serialportA7007-pga 9600)

Press “Enter”.

Step 11.

You are now in port terminal… type in “+++” and press “Enter”.

step 12.

For module 2, type the following:

ATMY 5678 (<— this is stating its status as receiver)

Press “Enter” (you should see the screen say ok)

ATDL 1234 (<— from its sender)

Press “Enter” (screen says ok)

ATID 1111WR (<—completing the ID communication for module 1 and 2 to speak to one another.)

Press “Enter”

“Ctrl-A”  “Ctrl-\” to quit out of command mode.

step 13.

Check to see if module 2 values were saved.

Press “Enter” again, and then back into command mode by pressing: “+++”.

Now type in ATMY, “Enter” to see the value it holds onto the module.

Continue checking with this manner. (ATDL, “Enter”, ATID,  “Enter”)

Ctrl-a Ctrl-\ to exit out of the command mode.

Step 14.

Close Terminal. Done!

When troubleshooting, also be sure to set ATDH to 0.

*** If you want XBee modules to communicate to more than one port, repeat the same process, but change the module ids to “2222″ or another id name of your liking.

Leave a Reply