[SOLVED]Running OTA detection

Hello,

is there any way how to detect currently running OTA update on the device itself? We have the status LED normally turned off, but want to turn it on when OTA is running to indicate it to the user.

Not sure if System.updatesPending() is intended to be used for this - we run local cloud.

Thanks!

You can see the available events to subscribe to here
https://docs.particle.io/reference/firmware/photon/#system-events

However, any subscription will not work during the actual OTA process since the user application is being replaced during this process. Basically, user code runs before and after the OTA but not during.

There are multiple phases of an ongoing OTA update.
During the download, temporary flash and integrity check your program can still run when using SYSTEM_THREAD(ENABLED), but your program won’t need to be running all the time.
To have feedback about the ongoing OTA you just need to catch the initiation and just hand RGB.control() back to the system.

1 Like

Great, thank you! This is exactly what I was looking for.
@peekay123 we use SYSTEM_THREAD(ENABLED) so the user code is processed during the OTA.

Thanks!

1 Like