-
Notifications
You must be signed in to change notification settings - Fork 513
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
OTA/YModem update result #1097
OTA/YModem update result #1097
Conversation
We should try to write tests for this:
|
- OTA: "spark/device/ota_result" event - YModem: ACK/CANCEL + string error code (validation bitmask)
0549513
to
4d71b9c
Compare
|
||
formatOtaUpdateStatusEventData(flags, result, &module, buf, sizeof(buf)); | ||
|
||
Particle.publish("spark/device/ota_result", (const char*)buf, 60, PRIVATE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add logs for this event ( as in PR #1169 ), dumping the buffer would be a quick way to tell in logs what the result of the OTA/YModem was.
formatOtaUpdateStatusEventData(flags, result, &module, buf, sizeof(buf)); | ||
|
||
Particle.publish("spark/device/ota_result", (const char*)buf, 60, PRIVATE); | ||
HAL_Delay_Milliseconds(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming we need this to ensure the publish is sent before we soft reset to apply the OTA update. Can we make this more synchronous, as implemented in PR #1144 ? We can do this as a separate PR after these get merged. I'll take notes on all of these review comments to make sure we don't forget :)
bool result = true; | ||
const module_info_t* info = module->info; | ||
|
||
buf[64] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine, but I would like to see this as buf[sizeof buf - 1] = '\0';
{ | ||
bool result = true; | ||
AppendJson json(append, append_data); | ||
//result &= json.write('{'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these {}
make the output exceed 255? Because it would be nice to have a properly formatted JSON object by default.
Acceptance tests for PR #1097 (OTA/YModem update result)
Implements #1032
When updating the device via YModem:
EOT
from Host, device doesn't immediately respond withACK
. Instead binary validation is performed.ACK
and prints received file name and size.CA
(CA
,CA
) as to indicate the error and prints hexademical error code, which is a bitmask of failed checks (https://github.com/spark/firmware/blob/c916faafaea75f802a521d32ca4353aba812dfe2/hal/inc/ota_flash_hal.h#L52)When updating OTA:
spark/device/ota_result
, which contains the following JSON object:Doneness:
Enhancements