4. Installing the Kivy layer in Yoctoο
Before proceeding, make sure you have set up Yocto following the First Steps with Yocto.
4.1. Installing the Layerο
To install the meta-phykivy layer, follow these steps:
Install the BSP with Qt6 demo image (also called
qtphy) by running:
DISTRO=ampliphy-vendor-xwayland MACHINE=phyboard-pollux-imx8mp-3 ./phyLinux init -p imx8mp -r BSP-Yocto-NXP-i.MX8MP-PD22.x.y
You can also only use ./phyLinux init and see all the options for the parameters before choosing one.
If you want more information on how to install your Phytec BSP with phyLinux, you can check the PHYTEC Yocto Reference Manual
Uncomment
ACCEPT_FSL_EULA = "1"in thelocal.conffile.Git clone the meta-phykivy layer in the source folder and add it to your
bblayer.conffile.Build the final image by using the
bitbake phytec-kivydemo-imagecommand after starting bitbake.
Thatβs it, you should then have the exact same image as the one you download during the first tutorial in Installation.
NOTE: If you want to use Wayland insted of XWayland, you need to change the distro and add REQUIRED_DISTRO:remove = "X11" in the bbappend file of Kivy.
4.2. Understanding the Layerο
The files necessary to run Kivy are:
sdl2.bbappendkivy.bbappendPatch for the cameras (
camera_gi.patchandkivy_opencv.patch)
All the other files are optional. Some patch are present to fix some warnings in Kivy while other are added for the demo.
You can choose what to add inside your image in the kivyphy_0.1.bb recipe.
4.3. Kivy Recipe and Minimal Versionο
Kivy uses sdl2 to work, but sdl2 does not work out of the box for this product. To use Wayland instead of X11, you need to add the sdl2.bbappend.
Similarly, the cameras in Kivy do not work as expected on the product, so you need a patch to fix this depending on you provider for the camera (gstreamer or opencv).
For more information about the cameras, you can check Camera with Kivy.
4.4. Disabling Kivy Demoο
To disable the Kivy demo inside the image, add the following line inside the local.conf file:
SYSTEMD_AUTO_ENABLE:kivyphy-service = "disable"
You can also disable the service on the board with:
# to stop the service
systemctl stop kivyphy
# to start the service again
systemctl start kivyphy
#to disable permanently, so it does not start on boot
systemctl disable kivyphy
That way, you can avoid to have the demo each time you boot the board.