# Flashing Spark Core not working

**URL:** <https://community.particle.io/t/flashing-spark-core-not-working/12316>\
**Category:** Troubleshooting\
**Created:** [June 4, 2015, 12:09pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316 "2015-06-04T12:09:27Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![poseid](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/poseid/32/5601_2.png) [@poseid](https://community.particle.io/u/poseid)\
**Post date:** [June 4, 2015, 12:09pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/1 "2015-06-04T12:09:27Z")

</div>

Hi,

after some weeks of idling, I wanted to play with my Spark Core again.

However, I have troubles logging in, or flashing the device via USB.

I see the blue LED toggling fine, but when I scan for the device in my wifi, I see no device. When I connect the device with a USB cable and run:

```
 $ particle setup

```

There is no device either.

Also,

```
dfu-util -l

```

does not list a device, and

```
ls -ltr /dev/cu.*

```

does not show anything either.

How can I debug this setup? What is the most simple way to get again some application code running? (I would like to try this: [Tutorial: Upgrading Factory Reset Firmware](https://community.particle.io/t/tutorial-upgrading-factory-reset-firmware/3430?redirected=true) but first I need to see a device 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [June 4, 2015, 12:49pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/2 "2015-06-04T12:49:26Z")

</div>

For any type of [USB connection](http://docs.particle.io/core/connect/#connecting-your-device-connect-over-usb) to work, it’ll need to be in either [listing (blinking blue)](http://docs.particle.io/core/modes/#core-modes-listening-mode) or [DFU (blinking yellow)](http://docs.particle.io/core/modes/#core-modes-dfu-mode-device-firmware-upgrade) mode. Or you’ll need to have opened a [Serial connection](http://docs.particle.io/core/firmware/#communication-serial) in your code.  
The easiest way to start fresh is to do a [factory reset.](http://docs.particle.io/core/modes/#core-modes-factory-reset) That’ll allow you to configure your device from the factory Tinker firmware, as if it’s out of the box once more.

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jack/32/5412_2.png) [@Jack](https://community.particle.io/u/Jack)\
**Post date:** [June 4, 2015, 1:25pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/3 "2015-06-04T13:25:00Z")

</div>

My core also stopped accepting a new flash, about 12 hours ago. I guess I should do the factory reset also. I have been using the OTA flash on the build IDE.

I have done the factory reset, and all worked ok, I was able to flash some code, and it ran.  
But, then when I made slight changes to the script, and tried to flash again, I keep getting "request timed out , flash unsuccessful ". (I have tried this morning about 12 times).

Could it have anything to do with the fact that I am using  
Spark.publish(“hc-sr04 inches”,String(inchesAverage));  
in the code that is currently running?

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jack/32/5412_2.png) [@Jack](https://community.particle.io/u/Jack)\
**Post date:** [June 4, 2015, 9:25pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/4 "2015-06-04T21:25:27Z")

</div>

Maybe I don’t understand the procedure to flash code OTA to the core, using the build IDE.  
I was able to do it consistently for a few months, and now not.

Should I take out the Spark.publish(),  
if I plan to reflash my core often, and don’t want to go through a factory reset each time?  
Thanks

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jack/32/5412_2.png) [@Jack](https://community.particle.io/u/Jack)\
**Post date:** [June 4, 2015, 10:39pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/5 "2015-06-04T22:39:00Z")

</div>

SUCCESS! I took out the Spark.publish(), (after a factory reset), and now, every time I hit “flash” it does it. Glad to see “flash” working so good again.  
If the Original Poster has his problem solved, and I do, someone can mark this as [SOLVED]…  
Thanks.

---

<div class="post-metadata">

**Author:** ![mastap94](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mastap94](https://community.particle.io/u/mastap94)\
**Post date:** [July 22, 2015, 8:17pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/6 "2015-07-22T20:17:22Z")

</div>

@Jack,

Where is the Spark.publish you speak of? Is it simply a matter of removing it once for all your code?

Thanks!

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 22, 2015, 8:30pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/7 "2015-07-22T20:30:06Z")

</div>

Spark.publish() shouldn’t create issues like that. Most likely, there’s something else going on in your code that’s wreaking havoc. If you’re willing to share your code, it’d be easier to debug.

---

<div class="post-metadata">

**Author:** ![Jack](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/jack/32/5412_2.png) [@Jack](https://community.particle.io/u/Jack)\
**Post date:** [July 22, 2015, 9:01pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/8 "2015-07-22T21:01:00Z")

</div>

> [@Moors7](#):
>
> Spark.publish() shouldn't create issues like that. Most likely, there's something else going on in your code that's wreaking havoc. If you're willing to share your code, it'd be easier to debug.

Moors7 will probably be able to help you.  
But in my code (month ago now), I added Spark.publish(). If you have not added that into your code, then it is not there.

---

<div class="post-metadata">

**Author:** ![mastap94](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mastap94](https://community.particle.io/u/mastap94)\
**Post date:** [July 22, 2015, 9:02pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/9 "2015-07-22T21:02:27Z")

</div>

Flashing code OTA is also not working very consistently for me.

How can I flash via usb? I imagine I do this by DFU, but what command to I use? I want to flash code that is currently in my particle IDE. Thanks!

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [July 22, 2015, 11:57pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/10 "2015-07-22T23:57:30Z")

</div>

In the IDE, click the little download button:  
 ![](https://community.particle.io/uploads/particle/original/0/f/0fffeb79b5ede5f0774bf8b185c6a2f6f5293a8e.png)  
That will download the compiled .bin file. In the directory that’s downloaded to, open your command prompt and do `particle flash --usb firmware.bin`. Assuming your device was in DFU mode, that should work.

---

<div class="post-metadata">

**Author:** ![mastap94](https://avatars.discourse-cdn.com/v4/letter/m/54ee81/32.png) [@mastap94](https://community.particle.io/u/mastap94)\
**Post date:** [July 23, 2015, 3:30pm UTC](https://community.particle.io/t/flashing-spark-core-not-working/12316/11 "2015-07-23T15:30:42Z")

</div>

Thanks @Moors7
