# Deep Update (source file for spark-cli)

**URL:** <https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872>\
**Category:** General\
**Created:** [July 22, 2014, 6:44pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872 "2014-07-22T18:44:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 22, 2014, 6:44pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/1 "2014-07-22T18:44:05Z")

</div>

HI all,

according to this reference: [http://docs.spark.io/troubleshooting/#deep-update](http://docs.spark.io/troubleshooting/#deep-update)  
When will the :spark: deep\_update source file will be released for the command line interface!

✂  
_Run the flash command:  
 ~~spark~~ `particle flash --usb deep_update_2014_06`  
This installs the deep update from a binary that is packaged with the Spark CLI, so you don’t have to download it.  
TODO: DEPLOY THIS_

---

<div class="post-metadata">

**Author:** ![Hootie81](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/hootie81/32/2879_2.png) [@Hootie81](https://community.particle.io/u/Hootie81)\
**Post date:** [July 22, 2014, 7:42pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/2 "2014-07-22T19:42:41Z")

</div>

im keen for this too… i dont trust the really slow internet out here to do it OTA. it will take me 5mins to download the bin

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 22, 2014, 8:37pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/3 "2014-07-22T20:37:01Z")

</div>

Hey guys, the deep\_update file is already available on `spark-cli` so all you need to do is to ensure that you have the latest version.

You can update Spark-cli using `npm update -g spark-cli`

I will send a PR to fix those links…

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [July 22, 2014, 8:57pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/4 "2014-07-22T20:57:43Z")

</div>

I have added in the link with this commit:

> <https://github.com/particle-iot/docs/commit/1a1326cbe2f2fc1771db71ecfd60948f2c12a25e>

Sorry for the issue 😄

The link for the `.bin` file is here: [https://github.com/spark/spark-cli/raw/master/js/binaries/deep\_update\_2014\_06.bin](https://github.com/spark/spark-cli/raw/master/js/binaries/deep_update_2014_06.bin)

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 22, 2014, 10:02pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/5 "2014-07-22T22:02:47Z")

</div>

Haha, oh docs. Thanks for noticing this, surprised that made it out. 🙂

I actually secretly rolled this out to the spark-cli last week: [https://www.npmjs.org/package/spark-cli](https://www.npmjs.org/package/spark-cli)

So if you update, you’ll have it.

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 23, 2014, 3:31pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/6 "2014-07-23T15:31:15Z")

</div>

Update - nothing … same error. Did not find the file.

But now I know, thanks to you, it´s in the package of the spark-cli and is not downloaded right in the moment where I try to flash the core.  
So I did a quick

```
find / -name deep_update_2014_06.bin 

```

and found the file (Raspbian) under:  
/usr/local/lib/node\_modules/spark-cli/binaries/deep\_update\_2014\_06.bin

Now I finally able to do the deep-flash-dance with:

```
spark flash --usb /usr/local/lib/node_modules/spark-cli/binaries/deep_update_2014_06.bin

```

_…  
DfuSe interface name: "Internal Flash&nbsp; "  
Downloading to address = 0x08005000, size = 93636  
Download&nbsp;&nbsp; &nbsp;[=========================] 100%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 94208 bytes  
Download done.  
File downloaded successfully  
Transitioning to dfuMANIFEST state  
Flashed!_

Last thing I´d like to know is: In the link from my first post there is a troubleshoot section or something like to check if the deep\_update applied successfully. But my output looks quite different and there is no “version”

1. **curl ‘[http://mylocalcloud:8080/v1/devices?access\_token=mylocalcloudaccesstoken](http://mylocalcloud:8080/v1/devices?access_token=mylocalcloudaccesstoken)’**  
_[  
&nbsp; {  
&nbsp;&nbsp;&nbsp; “id”: “mycoreid”,  
&nbsp;&nbsp;&nbsp; “name”: “mycorename”,  
&nbsp;&nbsp;&nbsp; “connected”: true  
&nbsp; }  
]_  
**2. curl ‘[http://mylocalcloud:8080/v1/devices/mycoreid?access\_token=mylocalcloudaccesstoken](http://mylocalcloud:8080/v1/devices/mycoreid?access_token=mylocalcloudaccesstoken)’**  
_{  
&nbsp; “id”: “mycoreid”,  
&nbsp; “name”: “mycorename”,  
&nbsp; “connected”: true,  
&nbsp; “variables”: {},  
&nbsp; “functions”: [  
&nbsp;&nbsp;&nbsp; “SCL”  
&nbsp; ]  
}_

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 23, 2014, 6:41pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/7 "2014-07-23T18:41:48Z")

</div>

Hi @clyde,

If you ran the command `spark flash --usb deep_update_2014_06` and it didn’t work as expected, then you have the wrong version of the CLI, and the wrong version of deep\_update. The local spark-protocol module doesn’t store the cc3000 patch version, but if you’re subscribing to your events, you should see it when your core starts up, try a `spark subscribe mine`. 🙂

If you run `spark --version` you should see 0.3.95

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 23, 2014, 7:13pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/8 "2014-07-23T19:13:52Z")

</div>

@Dave

exactly 0.3.95… but did not work.  
So I´ve installed macports, dfu-util, node.js and spark-cli on my mac. Run the command once again and gained:

_Downloading to address = 0x08005000, size = 93636  
…  
File downloaded successfully  
Transitioning to dfuMANIFEST state  
Error during download get\_status  
Flashed!_

Seems ok now i got some more output. But no patch version of the cc3000 wifi chip…

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 23, 2014, 7:16pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/9 "2014-07-23T19:16:18Z")

</div>

Hi @clyde,

Hmm, the deep\_update works by optionally patching the cc3000, then it connects to the cloud and does an auto-upgrade. That feature might not be working on the local cloud. It sounds like you’re using the local cloud, can you try flashing the latest tinker via usb after the patch is done?

[https://github.com/spark/core-firmware/blob/spark\_6/build/core-firmware.bin?raw=true](https://github.com/spark/core-firmware/blob/spark_6/build/core-firmware.bin?raw=true)

```
#in dfu mode 
spark flash --factory core-firmware.bin
spark flash --usb core-firmware.bin

```

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 23, 2014, 7:29pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/10 "2014-07-23T19:29:51Z")

</div>

Hi @Dave…

sorry tried but it seems like exactly the same result as before:

**factory:**  
_DfuSe interface name: "SPI Flash : SST25x"  
Downloading to address = 0x00020000, size = 76808  
…  
File downloaded successfully  
Flashed!_

**usb:**  
_DfuSe interface name: "Internal Flash "  
Downloading to address = 0x08005000, size = 76808  
…  
File downloaded successfully  
Transitioning to dfuMANIFEST state  
Error during download get\_status  
Flashed!_

**curl with access\_token:**  
_[  
{  
“id”: “mycoreid”,  
“name”: “ArwenUndomiel”,  
“last\_heard”: “2014-07-23T19:25:30.797Z”,  
“connected”: true  
}  
]_

**curl with coreid and access\_token:**  
{  
“id”: “mycoreid”,  
“name”: “ArwenUndomiel”,  
“connected”: true,  
“variables”: {},  
“functions”: [  
“digitalread”,  
“digitalwrite”,  
“analogread”,  
“analogwrite”  
]  
}

☹

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 23, 2014, 7:35pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/11 "2014-07-23T19:35:36Z")

</div>

Hi @clyde,

Sorry, the new Tinker will publish the version as an event, so you’d need to be subscribed when the core connects initially.

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 23, 2014, 7:42pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/12 "2014-07-23T19:42:46Z")

</div>

Öhm sorry what this exactly means?  
I cannot subscribe because cli tells me to log in (which is the login to the spark cloud)… so what exactly did i do wrong ?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 23, 2014, 7:47pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/13 "2014-07-23T19:47:23Z")

</div>

Hi @clyde,

If you have the CLI pointed at your local cloud, then try the following:

```
# new feature! :) 
# fix normal apiUrl
spark config spark apiUrl https://api.spark.io

# setup your local api url
spark config local apiUrl http://mylocalcloud:8080

# switch to your local setup
spark config local

#start the setup so you can create a new user, but hit ctrl-c after your user account is setup. :) 
spark setup

# listen for local events    
spark subscribe mine

```

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 23, 2014, 7:59pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/14 "2014-07-23T19:59:07Z")

</div>

~ clyde$ spark subscribe mine  
_Subscribing to all events from my personal stream (my cores only)  
Listening to: /v1/devices/events_

Now it stops, i have tried to ctrl+c and then type another time the curl command with same result. Then I tried in a screen to subscribe and outside the screen run the curl command… same result…

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 24, 2014, 5:37pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/15 "2014-07-24T17:37:10Z")

</div>

Hi @clyde,

Ahh, hmm, sorry! Can you try throwing this code chunk in your setup call?

```
unsigned char patchver[2];
nvmem_read_sp_version(patchver);
char patchstr[8];
snprintf(patchstr, 8, "%d.%d", patchver[0], patchver[1]);
Spark.publish("spark/cc3000-patch-version", patchstr, 60, PRIVATE);

```

Thanks,  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 28, 2014, 2:15pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/16 "2014-07-28T14:15:36Z")

</div>

@Dave

Sadly I have more problems since I used the local cloud, hoped the deep update clears up some of them.

1. Connecting to the cloud takes about 20-30 times.

this game runs a dozen times if i switch my core on. The most time it connects successfully to the wifi and then searches for the cloud blinks red and resets and starts at the beginning. I have found in the forum that I not the alone with this problem. After 20-30 tries the core connect and the program starts?! Can´t find the problem, the spark-server log says as you see every time “Core online” and there is no disconnect message. But something must be missing?

1. Former running progam which uses spark.publish() wan´t run anymore. My Website did not get any results. I send my information to the git issue that @kennethlimcp has opened ([https://github.com/spark/spark-server/issues/229](https://github.com/spark/spark-server/issues/229))

2. Is that “deep update” problem. What we have discussed here.  
Sure, I can put that code in my setup call of my project, but y? I thought the update should run out of the box? Give me a bit more what I have to do, feels like you have lost me at the side of the road, when you know what I mean…  
And currently I have the problem that I have to flash with USB not OTA means I have to unplugg my project and bring in to my computer thats little bit annoying.  
Should I keep it there or is this a “one timer”?

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 28, 2014, 2:38pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/17 "2014-07-28T14:38:34Z")

</div>

Hi @clyde,

Deep\_update doesn’t work the same way on the local cloud, if you want to deep\_update your core locally, try the following (one time thing):

1.) update your copy of the spark-cli `npm update -g spark-cli`

2.) connect your core in dfu mode:

```auto
spark flash --factory tinker
spark flash --usb cc3000

#when your core starts flashing yellow again
spark flash --usb tinker

```

If you’re building locally, make sure you’ve pulled the latest code from the repositories as well.

– A few other people have mentioned they’re not seeing the local cloud API show published messages properly -( [https://github.com/spark/spark-server/issues/22](https://github.com/spark/spark-server/issues/22) ), so I’m looking into that.

– 20-30 connection attempts sounds pretty nuts, what else is happening? Does it take 20-30 tries with stock tinker?

Thanks!  
David

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 28, 2014, 8:36pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/18 "2014-07-28T20:36:24Z")

</div>

Ok @Dave: Thx for your advise, seems that sometimes I need a helping hand.  
I will try this out asap and wrote results to this thread.

---

<div class="post-metadata">

**Author:** ![Dave](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/dave/32/181_2.png) [@Dave](https://community.particle.io/u/Dave)\
**Post date:** [July 28, 2014, 8:52pm UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/19 "2014-07-28T20:52:21Z")

</div>

No worries, thanks for troubleshooting with us 🙂

---

<div class="post-metadata">

**Author:** ![clyde](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/clyde/32/1243_2.png) [@clyde](https://community.particle.io/u/clyde)\
**Post date:** [July 29, 2014, 11:50am UTC](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872/20 "2014-07-29T11:50:27Z")

</div>

@Dave

Here are my results:

1. Deinstalled curernt version with npm uninstall -g spark-cli  
Reinstalled it with npm install -g spark-cli  
To absolute be safe I updeded with npm update -g spark-cli  
Info from Readme: 0.3.95 (/usr/local/lib/node\_modules/spark-cli/Readme.md

2. I connect the core to my raspberry and startet the spark-server in a screen  
I set the Core in DFU Mode bei Pressing Mode + RST release RST and whaiting for flashing yellow

Now I tried `spark flash --factory tinker`

/usr/local/lib/node\_modules/spark/bin/spark:14  
&nbsp;&nbsp;&nbsp; netBinding = process.binding(‘net’),  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^  
Error: No such module  
&nbsp;&nbsp;&nbsp; at Object. (/usr/local/lib/node\_modules/spark/bin/spark:14:26)  
&nbsp;&nbsp;&nbsp; at Module.\_compile (module.js:456:26)  
&nbsp;&nbsp;&nbsp; at Object.Module.\_extensions…js (module.js:474:10)  
&nbsp;&nbsp;&nbsp; at Module.load (module.js:356:32)  
&nbsp;&nbsp;&nbsp; at Function.Module.\_load (module.js:312:12)  
&nbsp;&nbsp;&nbsp; at Function.Module.runMain (module.js:497:10)  
&nbsp;&nbsp;&nbsp; at startup (node.js:119:16)  
&nbsp;&nbsp;&nbsp; at node.js:906:3

Thats it, tried to locate “tinker” or “cc3000” as a file but did not find it.  
Sorry for making such trouble…☹ it´s not my intention!  
Some checks later I can locate in the /binaries folder of the spark-cli there are the files which we need I think. So I tried first do move to the correct folder:

```
cd /usr/local/lib/node_modules/spark-cli/
spark flash --factory tinker

```

Again nothing, last try:

```
cd /binaries
spark flash --factory spark-tinker.bin

```

Same on --usb cc3000 ;(

[Next page](https://community.particle.io/t/deep-update-source-file-for-spark-cli/5872.md?page=2)
