-
Notifications
You must be signed in to change notification settings - Fork 514
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
Asset OTA fixes #2711
Asset OTA fixes #2711
Conversation
825113e
to
b09475c
Compare
if (!is_module_function_valid((module_function_t)module.info.module_function)) { | ||
continue; | ||
} | ||
// If sending a describe, skip factory modules entirely just in case |
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 will be reverted once this is safe.
b09475c
to
ce04487
Compare
adc22ac
to
6eaff5e
Compare
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.
Looks great! I tested the control requests. I left a comment about making the list of available assets consistent between describe, control request and System.assetsAvailable
pbDesc.assets.arg = (void*)&availableAssets; | ||
pbDesc.assets.funcs.encode = encodeAssetDependencies; | ||
} | ||
EncodeAssets assets(&pbDesc.assets, AssetManager::instance().availableAssets()); |
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 think this should use availableAndRequiredAssets()
to avoid showing assets still on the device but not required by the application on the Console.
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 for cloud: we want the DS to be aware of what is entirely on the device to avoid OTAing things over unnecessarily.
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.
As discussed before the "use-case" for this is:
- product fw version 1 assets (1,2,3)
- product fw version 2 assets (2,3)
- product fw version 3 assets (1,2,3)
Currently apart from the product application OTA (and depending on whether Device OS upgrade happened of course) the assets in this particular case will not get OTAd at all post #1.
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.
Assets wouldn't get flashed unnecessarily if this used availableAndRequiredAssets()
either since after 1, it would return assets 1, 2, 3 available, after 2, it would return 2, 3 available and after 3, it would return 1, 2, 3. The OTA planner only triggers after the device sends the new describe message. But since it works both ways it's fine like this.
int getAssetInfo(ctrl_request* req) { | ||
PB(GetAssetInfoReply) pbRep = {}; | ||
using namespace particle::system; | ||
EncodeAssets assetsAvailable(&pbRep.available, AssetManager::instance().availableAssets()); |
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.
Similarly I think this should use availableAndRequiredAssets()
for consistency with the describe and Wiring API. The CLI flashes the new application before assets so returning available and required assets in the control request will work.
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'd disagree. I'd like for system describe and control requests to represent the full picture and for wiring APIs to be representative of what's required by the application. Again, same thing: to avoid re-flashing things unnecessarily that are already on the device.
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 tested available
and required
works as expected.
Tested assetsAvailable()
return the assets which are available and required 👍
Checked getFirmwareModuleInfo()
and getAssetInfo()
work as expected 👍
I did not test the app crashing issue.
c784a99
to
7c32b65
Compare
Description
This PR introduces a number of Asset OTA related fixes/enhancements:
CTRL_REQUEST_GET_ASSET_INFO
control request to fetch information about required/available assets on device over BLE/USBCTRL_REQUEST_GET_MODULE_INFO
refactored to align with new protobuf-based System Describe and encoding for both the control request and system describe coalesced into a single implementation to save on flash spaceSystem.assetsAvailable()
hides extra assets that might still be in storage but are not currently required, essentially this is nowavailable ∩ required
seek()
forward and backwards support in wiring Asset OTA APIsTesting
ota/assets
NOTE: Requires latest
@particle/device-os-test-runner
Related