XBee point to multipoint

I'm trying to implement a point to multi-point network with a parent arduino-xbee module collecting status reports from up to ten children arduino-xbee modules.

The implementation is to be used as a location tracker and so all of the children need to check in with the parent within short time intervals. Ideally, I would like to have no more than 0.5 seconds pass between packet receptions of each child by the parent.

My sending and receiving functions are based on Andrew Rapp's Series1 Rx and Tx examples.

How can I schedule and coordinate the transmissions and receptions to increase my throughput?

Thanks,

Andrew

How can I schedule and coordinate the transmissions and receptions to increase my throughput?

I think you mean to maximize your throughput. Have the parent poll each child. The child responds only when talked to.

Thanks for the reply.

I've already implemented the polling. I've noticed that when reading a packet from a child by running my listen() function in a loop, the argument, xbee.getResponse().isAvailable(), will return true, the argument, xbee.getResponse().getApiId() == RX_16_RESPONSE, is true only by the third time through the loop.

Is there a way to better time sending and receiving so that I don't waste time with readPacket() and checking to see if a response is available, when apparently the response is not recognized as a RX_16_RESPONSE?

Thanks, below is an extract of my essential code.

Code:

void loop() {

poll();
//

}

//poll all of the children
void poll() {
int i;
for (i=0; i<numChildren; i++) {
xbee.send(tx*);*

  • int j;*
  • for (j=0; j<5; j++) { //attempt five times to read packet*
  • if(listen()) // listen for response from child*
  • break;*
  • }*
  • }*
    }
    int listen() {
  • xbee.readPacket(100);*
  • if (xbee.getResponse().isAvailable()) {*
  • // got something*
  • if (xbee.getResponse().getApiId() == RX_16_RESPONSE) {*
  • xbee.getResponse().getRx16Response(rx16);*
  • // *
  • return 1; //successfully parsed a packet*
  • }*
  • } *
  • return 0; //did not successfully retrieve a packet*
    }