# Core without Cloud \[Fixed\]

**URL:** <https://community.particle.io/t/core-without-cloud-fixed/1072>\
**Category:** General\
**Created:** [December 29, 2013, 7:28pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072 "2013-12-29T19:28:08Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frido](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frido/32/266_2.png) [@Frido](https://community.particle.io/u/Frido)\
**Post date:** [December 29, 2013, 7:28pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/1 "2013-12-29T19:28:08Z")

</div>

Hi there,

I managed to compile the latest firmware from git, write my own app w/o the web-GUI and compile/flash it via USB on my Mac.

How to modify the source to

- get a stable (as possible) running core
- without connection to the cloud
- with TCPClient functions

Searched the forum already…

Cheers,

Frido.

---

<div class="post-metadata">

**Author:** ![zachary](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zachary/32/20717_2.png) [@zachary](https://community.particle.io/u/zachary)\
**Post date:** [December 30, 2013, 4:36am UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/2 "2013-12-30T04:36:31Z")

</div>

Hi @Frido—short answer: It’s in our backlog and moderately high priority but not possible right now.

There’s a #define for turning off the Wi-Fi capabilities completely, but no simple way to use TCPClient without the Cloud connection. The firmware’s open source—if you can make it happen before we do, please submit a pull request! 😄

---

<div class="post-metadata">

**Author:** ![Frido](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frido/32/266_2.png) [@Frido](https://community.particle.io/u/Frido)\
**Post date:** [December 30, 2013, 2:08pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/3 "2013-12-30T14:08:42Z")

</div>

Ok. I’ll be patient… 😉

So I tried:

application.cpp:

```
#include "application.h"
int led = D7; 
void setup() 
{
  pinMode(led, OUTPUT);
}

void loop() 
{
  digitalWrite(led, HIGH);
  delay(500);
  digitalWrite(led, LOW); 
  delay(500);
}

```

make… dfu-util…

- RGB-LED flashes slow in the well known manner, as it’s connected to the cloud
- D7-LED blinks!

now I comment line 37 in platform\_config.h:

```
//#define SPARK_WLAN_ENABLE

```

now it’s undefined and therefore WiFi should be disabled, right?

make clean… make…dfu-util…

now:

- RGB-LED flashes fast the same way as if it lost the connection to the cloud
- D7-led stays off. ☹
- Reset does not fix this…

My fault?

---

<div class="post-metadata">

**Author:** ![zachary](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zachary/32/20717_2.png) [@zachary](https://community.particle.io/u/zachary)\
**Post date:** [December 30, 2013, 5:00pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/4 "2013-12-30T17:00:09Z")

</div>

Thanks @Frido. I haven’t turned off the WLAN in a while, but that’s surprising—I’ll test this this week.

---

<div class="post-metadata">

**Author:** ![mohit](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mohit/32/1971_2.png) [@mohit](https://community.particle.io/u/mohit)\
**Post date:** [December 30, 2013, 6:18pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/5 "2013-12-30T18:18:36Z")

</div>

@Frido Yes, I’m able to replicate this too. I had not commented out the SPARK\_WLAN\_ENABLE in a while. Seems like a bug. I’ll add this to the backlog.  
@satishgn could you confirm this as well?

---

<div class="post-metadata">

**Author:** ![Frido](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frido/32/266_2.png) [@Frido](https://community.particle.io/u/Frido)\
**Post date:** [January 11, 2014, 3:28pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/7 "2014-01-11T15:28:03Z")

</div>

My solution:

in _main.cpp_ insert code after line 191

```
#ifndef SPARK_WLAN_ENABLE
	ApplicationSetupOnce = 1;
	LED_RGB_OVERRIDE =1;
	LED_On(LED_RGB);
#endif

```

now comment Line 37 in _platform\_config.h_ (therefore SPARK\_WLAN\_ENABLE is undefined) and my little blinking code works solid as a rock!

Cheers,

Frido.

P.S. Can anybody fork and submit a pull request? I’m a noob to git!

---

<div class="post-metadata">

**Author:** ![Frido](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frido/32/266_2.png) [@Frido](https://community.particle.io/u/Frido)\
**Post date:** [January 12, 2014, 5:11pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/8 "2014-01-12T17:11:40Z")

</div>

Fix with a bug! It got caught in a loop with setup().

First fix for the fix:

in _main.cpp_ insert code after line 191

```
#ifndef SPARK_WLAN_ENABLE
	if (LED_RGB_OVERRIDE!=1) ApplicationSetupOnce = 1;
	LED_RGB_OVERRIDE =1;
	LED_On(LED_RGB);
#endif
```

---

<div class="post-metadata">

**Author:** ![zach](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/zach/32/20714_2.png) [@zach](https://community.particle.io/u/zach)\
**Post date:** [January 13, 2014, 5:48am UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/9 "2014-01-13T05:48:24Z")

</div>

Pull request has been initiated - thanks @Frido and @henriquepss!

> <https://github.com/particle-iot/device-os/pull/62>

Reviewing this week, but there it is if anyone wants to get at it early.

---

<div class="post-metadata">

**Author:** ![henriquepss](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/henriquepss/32/20785_2.png) [@henriquepss](https://community.particle.io/u/henriquepss)\
**Post date:** [January 13, 2014, 8:35pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/10 "2014-01-13T20:35:43Z")

</div>

Having trouble understanding why do you need the _if (LED\_RGB\_OVERRIDE!=1)_ before setting AplicationSetupOnce to 1, could you clarify please?

---

<div class="post-metadata">

**Author:** ![Frido](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/frido/32/266_2.png) [@Frido](https://community.particle.io/u/Frido)\
**Post date:** [January 13, 2014, 10:17pm UTC](https://community.particle.io/t/core-without-cloud-fixed/1072/11 "2014-01-13T22:17:42Z")

</div>

Without this, setup() is not only called once but again and again and again…

Figured this out by turning D7 on and off in setup() and doing nothing in loop(). 😉

Try:

```
#include "application.h"
int led = D7; 
void setup() 
{
  pinMode(led, OUTPUT);
  digitalWrite(led, HIGH);
  delay(500);
  digitalWrite(led, LOW);
  delay(500);
}

void loop() 
{
}
```
