/ mender

Trying out hosted mender.io

I was introduced to the idea of over-the-air (OTA) updates when Particle Industries (then Spark) ran their kickstarter for WiFi-connected microcontroller.

spark-wifi

It soon became a must-have as I am spoiled with the convenience of updating application code at the comfort of my desk!

However, things are not quite the same for embedded linux. There is only one that I am aware of is https://resin.io who started off with application upgrading (ie. upgrading docker images). Still, not a full OS update until they recently made it happen!

You can read more about how it is done here: https://docs.resin.io/updates/update-process/

Recently, I came to know about https://mender.io. Very cool from the initial looks but the documentation on getting the server running etc was kind of daunting with limited tinkering time. Luckily, they beta-ed the server side of things and I signed up for an account. :)

  1. Getting started

You will receive an email with some guide on getting your virtual or physical devices started. I have a Raspberry Pi 3 handy so why not!

  1. Burning the OS to the microSD card

Nothing too fancy here. The usual dd-ing to the microSD and done.

$ gunzip mender-raspberrypi3_master.sdimg.gz
$ diskutil list
	/dev/disk2 (internal, physical):
	   #:                       TYPE NAME                    SIZE       IDENTIFIER
	   0:     FDisk_partition_scheme                        *15.9 GB    disk2
	   1:                      Linux                         104.9 MB   disk2s1
	   2:                      Linux                         2.1 GB     disk2s2
	   3:                      Linux                         2.1 GB     disk2s3
	   4:                      Linux                         2.1 GB     disk2s5
$ sudo dd if=mender-raspberrypi3_master.sdimg of=/dev/rdisk2 bs=1M && dd
$ diskutil unmountDisk /dev/disk2
Unmount of all volumes on disk2 was successful
$ sudo dd if=mender-raspberrypi3_master.sdimg of=/dev/rdisk2 bs=1m && sudo sync
388+0 records in
388+0 records out
406847488 bytes transferred in 28.284105 secs (14384316 bytes/sec)
KENMBP:mender-test kennethlimcp$ sudo dd if=mender-raspberrypi3_master.sd
  1. Logging in to https://hosted.mender.io

mender-login-page

  1. Authorizing a device

mender-auth-device

You will see the device trying to connect...

mender-device-init

and finally load all the details such as client version and more.

mender-device-info

  1. Uploading an artifact (aka newer image)

You will start of clean...
mender-artifact-tab

Let us upload an artifact provided to us in the download link
mender-artifact-upload

And done!
mender-artifacts-tab

  1. Doing a deployment

mender-deployment-tab

You can selectively deploy to different groups of devices but I only have one so All devices
mender-deployment-create

The device will start downloading but there is some bug where the bar will keep showing 10% without any progress
mender-deployment-downloading

and jump to 80% where the device will reboot
mender-deployment-rebooting

then success!
mender-deployment-success

  1. Checking that the device has the new artifact

In the DEVICES tab, I checked that the device is indeed running the new artifact, release-1_master
mender-updated-release-1

  1. Main dashboard

On the main tab, there will be a summary of the past deployments and those in progress.

Simple and straightforward.

mender-main-tab

  1. Attempts to corrupt the artifact to simulate a fail deployment

I tried to tweak some parts of the artifact in hopes that mender does not find out during the uploading process.
mender-image-corrupting

However, it seems like there are some checksum and integrity verification going on when artifacts are uploaded.

mender-artifact-corrupted-tab

  1. Some information about the microSD
root@raspberrypi3:~# fdisk -l
Device         Boot  Start    End Sectors  Size Id Type
/dev/mmcblk0p1 *     24576 106495   81920   40M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      106496 319487  212992  104M 83 Linux
/dev/mmcblk0p3      319488 532479  212992  104M 83 Linux
/dev/mmcblk0p4      532480 794623  262144  128M 83 Linux

root@raspberrypi3:~# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        97M   91M     0 100% /
devtmpfs        460M     0  460M   0% /dev
tmpfs           464M     0  464M   0% /dev/shm
tmpfs           464M   18M  447M   4% /run
tmpfs           464M     0  464M   0% /sys/fs/cgroup
tmpfs           464M     0  464M   0% /tmp
tmpfs           464M  224K  464M   1% /var/volatile
/dev/mmcblk0p1   40M   13M   28M  32% /uboot
/dev/mmcblk0p4  120M  5.3M  106M   5% /data

Conclusion

It only took me a couple of minutes to download and burn the image to get going. Most of the time is spent on the Dashboard and having it hosted (ie. up and running with zero effort) reduces the barrier to tinker.

Although I have not tried creating my own artifacts and running applications on the base image provided, the overall experience is great for something tagged as beta!

I will be sending feedback to mender and propose to have an artifact that will simulate a failed deployment to cover the case that demonstrates the failover mechanism.

Looking forward to see what the team at mender is pipelining and maybe do a couple of personal projects with their platform.

ken.

Trying out hosted mender.io
Share this

Subscribe to kennethlimcp