Xenon wakeup time

xenon
Tags: #<Tag:0x00007fe22311a258>

#1

Hi,
Can you please let me know the time xenon takes to wake up from deep sleep mode and normal sleep mode?


#3

Is it not working as expected?


#4

It’s is taking some milli seconds. I wanted to know what’s the expected wakeup time


#5

How are you measuring this time and what do you mean by ‘some’ milli seconds?


#6

Hi,
I used something like this.
t1 = millis();
SLEEP(,10s);
t2 = millis();
wakeuptime = (t2-t1) - 10s;

I got wakeuptime somewhere around 100-120ms

I don’t know whether its the actual wakeup time or I calculated it by mistake


#7

If you are using SYSTEM_THREAD(ENABLED) and/or are not connected to any network your code should start execution a bit quicker.

However, the millis() counter will most likely not count exact during the sleep period.

And SLEEP(,10s); this would want some clarification as it looks like pseudo code.


#8

I think @ScruffR has hit a couple of nails on their heads;

  1. Using millis() isn’t that accurate and especially whilst in sleep, actually, it is not accurate at all - so I am not sure I’d believe that wakeup time.
  2. Going to sleep takes a little bit of time depending upon what is going on and so does waking up and also can take much longer if trying to reconnect.

#9

True, on the Boron I was not able to get into Sleep Stop mode without using the following code. Not sure if it’s required on the Xenon also?

bool HaveWeTurnedOffModemYet = 0;


if (HaveWeTurnedOffModemYet == 0) {disconnectFromParticle();}
  //disconnectFromParticle(); / This by it's self works for putting Boron into System.sleep mode. 1mA Sleep. 
  System.sleep({}, {}, 60); // Put the device into stop mode with wakeup using RISING edge interrupt on D1 pin or wakeup after 60 seconds whichever comes first


bool disconnectFromParticle()
{
  Particle.disconnect();
  waitFor(notConnected, 15000);                                     
  Cellular.off();
  delay(2000);                                                    
  return true;
  HaveWeTurnedOffModemYet = 1;
}

bool notConnected() {
  return !Particle.connected();                             
}