# ReConnecting after power glitch

**URL:** <https://community.particle.io/t/reconnecting-after-power-glitch/11518>\
**Category:** Troubleshooting\
**Created:** [April 30, 2015, 3:48am UTC](https://community.particle.io/t/reconnecting-after-power-glitch/11518 "2015-04-30T03:48:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Awake](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@Awake](https://community.particle.io/u/Awake)\
**Post date:** [April 30, 2015, 3:48am UTC](https://community.particle.io/t/reconnecting-after-power-glitch/11518/1 "2015-04-30T03:48:09Z")

</div>

There was a thunderstorm the other day and power went out for about 2 seconds due to lightning. Everything not on a UPS rebooted.  
The house router rebooted and reconnected to the Internet, but the Spark core ended up flashing “no connection”, and I had to re-power it one time to get it to reconnect.  
I suspect that It couldn’t find the Wi-Fi since that router was rebooting, and the router took longer than the Spark.

How do I have the core “hard reset” every few minutes if it loses (or never gets) a connection?

---

<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:** [April 30, 2015, 6:36am UTC](https://community.particle.io/t/reconnecting-after-power-glitch/11518/2 "2015-04-30T06:36:00Z")

</div>

For example you could check `Spark.connected()` and issue a `System.reset()` if needed.

---

<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:** [April 30, 2015, 12:10pm UTC](https://community.particle.io/t/reconnecting-after-power-glitch/11518/3 "2015-04-30T12:10:19Z")

</div>

@Awake, @ScruffR is correct except if you are using system mode AUTOMATIC (default). In that case, the user code will block until the Cloud connection is re-established. In MANUAL or SEMI\_AUTOMATIC modes the user code will be able to check the status as @ScruffR indicated and do the System.reset(). 😃

---

<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:** [April 30, 2015, 4:18pm UTC](https://community.particle.io/t/reconnecting-after-power-glitch/11518/4 "2015-04-30T16:18:44Z")

</div>

@peekay123, I’m glad you look over my posts and - where needed - correct some bits I was failing to mention (or didn’t think of 😊).
