# Unable to flash locally - USB or Serial

**URL:** <https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970>\
**Category:** Troubleshooting\
**Created:** [September 12, 2017, 10:12pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970 "2017-09-12T22:12:26Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 12, 2017, 10:12pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/1 "2017-09-12T22:12:26Z")

</div>

Hi everyone. I have been trying in vain to flash my Electron either via USB or over serial. The last time I tried to flash firmware, I got the following message:

Flash device failed.  
{ Error: getaddrinfo ENOTFOUND [api.particle.io](http://api.particle.io) [api.particle.io:443](http://api.particle.io:443)  
at errnoException (dns.js:28:10)  
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)  
code: ‘ENOTFOUND’,  
errno: ‘ENOTFOUND’,  
syscall: ‘getaddrinfo’,  
hostname: ‘[api.particle.io](http://api.particle.io)’,  
host: ‘[api.particle.io](http://api.particle.io)’,  
port: 443 }

Not sure what the problem is, I have tried (I believe) just about everything.

Sure appreciate any help.

---

<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:** [September 12, 2017, 10:13pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/2 "2017-09-12T22:13:33Z")

</div>

> [@stormchaserjohn](#):
>
> I have tried (I believe) just about everything.

To save us from suggesting things you've already tried: what have you already tried?

---

<div class="post-metadata">

**Author:** ![Vitesze](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/vitesze/32/15427_2.png) [@Vitesze](https://community.particle.io/u/Vitesze)\
**Post date:** [September 12, 2017, 10:39pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/3 "2017-09-12T22:39:53Z")

</div>

Odd; I had a similar issue today with not being able to flash anything anymore. A simple ‘‘particle update’’ miraculously fixed it though.

---

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 13, 2017, 2:54am UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/4 "2017-09-13T02:54:18Z")

</div>

Hi Moors7, and thanks for your reply.

- I have tried flashing with both listening and DFU modes
- Ran the particle doctor to hopefully fix issues
- Changed out the USB cable
- Ran the particle update function

---

<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:** [September 13, 2017, 3:44am UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/5 "2017-09-13T03:44:53Z")

</div>

Can you post the exact commands you used to flash the device?  
This error message implies you were performing some command that involves network access which neither `particle flash --usb` nor `particle flash --serial` would require.

---

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 13, 2017, 12:45pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/6 "2017-09-13T12:45:14Z")

</div>

Hi ScruffR,

When I flashed the particle I used the command: particle flash --serial/Users/John/Documents/myFirmware.bin

---

<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:** [September 13, 2017, 12:53pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/7 "2017-09-13T12:53:30Z")

</div>

> [@stormchaserjohn](#):
>
> particle flash --serial/Users/John/Documents/myFirmware.bin

I assume that's a type, and there was a space between `--serial` and the path?

If you navigate to the directory the .bin is in, you won't have to type the Path anymore, which might save some errors. You can then simply do `particle flash --serial firmware.bin`, though I personally prefer --usb (DFU), if you're going over USB anyhow. DFU gives a more detailed error output, should anything go wrong during the process.

---

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 13, 2017, 1:07pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/8 "2017-09-13T13:07:36Z")

</div>

Yes, there was a space in the command before the directory. I will try opening the terminal right at the folder and use the DFU method. Will let you know how it works.

---

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 13, 2017, 1:52pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/9 "2017-09-13T13:52:37Z")

</div>

Finally got it to work! It seems that it makes a difference somehow to launch the terminal window in the same folder that contains the firmware. Why this would make a difference I am not sure, but I have never been one to question success.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [September 13, 2017, 1:57pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/10 "2017-09-13T13:57:21Z")

</div>

@stormchaserjohn, if the terminal window is launching in the default system32 directory, that may be the issue since that directly is permissions protected. I have a CMD shortcut on my desktop (Win 10) that has the admin rights enabled and the default directory set where all my projects are.

---

<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:** [September 13, 2017, 2:15pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/11 "2017-09-13T14:15:04Z")

</div>

Glad to hear you’ve got it working.  
As an alternative to @peekay123’s suggestion, you could add the (administrator) terminal to the quick access toolbar of the explorer, which I personally find a lot more convenient and versatile.  
 ![](https://us1.discourse-cdn.com/flex026/uploads/particle/original/2X/0/0d99cf029924b988d87aabe2c8e40e46f3c4fdd3.png)

---

<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:** [September 13, 2017, 2:41pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/12 "2017-09-13T14:41:15Z")

</div>

A third way I usually use is holding SHIFT while right clicking on the desired folder in Explorer which provides you with an _“Open console in this folder”_ option 😉

---

<div class="post-metadata">

**Author:** ![stormchaserjohn](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stormchaserjohn](https://community.particle.io/u/stormchaserjohn)\
**Post date:** [September 13, 2017, 4:19pm UTC](https://community.particle.io/t/unable-to-flash-locally-usb-or-serial/35970/13 "2017-09-13T16:19:28Z")

</div>

Hey thanks for all the suggestions, guys. This is a really great community, and this platform has a lot of potential! On to the learning curve…
