Skip to content

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 25 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
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 Aug 30, 2022
3a875a6
Finishing touches
BenjaminDannegard Sep 9, 2022
0366c7e
Linter fixes
BenjaminDannegard Sep 12, 2022
0e31f17
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 12, 2022
6712443
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 12, 2022
90b2a75
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
9621ecd
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
6515889
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
b587496
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
74afd98
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
1a27df3
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
a10ef70
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 13, 2022
7ca4215
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
82e0b23
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
38da167
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
15c72eb
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
a4c9125
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
ef889cd
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
da82ca0
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
b7ec32d
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
ed7665b
Fixed content after review
BenjaminDannegard Sep 14, 2022
74977b8
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
8b5e0c2
Update content/hardware/04.pro/boards/portenta-x8/tutorials/waves-fle…
BenjaminDannegard Sep 14, 2022
1d659fa
Fix `description` and MD typos
marqdevx Sep 15, 2022
6acc599
Align commands with camel case `<explanations>`
marqdevx Sep 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.

![The wave page on your FoundriesFactory](assets/foundriesfactory-waves-page.png)

### 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">
```

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.

![Device group sorting on the FoundriesFactory page](assets/foundriesfactory-device-group.png)

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.