When does OTA update a device?


I’m getting ready to release a new version of software. When does the OTA update actually happen on the device? What mode does the device have to be in? What happens if the device is running it’s current version of software? Finally, do I need to modify my software to listen for the firmware_update_pending and then shut the app down gracefully?

If there is documentation on this topic please point me in it’s direction - Thanks!


Are you flashing via the Particle Product feature for fleets?
Are you flashing a single developer device?
Are you running SYSTEM_THREAD(ENABLED) or not?
How does your currently running code behave in regards to connectivity (including sleep modes)`?

Without all of these infos answering your questions would just produce a load of cases and eventualities which only cost a lot of time on our side where your use-case probably only requires a fraction of the possible answers.


Thank you for your reply. My ultimate goal is to locate the documentation that would essentially lay out the requirements, and then help me to to properly design my application. Is there documentation that will assist?


  1. Yes - flashing via Particle Product feature
  2. No - I would like to flash the fleet of vehicles - currently standing at 15 in total
  3. No - I am not using SYTEM_THREAD(enabled)
  4. Current code utilizes several functions and variables - all function as expected.

I have released a new version of software the Product Feature section shows that some devices have updated and some have not. So I’d like to know what to expect and how to better control when the updates happen.

I have located the OTA Update section of the documentation and I see there are disable and enable update functions. Am I able to utilize those within my code to tell particle when it’s ok and not ok to perform the update? If so, I would probably start with a disable, then transition based on detecting idle conditions for our operating environment, and during the idle condition issue the enable. Does that sound like the right strategy? If not, could anyone suggest a better one?


The issue is that at this time, a product firmware update occurs only on full cloud handshake. With Electron devices, this doesn’t happen that frequently, because doing so requires about 5K of data. Thus it can take around a week for all Electron/E-series devices to get a product firmware update at this time.

There are two workarounds that can be used now:

At some time, perhaps once a day, your device can end the session to force a new session handshake by running this code on the device.

Particle.publish("spark/device/session/end", "", PRIVATE);

This will cause a firmware update if there is one available after it reconnects.

Another option is to force the update from the cloud-side using lock and flash. This is usually only practical for devices that are always on. Since it’s possible to control lock and flash from the cloud API, you could also automate this process.

A more reasonable solution to this problem will be provided in the future, but I don’t have a schedule for when it will be available.

The secret OTA sauce... reliable OTA updates