How to restart deployment automatically when update is interrupted by device reboot

Hello,

I am working on an IoT project where the devices in the field get power very intermittently. The customers turn on the device when they want to use our feature and turn it off went it is not needed.

For the FOTA of the device, we use Mender. Currently we have 50 devices in the field. When there is a new SW, I start deploying the images to all the devices using mender server. If the device is turned off or rebooted when deployment is in progress, I see the deployment failure log in mender server in the next reboot with the log message:

2021-07-17 08:01:42 +0000 UTC info: Running Mender version 4084710
2021-07-17 08:01:42 +0000 UTC error: Update was interrupted in state: update-store

I have to redeploy manually again. Is there any way in Mender to do this automatically?

Thanks & regards,
Vinothkumar

Hello Vinothkumar,

The professional plan of mender includes “Automatic retry of deployments,” which could be what you are looking for. Plans and pricing are over here.

Some ideas I could think of (for the sake of the brainstorming), if the power off of the device is executed by software, maybe you can disable the possibility of powering off the device during the update; for that, take a look at the state scripts documentation.

If not, another option is to trigger the deployment from the device itself, overloading some functions.

Finally, you can overload the tasks related to the commit. The device can notify the server when ready; if there is a timeout, the server could trigger the deployment again using Mender’s API.

These are some ideas on the top of my mind, but I haven’t tested them yet. Creating your tasks for the state scripts are good way of automating and taking advantage of the Mender ecosystem.

Luis