Duplicate OTA-JOB receiving issue while running OTA Agent

Hi,

Currently I am using TICC3220SF along with AWS-FreeRTOS example demo project downloaded from AWS.

While downloading OTA-JOB document, I am getting the same duplicate JOB document 2 or 3 times.

I understood that, this behaviour is because cloud is expecting Ack from the device (as enabled QOS1 for prvSubscribeToJobNotificationTopics),

Ack is missing due to network issue(testing under slower network).

Whenever this issue occurs, OTA task is getting aborted and reporting JSON parse error to the cloud.

Device side Error : “Superfluous report of current job”
Cloud side error : “error occurred during JOB Document parsing”

If I make device side code changes QOS1 to QOS0 I am able to resolve the issue.
I wanted to do work around to avoid the duplicate job and continue upgrading the OTA without aborting.

Please help me to resolve this.

Please find the following logs for more info:

[iot_thread] [INFO ][DEMO][73601] OTA Started
[iot_thread] Creating MQTT Client…
[iot_thread] Starting OTA Agent.
[OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/Temp/jobs/$next/get/accepted
[OTA Task] [prvSubscribeToJobNotificationTopics] OK: $aws/things/Temp/jobs/notify-next
[OTA Task] [prvPAL_GetPlatformImageState] xFileInfo.Flags = 0250
[OTA Task] [prvPAL_GetPlatformImageState] eOTA_PAL_ImageState_Valid
[OTA Task] [prvPAL_GetPlatformImageState] xFileInfo.Flags = 0250
[OTA Task] [prvPAL_GetPlatformImageState] eOTA_PAL_ImageState_Valid
[OTA Task] [OTA_CheckForUpdate] Request #0
[OTA Task] [prvParseJobDoc] Job was accepted. Attempting to start transfer.
[OTA Task] [prvPAL_GetPlatformImageState] xFileInfo.Flags = 0250
[OTA Task] [prvPAL_GetPlatformImageState] eOTA_PAL_ImageState_Valid
[iot_thread] Error: Could not get a free buffer to copy callback data.
[iot_thread] OTA State: Ready Received: 3 Queued: 2 Processed: 0 Dropped: 1
[iot_thread] Error: Could not get a free buffer to copy callback data.
[OTA Task] [prvStartRequestTimer] starting timer
[iot_thread] OTA State: Active Received: 4 Queued: 2 Processed: 0 Dropped: 2
[Tmr Svc] [prvRequestTimer_Callback] timer callback.
[iot_thread] OTA State: Active Received: 4 Queued: 2 Processed: 0 Dropped: 2
[OTA Task] [prvPAL_CreateFileForRx] Receive file created. Token: 1952007250
[OTA Task] [prvOTA_Close] Context->0x200000a0
[OTA Task] [prvRollbackBundle] Bundle rollback succeeded
[iot_thread] OTA State: Active Received: 4 Queued: 2 Processed: 1 Dropped: 2
[OTA Task] [prvParseJobDoc] Superfluous report of current job.
[OTA Task] [prvParseJobDoc] Error 3 parsing job document.
[OTA Task] [prvParseJobDoc] Ignoring job without ID.
[OTA Task] [prvOTA_Close] Context->0x200000a0
[OTA Task] [prvPAL_SetPlatformImageState] Bundle rollback failed after abort (-10282).
[OTA Task] [prvUpdateJobStatus] Msg: {“status”:“FAILED”,“statusDetails”:{“reason”:“aborted: 0x24000000”}}
[iot_thread] OTA State: Active Received: 4 Queued: 2 Processed: 1 Dropped: 2
[OTA Task] [prvDefaultCustomJobCallback] Received Custom Job inside OTA Agent.
[OTA Task] [prvParseJobDoc] Ignoring job without ID.
[OTA Task] [prvPAL_SetPlatformImageState] Bundle rollback failed after abort (-10282).
[iot_thread] OTA State: Active Received: 5 Queued: 3 Processed: 3 Dropped: 2
[iot_thread] adiCheckforOtaUpdate() wait time expired
[OTA Task] [prvOTAUpdateTask] Received shutdown event.
[OTA Task] [prvOTA_Close] Context->0x200000a0
[iot_thread] [INFO ][DEMO][118793] OTA Completed

Regards,
Suresh

Hello,

Can you please share which version/release you are using ? Also if you can please share if you using the default OTA configurations ?

HI pvyawaha,

Thanks for your reply,

I am using SDK SimpleLink_CC32xx_v2_10_00_04 (OTA : Amazon FreeRTOS OTA V1.0.3).

There is no custom changes, I am using AWS-OTA Example code.
Creating OTA task prvOTAUpdateTask() and checking OTA update by OTA_CheckForUpdate().

Below API is causing the issue (eOTA_JobParseErr_BusyWithSameJob):
prvProcessOTAJobMsg()

Regards,
Suresh

Hello,

If you are using MQTT protocol ( which is only supported at this time for control messages ) you do not need to call the OTA_CheckForUpdate() as you are already subscribe to the job notification topics. Can you try running the demo provided and check if you still receive the same error?

Hi pvyawaha,

Thanks for your response and support.

Device operates over battery and goes to hibernate mode regularly, Due to application requirement needs to perform OTA_CheckForUpdate().

Regards,
Suresh