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