Important: Please read the Qt Code of Conduct -

Running Qt application on headless Rpi

  • I have followed the instructions listed here: to install qt on my rpi. Everything worked fine with the compilation.

    I then tried to run the example program raspberrytest listed at the end of the blog, but I received the following error on my rpi:

    QML debugging is enabled. Only use this in a safe environment.
    QSocketNotifier: Can only be used with threads started with QThread
    EGLFS: Unable to query physical screen size, defaulting to 100 dpi.
    EGLFS: To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

    I am not sure if this error is because I have no native display for my rpi and that it's running headless via VNC. I tried running a simple hello world console application and it generated the correct output.

    Any clues?

  • Lifetime Qt Champion

    raspberrytest is a GUI application, that's probably the reason for the messages you see. It should work if you start the X server.

  • @jsulm I'm using VNC to log into the rpi and then running from the console window. Isn't that sufficient.

  • Lifetime Qt Champion

    @Gagan-Mahan Actually these messages do not sound like errors, more like warnings. What is not clear from your original post: what happens after these messages are printed? Does the application terminate?

  • @jsulm I don't see an output. It just stays at the command prompt. I guess I should be seeing a green screen. I installed a touch screen, but now I get the following error:

    ./raspberrytest: error while loading shared libraries: cannot open shared object file: No such file or directory

  • Lifetime Qt Champion

    You need the lib. On Ubuntu/Debian you can find out which package provides it using apt-file.

  • @jsulm Thanks for your help on this so far. I installed the package, but now i've run into another problem, when I run the application I get the following error:

    **QML debugging is enabled. Only use this in a safe environment.
    This application failed to start because it could not find or load the Qt platform plugin "eglfs".

    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen.

    Reinstalling the application may fix this problem.

    Using -platform eglfs didn't help.

    Here is a part output from my configure operation

    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    XCB .................. no

    Do I need to rebuild Qt? Not sure what I need to fix though. Thanks!

  • Lifetime Qt Champion

    Search in the Qt forums, there are discussions about not found platform plugins. Your application is not able to find needed platform plugin. You should read as well.

Log in to reply