sending text strings through xbee mesh

I've been working my way through Rob Faludi's WSN book, and I have successfully sent text strings from one arduino to another using my series 2 ZB xbee units in transparent mode. I also did his example of having 3 router/endpoint nodes transmitting temperature data to a coordinator with API and displaying the live data on the Processing thermometer graph. But those nodes sensed the temperature from a sensor on their own analog input pins. I have arduino-based loggers with multiple sensors on them that require a more complicated interface than I can achieve with the onboard I/O of the xbee. Currently the loggers just write the data to an SD card, but I'd also like to transmit it via the xbee. How do I go about sending a string of text through the mesh and have it arrive in one piece at the coordinator? Is it simply a matter of saying "Serial.print("23 degrees, 0.58 cm, 4.5 volts") on the serial input of the end node, or do I have to use a special protocol?

I also did his example of having 3 router/endpoint nodes transmitting temperature data to a coordinator with API and displaying the live data on the Processing thermometer graph.

What API mode does is embed info about the sender into the message that is sent. The receiver can then detect which sender the data came from.

In transparent mode, that data is not available, so the receiver has no idea.

If you send "23 degrees, 0.58 cm, 4.5 volts" from one node and "22.9 degrees, 0.50 cm, 4.2 volts" from another, chaos and confusion will result.

If, instead, you send "Tom: 23 degrees, 0.58 cm, 4.5 volts" from one node and "Bob: 22.9 degrees, 0.50 cm, 4.2 volts" from another, you know which data came from which node.

Of course, it is unlikely that you will name your nodes Tom and Bob, but you get the idea.

This also means that the same code can not run on each node, since the code needs to tag the messages differently. There are ways around this. One could load a sketch that contained a different ID on each Arduino, that did nothing more than store that ID in EEPROM. Then, load the actual sketch (the same one on all nodes) that tagged the message with the ID in EEPROM.

Since the data in EEPROM would be different, the messages sent would be different, even though the same code was sending the data.

It is possible to get the MY value from the XBee that is attached to the Arduino, and use that as the unique ID, though it wasn't all that simple to do so.

Each of my arduino logger nodes have unique names anyway, so it's not a problem to tack that on to the beginning of the string. I just wasn't sure if API mode was more efficient in terms of the actual packets that are being transmitted, or am I losing some cool features of API mode if I choose transparent mode.

am I losing some cool features of API mode if I choose transparent mode.

Are you using those cool features?

PaulS: This also means that the same code can not run on each node, since the code needs to tag the messages differently. There are ways around this. One could load a sketch that contained a different ID on each Arduino, that did nothing more than store that ID in EEPROM. Then, load the actual sketch (the same one on all nodes) that tagged the message with the ID in EEPROM.

Another approach, set all the XBee node identifiers to unique values (ATNI command), have the sketch read it as part of setup(), then include it with each message sent.

Jack, that is an incredible idea!! I've been messing with other techniques and that one will solve a couple of problems I've been having. Glad I checked out this thread.

Thanks.