# Particle.function when electron wakes

**URL:** <https://community.particle.io/t/particle-function-when-electron-wakes/36377>\
**Category:** Troubleshooting\
**Created:** [September 29, 2017, 4:16pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377 "2017-09-29T16:16:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![PeaTearDial](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@PeaTearDial](https://community.particle.io/u/PeaTearDial)\
**Post date:** [September 29, 2017, 4:16pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/1 "2017-09-29T16:16:58Z")

</div>

Hey all!

I’m looking for a bit of advice about using the particle.function command.

So I have an electron that sleeps and wakes every 15 min for 1 min then goes back to sleep. Obviously I can’t connect to the electron while it’s in sleep mode but when it wakes I would like it to check if there has been a request while it was asleep.

Anybody have any ideas on how to do this?

---

<div class="post-metadata">

**Author:** ![Ric](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ric/32/514_2.png) [@Ric](https://community.particle.io/u/Ric)\
**Post date:** [September 29, 2017, 7:29pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/2 "2017-09-29T19:29:42Z")

</div>

> [@PeaTearDial](#):
>
> when it wakes I would like it to check if there has been a request while it was asleep.

Do you mean, you want to know if there was an attempt to call a Particle function while the device was asleep? There's no way to do that from the Electron side. When it's asleep it doesn't have any way to know if a function has been called, or a variable polled, since it's offline.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 29, 2017, 7:31pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/3 "2017-09-29T19:31:08Z")

</div>

@PeaTearDial, to add to what @Ric said, the Particle Cloud does not queue any events or Particle.function() calls.

---

<div class="post-metadata">

**Author:** ![PeaTearDial](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@PeaTearDial](https://community.particle.io/u/PeaTearDial)\
**Post date:** [September 29, 2017, 8:35pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/4 "2017-09-29T20:35:26Z")

</div>

Thanks all,  
Would there be an alternative way for me to do this?  
I basically want to be able to get the particle to wake up and check to see if a variable has changed since it was last awake…

---

<div class="post-metadata">

**Author:** ![Ric](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ric/32/514_2.png) [@Ric](https://community.particle.io/u/Ric)\
**Post date:** [September 29, 2017, 10:00pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/5 "2017-09-29T22:00:09Z")

</div>

> [@PeaTearDial](#):
>
> I basically want to be able to get the particle to wake up and check to see if a variable has changed since it was last awake..

A variable can't change when the device is asleep, since code has to be running for that to happen. Maybe you can tell us in more detail what you're trying to do. What variable are you wanting to look at? How does it change?

---

<div class="post-metadata">

**Author:** ![PeaTearDial](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@PeaTearDial](https://community.particle.io/u/PeaTearDial)\
**Post date:** [September 29, 2017, 10:29pm UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/6 "2017-09-29T22:29:57Z")

</div>

Hey sorry I haven’t been clear enough.

Ok so my electron sleeps most of the time.  
It wakes up every 15min to do a particle.publish then goes back to sleep.

I would like to be able to remotely change how often the electron wakes up.  
So it wakes up, checks a variable somewhere online to see if anything has changed … maybe the variable has changed from 15 to 5 for example. The electron would go back to sleep but wake up every 5 min from now on.

---

<div class="post-metadata">

**Author:** ![Ric](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ric/32/514_2.png) [@Ric](https://community.particle.io/u/Ric)\
**Post date:** [September 30, 2017, 4:24am UTC](https://community.particle.io/t/particle-function-when-electron-wakes/36377/7 "2017-09-30T04:24:03Z")

</div>

To a certain extent, how you do this depends on what “somewhere online” means. If you have a phone app or web app, it can subscribe to an event that your Electron publishes when it wakes up. In response, the app can either call a function on the Electron (which would change the value of some variable), or publish an event that the Electron subscribes to.
