Skip to content

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

  1. 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").
  2. Be sure to have meta-mender-core in your conf/bblayers.conf.

  3. 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.

  4. 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.

Configure at runtime

This is an alternative method to configure mender on your device when the configuration was not done at build time.

  1. Start your device.

  2. Connect to your the device (either serial console or SSH).

  3. Edit the file: /var/lib/mender/mender.conf and set ServerURL and TenantToken:

    /var/lib/mender/mender.conf
    {
        "ServerURL": "https://eu.hosted.mender.io",
        "TenantToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZ...zjSH3p_"
    }
    

    • ServerURL: same as MENDER_SERVER_URL
    • TenantToken: same as MENDER_TENANT_TOKEN
  4. Restart the Mender daemon: systemctl restart mender-client.

  5. 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:

  1. Create a deployment for your device, and upload the Mender artifact generated earlier by the build.
  2. Restart the Mender daemon: systemctl restart mender-client . (this is to avoid waiting for 30 minutes which is the default UpdatePollIntervalSeconds).

  3. 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.

  4. 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.
  5. 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.

  6. Check update status using updatectl status. Example:

    $ updatectl status
    state               normal
    partitions-active   /dev/mmcblk0p3 /dev/mmcblk0p5 /dev/mmcblk0p7
    partitions-inactive /dev/mmcblk0p4 /dev/mmcblk0p6 /dev/mmcblk0p8
    

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:

    journalctl -u mender-client
    
  • 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:

    ... level=error msg="authorize failed: transient error: authorization request failed: failed to execute authorization request"
    
    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:

    timedatectl status