Suggest you look at using the console and product if not already doing so. Thus, you upload your new release to the console and let it control OTA update process automatically.
For the device to OTA update it will need to be cloud connected - you say that it in normal mode it does not require cloud communication and may be sleeping. What you will need to do therefore is once per day (or however often you want to try updates) ensure that the device is not sleeping and connects to the cloud AND
Particle.publish(“spark/device/session/end”, “”, PRIVATE); to ensure that any pending software updates are triggered.
Well we are planning to give one popup in mobile app so when customer select then after it update specific device firmware.
Sorry, I don’t understand the process - do you mean the customer can enable or disable OTA software updates?
Not added anything like that but when update popup came we can display some message like “Do not start any process while device is updating”
If I understand this correctly - it is a good idea to warn the user if an update is in progress and a reset is about to happen - you can do this by including something like this in setup();
`System.on(reset+reset_pending+firmware_update, handle_restart_events); //register event handler`
The handler would look like this, global bool isResetPending is checked within the application code to avoid operations when the device is about to be reset. I would normally have System.disableReset(); in setup();
void handle_restart_events(system_event_t event, int data)
if (event == reset)
isResetPending = false;
else if (event == reset_pending)
else if (event == firmware_update && data == firmware_update_complete)
isResetPending = true;
else if (event == firmware_update && data == firmware_update_begin)
statusMessage("Software Update In Progress");