AFR & ESP32 - How to defer/ postpone an OTA update on the device?

Namaste Community Member,

For my product under development, I am able to update my application firmware on the ESP32-DevKitC target board. This is achieved by running the AFR OTA Update Thread on the board and, leveraging the Jobs and Amazon S3 Bucket on the AWS IoT console.

The firmware version is FreeRTOS V202002.00 and, is downloaded from the AWS IoT console (FreeRTOS Device Software). The OTA Update demo code is leveraged and, integrated in my firmware.

Observations (in line to the OTA Update Demo implementation)

  1. The OTA Update Thread is continuously running on the device.
  2. An OTA Update on the device begins immediately once a Job is created on the AWS IoT console.
  3. Device restarts immediately once the firmware signature is validated and, applies the new firmware as the active image upon a successful reboot.

Requirement
At the device end

  1. Either disable the OTA Update thread when the device is in the Active state.
  2. Or, accept the firmware received via OTA update but, restart the device only when the device is in the Standby state.

At the AWS IoT console end

  1. Schedule the OTA Update Job at a specific time.

Code modification attempts
Two attempts to defer the OTA update were unsuccessful. The vTaskDelay() statement was added here and here. These two references are related to the master branch.

Your inputs for my above requirements or, a better recommendation are truly appreciated!

Thanks | Regards,
Dipen

1 Like

Namaste Community Member,

Below is the reply received for the same query, which I had also posted on GitHub. Hope it helps!

Thanks | Regards,
Dipen

1 Like

@dipen12, we really appreciate you making the effort to link back to here is highly valuable to the community. Thank you.

1 Like