Arduino-XBee project set-up for "Position Location Algorithm"

Hi there. I'm an electronics student working on a project to investigate ZigBee as a method for Position Location indoors. Firstly I am quite aware that this method for position location is not going to produce wonders due to bad multipath and shadowing, Its just the project I've been given and I'm struggling with the initial set up.

This is what I've achieved so far...

I have 4 x XBee S2 from Digi International, my Coordinator is set up in API mode with the three routers in AT mode (using an Arduino DUE for my coordinator).

I have managed to set up the system so that the coordinator receives a continuous stream of the RSSI values from whichever router it connects to first and prints to the IDE serial monitor. If the router turns off or goes out of range the coordinator recieves a stream from the next available router.

What I would like to achieve is...

I would like the Coordinator to take N readings from one router, record them in a .csv file on my computer, then move onto the next router and take N readings, record to .csv, and move onto the next.

The Idea is that having got these 3 sets of readings in .csv format I can then use Matlab to process the data, However I'm finding that I'm spending far too much time on trying to get the system working and need to move on in the process.

Any suggestions for how I can:

  • Selectively recieve N samples from each router consecutively
  • Export the samples to a .csv file for use in matlab
  • Or alternatively read directly into matlab via the COM port

any help would be much appreciated.

thanks James