I actually tried what you suggest by adding the for loop for delay but I have not seen any updates taking place:
function()
{
Log.trace("This OTA state before updates are enabled");
System.enableUpdates();
Log.trace("This OTA state after updates are enabled");
for(uint32_t t = millis(); millis() - t < 120000L; Particle.process())
Log.trace("This OTA state after delay FW-Ver4");
}
The above code gets executed when a new firmware update is detected, but I don’t see any updates happen at all.
I just noticed my code keep looping for 2 minutes in this function displaying “This OTA state after delay FW-Ver4”.
Do I need to increase the delay? is this happening because there is not a good handshake between the device and the cloud?