Particle API JS - Flash Issue [Solved]


I have developed a little nodejs application which I use to claim a Photon, and then flash some firmware.

Claiming the Photon works, but then as soon as I issue particle.flashDevice command, the Photon flashes magneta for a quick second, then reboots. However, my firmware did NOT get delivered.

On my Nodejs application, I get this command when flashing:

Device flashing started successfully: { body: { id: 'XXXXX', status: 'Update started' },
  statusCode: 200 }

If I flash through the WebIDE, it works. However, I noticed that it seems to go through 3 flashing cycles (flashing magneta, reboot, etc x3).

Any ideas what might be causing this issue?


Could it be that the device has to update its system firmware? That’d explain the multiple flashing, but doesn’t quite explain why the JS SDK doesn’t seem to stick. Could you try using an older version of the library to see if recent changes might be of influence?

What version of the particle-api-js are you using? I was previously able to reproduce a failure to flash behavior with 6.0.3, same symptoms, but it worked correctly with 5.3.1 for me.

npm install particle-api-js@5.3.1

I was using 5.2.7. Tried 5.3.1/6.0.4 and got the same issue.

Here is a video of how it tries to flash:

What do see in particle console? When I had this problem in the linked issue above there was a flash failed event in particle console, even though the JS flashDevice succeeded.

Good idea, but no much more help here:

I resolved the issue.

The firmware.bin file got corrupted on my server somehow. I uploaded it again and it worked.