# Please add timeout to System.connect()/Spark.connect()

**URL:** <https://community.particle.io/t/please-add-timeout-to-system-connect-spark-connect/13889>\
**Category:** Firmware\
**Created:** [July 28, 2015, 5:42pm UTC](https://community.particle.io/t/please-add-timeout-to-system-connect-spark-connect/13889 "2015-07-28T17:42:32Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 25, 2015, 7:05am UTC](https://community.particle.io/t/please-add-timeout-to-system-connect-spark-connect/13889/4 "2015-08-25T07:05:49Z")

</div>

> [@owendelong](#):
>
> SYSTEM\_MODE(SEMI\_AUTOMATIC) and SYSTEM\_MODE(AUTOMATIC) is that it will hang until the cloud connection is successful, up to and including forever

What FW version are you running?  
In my experience this is not the case for `SEMI_AUTOMATIC`, `Spark.connect()` returns near immediately but different stages of the connection process add some lage to the code flow, but never block forever.

_There you can find some test code for this "theory" (for 0.4.3 which should have been your FW at the time of your first post)_  
[Photon/P1 loop()/user code blocking in SEMI\_AUTOMATIC mode - #4 by ScruffR](http://community.particle.io/t/photon-p1-loop-user-code-blocking-in-semi-automatic-mode/14089/4)

But I'd second your proposal for timeouts 👍

---

_[View the full topic](https://community.particle.io/t/please-add-timeout-to-system-connect-spark-connect/13889)._
