🛠 Images custom et flotte : construire son Yocto, déployer par OTA avec fioctl et Waves
Objectives
Move from "hacking my board" to "managing a fleet." The factory image is a Linux microPlatform (LMP) from Foundries.io, built with Yocto; the Arduino BSP layer is public (arduino/meta-partner-arduino), as are the kernel modules (portentax8-x8h7). The official workflow: a FoundriesFactory builds the OS + containers, fioctl drives updates, and OTA — guaranteed atomic by LMP's A/B structure — pushes both the OS and containers. In the managed version, Arduino Cloud for Business / Portenta X8 Manager adds provisioning via individual keys and fleet monitoring; the official waves-fleet-managment tutorial covers remote container deployment.
Hardware
- 1 × Arduino Portenta X8 (ideally 2: one for production, one for the bench)
- A robust Linux build machine (Yocto: expect many GBs of disk space and hours of compilation on the first build)
- GitHub account + a FoundriesFactory (free tier available to get started)
- fioctl CLI installed on the build machine (docs.foundries.io)
- adb access to the board to enroll it in the factory
Full Code
# --- Cote poste de build ---
# 1. Initialiser sa factory (guidé par la doc Foundries.io)
fioctl login
# 2. Récuperer la BSP Arduino : couche meta-partner-arduino
# (github.com/arduino/meta-partner-arduino) + recipes LMP ;
# tuto officiel : docs.arduino.cc/tutorials/portenta-x8/image-building
# puis : bitbake lmp-factory-image
# 3. Pousser la branche de build vers la factory
git push
# -> la factory compile en cloud et héberge l'OTA
# --- Cote carte : suivre la mise a jour ---
adb shell
fio@portenta-x8:~$ sudo journalctl -fu ostree-remount # ou update manager
fio@portenta-x8:~$ docker ps # les conteneurs applicatifs suivent l'OTA
# --- Cote flotte ---
fioctl updates list # état de rollout par appareil
fioctl devices list
# Gestion managée alternative : Arduino Cloud for Business /
# Portenta X8 Manager (provisioning keys + monitoring),
# ou le workflow « Waves » du tuto officiel waves-fleet-managment.
Expected Verification
After git push, the factory compiles the image; the enrolled board downloads the OTA and switches to the new OS without bricking: if boot fails, LMP's A/B mechanism reverts to the previous image. Application containers update independently, versioned like Docker images — this is exactly the deployment model exploited by the Waves tutorial for a fleet.
Common Errors
- Trying to
apt installin the image: this is Yocto — anything touching the OS must be declared in recipes and recompiled; quick tests go throughopkg(used by Arduino for its kernel modules) or via containers. - Modifying the BSP without reading image-building: the meta-partner-arduino layer has compatibility with LMP kernel 6.1.24 — mixing recent LMP branches with this layer breaks the build.
- Losing factory keys: provisioning is based on individual keys (Portenta X8 Manager model) — a lost key = a device that must be physically re-enrolled.
- Testing OTA on the only board in production: A/B rollback protects the boot, not your data — keep a bench board and validate every rollout on it.
- Confusing the two OTA levels: the OS (ostree/LMP via factory) and containers (registries) update separately; a container pull failure does not affect the OS, and vice versa.
- >
- >
Other tutorials for this board
- Premiers pas : comprendre le monstre à 9 cœurs et entrer dans Linux via ADB
- Premier sketch sur le cœur M4 : le blink qui se flash par ADB
- Docker dès la sortie de l'emballage : premier conteneur sur le Linux embarqué
- Pont Linux ↔ Arduino : appeler des fonctions du sketch M4 depuis Python (RPC)
- Mettre la X8 en réseau : Wi-Fi du Murata 1DX et Gigabit Ethernet sur porteuse
- Nœud IoT de datalogging : capteurs sur le M4, stockage et transport en conteneur
Code examples for this board
etat-systeme.shBashgpio-libgpiod.shBashpython-gpio.pyPythondocker-hello.shBashflasher-core-arduino.shBashwifi-nmcli.shBash