-
Run update-balena-supervisor or update-resin-supervisor on the device. If that doesn't work...
-
PATCH the
should_be_managed_by__release
(orshould_be_managed_by__supervisor_release
if that doesn't work) field in the device resource (/v6/device
) to equal the release ID of the target Supervisor version. To find the release ID of the target Supervisor version: (Replace variables starting with $ with the fields that are relevant to your case, and run this in a dashboard dev console)
await sdk.pine.get({
resource: 'supervisor_release',
options: {
$filter: {
is_for__device_type: {
slug: $DEVICE_MACHINE_NAME_SLUG
},
supervisor_version: $VERSION
},
}
})
It will be listed under id
.
Then, to patch the device, run the following from a host OS terminal instance:
curl -X PATCH \
"https://api.balena-cloud.com/v6/device($(cat /mnt/boot/config.json | jq -r '.deviceId'))" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $(cat /mnt/boot/config.json | jq -r '.deviceApiKey')" \
--data '{
"should_be_managed_by__release": $RELEASE_ID
}'
If the PATCH succeeds, you will receive a 2xx status code with your response. To verify success/failure, after PATCH-ing, check the device resource's should_be_managed...
field:
await sdk.models.device.get($UUID)