Waking up Particle Photon from Deep Sleep Mode

Hi all,

Third post here. :smile:
I would like to ask if there is a way to wake up Photon from its deep sleeping mode without using external wake up pin.
General layout is like that.
There is photon and sensor in remote area.
I want to set the monitoring time for sensor via web page like per hour or per half an hour.
Lets say…
System.sleep(SLEEP_MODE_DEEP, 1800); // I am not sure if there is time limit for sleep mode.
When Photon is in sleeping mode for half an hour, I change my mind and want to set the sleeping time to another value via web page.
But I cannot do that because it is in sleeping mode.
Is there is a way to wake up Photon from deep sleeping mode without physical pin but with trigger from webpage?
Because It is not ideal for me to physically go there and set the wake up trigger pin.

Thanks in advance.

I’d say no. The purpose of sleep is to turn off the processor and Wi-Fi to save power, so the only way to wake up a Photon is via an external hardware interrupt pin, like WKP.

Exceptions to this are situations where the radio stays active, like some sleep modes on the Electron where some sort of external trigger like an SMS would wake it up (not supported, but theoretically possible). Also, things like the Bluz Bluetooth LE device where the radio protocol is designed to wake up and sleep again quickly using very little power so it can be done continuously, even on battery power.

2 Likes

I’d like to second one of @phyo_tz’s questions -

Is there a limit to sleep mode timers?

For example System.sleep(SLEEP_MODE_DEEP,60) is valid,
is System.sleep(SLEEP_MODE_DEEP,86400) ?

Thanks for any help!

  • alex
1 Like

With the most recent firmware you should be able to sleep for years, if you want :wink:

3 Likes

Yahoo! Thanks @ScruffR!

1 Like

Hey Phyto_z,

I don’t have a direct method, however there is a way to adjust sleep time without having to reflash/ catch the particle in the few moments it is online.

I would say your best bet is to set a web flag somewhere called “Sleep Time”. The particle can the check this check this when it wakes up and adjust it’s sleeping time. Alternatively you could set a flag called “Can I sleep?”, that would allow you to keep the photon on indefinitely until you can update the firmware.

Good luck

2 Likes

Am I reading the Datasheet wrong when it says the Photon should wake up after it has been asleep for x seconds?

“The device will automatically wake up and reestablish the network connection after the specified number of seconds.”

-edit: I had a resistor on the wake up pin which would not allow the photon to wake up.

What happens when the photon wakes up with no network.
I have written code for offline mode but its still blinking green led.

Without any knowledge about your code it’s hard to tell - there is just too much to explain when starting from zero up to all the possible ins and outs of all different kinds of sleep modes.

If you have a particular issue, try to explain it as exact as possible with all the context needed to properly assess the situation - that usually involves a minimal test code that exhibits the unexpected behaviour you are seeing.

However, if your device was online when it went to (stop mode) sleep, it will try to reestablish the connection on next wake.

1 Like