Creating update artifact for Raspberry pi

Hi,

I’m currently testing the workflow for my first iOT devices that is using a 4G connection. I have a raspbian image where I installed al the needed packages.

I did the following:

  • installed self hosted mender on Amazon AWS EC2 server with 2gb memory and 4gb swap 30 gb storage with success

  • dd copied the image

  • used docker-mender-convert with following settings

    ./docker-mender-convert from-raw-disk-image
    –storage-total-size-mb 29000
    –raw-disk-image $RAW_DISK_IMAGE
    –mender-disk-image $MENDER_DISK_IMAGE
    –device-type $DEVICE_TYPE
    –artifact-name ARTIFACT_NAME \ --bootloader-toolchain arm-buildroot-linux-gnueabihf \ --server-cert (pwd)/server.crt
    –server-url “https://url-of-server

I added storage-total-size with max of sdcard.

I got an working sdimage I wanted to test by copying the .mender artifact to the server. The file is 1.31 gigabyte.

I got the device registered in the Mender dashboard. So that’s working.

I tried again with a .mender file of less than 100 mb with the same issue. Checked if there is enough space on the server.

After that I want to make an update of the mender sdimage. I changed some code on the mender sdimage and used dd to make a copy of the sd card again. So it’s not the golden image, but the mender sdimage created by mender-convert.

I have a few questions:

  • Should I use the mender sdimg or the original image for update?
  • How does Mender update the rpi? The file is 1.31 gb. When I create a new one with mender convert, I would expect that the file size would be the same. I think 1.31gb is way to large to send over 4G connection to the devices. The difference between prev image and updated one is max a few megabytes.

Hello @minusplusminus and welcome to the Mender community.

  • Should I use the mender sdimg or the original image for update?

The idea of the workflow is to do any modifications on the original image, then run it trough mender-convert to get an .mender file with the changes you made and use that to deploy to rest of your devices.

How does Mender update the rpi?

The default update method in Mender is to deploy they full image, regardless of what has changed. There are many benefits of doing this, but as you already pointed there is one drawback and it might not always be suitable to do this over a mobile connection.

You can find some additional information here,

https://docs.mender.io/2.1/architecture/overview

There are a couple ways to workaround this:

  • You can utilize Update Modules to deploy smaller change sets
  • Utilize a binary delta feature (not yet released), this allows you to only send the binary difference between two images