This makes it super easy. The Arduino simply needs to add a unique ID to the data that it sends. Each Arduino gets a different name, that it adds to whatever it sends.
The receiver then knows who (which Arduino) sent the data.
PaulS:
This makes it super easy. The Arduino simply needs to add a unique ID to the data that it sends. Each Arduino gets a different name, that it adds to whatever it sends.
The receiver then knows who (which Arduino) sent the data.
I Had this Idea, but this way each arduino should have a different program, each one compiled to transmit a uniqueid right? Or is there a way to retrive a unique id from the xBee so that I can write a generic program for all end-points?
The easiest thing to do would be to have a sketch that you modify for each Arduino, that causes the Arduino to store a unique value in EEPROM, in setup().
Change the sketch, upload to an Arduino.
Then, load the real sketch, which, in setup(), reads that stored ID.
That way, all the running Arduinos have the same code. Before using in this scheme, the Arduino needs to have the unique ID sketch modified and uploaded.
There are ways of having the XBee itself report it's MY value, but I don't have any experience doing that.
Not sure about Series 1, but Series 2 has a Node Discover (ND) command, I might look for that.
I've managed to avoid polling and the associated overhead by just having my endpoints send data when they have it ready. If it's important to know which endpoint, I assign a unique Node Identifier (NI) when I configure the XBees, and have them send that as part of the data packet.
One of the many links for the manual on the series 1 is : http://www.sparkfun.com/datasheets/Wireless/Zigbee/XBee-Manual.pdf and starting on page 10 is a discussion of API mode. In API mode the packet you receive has the unique source address in it. I don't use series 1 my, network of XBees is totally series 2 so I can get the data out of the packets much like you want to. However, from looking at the document, it appears the devices will do exactly what you want. In the document, scroll down to page 54 and take a look at the format of the packets. Everything you ever wanted to know about the XBee series 1 is in there somewhere.
On my series 2 XBees, I grabbed it out of the header and away I went.