0

I wrote a pyqt5 app that uses QQmlApplicationEngine to load a qml file for the GUI. Now everything runs well on my PC and also on Raspberry Pi4b, but when I am trying to run it on Pi Zero W, it loads the GUI and then partially or fully goes black.

I can use ssh and also checked the task manager to see whether it's throttling the pi or not. But it does not look like an issue. and everything else works.

I am running the official 32-bit pi os.

I get this kind of error on the terminal when running the app. But it also appears on rpi 4.

qt.qpa.xcb: QXcbConnection: XCB error: 148 (Unknown), sequence: 191, resource id: 0, major code: 140 (Unknown), minor code: 20
4
  • what research have you done?
    – jsotola
    Commented Oct 2, 2023 at 22:18
  • stackoverflow.com/questions/45138522/…
    – jsotola
    Commented Oct 2, 2023 at 22:19
  • @jsotola Thank you for your comment. I read through the answer there. The solution was to use static linking while cross-compiling for qt with C++. But I think static linking ain't an option for pyqt5. The cross-compiling setup does not work for pi zero because it is arm v6 (I guess). Commented Oct 3, 2023 at 3:29
  • After reading the article, my guess is this "XCB error" is the real issue. Another correction is that this does not appear on RPI4. Last time what I did after installing the fresh OS, the apt update and upgrade commands were executed on RPI4 and then I plugged the SD card into the PI zero. This time i will do these on PI zero directly. I will update on the issue. Commented Oct 3, 2023 at 3:31

1 Answer 1

0

For anyone facing this issue in the future:

Just hook up a HDMI display, it solves the problem instantly! I was working headless and the error only comes with the headless mode.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.