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. See here for more details.

Create a directory for downloading image:

mkdir ~/redpeskimage
cd ~/redpeskimage


wget -r -nd -nc --no-parent -A "redpesk*smack*" ''


wget -r -nd -nc --no-parent -A "redpesk*smack*" ''

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.


For more details see here.

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

xz -d --verbose redpesk*.raw.xz

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}


For more details see here.

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 dd if=redpesk*.raw of=${DEVICE} bs=4M status=progress

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

[root@localhost ~] 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.

[root@localhost ~] 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
# Need jq
curl -H "Content-Type: application/json" http://localhost:${PORT}/api/helloworld/ping | jq
  • Websocket request
afb-client -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 your service

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

And to remove your widget, simply run

[root@localhost ~] dnf remove helloworld-binding