XBee communication in API mode using X-CTU - xbee

I am trying to communicate between two XBee S2 modules both in API mode using the XCTU tool.
One device as router and another device as coordinator. I got successful communication of two XBee modules in AT mode and either of them as API or AT mode. But when I configure both of them in API mode they are not communicating.

How do you know they're not communicating? How are you forming your API frames to send into the device?
In API mode, the XBee module requires a checksummed series of bytes in a specific format to send data to another device. During your tests between the module in AT mode and the one in API mode, you were probably able to see a received frame on the API module when typing data into X-CTU on the AT module.
What language are you going to write your program in? I would recommend using a code library to manage encoding and decoding the API frames.
Digi has a webpage listing XBee host libraries in various languages.

After giving a lot of try i found two tricks in configuring X Bee modules
If your X Bee module is not getting read, just write with the suitable firmware
choosing manually
If it is not responding to read or even write also, connect reset pin to
ground using single wire for few second.

Related

programming for Xbee meshing

i have one query actually i have 3 xbees series2.
i want xbee 1 (sensor+xbee(end device)) and xbee 2 as coordinator,where XBee2 will be attched to MCU.
now i have xbee 3 which again ((sensor+xbee(end device)).
now i want to make xbee3 also to communicate with coordinator(Xbee2).
now i have kept the same pan ID of Xbee1 and xbee3 as like Xbee2.
and again i have set xbee1 and xbee3 destination address for the Xbee 2 .
now my question are
how do i program the MCU using eclipse environment for receiving both Xbee1 and Xbee3 data?
and i want to communicate all Xbees with UART communication means i want to read data using pin 2 and 3 of Xbee..is it possible??
can anyone provide me the code for developing this procedure???
thanks
This is a common scenario. Run the coordinator in API mode and the end devices (you may want to start with those nodes as routers, and figure out the "sleeping end device" details once everything else is working) in AT mode.
The "AT mode" devices with DH and DL set to 0 will just pass serial data to the coordinator, and the MCU can parse the API frames to determine which device sent the data. The MCU can also address requests to the other devices -- either Remote AT Commands or data to send out the serial port.
Write code for the MCU however you normally would. There's a portable ANSI C library available if that's your language of choice. It can parse the API frames for you and simplify communications on the network.

Can Xbee run code without being connected to another device?

I don't know if this is the right place to ask this. Sorry if I'm wrong.
I'd like to know if you can run code in an Xbee module without being connected to the computer or another device like arduino.
For example, I want to have 2-3 Xbee modules that communicate with each other sending information and then take decisions by code dynamically without using the X-CTU software. And I don't want those Xbee modules to be connected to the PC or other devices, they have to run by themselves with a coin cell battery and run some code previously written into their memory. Is this possible? If so, can you provide me some info/documentation to take a look? which language do you have to use to program the code? Which Xbee model do I need?
Thank you!
The XBEE modules can not do such tasks without a host. You can not run your own code on the module.
If you want to run you own code on the same device as the ZigBee stack then you should choose a solution from a silicon/stack provider.
You could achieve your goal using the Texas Instruments ZigBee Home automation SDK from www.ti.com/tool/z-stack which runs the ZigBee stack and your application on one of the TI ZigBee SoC's. But there are likely other similar providers as well.
Regards, TC.
XBees can be configured to initialize themselves with network data, i.e. the PAN ID, so they're aware of how to communicate on start up without requiring external configuration. However, they cannot run headlessly; they must to have some idea of the data that needs to be sent. They're fundamentally designed to act as a transparent serial bridge between computers to aid communications on personal networks. They cannot however be configured to do something bespoke.
It sounds like you're worried about power, so you could try looking for a low-power microcontroller that possesses a USART; this is all you'll need in order to communicate with an XBee via Serial.
It isn't possible to put your own code on a standard XBee module, but Digi does offer a Programmable XBee that includes a Freescale HCS08 co-processor that you can write code for. They offer a development kit with sample programs to get your started.
For a small-scale project where you don't need to be ZigBee certified, that might be easier than getting up to speed with a ZigBee development kit from TI, Freescale or Silicon Labs.

Xbee mesh network: Can end-devices have bi-directional communication with a coordinator?

Quick question: I'm setting up a mesh network with Digi's Xbees series 2, one coordinator and as many as 8 end-devices and as the title implies.
I was wondering if the end-devices could receive data from the coordinator, making for a 2-way communication as I know they can send data to it. These are used in an Arduino-based robot location triangulation project.
Yes, you can do it using API mode if you know the mac address of the device you want to talk to.
Try it here: Digi API Frame Maker. The Frame you need to use is Transmit Request (type 0x10).
You can do it in Transparent Mode too, but in this case you need to enter command mode and set the device address before sending data each time you need to talk to a different module (using ATDLand ATDH commands).

Why doesn't API mode work with two XBee units?

I have two XBee Pro Series 1 units. Both of them are in AP=2 mode (API mode). I have followed the instructions outlined under the "Series 1" section in XBee Configuration. I try to execute "ZnetSenderExample.java" and I can see it tries to send out a very simple "Xbee" string.
However, I keep getting timeouts on the receiving end saying it never gets any data.
Addtionally, I attempted the Unicast example on this page and found the same behavior. It does not work in X-CTU when in API mode.
I am using firmware 10EC.
How can I fix this problem?
Are the nodes on the same network? When you look at them in X-CTU, do they share the same operating network settings (channel, PAN ID)? Have you installed the API mode firmware, instead of the AT mode (sometimes called transparent serial) firmware?
Have you tried any of the examples on Digi's site, to confirm that the units are configured correctly?

Communicating using Dragon12 board with xbee chip

So basically, me and a friend are using the Dragon12-Plus2 board for our class in school, and we are trying to get them to talk via Xbee chips. We have hooked one of them up, and simply need a bit of code to get the Xbee to talk with the board so we can make sure it's in correctly. We are writing in C using Freescale Codewarrior, and as much help as possible is appreciated, especially next steps such as when we hook up the other one, how to get the two to talk and test, etc. They should in theory already be set up as a point-to-point system, but we don't have much experience at this time. Any help would be greatly appreciated
If you configure the XBee modules with "AT mode" firmware, you should be able to use the serial port on the Dragon12-Plus2 board to communicate just as you would with a wired connection.
You'll need to configure both radios with the same PAN ID. Make one a coordinator and the other a router. On the coordinator, configure the DH and DL settings to match the SH and SL settings of the router. You can keep the router's default configuration of using 0 for DH and DL, which tells it to send data to the coordinator.
Do your testing on a PC with a two terminal emulators so you can verify that data sent in on one comes out on the other and vice versa.
Here's an excellent guide from the Digi website on Basic XBee ZB ZigBee (Series 2) Chat which provides more detail and a step-by-step guide for configuring the radios.

Resources