# Electron Connectivity

**URL:** <https://community.particle.io/t/electron-connectivity/43354>\
**Category:** Firmware\
**Created:** [August 5, 2018, 1:33pm UTC](https://community.particle.io/t/electron-connectivity/43354 "2018-08-05T13:33:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [August 5, 2018, 1:33pm UTC](https://community.particle.io/t/electron-connectivity/43354/1 "2018-08-05T13:33:36Z")

</div>

I have an application that is running on an Electron. Sometimes (most likely due to cell service interruptions), the Electron loses connectivity and my code experiences problems as I mistakenly assume data had been sent.

How can I check that Electron is connected before sending (Particle.connected().)? When the connection is lost, what happens to the rest of my code if I send anyway? Does checking connectivity before sending incur data costs etc ...

Can the community direct me to a link on Electron connectivity issues?

Thanks in advance.

**Update:**  
Particle.connected() on Electron apparently does not work. The code after if below does not execute.

> if (Particle.connected())  
> {  
> .......  
> }

It returns false even though I can reach The Electron through the cloud.

Is there a different way to check Electron connectivity status?

---

<div class="post-metadata">

**Author:** ![rickkas7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/rickkas7/32/8681_2.png) [@rickkas7](https://community.particle.io/u/rickkas7)\
**Post date:** [August 6, 2018, 5:38pm UTC](https://community.particle.io/t/electron-connectivity/43354/2 "2018-08-06T17:38:27Z")

</div>

Which SYSTEM\_MODE are you using? The default is AUTOMATIC.

Are you using SYSTEM\_THREAD(ENABLED)? The default is not enabled.

If you are in AUTOMATIC with system thread not enabled (the default), your setup() and loop() code is not executed at all when you’re not cloud connected.

If you want your code to run whether connected or not, you should use:

```auto
SYSTEM_THREAD(ENABLED)

```

[https://docs.particle.io/reference/firmware/electron/#system-thread](https://docs.particle.io/reference/firmware/electron/#system-thread)

---

<div class="post-metadata">

**Author:** ![Jimmie](https://avatars.discourse-cdn.com/v4/letter/j/e95f7d/32.png) [@Jimmie](https://community.particle.io/u/Jimmie)\
**Post date:** [August 6, 2018, 10:18pm UTC](https://community.particle.io/t/electron-connectivity/43354/3 "2018-08-06T22:18:28Z")

</div>

Thank you @rickkas7.

I am using AUTOMATIC with system thread not enabled.

The problem I am having normally does not occur on startup, rather it occurs later most likely as a result of temporary cell interruption. Will SYSTEM\_THREAD(ENABLED) help in this case?

Also, does Particle.connected() ever work in the case of the Electron? Is there a way to check connectivity because my code has to find out if the transmission was successful before it updates its variables. I do not need a CRC check or anything like that but just to check that the Electron is connected to the cloud prior to transmission.
