How to know when FOTA Download is interrupted

I have been testing with the following setup:
Bundle: Full modem install.
Modem version: 1.3.4
SDK: 2.4.0
My application is based on the SLM sample.


Problem Part 1)

When I purposely disrupt my internet connection during a FOTA download (by removing my antenna) my application gives the following output, and then does nothing (I let it hang for 10 minutes to see if anything happens).
It does not try again, and it does not throw some sort of FOTA error. Obviously, I need to be able to see if a FOTA download has been interrupted by a bad internet connection, so I can handle it properly. It produces no further messages.
I was expecting some sort of timeout (there is none), or a retry (did not occur), or a cloud/FOTA callback event (also does not seem to occur), or at least some log messages



Problem Part 2)
After the above disruption, I restart my device and reconnect to the cloud with nrf_cloud_connect(), as usual.
I expected it would go and attempt to download the same FOTA image. But it did not. The cloud indicates "downloading", like this below, but the interrupted firmware update is now completely ignored. I can make a new one, and it will work, but the old one seems "dead".

Parents Reply
  • Hi there, 

    I'm having a similar issue. I get the above failures, and eventually it will run out of retry counts.
    When this happens, no fota_download_evt is emitted. Leaving my application to wait forever (until a watchdog finally times out).

    Not sure about this, but it seems that the download_client_callback in fota_download.c is missing a call to stopped() in the error_and_close section:

    error_and_close:
        atomic_clear_bit(&flags, FLAG_RESUME);
        (void)download_client_disconnect(&dlc);
        dfu_target_done(false);
        // Shouldn't we call stopped() here to transmit the error?
        return -1;

    If I should open a separate issue for this, please let me know.

Children
Related