I’m working with a Photon, and for some reason whenever I flash new code through Particle.io it will flash successfully, only to revert to the previous code a few seconds later. The LED will turn magenta on it’s own, appearing as if the Photon is being re-flashed with the old code that was supposed to be overwritten. I’m not sure why that’s happening, especially when the code I’m trying to flash is essentially empty.
Has this ever happened to anyone before?
It’s probably trying to flash new system firmware, causing it to flash magenta. If for some reason the update fails, it’ll still be running the old firmware. Try giving it some more time to finish the update, update using the CLI, or pick a lower version to compile against.
Could you make sure the CLI is updated to the latest version, and then issue particle update followed by particle flash --usb tinker, both while in DFU mode? Could you post a screenshot of that?
Then, try flashing something simple like ‘blink an LED’.
The CLI seems to be up to date, I used “$ npm update -g particle-cli” just in case.
Here is the screenshot after entering those two lines. I flashed a simple program that blinks an LED every second, the Photon reverted to the original code. It seems to always happen about 3 seconds or so after the code gets flashed.
You haven’t used the product creator features at console.particle.io with this device, have you? Once you make a device part of a product, as soon as the cloud detects that you have flashed different code on the device, it will flash the current version of the product firmware back, by design.
I was actually given the device to help develop it, continuing where others left off. I’m not actually sure whether not that has been done, though that sounds like the most logical explanation. I haven’t personally done anything like that with the board.
Edit: Perhaps the person working on it last set up something like what you described rickkas7. I went into console.particle.io and added the Photon board as a device in a product, and it the problem has been resolved.