Application deployment

Now that your application have been generated thanks to redpesk CI or the rp-cli, let’s see how to install it on a board. Since redpesk support cross-compilation, we can use either a x86_64 or aarch64 board to get your package installed in.

During this part, two cases will be studied: Emulated x86_64 board: qemu-x86_64 and Real aarch64 board: m3ulcb.

Getting the redpesk image

According to your board architecture, download the image


export RP_IMAGE=RedPesk-minimal-8_II-1.x86_64.raw.xz


export RP_IMAGE=RedPesk-minimal-8_II-1.aarch64.raw.xz
The image you have just downloaded has the following configuration:

Notes: Login: root / password: root

Running a redpesk image

Here we are, you are about to run the redpesk image. This section will deal with both types of image: x86_64 & aarch64.


First of all unzip the archive you have just downloaded to retrieve the redpesk image.

xz -d --verbose ${RP_IMAGE}

Then download the qemu-kvm package. For example, Ubuntu user can run:

sudo apt install qemu-kvm

Then, simply run the redpesk image by doing:

export TCP_PORT=3333
qemu-system-x86_64 \
        -hda ${PATH_TO_REDPESK_IMAGE} \
        -enable-kvm \
        -bios /usr/share/qemu/OVMF.fd \
        -machine q35 \
        -m 2048 \
        -cpu kvm64 \
        -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt \
        -net nic \
        -net user,hostfwd=tcp::${TCP_PORT}-:22 \
        -nographic \

Notes: You may have noticed that in the previous command we allow the user to connect to the emulated board by establishing a ssh connection through the port ${TCP_PORT}. You can access your emulated board with the following command:

ssh root@localhost -p ${TCP_PORT}


sudo apt-get install bmap-tools

Then insert your SDCard and retrieve its device name:

lsblk -dli -o NAME,TYPE,HOTPLUG | grep "disk.*1$"

Then export it into the environment variable DEVICE

export DEVICE="/dev/sdb"

Notes: If the SDCard is mounted, umount it.

sudo unmount ${DEVICE}

Write the image onto the SDCard.

sudo bmaptool copy ${RP_IMAGE} ${DEVICE}

Since then, your SDCard is bootable. You can access it by using the ssh command:

export YOUR_BOARD_IP=192.168.1.X
ssh root@${YOUR_BOARD_IP}

Installing your package

There are no difference in the command related to your package installation, neither in a x86_64, nor in an aarch64 redpesk distribution. Once you get in your redpesk image, you can proceed to the package installation.

As a reminder, the helloworld-binding gathered two sub-package the helloworld-binding and the helloworld-binding-test. To install the widget sub-package, you can simply run

dnf install helloworld-binding

If you correctly set your project name and version as explained in the Build part, you should have the following output during the package installation

[root@localhost ~] dnf install helloworld-binding
NOTICE: -- Install redpesk widget from /var/local/lib/afm/applications/helloworld-binding --

Start the service by running:

[root@localhost ~] afm-util start helloworld-binding

This implies that your widget has been installed correctly. Check if your widget id is helloworld-binding.

afm-util list --all
    "description":"Provide an Helloworld Binding",
    "author":"Iot-Team <>",

You can then start the service by running:

[root@localhost ~] afm-util start helloworld-binding

For example, you can access to its verb ping which belong to its api helloworld thanks to a HTTP or websocket request sent to the port $PORT such as follow

  • HTTP request
curl -H "Content-Type: application/json" http://localhost:${PORT}/api/helloworld/ping | jq
  • Websocket request
afb-client-demo -H ws://localhost:${PORT}/api?token=x\&uuid=magic helloworld ping

For both requests you should get the following answer from the first request

ON-REPLY 1:helloworld/ping: OK
    "info":"Ping count = 0"

Once again, if you correctly set your project name and version as explained in the Build part, to correctly stop and remove your widget, simply run

dnf remove helloworld-binding

You should have the following output

[root@localhost ~] dnf remove helloworld-binding-widget
INFO:  kill helloworld-binding
INFO:  uninstall helloworld-binding