Unable to flash locally - USB or Serial

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 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’,
host: ‘api.particle.io’,
port: 443 }

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

Sure appreciate any help.

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

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

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

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.

Hi ScruffR,

When I flashed the particle I used the command: 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.

1 Like

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.

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.

@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.

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.

2 Likes

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 :wink:

2 Likes

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…

2 Likes