How to prevent FOTA from starting if battery is low?

Hi,

I have a battery powered design that uses the nRF9160.  I understand FOTA will start automatically at bootup if the firmware version number is different.  But this can be dangerous if the battery is running low.  I can read the battery voltage first at bootup.  But how do I stop FOTA from starting if I know it is not a good time to do so?  Thank you.

Floyd

Parents
  • Hi Floyd,

    Are you referring to the image swapping/FW activation in the bootloader, or are you asking about a way to prevent the app from retrieving the update from the DFU server when the battery is low? If it's the latter, could you please specify which sample or DFU library your implementation is based on?

    The bootloader does not have any hooks or similar mechanisms to skip the activation process. It will automatically swap to the new firmware image if it detects a newer version in the secondary slot upon booting. However, this process is designed to be fail-safe. Therefore, even if there is a sudden power loss during the swap, it should be able to resume and continue the process when powered up again.

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/mcuboot/design.html#resumed-swaps 

    Thanks,

    Vidar

  • Hi Vidar,

    Thank you for your reply.  Yes, I am referring to the application from the DFU server.  I am building my application based on the AWS_IOT example.  To my understanding, there is a APP_VERSION setting in the Kconfig file.  If the default value is differed, FOTA will begin automatically.  Should I be worried about the battery dies in the middle of a download?  Thanks again.

    Floyd 

  • Hi Floyd,

    Thank you for the additional information. I asked one of our developers about this, and here is what he had to say: 

    AWS FOTA doesn't care about the APP version number. This number is used to confirm that an AWS FOTA jobs actually succeeded.
    FOTA jobs are issued via the aws jobs service and is triggered explicitly cloudside.

    The customer can implement reporting of battery level to cloud and decide themselves when it is safe to issue a job.

    He also mentioned that there were safeguards in place to handle power loss.

    Hope this helps.

    Best regards,

    Vidar

    EDIT: The device can also use the 'UpdateJobExecution' API to reject a job: https://docs.aws.amazon.com/iot/latest/developerguide/jobs-mqtt-api.html 

Reply Children
No Data
Related