Sending multiple temp readings through Xbee

Hi. I am working on a project that involves 2 Xbees (Series 1), 2 Arduinos and multiple temperature sensors (digital readings).

The aim is to wirelessly send multiple temperature readings from sensors connected to 1 arduino to the other arduino via xbee communication. I'm a bit new to Xbee communications and I have read API(packet mode) tutorials, sending static data through the payload.

However, I don't know how to send multiple variable data through the Xbee. Can the API (packet mode) send dynamic data (changing readings)? Is there a specific way to send variable data through the Xbee?

ardzill:
Can the API (packet mode) send dynamic data (changing readings)? Is there a specific way to send variable data through the Xbee?

I'm sure API mode can send dynamic data and I'd be very surprised if it can't send multiple variables but it's been too long since I've used API mode to remember the details.

Most XBee examples I've seen (included code I've written) just use the XBee in transparent mode and treat the data the same as any other serial communication. This lets you test the receive software by using a serial terminal.

My suggestion is to work through some of the serial communication examples on how to parse data. API mode may have advantages I'm not recalling but it sure seems like transparent mode would be easier. This way you could easily convert the program from XBee communication to Bluetooth or some other serial interface.

To send multiple values you have to tag them in some way so you can sort them out on the receive side.
There are many ways to do this.
One way is to sent the data in packets with the data always in the same order. You have a byte pattern to ensure you know when the packet starts and it is a fixed length.

Less efficiently is to send them in ASCII or text and then your tags can be non printing characters.

@DuaneDegn

Thank you for your reply. I think I’ll stick with API mode for the moment, I had issues with AT mode before not sending some characters in the serial.

@Grumpy_Mike

Thank you for your reply. What do you mean by having a byte pattern to ensure where the packet starts?

Data is just bytes. You might start each bunch of data with the numbers 0xff, 0xfe for example, if the data is in ascii then these numbers never occur in the data so when you see them coming in at the receiver you know that what followers is the first data number followed by the second followed .......