-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] OTA Block size check wrong #503
Comments
the buggy check was introduce in #477, its also not doing what the PR is intending it to do. |
Hello @BogdanTheGeek and thank you for bringing this to our attention. You are indeed correct, the existing check is buggy. If you would like to create a PR to address that would be great! We will review it once it is created. As for the second part of the issue, we are continuing to investigate this and will update you with our findings. |
@bradleysmith23 i've had a chance to look though the rest of the ota code. The check is only happening in
I would suggest that a better place to check if the number of blocks in the ota is valid would be in |
@BogdanTheGeek thank you for your continued effort! I agree, you are correct that |
@bradleysmith23 I will move the check the into |
If a network disconnect occurs and the ota task is suspended and resumed, when the job description comes back, the library checks the
pFileContext->blocksRemaining
againstOTA_MAX_BLOCK_BITMAP_SIZE
(128) and silently stops the ota, without updating the job. The same issue doesn't happen if the device reboots instead of resuming the ota task. The issue also never manifests if the ota job is not suspended in the middle of job, so the number of blocks is not checked unless we get a new job document while already having one?The issue is 2 fold, the check is wrong, it should be(ota.c:2404):
Applying the change above fixes the issue. I can create a PR with the change if you can confirm that my understanding of the issue is correct.
The other is that the ota library fails silently and the job will not resume until the device reboots.
This is the log after a network reconnection:
This is all on the main branches of ota-for-aws-iot-embedded-sdk, coreMQTT, jobs etc.
The text was updated successfully, but these errors were encountered: