Tree structure network using Series 2 Zigbee

I got a tree structured network running using series 1 and 802.15.4, but it is rather clunky. Can someone point me to an example of how to build such a thing using series 2 (or perhaps a series 1 in API mode)? All the examples for series 2 that I find only have 2 devices and are point-to-point.

Thanks.

Did you look in Digi Int’s web site? They do have examples.

I did, but only found using 2 radios for point-to-point. Elsewhere I found posts that said you can’t simulate a tree network with series 2, and several networks that route everything through the coordinator or the “cloud”. Also I have Robert Faludi’s book, but it stops just short of this point. See Routing on pg. 240. He seems to hint that an efficent, timely, tree network isn’t possible with series 2.

In my application, every node will know in advance its parent and children. There should be exactly one route from a leaf to the coordinator. Each node that is not a sensor leaf will have an attached uP ( Arduino Fio in the prototype).

I think the bit of information I’m missing is which firmware is best and how to use NI, DH, and DL.

Ok.

Set each End Device’s destination as the Coordinator’s address (64 bit). This gets the data to the coordinator.

The Network Association is automatic as a Node is detected and the Network creates a path to the Coordinator.

The S2 XBees in the middle are Routers. Routers can act as End Devices but End Devices can not act as routers.

Be sure the correct firmware is loaded. You need one and only one Coordinator that is typically connected to the master controller, typically a PC or Gateway.

I prefer the coordinator to be running API command firmware. An API Frame is much better for Network control and passing data between End Devices/Routes to/from the Coordinator.

To check the connections issue a Node Discovery command to discover all the network connections (associations). This command is in the XBee S2 document (#90000976) as well as the other commands required. Study this document to learn how to setup the XBees to form the network. Remember that S2 XBees are running the ZigBee protocol if you do reading of other info. Chapter 3 of the Doc covers the ZigBee network with XBees.

It may not be possible to manually configure the Network topography since the ZigBig protocol does this. You might be able to force a topography by spacing the Nodes so they can only connect to determined Nodes.

By “the document” do you mean the 155 page product description? If so, consider the figure on page 63. In my application bi-directional traffic is between C-R1, C-R5, R1-R2, R1-R4, and R2-R3 only. i.e. C never talks directly to R3. If I understand correctly, the coordinator application would send 0x21 commands routing to R1 and R5. R1 application would send 0x21 routing commands for coordinator, R2, and R4, etc. The 0xA1 and 0xA3 commands are auto-generated by the xbees. Is that correct?

I am using Digi Document Number 90000976, titled “XBee/XBee=PRO ZB RF Modules”, version M.

The ZB doc rev M has that figure on page 62 and is 157 pages long.

0x21, 0xA1 & 0xA3 are API Frame Types not commands. Commands are two letters such as ‘ND’ for example and are sent in a 0x08 or 0x09 Frame Type. The response to a Command is in a Frame type 0x88.

Frame Types 0xA1 & 0xA3 are generated by the XBee internally and are responses typically received by the Coordinator (or the XBee that sent the request).

XBees running ZigBee firmware can be quite complicated to learn how to setup since the network can be setup in many different ways. I keep most of it simple by allowing the Coordinator to set all the routing. Most of the Nodes in my ZigBee network just send collected data back to the Coordinator. I do have an exception, Two Node are running AT Command firmware and are setup as transparent Serial links.

So I suggest keep studying Doc 90000976 and get familiar with all the Frame Types an AT Commands. Then write code to work out how these Frames & Commands work and then how you what your ZigBee network configured.

I did this with Python code on a PC but you could use C or any other programming language. I recommend code instead of X-CTU since a Frame is difficult to build by hand, one bit wrong and the Frame is silently ignored.

There is a few code libraries for XBee ZB’s to get you going.

Digi Int also has Python code examples in their Wiki and they have a User forum to ask questions.

You are on the right track with the “Source Routing” section of the Doc but do read the other sections, Chapters 6, 7, 9 &10 to see the whole picture.

Shounds like we are on the same page. I understand about the frame types. I was just a bit sloppy in my terms. I have read the document and have been trying to sort through the complexities. Which is why I asked the original question. One example of a successful setup would be a big help.