# Waking up Electron from sleep using Pin and SMS

**URL:** <https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932>\
**Category:** Firmware\
**Created:** [May 18, 2017, 4:17am UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932 "2017-05-18T04:17:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![haroon.rehman](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@haroon.rehman](https://community.particle.io/u/haroon.rehman)\
**Post date:** [May 18, 2017, 4:17am UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932/1 "2017-05-18T04:17:29Z")

</div>

Hi,  
I have an electron that i need to wake up based on a pin interrupt e.g. D2 and also have the some option to wake up using SMS. I am trying to use`System.sleep(wakeUpPin, edgeTriggerMode, SLEEP_NETWORK_STANDBY);`But problem here is that i can only specify one pin either D2 or RI\_UC in this function. The idea is to have local and remote wake up option (via SMS). Separately they both work great. but how to specify two separate pins for the same wake up function. Any suggestions?

---

<div class="post-metadata">

**Author:** ![RWB](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rwb/32/22599_2.png) [@RWB](https://community.particle.io/u/RWB)\
**Post date:** [May 18, 2017, 4:46am UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932/2 "2017-05-18T04:46:03Z")

</div>

You are using a non-particle SIM to receive SMS messages correct?

The RI\_UC pin is not accessible via any external pins right?

---

<div class="post-metadata">

**Author:** ![haroon.rehman](https://avatars.discourse-cdn.com/v4/letter/h/5fc32e/32.png) [@haroon.rehman](https://community.particle.io/u/haroon.rehman)\
**Post date:** [May 19, 2017, 4:53pm UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932/3 "2017-05-19T16:53:49Z")

</div>

Yes i’m using a 3rd party Sim. Sadly, i think so you are right RI\_UC pin is not physically available otherwise i could have wired it.

So the question is is there a way we can specify two different pins as wakeUpPin in below function. That will allow for a local D2 pin interrupt and RI\_UC interrupt for following;

```
iSystem.sleep(uint16_t wakeUpPin, uint16_t edgeTriggerMode, SLEEP_NETWORK_STANDBY, long seconds);

```

Or unless there is a way to assign RI\_UC a physical pin through low level programming, that might also work.

---

<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:** [May 19, 2017, 5:03pm UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932/4 "2017-05-19T17:03:54Z")

</div>

@haroon.rehman, referring back to an [older post](https://community.particle.io/t/photon-sleep-mode-wakeup-on-multiple-interrupts/15368/7) by @mdma, try attaching an interrupt the pin you want to wake with. The STM32 will wake to any EXTI interrupt so give that a shot and let me know what happens. 😄

---

<div class="post-metadata">

**Author:** ![ScruffR](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/scruffr/32/6952_2.png) [@ScruffR](https://community.particle.io/u/ScruffR)\
**Post date:** [September 10, 2017, 3:22pm UTC](https://community.particle.io/t/waking-up-electron-from-sleep-using-pin-and-sms/32932/5 "2017-09-10T15:22:54Z")

</div>

Recently I did come back to a project that would have needed that but unfortunately it seems things have changed since.  
I tried a parallel wake on SMS with a wake on pin under 0.7.0-rc.3 and it didn't work.

> [@Photon sleep mode wakeup on multiple interrupts?](https://community.particle.io/t/photon-sleep-mode-wakeup-on-multiple-interrupts/15368/39):
>
> It's a long time since that statement, but I tried this void dmy() { digitalWrite(D7, !digitalRead(D7)); } void setup() { pinMode(D7, OUTPUT); attachInterrupt(RI\_UC, dmy, FALLING); attachInterrupt(D1, dmy, FALLING); } void loop() { static uint32\_t ms = 0; if (millis() - ms \> 60000) { System.sleep(RI\_UC, FALLING, 20\*60, SLEEP\_NETWORK\_STANDBY); ms = millis(); } } And unlike the experience from back then This seems not (anymore) to work. But having multiple w…

Unless someone can spot my mistake and point me to it - I'd be grateful.
