OTA update has stopped working for me - Photon

Hi All,

I have seen just recently (in the last few weeks) that OTA updates have stopped working as they have normally functioned.

Okay so let me give some background I compile my code locally using a customized system (there are only a few small changes to the system).

Anyways many months ago I upgraded my customized system and user code, but I still have old units in the field that eventually get turned on and I need to upgrade them to the newer system and user code.

Here is what I did in the past for OTA upgrades and it worked pretty well:

  1. When the device running my old user code connects to my server I issue a particle flash command to update the user code.
  2. The device reconnects to my server now having the new user code but still the old system part 1 & 2. I issue the particle flash command to update system part1
  3. The device reconnects to my server now having the new user and system part 1 code but old system part 2. I issue the particle flash command to update system part2

There are a number of issues regarding my devices’ use of deepsleep and that they are battery powered that have caused me to use this command sequence for flashing. So I would really like to get this working again as is or at least in the same sequence as before.

So let me explain what goes wrong: After I execute step 1. The device goes into a blinking magenta state and is no longer running my old user or new user code. Something must have changed in how Particle is doing the OTA update that is causing this problem It leaves me with devices that that stay awake endlessly until they drain their batteries.

I have not changed my script or binaries.


You might have missed the introduction of Safe Mode Healer.
This should actually take the responsibility off you to do the system flashing “manually”.
When you OTA flash an incompatible application firmware, your device goes into Safe Mode and the cloud will be informed about the incompatibility and trigger an auto-update.
Maybe this and your own attempt to update do interfere which eachother.

@mdma might have extra input tho’

Hi @ScruffR,

Thanks so much for your reply. It sounds like this new Safe Mode Healer is exactly the cause of the problems I am having. For me it has proven to be the Safe Mode Destroyer. I can understand that it is very well intentioned and fixes problem OP are having but it has left me with a bunch of dead devices at remote locations which is quite painful. I am guessing that the bootloader is running this safe mode code rather than flashing my new user code to the device and the server is determining that it cannot send an update to the system as it is a custom version, leaving my the devices in this death spiral.

Is there a way to disable the Safe Mode Healer for my devices with some sort of server instruction?

If that is not the case, I am going to have to spend some significant effort to change my update script and do a fair amount of testing.

I have not been down that route really myself but product creators would set an alternative PRODUCT_ID to keep Safe Mode Healer from interfering.
But as said, others would possibly be able to give you better advice.