Hi,
I don't understand you quite well. But I'm trying to explain what I'm doing.
I'm using an arduino FIO with a xbee module. The fio will feed from a battery. Like you, I achieve to sleep the xbee module, but I'm not sure if doing that I'm sleeping the fio too.
I have some questions or comments to ask.... You enter on command mode, why? I used the x-ctu program to enable SM to 1, I'm not concerning to putting to 0 later. I copy I part of my program
void setup() {
pinMode(sleepPin, OUTPUT); // OUTPUT controls xbee module
digitalWrite(sleepPin, LOW); // set to LOW (wake)
xbee.begin(9600); // start XBee communication
}
void loop() {
Serial.print("\n zZzZzZzZ \n");
digitalWrite(sleepPin, HIGH); // sleep state
delay(SLEEP_CYCLE*1000); // tiempo en ms, declarado como UNSIGNED LONG !!!!
digitalWrite(sleepPin, LOW); // ESTADO DESPIERTO
Serial.print("\n DESPIERTO\n");
delay(1000);
// 1. medir temperatura y humedad
temperature = readSensor('T');
humidity = readSensor('H');
uint8_t data[] = { 3,4,1,temperature,2,humidity };
uint8_t length = sizeof(data);
uint8_t option = 0;
As you can see I do not enter to command mode...
well, maybe you don't need my experience xD but I was wondering if you are interesting on sleeping the board. I found these libraries:
narcoleptic --> (
http://code.google.com/p/narcoleptic/)
enerlib --> (
http://arduino.cc/playground/Main/LibraryList).
But, in all of them, it seems to be necessary an external action like press a button or write something on the monitor ... Well, rigth now, I am not quite sure of that, but what I need is a sort of a counter that when it is expired the board wakes up do something and again sleep, all itself without a external action.
I hope I could help you and overall, you or somebody could give me a clue.
Greetings
(sorry for my english)