Greetings all! I’m trying to speed up provisioning of a fleet of Raspberry Pi devices using the Balena CLI, and running into an issue where the device doesn’t join the designated fleet after booting.
I’m on Balena CLI version 12.48.7
Here are the commands I’m using (from following the CLI Advanced Masterclass):
Download a raw os image:
balena os download raspberrypi4-64 --output image.img --version v2.83.10+rev1.dev
Getting device operating system for raspberrypi4-64
The image was downloaded successfully
Configure the image:
balena os configure image.img --config generated_config.json --fleet myFleet
Configuring operating system image
Write the image to an SD card:
balena os initialize image.img --type raspberrypi4-64 --drive '\\.\PhysicalDrive2' --yes
Initializing device
Note: Initializing the device may ask for administrative
because we need to access the raw devices directly.
Going to erase \.\PhysicalDrive2.
Writing Device OS [========================] 100% eta 0s
Validating Device OS [========================] 100% eta 0s
You can safely remove \.\PhysicalDrive2 now
Here are the contents of generated_config.json (with ssid/key changed to protect the innocent):
{
"network": "wifi",
"wifiSsid": "mySSID",
"wifiKey": "myPassword"
}
These steps all complete without errors, and the Pi boots from the SD card as expected. Once it’s booted, I can see that it has joined the wifi network, as it comes up with the scan
command:
balena scan
Scanning for local balenaOS devices… Reporting scan results
-
host: a3f6878.local
address: 192.168.86.120
osVariant: development
dockerInfo:
Containers: 1
ContainersRunning: 1
ContainersPaused: 0
ContainersStopped: 0
Images: 2
Driver: overlay2
SystemTime: 2021-09-08T03:05:32.872105978Z
KernelVersion: 5.10.31-v8
OperatingSystem: balenaOS 2.83.10+rev1
Architecture: aarch64
dockerVersion:
Version: 19.03.24
ApiVersion: 1.40
However, when I run balena devices
to see if it has joined the Fleet, I get an empty list:
balena devices --v13
ID UUID DEVICE NAME DEVICE TYPE FLEET STATUS IS ONLINE SUPERVISOR VERSION OS VERSION DASHBOARD URL
I’ve tried waiting up to an hour to see if it ever joins, and I never see the newly commissioned device come up in the device list.
I have found that I can force it to join the fleet by its IP address with:
balena join 192.168.86.120 --fleet myFleet
←[32m?←[39m ←[1mCheck for updates every X minutes←[22m←[0m ←[0m←[2m(10) ←[22m←[41D←[41C
… bunch of other garbled output trimmed…
| [192.168.86.120] Configuring…←[2K←[1G/ [192.168.86.120] Configuring…←[2K←[1G←[32m[Success]←[39m Device successfully joined balena-cloud.com!
At this point, if I run balena devices
again, I see it show up as expected in the device list.
I have two questions:
- Am I doing something incorrectly in the os image configuration or initialization process that’s keeping the device from automatically joining the fleet when it boots up?
- What’s with all the garbage on the output of the
balena join
command? Is this a known issue?
Thanks for the help all!
-Robert