loading
I am currently looking for someone to help out with this blog. I didn't realize the scope that this blog would effect. Hits from countries in political strife and the like, people looking for a way to communicate outside of government control. If you would like to help please send me an email George dot Endrulat at Gmail dot Com.

Friday, June 17, 2011

XBee mesh networking, using ATMega168





Post new topic Reply to topic [ 12 posts ] 
AuthorMessage
 Post subject: XBee mesh networking, using ATMega168
PostPosted: Mon Feb 02, 2009 8:54 am 
Offline

Joined: Mon Feb 02, 2009 8:32 am
Posts: 4
Hi, I'm using XBee series 2 modulesATMega168 microprocessor and a maxstream board to make a network. I'm using coordinator and routers modules, as well as AVR Studio software to create the code. I'm with some problems to create all the C code to create the mesh network.
Can someone tell me if exists some code made in this area? How can I create clusters using this tecnology?

Thanks.[/img]


Top
 Profile  
 Post subject:
PostPosted: Mon Feb 02, 2009 1:13 pm 
Offline

Joined: Sat Jun 05, 2004 8:51 pm
Posts: 1953
Location: USA, California
Xbee Series 1 are based on FreeScale's 802.15.4 chip. No ZigBee meshing.

XBee Series 2 are based on Ember's chip with ZigBee meshing.

Most student/hobby apps don't need meshing.

Don't do meshing unless you must. Instead, use a star topology.
Meshing is needed only if RF conditions and your choice of antenna types and TX power (e.g., XBee PRO) plus obstructions lead to a need for meshing. I say this because meshing is 100 times more difficult than non-ZigBee protocol / firmware configurations.

XBee series 1 is not viable for ZigBee type of meshing. You can do your own "mesh" with static routing if the nodes don't move.

Xbee series 2 is all about ZigBee. Beware that ZigBee mesh routers cannot be battery powered; end nodes can.


Top
 Profile  
 Post subject: XBee mesh networking, using ATMega168
PostPosted: Mon Feb 02, 2009 2:50 pm 
Offline

Joined: Mon Feb 02, 2009 8:32 am
Posts: 4
Thanks for your answer Stevech.

What I'm trying to implement is this: install a ZigBee coordinator (The most capable device, the coordinator forms the root of the network tree and might bridge to other networks. There is exactly one ZigBee coordinator in each network), a ZigBee Router (to passing data from other devices) and ZigBee End Device (Contains just enough functionality to talk to the parent node that cannot relay data from other devices). I need to create a network (star topology its a good idea), where its possible to send/receive data from any XBee (making some hops if necessary) to the main computer, where will get all the information. To do this, I need to make a code in C language. Do you have any idea if exist some code made for this situation? I remember you that all the code is "installed" in a atmega168 micro.

Thanks for your help, best regards.


Top
 Profile  
 Post subject:
PostPosted: Tue Feb 03, 2009 9:24 pm 
Offline

Joined: Sat Jun 05, 2004 8:51 pm
Posts: 1953
Location: USA, California
is the routing static, i.e., the nodes don't move?

Did you consider using Digi's proprietary routing firmware? I don't recall if it's free. If you have series 2, you can use ZigBee with a cluster tree topology.

Otherwise, you'll need to write your own code to forward all incoming packets to a given address. This code could reside in the XBee but to do so you have to go into a very complex development environment. If you connect a micro, say, a small AVR, to the XBee via a UART 3.3v connection, you can have the AVR forward the data using the AT commands or binary API of the XBee series 1.


Top
 Profile  
 Post subject:
PostPosted: Wed Feb 11, 2009 11:58 am 
Offline

Joined: Mon Feb 02, 2009 8:32 am
Posts: 4
Hi, is routing static, the modules are in a static position, maybe in the future I consider put them in a mobile situation.
You write about "Digi's proprietary routing firmware". This firmware can forward the packets, in a mesh (or cluster) network?

Thanks.


Top
 Profile  
 Post subject:
PostPosted: Wed Feb 11, 2009 4:11 pm 
Offline

Joined: Wed Nov 05, 2008 4:36 pm
Posts: 40
Yes their protocol can do everything you want to do. It's very well documented, and basically just involved a lot of bit twiddling to form the proper hex packets. Digi's website has all kinds of documentation and examples of how to do this. Since you are using a Series 2 module, I would start here: http://www.digi.com/products/wireless/zigbee-mesh/xbee-pro-series2-module.jsp

I did read somewhere that Digi has C libraries to help make it easier to code in their protocol. I'm not sure if these are free, and they were developed for a different processor. But, you could probably port these to AVR without too much effort (it is C after all).

Good luck on your project.


Top
 Profile  
 Post subject:
PostPosted: Mon Feb 16, 2009 12:21 pm 
Offline

Joined: Mon Feb 02, 2009 8:32 am
Posts: 4
Ok, thanks.
Best Regards.


Top
 Profile  
 Post subject: Re: XBee mesh networking, using ATMega168
PostPosted: Tue Mar 17, 2009 1:30 am 
Offline

Joined: Sat Mar 14, 2009 7:29 am
Posts: 2
claudioalves wrote:
Thanks for your answer Stevech.

What I'm trying to implement is this: install a ZigBee coordinator (The most capable device, the coordinator forms the root of the network tree and might bridge to other networks. There is exactly one ZigBee coordinator in each network), a ZigBee Router (to passing data from other devices) and ZigBee End Device (Contains just enough functionality to talk to the parent node that cannot relay data from other devices). I need to create a network (star topology its a good idea), where its possible to send/receive data from any XBee (making some hops if necessary) to the main computer, where will get all the information. To do this, I need to make a code in C language. Do you have any idea if exist some code made for this situation? I remember you that all the code is "installed" in a atmega168 micro.


First of all I'm assuming your going to be using AT mode rather than API mode to pass serial(?) data to/from the Xbees

I don't know why you want to make life difficult for yourself. Install the coordinator firmware on the xbee connected to the PC then install the Router firmware on the other Xbees. Set the network and channel for all of them to be the same. The meshing happens automatically, ie if a node can't see the coordinator directly it'll use one of the nodes it can see to hop from.

Then in its simplest form this is what will happen:

1) if the coordinator sends data, each of the xbee nodes will receive it
2) if an xbee node sends data the coordinator will receive it.

You don't need to code any of this yourself.

You can configure the coordinator to address each xbee node individually if you want in which case all you need to do is concentrate on your PC application/code.

I use the default mechanism to retrieve sensor data from 1-wire devices around my home. The command is issued from the coordinator and the xbee nodes reply with all the 1-wire devices they have + the data reading. There are a couple of nodes that can't see the coordinator directly but their data gets through via one of the other nodes.

ScaredyCat


Top
 Profile  
 Post subject:
PostPosted: Tue Mar 17, 2009 1:57 am 
Offline

Joined: Sat Mar 14, 2009 7:29 am
Posts: 2
stevech wrote:

XBee series 1 is not viable for ZigBee type of meshing. You can do your own "mesh" with static routing if the nodes don't move.


Series 1 can use DigiMesh ( http://www.digi.com/technology/digimesh/ )

stevech wrote:
Xbee series 2 is all about ZigBee. Beware that ZigBee mesh routers cannot be battery powered; end nodes can.


Series 2 can use ZigBee mesh.

Comparison whitepaper

http://www.digi.com/pdf/wp_zigbeevsdigimesh.pdf

SC


Top
 Profile  
 Post subject: Re: XBee mesh networking, using ATMega168
PostPosted: Fri Apr 02, 2010 11:44 pm 
Offline

Joined: Mon Oct 15, 2007 4:57 pm
Posts: 2
ScaredyCat wrote:
I don't know why you want to make life difficult for yourself.


I have used the series 2 modules before both in transparent and API mode. But now I cannot get them to work together. I am not sure if I have defective units or missing something. I can reprogram all of them using x-ctu with the function sets listed for xb24-b modules. Could you give me the setup instructions for one module to connect to many modules mainly to send data but if possible to receive from them as well?


Top
 Profile  
 Post subject: Re: XBee mesh networking, using ATMega168
PostPosted: Sat Apr 03, 2010 6:16 am 
Offline

Joined: Tue Sep 08, 2009 12:07 pm
Posts: 1534
Location: Philadelphia, USA
What firmware version is in your Series 2 modules?


Top
 Profile  
 Post subject: Re: XBee mesh networking, using ATMega168
PostPosted: Thu Apr 08, 2010 6:42 am 
Offline

Joined: Fri Apr 27, 2007 7:39 am
Posts: 31
Hello,

The meshing is perform automatically by XBee. All you need to do is pass the serial data to it and it will send out the data. Same goes to receiving mode. Just bear in mind, the depth limitation which is stated in the XBee data sheet. One important note on end device, make sure you use the "pin hibernate & cyclic sleep" mode instead of "cyclic sleep" or else when your MCU sends data to it, it won't receive them as it would most probably in sleeping mode. Always use the CTS pin to check whether it's ready to receive the data from MCU before sending serial data to it. I used this setup in a jungle and it works. Hope this helps. :)

No comments:

Post a Comment