[Solved] Flashing electron over the air OTA will not work

Has anyone been able to flash their electron over the air? I can not because the web IDE will not update to firmware actually on the device. I have updated my firmware to 5.1 and the web IDE says it is 5.0 still on the device. I have removed and re added the electron and it still says the same thing. I tried from the CLI with a local binary and I get flash device failed. Can not read property ‘length’ of undefined

That’s a know bug in Build and Particle will address that shortly - I think :wink:

But I have tested with CLI and it works.

What about OTA using cli with a binary file?

Particle flash file.bin

Have you updated CLI 1.14.0?

actually

particle flash <DeviceName> firmware.bin

OTA flashing needs to know which device to send the bin to.

I typed that but it edits it out for some reason. Yes I have the current version and I type it as stated. It even asks me to confirm the amount of data it will consume, and after I do I get the fail

Since you didn't mark it as code/text block that <...> part was interpreted as a Discourse tag :wink:

Sorry still very new to forum

1 Like

Just to clarify the basics:
What version Node, npm and CLI have you got you your machine?


If you copy-paste the text of you output and insert it here, it’s easier for us to work with it than with a screenshot

To format this nicely just wrap your text block in a set of this

 ```text
 // text block here

I won’t be home until later today but cli is version 1.14.0 how do I see what version npm is? Thank you for helping me out I greatly appreciate your time

npm -v
node -v

Thank you. I was about to update my comment I found out how online. I will be sure to check, but if Node and npm are current from the Node website, I installed the latest node 2 days ago in part of my troubleshooting process. Am I correct that npm is included with node? Sorry for all the newbie questions. Without looking I am fairly certain I installed node 6.2.0 current latest features 32bit

node was version 6.2.0 npm was 3.8.9 cli was 1.14.0 I uninstalled particle cli and installed the new version 1.14.1 and I am currently updating npm to the newest version. Once I complete I will try OTA again and let you know what happens. Thank you again for your time. npm was updated to 3.9.3 and cli is version 1.14.1 and I tried it again.

here is the error

C:\Users\trent_000>particle flash clayton firmware.bin
Including:
    firmware.bin

! Flashing firmware Over The Air (OTA) uses cellular data, which may cause you to incur usage charges.
! This flash is estimated to use at least 0.012 MB, but may use more depending on network conditions.

! Please type 0.012 below to confirm you wish to proceed with the OTA flash.
! Any other input will cancel.
? Confirm the amount of data usage in MB: 0.012
attempting to flash firmware to your device clayton
Flash device failed
TypeError: Cannot read property 'length' of undefined
    at Object.ApiClient._addFilesToCompile (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\lib\ApiClient.js:508:33)
    at Object.ApiClient.flashDevice (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\lib\ApiClient.js:474:8)
    at flashyFlash (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\commands\CloudCommands.js:346:16)
    at runTask (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\pipeline.js:34:12)
    at C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\pipeline.js:42:12
    at tryCatchResolve (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\lib\apply.js:46:23)
    at callAndResolve (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\lib\apply.js:30:12)
    at callAndResolveNext (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\lib\apply.js:40:4)
    at Fold.fulfilled (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\lib\makePromise.js:767:11)
    at tryCatchReject (C:\Users\trent_000\AppData\Roaming\npm\node_modules\particle-cli\node_modules\when\lib\makePromise.js:845:30)

Does the location of the binary file file need to be somewhere specific? When you verified that it worked did you flash a binary or did you compile an ino and flash? Did you use web build or Dev?

I do see a similar issue flashing a 0.5.1 bin

C:\Users\Andy\Downloads>particle flash ScruffyG3 firmware.bin
Including:
    firmware.bin

! Flashing firmware Over The Air (OTA) uses cellular data, which may cause you to incur usage charges.
! This flash is estimated to use at least 0.005 MB, but may use more depending on network conditions.

! Please type 0.005 below to confirm you wish to proceed with the OTA flash.
! Any other input will cancel.
? Confirm the amount of data usage in MB: 0.005
attempting to flash firmware to your device ScruffyG3
Flash device failed
[TypeError: Cannot read property 'length' of undefined]

And now I can't even do what worked with 1.14.0 particle flash <DeviceName> <appFolder>
It builds a binary but does not flash it.

@jvanier, I think things have gone a bit haywire.


Your questions:

Not when your are in the respective folder when executing the command.
If you are not, you'd need to supply the full path, but this should not contain blanks (wrapping it in double quotes might help tho')

I did particle flash <DeviceName> <appFolder> and particle flash <DeviceName> firmware.bin (but with 1.14.0 - as said above)

I used both Build and CLI for building, but not Dev.

Thanks for your reply. I did everything correctly as you have said. At least now that I know it’s not just me I can stop pulling my hair out and let some of it grow back :wink:

1 Like

I'm using
particle CLI 1.14.2
node v4.2.6
npm 2.14.12

The device is version 0.4.8.

I get the same result whether I try to update to 0.5.0 or 0.5.1

particle flash MYDEVICE system-part1-0.5.0-electron.bin
Including:
system-part1-0.5.0-electron.bin

! Flashing firmware Over The Air (OTA) uses cellular data, which may cause you to incur usage charges.
! This flash is estimated to use at least 0.141 MB, but may use more depending on network conditions.

! Please type 0.141 below to confirm you wish to proceed with the OTA flash.
! Any other input will cancel.
? Confirm the amount of data usage in MB: 0.141
attempting to flash firmware to your device MYDEVICE
Flash device failed
Timed out.

EDIT:
I updated to npm 3.9.3 and reinstalled particle CLI via npm

npm install npm@latest -g

and then

npm install particle-cli -g

same result. Is anyone seeing this?

That doesn't seem like a valid version.

It will be better to update firmware using CLI via usb. Either easy method or usb method found here

Hey all! The CLI was updated to fix this issue. Please run:

npm update -g particle-cli

and then make sure you have version 1.14.2 or newer with

particle --version
1 Like

Yup! Confirmed, 1.14.2 works for me :+1:

2 Likes

Thanks for the help. I haven’t tried the CLI yet but I was working with the IDE which was fixed and suited my needs for the time being. I will update CLI late today. Thanks again