-
-
Notifications
You must be signed in to change notification settings - Fork 440
Benjamindannegard/x8 waves tutorial #539
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
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
184b1d2
Added structure and commands
BenjaminDannegard 3a875a6
Finishing touches
BenjaminDannegard 0366c7e
Linter fixes
BenjaminDannegard 0e31f17
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 6712443
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 90b2a75
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 9621ecd
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 6515889
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard b587496
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 74afd98
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 1a27df3
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard a10ef70
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 7ca4215
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 82e0b23
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 38da167
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 15c72eb
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard a4c9125
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard ef889cd
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard da82ca0
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard b7ec32d
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard ed7665b
Fixed content after review
BenjaminDannegard 74977b8
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 8b5e0c2
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard 1d659fa
Fix `description` and MD typos
marqdevx 6acc599
Align commands with camel case `<explanations>`
marqdevx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file added
BIN
+185 KB
...nta-x8/tutorials/waves-fleet-managment/assets/foundriesfactory-device-group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+165 KB
...tenta-x8/tutorials/waves-fleet-managment/assets/foundriesfactory-waves-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 123 additions & 0 deletions
123
...t/hardware/04.pro/boards/portenta-x8/tutorials/waves-fleet-managment/content.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
--- | ||
title: 'Using FoundriesFactory Waves Fleet Management' | ||
description: 'Learn how to manage multiple Portenta X8 devices using FoundriesFactory fleet management tool, Waves' | ||
difficulty: intermediate | ||
tags: | ||
- Embedded Linux | ||
- Flashing | ||
- Foundries.io | ||
author: 'Benjamin Dannegård' | ||
hardware: | ||
- hardware/04.pro/boards/portenta-x8 | ||
--- | ||
|
||
## Overview | ||
|
||
In a production environment it is convenient to plan updates, and have control over when and which devices are updated. FoundriesFactory® Waves is the feature for this. It allows you to easily define a group of Portenta X8s and then push updates to that specific group. The difference between standard updates and using Waves to update, is that the Wave update will promote targets to production by double signing them, which makes the updates more manageable and controllable. This tutorial will show you how to define that group and how to construct a Wave that can then be pushed to a group. | ||
|
||
## Goals | ||
|
||
- Learn how to use Waves fleet manager | ||
- Learn how to assign a target to a Wave | ||
- Learn how to push a Wave to a group of devices | ||
|
||
### Required Hardware and Software | ||
|
||
- USB-C to USB-A or USB-C to USB-C | ||
- Portenta X8 | ||
- Arduino Create account | ||
- Arduino Pro Cloud Subscription. [Learn more about the Pro Cloud](https://www.arduino.cc/pro/hardware/product/portenta-x8#pro-cloud). | ||
- Foundries.io™ account (linked with the Pro Cloud subscription) | ||
- FoundriesFactory® and devices already attached to your Factory. ([Check the Getting Started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box)) | ||
|
||
## Instructions | ||
|
||
### Setting Up the Terminal | ||
|
||
Waves fleet management requires us to have the X8 setup with FoundriesFactory. If you have not done so, please follow our [Getting Started tutorial](https://docs.arduino.cc/tutorials/portenta-x8/out-of-the-box), as it will walk you through setting up the X8 with your Factory. To use Waves, you need to have fioctl installed and configured. Follow this [guide](https://docs.foundries.io/latest/getting-started/install-fioctl/index.html) to do so.Creating Waves and device groups will be done via the host, which is your factory. As such, the following commands will be entered in a terminal using fioctl to connect to your Factory. | ||
|
||
### Rotating Our Keys | ||
|
||
For security purposes, we recommend that you rotate your FoundriesFactory keys. Rotation of the key will convert the root role's online-key, which was generated during the bootstrap of your Factory, to an [offline key](https://docs.foundries.io/latest/reference-manual/security/offline-keys.html). | ||
|
||
First we will rotate the root keys. These are the most important keys, as they can be used to create new target keys. Rotate them with the command: | ||
``` | ||
fioctl keys rotate-root --initial /absolute/path/to/root.keys.tgz | ||
``` | ||
|
||
Now we can rotate the target only keys with: | ||
``` | ||
fioctl keys rotate-targets /absolute/path/to/root.keys.tgz | ||
``` | ||
|
||
And finally, for security reasons, we separate the target keys from root using: | ||
``` | ||
fioctl keys copy-targets /absolute/path/to/root.keys.tgz /path/to/target.only.key.tgz | ||
``` | ||
|
||
Now we can move on to creating our Wave. | ||
|
||
### Creating a Dummy Wave for Production Targets | ||
|
||
Before a Factory can start doing production OTAs, an initial production Targets file must be created. More information can be found [here](https://docs.foundries.io/latest/reference-manual/ota/production-targets.html). This can be done by creating a dummy wave with the command: | ||
``` | ||
fioctl wave init -k /absolute/path/to/targets.only.key.tgz populate-targets | ||
``` | ||
|
||
Then complete the Wave with: | ||
``` | ||
fioctl wave complete populate-targets | ||
``` | ||
This creates a new targets.json file for production devices subscribing to the production tag. It will include a single Target from CI build. | ||
|
||
### Creating a Wave | ||
|
||
Now we can start creating our Wave. The command below will create a Wave that can then be pushed to our devices. To create a Wave, we will sign it with a key, here we will use the targets only key. Then we give the Wave a name, target number, and tag. The `target number` needs to correspond to the target that we want the Wave to contain for our devices. The `tag` can be set as production or development. | ||
``` | ||
fioctl wave init -k /absolute/path/to/targets.only.key.tgz <wave-name> <target number> <tag> | ||
``` | ||
|
||
And then we can complete the Wave by passing the name to the "complete" function: | ||
``` | ||
fioctl wave complete <wave-name> | ||
``` | ||
|
||
Or we can cancel it with: | ||
``` | ||
fioctl waves cancel <wave name> | ||
``` | ||
|
||
After creating the Wave, you should see it on your Factory page. It should also be marked as complete after you call the Wave complete command. | ||
|
||
 | ||
|
||
### Create the Device Group | ||
|
||
With this command, we create our group, giving it a name and a short description: | ||
``` | ||
fioctl config device-group create <group name> <"short description here"> | ||
marqdevx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
Now to assign a device to our group we use: | ||
``` | ||
fioctl device config group <device name> <group name> | ||
``` | ||
|
||
On your FoundriesFactory device page you can sort and view devices by group. | ||
|
||
 | ||
|
||
To rollout our Wave to our device group, use: | ||
``` | ||
fioctl waves rollout <wave name> <device group name> | ||
``` | ||
|
||
Every device in the device group should now have the target specified in the Wave creation. | ||
|
||
### Conclusion | ||
|
||
In this tutorial we first looked at what is required to use the Wave tool. We then went through the process of creating a Wave and device group. Then we pushed a target to the device group using the Wave tool. | ||
|
||
## Troubleshooting | ||
|
||
- If you are having trouble with any fioctl commands you can use `fioctl wave --help` or `fioctl wave rollout --help` depending on the context. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.