programming for Xbee meshing - xbee

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.

Related

Communication between Xbee Series 1 and different RF Module(TI-CC2538)

I want to test communication between Xbee Series 1 and TI CC2538.
I built 802.15.4 protocol on CC2538 and i want to test whether it
can transmit and receive data with Xbee Series 1 through XCTU.
I tried to scan in XCTU program, but it couldn't find any device.
I set scenario that CC2538 RF chip is coordinator and Xbee S1 is a device trying to associate PAN network.
According to 802.15.4, device has to passive scan and receive beacon frame, after then, device should transmit association request mac command to coordinator which is CC2538.
How Xbee series 1 through XCTU's scan button is working ?
Does it wait for receiving Beacon frame or send beacon request or other frame ?
Is there other way to test communication between Xbee s1 and CC2538 with 802.15.4 which i built ?
I assume you are not trying to run ZigBee protocol on the CC2538. The XBee Series 1 is 802.15.4 and you would need to use a Series 2 for ZigBee.
You might need to use an 802.15.4 sniffer to monitor communications to see what's happening. Does the XBee module send a properly formatted association request? Can you capture another CC2538 successfully joining your network, and compare it to the XBee module's attempts to do so?
Make sure that the XBee module is configured with ATSC (Scan Channels) set to enable whatever channel the CC2538 has established.
I know that some XBee modules support an ATAS (Active Scan) command that will report on beacons seen, but I'm not sure whether the Series 1 supports that command. ATAI provides details on association.
Can you enable debugging on the CC2538 and have it report on the XBee module's attempts to join the network?

Data transfer using xbee and arduino

i have a portable device that consist of
arduino leonardo board,xbee series 2 as router( AT mode ) and different sensors.This portable device acts as a remote device and can be used upon power up.
The other side, i have a host controller that consist of arduino uno board, arduinoxbee shield v1.1, and xbee series 2 as coordinator( AT mode ). This host controller is plug through USB into my PC.
The aim of my project is to send the sensor data from the portable device using xbee wirelessly over to my host controller and displaying out on the arduino serial monitor.
I've managed to configured the two xbees. But now, i'm unsure of how im going to transmit and receive the data. I need a transmitter and receiver program for both xbees that is connected to the arduino. Anyone can help please?
There are a couple different options for how you can do this, but the simplest is to set up your sensor XBee either in change detect (IC) mode, or set a sample rate (IR). In either case you'll need to handle the RX Indicator frame at the controller, which will contain the sampled data.
I wrote a C# stack that can configure all this, but for what you're trying to do it would probably only be useful as a reference (https://github.com/jefffhaynes/XBee).

Autoconfiguration on programmable Xbee modules

Non-programmable Xbee modules should be configured through a PC (with XCTU) or other devices like Arduino... but can the programmable xbee modules (like xbee-pro zb s2b) autoconfigure themselves, without being connected to another device like a PC or Arduino, by running code stored in their memory?
I mean, can they run orders like the ones you run through XCTU but programming them in the internal memory code? Like scan energy of every channel, select a channel, set a PAN ID, configure the different parameters of the device...
Thank you
Yes, the development kit includes an API for sending AT commands from the co-processor to the radio on those boards.
There's also a passthrough mode that relays the host computer serial port through to the radio processor, which can help with initial setup/configuration of the modules like you might do during manufacturing.
To answer your question:
I mean, can they run orders like the ones you run through XCTU but programming them in the internal memory code?
No. You can not program a sequence of orders/commands into the internal memory of the device. To do anything meaningful the device needs to be "driven" from a host PC or MCU that can send the AT Commands.
If you want 1 device solution that does not require a Host MCU then you will need to use a ZigBee SoC (System on Chip), such as the CC2538 - http://www.ti.com/product/cc2538 running a ZgBee SDK (Software Development Kit) - http://www.ti.com/tool/z-stack (ZStack-Home). However this will require you to develop the ZigBee application SW.
Regards,
TC.

XBee communication in API mode using X-CTU

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.

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).

Resources