cancel
Showing results for 
Search instead for 
Did you mean: 

PyQt Gui Application

alzj
Associate II

Hello ST team,

our company is evaluating the STM32MP135F-DK to develop a new interface for our displays. This board was given to us by ST at the embedded world exhibition in Nuremberg, Germany. I am not familiar with MPUs and Yocto. I am having a lot of problems getting a simple PyQt5 GUI application (see mySimpleApp.txt) running on the board. I was able to successfully build the SDK and start a simple GTK application using the starter package.

These are some of the steps I took:

  • First, I used the starter package and installed there everything that i needed to run this application:
    • apt install python3-pyqt5 qtwayland
    • copied my application to /home/weston
    • run:  su -l weston -c "env QT_QPA_PLATFORM=wayland-egl python3 /home/weston/mySimpleApp.py"
      These is the Error i get: 
      [ 1] Failed to open device: No such file or directory, Try again...
      [ 2] Failed to open device: No such file or directory, Try again...
      [ 3] Failed to open device: No such file or directory, Try again...
      [ 4] Failed to open device: No such file or directory, Try again...
      [ 5] _OpenDevice(1111): FATAL: Failed to open device, errno=No such file or directory.
      [ 6] Failed to open device: No such file or directory, Try again...
      [ 7] Failed to open device: No such file or directory, Try again...
      [ 8] Failed to open device: No such file or directory, Try again...
      [ 9] Failed to open device: No such file or directory, Try again...
      [ 10] _OpenDevice(1111): FATAL: Failed to open device, errno=No such file or directory.
    • Then I run:
      • root@stm32mp1:/home/weston# env QT_QPA_PLATFORM=wayland-egl 
      • root@stm32mp1:/home/weston# python3 mySimpleApp.py
      • Error:

        qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
        This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

        Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland.

        Aborted (core dumped)

After not having success with the starter package I started working with the distribution package and built a new distroimage to set up Qt (st-example-image-qt or st-example-image-qtwayland).I did both way with and without accepting the EULA but everything I did gives me the same errors as above. I also removed the repo and reinstalled everything, but I still did not have success.

I would greatly appreciate your assistance in resolving this issue. I would also be open to arranging a meeting with you to discuss possible solutions. We are currently evaluating the suitability of ST (MCUs) for our upcoming projects and it would be beneficial if we could exclusively use ST for our products.

 

Thank you for your help and best regards
A. Lazaj

1 ACCEPTED SOLUTION

Accepted Solutions
PPAGE.13
ST Employee

Hello Arjan,

 

I have made the full scenario again with the Distribution package on MP135 (v5.0.3):

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_OpenSTLinux_release_note_-_v5.0.0#Minor_release_updates

 

1- python3-pyqt5 compilation and add it to image

Rather than installing "python3-pyqt5" Debian package through apt-get, I added the recipe in meta-qt5 layer:

I get files from

https://github.com/STMicroelectronics/meta-st-pkgrepo-updates/tree/openstlinux-ecosystem-5.0.0/recipes-python/pyqt5
and copied to
layers/meta-qt5/recipes-python/pyqt5

(This recipe comes from official meta-qt5 layer, but we added patches for compilation issue such as 

error: #error "LONG_BIT definition appears wrong for platform)

 

And I added " python3-pyqt5" to my image in conf/local.conf:

IMAGE_INSTALL:append = " python3-pyqt5"

 

Then build the full image:

bitbake st-example-image-qtwayland

 

 

1-Bis  python3-pyqt5 Debain installation

I think installing Debian package from our repo should work in the same way with a qtwayland image (bitbake st-example-image-qtwayland)

 apt-get update

 apt-get install python3-pyqt5

 

 

2- For execution, you have two possibilities:

 

A- with Wayland composition if you need windowing. This is the default when you boot the board (QT_QPA_PLATFORM=wayland)

As root user, you can directly launch:

python3 SimpleApp.py

 

B- use EGLFS for a full screen application. You will get better performances. In that case you must stop the following Weston service before:

systemctl stop weston-graphical-session.service

export QT_QPA_PLATFORM=eglfs

python3 SimpleApp.py

 

Hope this will solve your issue.

Do not hesitate to contact me again if you need,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

View solution in original post

5 REPLIES 5
PPAGE.13
ST Employee

Hello Arjan,

 

I think we met at EW. Let me come back to you directly beginning of next week. I need to check a few thinks before.

I will update this POST as well for Community regarding  PyQt5 and Qt platform support on MP135.

 

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
PPAGE.13
ST Employee

Hello Arjan,

 

I have made the full scenario again with the Distribution package on MP135 (v5.0.3):

https://wiki.st.com/stm32mpu/wiki/STM32_MPU_OpenSTLinux_release_note_-_v5.0.0#Minor_release_updates

 

1- python3-pyqt5 compilation and add it to image

Rather than installing "python3-pyqt5" Debian package through apt-get, I added the recipe in meta-qt5 layer:

I get files from

https://github.com/STMicroelectronics/meta-st-pkgrepo-updates/tree/openstlinux-ecosystem-5.0.0/recipes-python/pyqt5
and copied to
layers/meta-qt5/recipes-python/pyqt5

(This recipe comes from official meta-qt5 layer, but we added patches for compilation issue such as 

error: #error "LONG_BIT definition appears wrong for platform)

 

And I added " python3-pyqt5" to my image in conf/local.conf:

IMAGE_INSTALL:append = " python3-pyqt5"

 

Then build the full image:

bitbake st-example-image-qtwayland

 

 

1-Bis  python3-pyqt5 Debain installation

I think installing Debian package from our repo should work in the same way with a qtwayland image (bitbake st-example-image-qtwayland)

 apt-get update

 apt-get install python3-pyqt5

 

 

2- For execution, you have two possibilities:

 

A- with Wayland composition if you need windowing. This is the default when you boot the board (QT_QPA_PLATFORM=wayland)

As root user, you can directly launch:

python3 SimpleApp.py

 

B- use EGLFS for a full screen application. You will get better performances. In that case you must stop the following Weston service before:

systemctl stop weston-graphical-session.service

export QT_QPA_PLATFORM=eglfs

python3 SimpleApp.py

 

Hope this will solve your issue.

Do not hesitate to contact me again if you need,

Philippe.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hello Philippe,

thank you for your reply.

About the installation of the package from the repo with

apt-get update
apt-get install python3-pyqt5

I was only able to download PyQt5 when using the starter package. But I was not able to start the application, as I mentioned in the ticket above.

Using the built image from bitbake st-example-image-qtwayland, I could not get the python3-pyqt5 package from the apt repository. There were some missing dependencies that I couldn't install from the repository. Logs from weston-terminal:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
qtbase : Depends: libegl-gcnano (>= 6.4.13+20230517) but it is not installable
Depends: libgles2-gcnano (>= 6.4.13+20230517) but it is not installable
Recommends: qtbase-plugins but it is not going to be installed
Recommends: qtbase-qmlplugins but it is not going to be installed
qtwebkit : Depends: libegl-gcnano (>= 6.4.13+20230517) but it is not installable
Depends: libgles2-gcnano (>= 6.4.13+20230517) but it is not installable
Recommends: qtwebkit-plugins but it is not going to be installed
Recommends: qtwebkit-qmlplugins but it is not going to be installed
E: Unable to correct problems, you have held broken packages

I don't know why these dependencies are missing, because when I enabled envsetup all packages were installed correctly (Check OK: all required packages are installed on host.). Can you tell me anything about this problem? Is this issue related to Ecosystem v5.0.0? I got the layers using this "repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-6.1-yocto-mickledore-mp1-v23.06.21" and I see that there is a new release version openstlinux mp1-v24.03.13 which I didn't see while init the repo. 

 

As for your instructions. I removed my distribution package and did everything from scratch.

  1. repo init -u https://github.com/STMicroelectronics/oe-manifest -b refs/tags/openstlinux-6.1-yocto-mickledore-mp1-v24.03.13 (v5.0.3)
  2. repo sync
  3. got pyqt5 files from https://github.com/STMicroelectronics/meta-st-pkgrepo-updates/tree/openstlinux-ecosystem-5.0.0/recipes-python/pyqt5 and copied them to layers/meta-qt5/recipes-python/pyqt5
  4. run DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh to get the conf/local.conf file
    All packages installed: “Check OK: all required packages are installed on host.”
  5. added IMAGE_INSTALL:append = " python3-pyqt5" to my image in build-openstlinuxweston-stm32mp1/conf/local.conf
  6. bitbake st-example-image-qtwaylandalzj_0-1716458825553.png

I have tried many times to build the image, but I can't. I get some errors while building:

ERROR: rust-native-1.68.2-r0 do_install: ExecutionError('/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1/tmp-glibc/work/x86_64-linux/rust-
native/1.68.2-r0/temp/run.do_install.2586093', 1, None, None)

ERROR: Logfile of failure stored in: /home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1/tmp-glibc/work/x86_64-linux/rust-native/1.68.2-r0/
temp/log.do_install.2586093

ERROR: Task (virtual:native:/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/layers/openembedded-core/meta/recipes-devtools/rust/rust_1.68.2.bb:do_install) failed with exit
code '1'

Summary: 1 task failed:
virtual:native:/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/layers/openembedded-core/meta/recipes-devtools/rust/rust_1.68.2.bb:do_install
Summary: There was 1 ERROR message, returning a non-zero exit code.

 

I've tried various ways, with and without accepting the EULA, but I couldn't get rid of this issue. Is this a known issue?

Best regards,
Arjan

Hello Philippe,

thank you for your reply.

About the installation of the package from the repo with

apt-get update
apt-get install python3-pyqt5

I was only able to download PyQt5 when using the starter package. But I was not able to start the application, as I mentioned in the ticket above.

Using the built image from bitbake st-example-image-qtwayland, I could not get the python3-pyqt5 package from the apt repository. There were some missing dependencies that I couldn't install from the repository. Logs from weston-terminal:

Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
qtbase : Depends: libegl-gcnano (>= 6.4.13+20230517) but it is not installable
Depends: libgles2-gcnano (>= 6.4.13+20230517) but it is not installable
Recommends: qtbase-plugins but it is not going to be installed
Recommends: qtbase-qmlplugins but it is not going to be installed
qtwebkit : Depends: libegl-gcnano (>= 6.4.13+20230517) but it is not installable
Depends: libgles2-gcnano (>= 6.4.13+20230517) but it is not installable
Recommends: qtwebkit-plugins but it is not going to be installed
Recommends: qtwebkit-qmlplugins but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

 

I don't know why these dependencies are missing, because when I enabled envsetup all packages were installed correctly (Check OK: all required packages are installed on host.). Can you tell me anything about this problem? Is this issue related to Ecosystem v5.0.0? I got the layers using this "repo init -u https://github.com/STMicroelectronics/oe-manifest.git -b refs/tags/openstlinux-6.1-yocto-mickledore-mp1-v23.06.21" and I see that there is a new release version openstlinux mp1-v24.03.13 which I didn't see while init the repo.


As for your instructions. I removed my distribution package and did everything from scratch.

  1. repo init -u https://github.com/STMicroelectronics/oe-manifest -b refs/tags/openstlinux-6.1-yocto-mickledore-mp1-v24.03.13 (v5.0.3)
  2. repo sync
  3. got pyqt5 files from https://github.com/STMicroelectronics/meta-st-pkgrepo-updates/tree/openstlinux-ecosystem-5.0.0/recipes-python/pyqt5
    and copied them to layers/meta-qt5/recipes-python/pyqt5
  4. run DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh to get the conf/local.conf file

    All packages installed: “Check OK: all required packages are installed on host.”
  5. added IMAGE_INSTALL:append = " python3-pyqt5" to my image in build-openstlinuxweston-stm32mp1/conf/local.conf
  6. bitbake st-example-image-qtwayland
Build Configuration:
BB_VERSION = "2.4.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-22.04"
TARGET_SYS = "arm-ostl-linux-gnueabi"
MACHINE = "stm32mp1"
DISTRO = "openstlinux-weston"
DISTRO_VERSION = "4.2.2-snapshot-20240522"
TUNE_FEATURES = "arm vfp cortexa7 neon vfpv4 thumb callconvention-hard"
TARGET_FPU = "hard"
DISTRO_CODENAME = "mickledore"
ACCEPT_EULA_stm32mp1 = "0"S
GCCVERSION = "12.%"
PREFERRED_PROVIDER_virtual/kernel = "linux-stm32mp"
meta-python
meta-oe
meta-gnome
meta-initramfs
meta-multimedia
meta-networking
meta-webserver
meta-filesystems
meta-perl = "HEAD:03fd1d368ac19793b3e4c35159ba2ce802247e4d"
meta-st-stm32mp = "HEAD:5e5b99ba054276d10b4afec2b80962de3455b0a1"
meta-qt5 = "HEAD:cf6ffcbad5275a3428f6046468a0c9d572e813d1"
meta-st-openstlinux = "HEAD:6526808593a93f5da31dbb05dd5b0bc3d27d4d2c"
meta = "HEAD:3ef283e02b0b91daf64c3a589e1f6bb68d4f5aa1"

I have tried many times to build the image, but I can't. I get some errors while building (generated log file, see attached file):

ERROR: rust-native-1.68.2-r0 do_install: ExecutionError('/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1/tmp-glibc/work/x86_64-linux/rust-
native/1.68.2-r0/temp/run.do_install.2586093', 1, None, None)

ERROR: Logfile of failure stored in: /home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/build-openstlinuxweston-stm32mp1/tmp-glibc/work/x86_64-linux/rust-native/1.68.2-r0/
temp/log.do_install.2586093

ERROR: Task (virtual:native:/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/layers/openembedded-core/meta/recipes-devtools/rust/rust_1.68.2.bb:do_install) failed with exit
code '1'

Summary: 1 task failed:
virtual:native:/home/alazaj/STM32MPU_workspace/STM32MP1-Ecosystem-v5.0.0/Distribution-Package/layers/openembedded-core/meta/recipes-devtools/rust/rust_1.68.2.bb:do_install
Summary: There was 1 ERROR message, returning a non-zero exit code.

 

I've tried various ways, with and without accepting the EULA, but I couldn't get rid of this issue. Is this a known issue?

Best regards,
Arjan

alzj
Associate II

[UPDATE]

After looking at the log file again, I was finally able to see the reason why rust-native failed.

warning: gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
warning: compilation terminated.

It would be better if thouse lines started with an error.

Anyway, I had several gcc compilers installed on my system. I simply removed some of them and ran

bitbake -c cleanall rust-native
bitbake rust-native

After that I was able to get rid of the errors. I will now build the st-example-image-qtwayland image and see if I can run the PyQt5 application.

[update]
Thank you Philippe for your help. I am now able to run the pyqt5 application. It is important not to accept the EULA when building the image because we cannot start the application if the EULA is accepted.

Best regards,
Arjan