Communicating using Dragon12 board with xbee chip - xbee

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.

Related

Architecture for communication with sensor network

I have several raspberry pis, each one connected to a sensor module. I have written a C program which runs on each raspberry pi to communicate with the sensor module and to configure it properly (the driver for the sensor module is written in C).
The next step is to make the configuration of the sensor modules more flexible and to enable other applications to communicate with the sensor modules over the network.
To make the configuration more flexible I thought about creating a web application which is able to connect to the raspberry pis (all of them are in the same wifi) and configure the sensor modules remotely.
My idea is to create a REST Api which runs on each raspberry pi and enables the communication with the sensor module. But as my application is written in C, I was wondering if there is any better solution to my problem? I know that creating a REST Api in C is possible, but, as far as I know, it is not very common.
Would you think that creating a REST Api in C for this use case is a good idea and if so, is there any good framework available?
Also, if someone has a better idea for a different architecture, I would really appreciate it.
Thanks in advance!

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.

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

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?

Resources