Mender Connected user guide¶
This user guide aims to explain how to create an update and deploy it on target via Mender Connected on Welma.
Build¶
-
Setup Mender Connected in your
conf/local.conf
:WELMA_UPDATE = "mender-connected" MENDER_SERVER_URL = "https://eu.hosted.mender.io" MENDER_TENANT_TOKEN = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZ...zjSH3p_"
MENDER_SERVER_URL
: US instance (https://hosted.mender.io
) or EU instance (https://eu.hosted.mender.io
).MENDER_TENANT_TOKEN
: can be found in the web page of the hosted Mender platform ("My organization" > "Organization token").
-
Be sure to have
meta-mender-core
in yourconf/bblayers.conf
. -
Set the size of your partitions:
-
At build time and before the first installation of the device, the following can be customized:
- Size of partitions
- Order of partitions
- Location of bootflags and partitions
-
Defining and customizing the size of partitions is recommended for software update: ensure that partitions of BOOT, SYSRO and APPRO are large enough to host future versions.
-
To set the size of your partitions, if using
wic
, you need to update the wic description (WKS_FILE
). See OpenEmbedded Kickstart Reference.
-
-
The generated output files will be:
- A SD card image with the whole partitioning (with extensions
.wic
or.wic.gz
) suitable for the first bare-metal installation of the device. - Module files with extension
.mender
for remote updates.
Notes: BOOT, SYSRO and APPRO modules can be installed together, or just one of them.
- A SD card image with the whole partitioning (with extensions
Configure at runtime¶
This is an alternative method to configure mender on your device when the configuration was not done at build time.
-
Start your device.
-
Connect to your the device (either serial console or SSH).
-
Edit the file:
/var/lib/mender/mender.conf
and setServerURL
andTenantToken
:/var/lib/mender/mender.conf{ "ServerURL": "https://eu.hosted.mender.io", "TenantToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZ...zjSH3p_" }
ServerURL
: same asMENDER_SERVER_URL
TenantToken
: same asMENDER_TENANT_TOKEN
-
Restart the Mender daemon:
systemctl restart mender-client
. -
On the web page of the hosted Mender platform, find the pending device, and accept it.
Deploy¶
Staying in the web page of the hosted Mender platform:
- Create a deployment for your device, and upload the Mender artifact generated earlier by the build.
-
Restart the Mender daemon:
systemctl restart mender-client
. (this is to avoid waiting for 30 minutes which is the default UpdatePollIntervalSeconds). -
You should see progress of the deployment on the web page of the hosted Mender platform.
Note: Sometimes the progress bar on the webpage hangs and does not reflect progress in realtime.
-
To enable updates to be initiated by the user, our local agent requires clearance for both downloading and installing updates
- Run
updatectl clearance-notify ready
to accept the download of the artifact - After few seconds, on Mender's web page, you will notice that the deployment process is waiting to start the installation of the artifact. Run the same command again
updatectl clearance-notify ready
on your target to accept the installation.
- Run
-
The system will then restart once the installation is over and the Mender daemon will confirm the installation after it has reached the Mender server.
-
Check update status using
updatectl status
. Example:
Troubleshoot¶
-
Logs are usually needed in order to diagnose an issue:
The Mender client by default logs to the system log using systemd, so the easiest way to retrieve logs is to run the following command:
-
If the Mender client can not connect to the server, typically the first time it tries, and emits messages like the following to syslog at the device:
Most commonly this is caused by incorrect time setting on the device which runs the Mender client. Check this by running date on the device, and make sure it is correct. To determine the status of your time synchronization, execute the following: