Guide.ArduinoWirelessShieldS2 History

Hide minor edits - Show changes to output

July 10, 2014, at 04:05 PM by Federico Fissore - updated ctu link
Changed lines 19-20 from:
Download it from this [[ http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 | link]].
to:
Download it from this [[ http://www.digi.com/support/kbase/kbaseresultdetl?id=2125 | link]].
November 05, 2011, at 01:07 PM by Federico -
Changed lines 3-13 from:
The Arduino Wireless Shield allows your Arduino board to communicate wirelessly using Zigbee. This documentation describes the use of the shield with the XBee Series 2 module. The XBee Series 2 and the Series 1 modules are not compatible over-the-air because they use different chipsets. In particular in XBee Series 1 modules uses the Freescale chipset that implements the 802.15.4 protocol while the XBee Series 2 modules uses the Ember chipset that can implement the ZigBee protocol or the ZNet 2.5 protocol. Despite the ZNet 2.5 is older than the ZB (ZigBee) firmare, Digi International continue to support both, so you are free to change firmware anytime you want, just remember that only radios with the same type of firmware can communicate with each other.

The 802.15.4 firmware support only point-to-point or multipoint communication, without routing so, the XBee modules are ready out of the box to enstablish a peer communication beetwen two radios without any configuration.

In the XBee with ZNet 2.5 or ZB firmwares what is described above that seems an advantage for simple communications is not allowed, because they are designed to form network with star, cluster tree or mesh topologies, where there is a hierarchy of devices and one coordinator is always necessary.

So, in a ZigBee network there can be only one coordinator that manage all the network, there can be different routers attached to the coordinators and many oders end device that can communicate directly with a coordinator or pass trough a router. This means that each module must be configurate for his purpose, but the advantage is that you can form wider netwoks, ZigBee protocol provides to set up a radio link between the modules that are distant from each other and where the endpoints save power by sleeping, but don't lose messages when asleep.

After reading this you definitely realized that two modules to communicate with each other you'll need to configure a coordinator and a router/end device. Let's do this!

to:
The Arduino Wireless Shield allows your Arduino board to communicate wirelessly using ZigBee. This documentation describes the use of the shield with the [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-zb-module.jsp | XBee® ZB ZigBee® RF Modules]] module. The [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-zb-module.jsp | XBee® ZB ZigBee® RF Modules]] and the [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#overview | XBee® 802.15.4 OEM RF Modules]] are not compatible over-the-air because they use different chipsets. In particular in [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/xbee-series1-module#overview | XBee® 802.15.4 OEM RF Modules]] implements the 802.15.4 protocol while the the [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/zigbee-mesh-module/xbee-zb-module.jsp | XBee® ZB ZigBee® RF Modules]] implements the ZigBee protocol or the ZNet 2.5 protocol. Digi International continue to support both ZigBee and Znet 2.5, so you are free to use either on the Series 2 radios. Remember that only radios with the same type of firmware can communicate with each other.

The Xbee 802.15.4 modules support point-to-point or multipoint communication without routing, so they are ready out of the box to establish peer communication between two radios without any configuration.

The XBee with ZNet 2.5 or ZB firmwares are designed to form networks with star, cluster tree or mesh topologies, where there is a hierarchy of devices and one coordinator is always necessary. Simple peer-to-peer communication with these modules is therefore more complicated than with the 802.15.4 modules. Each ZB module must have its firmware configured as coordinator, router, or endpoint before you can begin communication.[[<<]]
In a ZigBee network there must be only one coordinator that manages all the network. There can be several routers attached to each coordinator and many end devices that can communicate directly with a coordinator or pass messages to other end devices through router and the coordinator. Though each module must be configured for a specific role, the advantage is that you can form wider networks than you can with the 802.15.4 modules. The ZigBee protocol allows you to set up a radio link between the modules that are distant from each other by sending messages through multiple routers from endpoint to endpoint. You can also make networks in which the endpoints save power by sleeping, but don't lose messages when asleep.

To enable simple communication between two ZB radios, you'll need to configure one with the coordinator firmware, and one with router or endpoint firmware. The next section shows you how to do this.
Changed lines 14-20 from:
These instructions show you how to get two Arduino boards talking to each other over XBee series 2 radios using Wireless Shields.

First of all the XBee Series 2 modules needs a configuration. To change the device function you must change the firmware installed on the module, you can do that with the official software called X-CTU.
You can download X-CTU on the official website, to the following [[ http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 | link]], unfortunately it's released only for Windows platforms.

If you are running a linux distro, you can install X-CTU trough Wine. For the reason why the software ask for a COM port where the module is attached you have to create a link from the Arduino device recognized by Linux to the Wine dosdevice directory. Like this:
to:
These instructions show you how to get two Arduino boards talking to each other over ZB radios using Wireless Shields.

Attach:ArduinoUno_XBeeS2.png

To configure a ZB module as coordinator, router, or end device, you'll need to change the firmware. You need Digi's configuration software, X-CTU, to do this. Unfortunately it's only available for Windows.
Download it from this [[ http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 | link]].

If you are running a Linux, you can install X-CTU trough Wine. You'll need to create a link from the Arduino device on which the radio is mounted to the Wine dosdevice directory. To do so, open a terminal windows and type:
Changed lines 25-29 from:
@@ln -s /dev/ttyACMx ~/.wine/dosdevices/com1@@[[<<]][[<<]]


To configure the modules from the computer, put the serial switch to the USB position and have removed the microncontroller from your Arduino board, or upload an empty sketch, like this:
to:
@@ln -s /dev/ttyACMx ~/.wine/dosdevices/com1@@[[<<]]
[[<<]]


To configure the modules from the computer, put the serial switch to the USB position and upload an empty sketch, like this:
Changed lines 32-35 from:
void setup() {
}
void loop() {
}
to:
void setup() { }
void loop() { }
Changed lines 36-38 from:
These are the basic condition to reprogram a firmware on an XBee module. Now configuring it.

to:
Then mount the radio on your Wireless shield.

Changed lines 45-47 from:
Click on the Modem Configuration tab and click the "Read" button, this will read and show your module configuration. Below are the settings for the XB24-B version, with some custom changes. Make sure you set "ZNET 2.5 ROUTER/END DEVICE AT". In the list below you only need to change the PAN ID, choose a number you like, this number is the network identifier, so it must be the same on the other module.
Read the SH and SL parameters and take note of them, the togheter form the Serial Number of the module which is unique. If you are unable to read this parameter from the list, you should go in the "Terminal" tab and type three plus signs: +++ to enter in the configuration mode, then type ATSH an ATSL to get the serial number from the module, the module will answer like below:
to:
The settings that are most important are the PAN ID (ID)and the serial number high word (SH) and low word (SL). Radios which share a PAN ID can communicate with each other. Radios on different PAN IDs will ignore each others messages. The Serial number consists of two 16-bit numbers, stored in two addresses: SH (serial high) and SL (serial low). This is the radio's unique address, and is used to send messages to it. In the settings below you only need to change the PAN ID. Use the same number for both radios so that they can communicate. Read the SH and SL parameters and take note of them, because you'll need to tell the coordinator this address in the next step.

Now the end device configuration is complete. Check the "Always Update Firmware" in the check box and press "Write" button, and the configuration will be uploaded on your module. If you are unable to read these parameters from the list, you can go in the "Terminal" tab and type three plus signs: +++ to enter in the configuration mode, then type ATSH an ATSL to get the serial number from the module, the module will answer like below:
Changed lines 50-51 from:
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
to:
(:cellnr width="33%":) '''Send Command'''
(:cell width="33%":) '''Expected Response'''
(:cell width="33%":) '''What it does'''
Changed lines 56-60 from:
(:tableend:)

(:table width="60%":)
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
to:
(:cell:) Puts the radio in command mode
Added lines 60-64:
(:cell:) Reads the serial number high word

(:cellnr:) @@ATSL@@ ''<press Enter>''
(:cell:) @@407B0E9F@@''<CR>''
(:cell:) Reads the serial number low word
Added lines 67-68:
You can also configure the PAN ID like so:
Changed lines 70-73 from:
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
(:cellnr:) @@ATSL@@ ''<press Enter>''
(:cell:) @@407B0E9F@@''<CR>''
to:
(:cellnr width="33%":) '''Send Command'''
(:cell width="33%":) '''Expected Response'''
(:cell width="33%":) '''What it does'''

(:cellnr:) @@+++@@
(:cell:) @@OK@@''<CR>''
(:cell:) Puts the radio in command mode

(:cellnr:) @@ATID1111@@ ''<press Enter>''
(:cell:) @@OK@@''<CR>''
(:cell:) Set the PAN ID to 1111

(:cellnr:) @@ATWR@@ ''<press Enter>''
(:cell:) @@OK@@''<CR>''
(:cell:) Save the new configuration to flash memory
Changed lines 89-91 from:
Now the configuration is complete, you must only check the "Always Update Firmware" in the check box and press "Write" button, and the configuration will be uploaded on your module.

to:
Changed lines 92-94 from:
Mount the second module on the socket and do again the procedure for connect it with X-CTU. Click on the "Modem Configuration" tab and click the "Read" button. This module should be recognized as XB24-B model and you have to change its function switching it on "ZNET 2.5 COORDINATOR AT", look that the version change and becone 1047. Now you have to do three simple things:

#Change the PAN ID an write the one you assigned in the End Device.
to:
Mount the second module on the Wireless Shield socket and repeat the procedure for connecting to X-CTU. Click on the "Modem Configuration" tab and click the "Read" button. This module should be recognized with the XB24-B firmware and you have to change its function switching it on "ZNET 2.5 COORDINATOR AT".
The version number will change to 1047. Now you have to do three simple things:

#Change the PAN ID an write the one you assigned in the End Device (1111 in the example above).
Changed lines 99-100 from:
As for the previous module, the configuration is complete, you must only check the "Always Update Firmware" in the check box and press "Write" button, and the configuration will be uploaded on your module.
to:
As for the previous module, the configuration is complete, you must only check the "Always Update Firmware" in the check box and press "Write" button and the configuration will be uploaded on your module.
Changed lines 103-105 from:
The modules now are really in a network but the coordinator manage only one node so, as if it were a transparent serial communication. You should be able to get two Arduino boards with Wireless Shields talking to each other using just the standard Arduino serial commands (described in the [[Reference/HomePage | reference]]). Like in the example below.

to:
Note that you didn't have to set the end device's destination address. That's because the end device always speaks to the coordinator. The modules now form a network. The coordinator is managing only one end node, so it's as if it were a transparent serial communication. You should be able to get two Arduino boards with Wireless Shields talking to each other using just the standard Arduino serial commands (described in the [[Reference/HomePage | reference]]). Following is an example.

Changed lines 108-111 from:
To upload a sketch to an Arduino board with a Wireless shield, place the switch in the USB position. Then, you can upload a sketch normally from the Arduino environment. In this case, upload the '''Communication | Physical Pixel''' sketch to one of the boards. This sketch instructs the board to turn on the LED attached to pin 13 whenever it receives an 'H' over its serial connection, and turn the LED off when it gets an 'L'. You can test it by connecting to the board with the Arduino serial monitor (be sure it's set at 9600 baud), typing an H, and pressing enter (or clicking send). The LED should turn on. Send an L and the LED should turn off. If nothing happens, you may have an Arduino board that doesn't have a built-in LED on pin 13 (see the [[Main/Boards | board index]] to check for sure), in this case you'll need to supply your own.

Once you've uploaded the Physical Pixel sketch and made sure that it's working, unplug the first Arduino board from the computer. Change the switch to the Micro setting. Now, you need to upload a sketch to the other board. Make sure its switch is in the USB setting. Then upload the following sketch to the board:
to:
To upload a sketch to an Arduino board with a Wireless shield, place the switch in the USB position. Then, you can upload a sketch normally from the Arduino environment. In this case, upload the [[Tutorial/PhysicalPixel |'''Communication | Physical Pixel''']] sketch to one of the boards. This sketch instructs the board to turn on the LED attached to pin 13 whenever it receives an 'H' over its serial connection, and turn the LED off when it gets an 'L'. You can test it by connecting to the board with the Arduino serial monitor (be sure it's set at 9600 baud), typing an H, and pressing enter (or clicking send). The LED should turn on. Send an L and the LED should turn off. If nothing happens, you may have an Arduino board that doesn't have a built-in LED on pin 13 (see the [[Main/Boards | board index]] to check for sure), in this case you'll need to supply your own.

Once you've uploaded the Physical Pixel sketch and made sure that it's working, unplug the first Arduino board from the computer. Change the switch to the Micro setting. Now, you need to upload a sketch to the other board. Make sure its switch is in the USB setting. Then upload the following sketch to the board:
Changed lines 127-129 from:
When it's finished uploading, you can check that it's working with the Arduino serial monitor. You should see H's and L's arriving one a second. Turn off the serial monitor and unplug the board. Change the switch to the Micro setting. Now connect both boards to power. After a few seconds, you should see the LED on the first board turn on and off, once a second. (This is the LED on the Arduino board itself, not the one on the XBee shield, which conveys information about the state of the XBee module.) If so, congratulations, your Arduino boards are communicating wirelessly.

to:
When it's finished uploading, check that it's working with the Arduino serial monitor. You should see H's and L's arriving one a second. Turn off the serial monitor and unplug the board. Change the switch to the Micro setting. Now connect both boards to power. After a few seconds, you should see the LED on the first board turn on and off, once a second. (This is the LED on the Arduino board itself, not the one on the XBee shield, which conveys information about the state of the XBee module.) If so, congratulations, your Arduino boards are communicating wirelessly.

Deleted lines 131-132:
You can use any of the standard Arduino serial commands with the XBee shield. With the switch in the Micro position, the print and println commands will send data over the XBee shield and the USB connection (i.e. to other Xbee shields and to the computer at the same time). In this configuration, however, the board will only receive data from the XBee shield not from the USB connection.
Deleted lines 133-134:
To allow your computer to communicate directly with the Xbee shield, connect it to an Arduino board whose microcontroller has been removed and place the switch in the USB configuration. Then you can send data to and receive data from the XBee module from any terminal program. This allows you, for example, to see the data that the module is receiving from other Xbee shields (e.g. to collect sensor data wirelessly from a number of locations).
October 27, 2011, at 03:33 PM by Federico -
Changed lines 3-5 from:
The Arduino Wireless Shield allows your Arduino board to communicate wirelessly using Zigbee. This documentation describes the use of the shield with the XBee Series 2 ZB ZigBee mesh module. The Series 2 modules are different from the XBee Series 1 modules because implements the ZigBee protocol and may form more complex networks.

to:
The Arduino Wireless Shield allows your Arduino board to communicate wirelessly using Zigbee. This documentation describes the use of the shield with the XBee Series 2 module. The XBee Series 2 and the Series 1 modules are not compatible over-the-air because they use different chipsets. In particular in XBee Series 1 modules uses the Freescale chipset that implements the 802.15.4 protocol while the XBee Series 2 modules uses the Ember chipset that can implement the ZigBee protocol or the ZNet 2.5 protocol. Despite the ZNet 2.5 is older than the ZB (ZigBee) firmare, Digi International continue to support both, so you are free to change firmware anytime you want, just remember that only radios with the same type of firmware can communicate with each other.

The 802.15.4 firmware support only point-to-point or multipoint communication, without routing so, the XBee modules are ready out of the box to enstablish a peer communication beetwen two radios without any configuration.

In the XBee with ZNet 2.5 or ZB firmwares what is described above that seems an advantage for simple communications is not allowed, because they are designed to form network with star, cluster tree or mesh topologies, where there is a hierarchy of devices and one coordinator is always necessary.

So, in a ZigBee network there can be only one coordinator that manage all the network, there can be different routers attached to the coordinators and many oders end device that can communicate directly with a coordinator or pass trough a router. This means that each module must be configurate for his purpose, but the advantage is that you can form wider netwoks, ZigBee protocol provides to set up a radio link between the modules that are distant from each other and where the endpoints save power by sleeping, but don't lose messages when asleep.

After reading this you definitely realized that two modules to communicate with each other you'll need to configure a coordinator and a router/end device. Let's do this!

Changed lines 16-21 from:
You should be able to get two Arduino boards with Wireless Shields talking to each other with a simple configuration.

Two Series 2 modules do not work together out of the box like the Series 1 modules, they need a configuration first. You must change the firmware on the modules, you only can do that with the official software called X-CTU.

To configure the modules from the computer, you'll need to have the switch in the USB position and have removed the microncontroller from your Arduino board, or upload an empty sketch, like this:
to:
These instructions show you how to get two Arduino boards talking to each other over XBee series 2 radios using Wireless Shields.

First of all the XBee Series 2 modules needs a configuration. To change the device function you must change the firmware installed on the module, you can do that with the official software called X-CTU.
You can download X-CTU on the official website, to the following [[ http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 | link]], unfortunately it's released only for Windows platforms.

If you are running a linux distro, you can install X-CTU trough Wine. For the reason why the software ask for a COM port where the module is attached you have to create a link from the Arduino device recognized by Linux to the Wine dosdevice directory. Like this:

@@ln -s /dev/ttyUSBx ~/.wine/dosdevices/com1@@[[<<]]
or[[<<]]
@@ln -s /dev/ttyACMx ~/.wine/dosdevices/com1@@[[<<]][[<<]]


To configure the modules from the computer, put the serial switch to the USB position and have removed the microncontroller from your Arduino board, or upload an empty sketch, like this:
Added lines 37-39:
These are the basic condition to reprogram a firmware on an XBee module. Now configuring it.

Changed lines 42-46 from:
Open the X-CTU sofware and in the "Com Port Number" field type the COM port where the Arduino with XBee module is plugged[[#linux|'^[1]^']], click the "Add" button. In the two text boxes on the left will appear the COM port you created, select both and then click the "Test / Query" button, will appear a screen like this:

[IMAGE 1]

Go in the Modem Configuration tab and click the "Read" button, this will read and show your module configuration. In this case we have a XB24-B version, that have some different function set be sure you select "ZNET 2.5 ROUTER/END DEVICE AT". In the list below you only need to change the PAN ID, choose a number you like, this number is the network identifier, so it must be the same on the other module.
to:
Open the X-CTU sofware and type the Arduino XBee module's COM port number into the "Com Port Number" field. Then click the Add button. The COM port you created will appear in the two text boxes on the left. Select both and then click the "Test / Query" button, will appear a screen like this:

Attach:XCTU_S2_ComPort.png

Click on the Modem Configuration tab and click the "Read" button, this will read and show your module configuration. Below are the settings for the XB24-B version, with some custom changes. Make sure you set "ZNET 2.5 ROUTER/END DEVICE AT". In the list below you only need to change the PAN ID, choose a number you like, this number is the network identifier, so it must be the same on the other module.
Changed lines 70-71 from:
[IMAGE 2]
to:
Attach:XCTU_S2_EndDevice.png
Changed lines 77-79 from:
Mount the second module on the socket and do again the procedure for connect it with X-CTU. Go in the "Modem Configuration" tab and click the "Read" button, this module should be recognized as XB24-B model and you have to change its function switching it on "ZNET 2.5 COORDINATOR AT", look that the version change and becone 1047. There can be only one coordinator in the network. Now you have to do three simple things:

#change the PAN ID an write the one you assigned in the End Device.
to:
Mount the second module on the socket and do again the procedure for connect it with X-CTU. Click on the "Modem Configuration" tab and click the "Read" button. This module should be recognized as XB24-B model and you have to change its function switching it on "ZNET 2.5 COORDINATOR AT", look that the version change and becone 1047. Now you have to do three simple things:

#Change the PAN ID an write the one you assigned in the End Device.
Changed lines 85-89 from:
[IMAGE 3]

The modules are now configured to talk together as if it were a transparent serial communication, you should be able to get two Arduino boards with Wireless Shields talking to each other using just the standard Arduino serial commands (described in the [[Reference/HomePage | reference]]). Like in the example below.

to:
Attach:XCTU_S2_Coordinator.png

The modules now are really in a network but the coordinator manage only one node so, as if it were a transparent serial communication. You should be able to get two Arduino boards with Wireless Shields talking to each other using just the standard Arduino serial commands (described in the [[Reference/HomePage | reference]]). Like in the example below.

Deleted lines 124-133:

'''Notes:'''[[<<]]
[[#linux]][1] If you installed X-CTU with Wine on Linux, to be able to insert a COM port in the software you have to create a link from the Arduino device recognized by Linux to the Wine dosdevice directory.

@@ln -s /dev/ttyUSBx ~/.wine/dosdevices/com1@@[[<<]]
or[[<<]]
@@ln -s /dev/ttyACMx ~/.wine/dosdevices/com1@@

----
October 25, 2011, at 04:48 PM by Federico -
Changed lines 103-106 from:
If you want to deepen in the configuration and networking with ZigBee using XBee Series 2 modules we recommend that you read the book by Robert Faludi: Building Wireless Sensor Networks, published by O'Reilly.


to:
If you want to deepen in the configuration and networking with ZigBee using XBee Series 2 modules we recommend that you read the book by Robert Faludi: [[http://www.faludi.com/bwsn/ | Building Wireless Sensor Networks]], published by O'Reilly.


Changed line 110 from:
@@ln -s/dev/ttyUSBx ~/.wine/dosdevices/com1@@[[<<]]
to:
@@ln -s /dev/ttyUSBx ~/.wine/dosdevices/com1@@[[<<]]
Changed lines 112-113 from:
@@ln -s/dev/ttyACMx ~/.wine/dosdevices/com1@@
to:
@@ln -s /dev/ttyACMx ~/.wine/dosdevices/com1@@
October 25, 2011, at 04:41 PM by Federico -
Added lines 1-118:
!!Arduino Wireless Shield with XBee Series 2 radios

The Arduino Wireless Shield allows your Arduino board to communicate wirelessly using Zigbee. This documentation describes the use of the shield with the XBee Series 2 ZB ZigBee mesh module. The Series 2 modules are different from the XBee Series 1 modules because implements the ZigBee protocol and may form more complex networks.


!!!Set up a XBee Module

You should be able to get two Arduino boards with Wireless Shields talking to each other with a simple configuration.

Two Series 2 modules do not work together out of the box like the Series 1 modules, they need a configuration first. You must change the firmware on the modules, you only can do that with the official software called X-CTU.

To configure the modules from the computer, you'll need to have the switch in the USB position and have removed the microncontroller from your Arduino board, or upload an empty sketch, like this:

(:source lang=arduino tabwidth=4:)
void setup() {
}
void loop() {
}
(:sourceend:)

!!!Configuring the End Device

Open the X-CTU sofware and in the "Com Port Number" field type the COM port where the Arduino with XBee module is plugged[[#linux|'^[1]^']], click the "Add" button. In the two text boxes on the left will appear the COM port you created, select both and then click the "Test / Query" button, will appear a screen like this:

[IMAGE 1]

Go in the Modem Configuration tab and click the "Read" button, this will read and show your module configuration. In this case we have a XB24-B version, that have some different function set be sure you select "ZNET 2.5 ROUTER/END DEVICE AT". In the list below you only need to change the PAN ID, choose a number you like, this number is the network identifier, so it must be the same on the other module.
Read the SH and SL parameters and take note of them, the togheter form the Serial Number of the module which is unique. If you are unable to read this parameter from the list, you should go in the "Terminal" tab and type three plus signs: +++ to enter in the configuration mode, then type ATSH an ATSL to get the serial number from the module, the module will answer like below:

(:table width="60%":)
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
(:cellnr:) @@+++@@
(:cell:) @@OK@@''<CR>''
(:tableend:)

(:table width="60%":)
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
(:cellnr:) @@ATSH@@ ''<press Enter>''
(:cell:) @@13A200@@''<CR>''
(:tableend:)

(:table width="60%":)
(:cellnr width="50%":) Send Command
(:cell width="50%":) Expected Response
(:cellnr:) @@ATSL@@ ''<press Enter>''
(:cell:) @@407B0E9F@@''<CR>''
(:tableend:)

[IMAGE 2]

Now the configuration is complete, you must only check the "Always Update Firmware" in the check box and press "Write" button, and the configuration will be uploaded on your module.


!!!Configuring the Coordinator

Mount the second module on the socket and do again the procedure for connect it with X-CTU. Go in the "Modem Configuration" tab and click the "Read" button, this module should be recognized as XB24-B model and you have to change its function switching it on "ZNET 2.5 COORDINATOR AT", look that the version change and becone 1047. There can be only one coordinator in the network. Now you have to do three simple things:

#change the PAN ID an write the one you assigned in the End Device.
#In the DH parameter write the numbers you noted from the SH parameter in the End Device.
#In the DL parameter write the numbers you noted from the SL parameter in the End Device.

As for the previous module, the configuration is complete, you must only check the "Always Update Firmware" in the check box and press "Write" button, and the configuration will be uploaded on your module.

[IMAGE 3]

The modules are now configured to talk together as if it were a transparent serial communication, you should be able to get two Arduino boards with Wireless Shields talking to each other using just the standard Arduino serial commands (described in the [[Reference/HomePage | reference]]). Like in the example below.


!!!A Simple Example

To upload a sketch to an Arduino board with a Wireless shield, place the switch in the USB position. Then, you can upload a sketch normally from the Arduino environment. In this case, upload the '''Communication | Physical Pixel''' sketch to one of the boards. This sketch instructs the board to turn on the LED attached to pin 13 whenever it receives an 'H' over its serial connection, and turn the LED off when it gets an 'L'. You can test it by connecting to the board with the Arduino serial monitor (be sure it's set at 9600 baud), typing an H, and pressing enter (or clicking send). The LED should turn on. Send an L and the LED should turn off. If nothing happens, you may have an Arduino board that doesn't have a built-in LED on pin 13 (see the [[Main/Boards | board index]] to check for sure), in this case you'll need to supply your own.

Once you've uploaded the Physical Pixel sketch and made sure that it's working, unplug the first Arduino board from the computer. Change the switch to the Micro setting. Now, you need to upload a sketch to the other board. Make sure its switch is in the USB setting. Then upload the following sketch to the board:

(:source lang=arduino tabwidth=4:)
void setup()
{
Serial.begin(9600);
}

void loop()
{
Serial.print('H');
delay(1000);
Serial.print('L');
delay(1000);
}
(:sourceend:)

When it's finished uploading, you can check that it's working with the Arduino serial monitor. You should see H's and L's arriving one a second. Turn off the serial monitor and unplug the board. Change the switch to the Micro setting. Now connect both boards to power. After a few seconds, you should see the LED on the first board turn on and off, once a second. (This is the LED on the Arduino board itself, not the one on the XBee shield, which conveys information about the state of the XBee module.) If so, congratulations, your Arduino boards are communicating wirelessly.


!!!A Few Notes

You can use any of the standard Arduino serial commands with the XBee shield. With the switch in the Micro position, the print and println commands will send data over the XBee shield and the USB connection (i.e. to other Xbee shields and to the computer at the same time). In this configuration, however, the board will only receive data from the XBee shield not from the USB connection.

The Xbee module on the shield is set up to work at 9600 baud by default, so unless you reconfigure it, you'll need to make sure you're passing 9600 to the Serial.begin() command in your sketch.

To allow your computer to communicate directly with the Xbee shield, connect it to an Arduino board whose microcontroller has been removed and place the switch in the USB configuration. Then you can send data to and receive data from the XBee module from any terminal program. This allows you, for example, to see the data that the module is receiving from other Xbee shields (e.g. to collect sensor data wirelessly from a number of locations).

If you want to deepen in the configuration and networking with ZigBee using XBee Series 2 modules we recommend that you read the book by Robert Faludi: Building Wireless Sensor Networks, published by O'Reilly.



'''Notes:'''[[<<]]
[[#linux]][1] If you installed X-CTU with Wine on Linux, to be able to insert a COM port in the software you have to create a link from the Arduino device recognized by Linux to the Wine dosdevice directory.

@@ln -s/dev/ttyUSBx ~/.wine/dosdevices/com1@@[[<<]]
or[[<<]]
@@ln -s/dev/ttyACMx ~/.wine/dosdevices/com1@@

----

!!!References

For more information, see: the [[Main/ArduinoWirelessShield | hardware page]] for the Xbee shield, and the [[http://www.digi.com/products/wireless-wired-embedded-solutions/zigbee-rf-modules/point-multipoint-rfmodules/ | Digi Xbee page]].

Share