[SOLVED] Deploying to a headless Raspberry Pi



  • Hi,

    I successfully compiled Qt5 and I can deploy a simple program to the RPi : Qt Creator uploads the executable to the RPi and runs it. The widget shows up full-screen on a HDMI attached monitor. So far, so good.

    2 questions :

    I'd like to run my app on the RPi and display it on my desktop. How do I do that ?

    How do I run my app, not full-screen ? i.e. like a normal X11 program ?

    Thanks.



  • It's simple, first and second resolve with the same answer. Build your app as desktop application on a Linux Machine. So you can test it on desktop and the executable is ready for X11 if you mean X11 = Linux Machine with desktop like KDE or Gnome or Xfce you named :)



  • Yeah, that's what I'm doing right now, But that only works as long as your app is not hardware dependent...

    Also, my ultimate goal, in production mode, is to run the RPi without a monitor and connect via VNC from time to time to check it.



  • i don't know what you mean with hardware dependent? Install any lightweight desktop, remove all unused programs and install the vnc server. Start your program with autostart you are done. The hard way, start your own X11 session and start your program and the vnc server.



  • Well, perhaps I misunderstood your previous message. If so, I'm sorry.

    I can compile and test on my laptop. I can cross-compile and run on the RPi, but I can only see the widget full-screen on a HDMI monitor, whether I typed "startx" or not. As a consequence, I can't see my app via VNC, which I configured successfully.

    Before I compiled, I used the following config. Could it be because of the -opengl option ?

    @
    configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/USERNAME/opt/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /mnt/rpi -opensource -confirm-license -optimized-qmake -release -make libs -prefix /usr/local/qt5pi -no-pch -qt-xcb
    @

    And the config.summary file contents :
    @
    Configure summary

    Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
    Building for: devices/linux-rasp-pi-g++ (arm, CPU features:)
    Platform notes:

            - Also available for Linux: linux-kcc linux-icc linux-cxx
    

    Build options:
    Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl eglfs evdev eventfd freetype full-config getaddrinfo getifaddrs iconv inotify ipv6ifname large-config largefile linuxfb medium-config minimal-config mremap nis no-harfbuzz opengl opengles2 pcre png posix_fallocate qpa qpa reduce_exports release rpath shared small-config system-zlib xcb xcb-plugin xcb-qt xkbcommon-qt xlib
    Build parts ............ libs
    Mode ................... release
    Using C++11 ............ yes
    Using PCH .............. no
    Target compiler supports:
    iWMMXt/Neon .......... no/auto

    Qt modules and options:
    Qt D-Bus ............... no
    Qt Concurrent .......... yes
    Qt GUI ................. yes
    Qt Widgets ............. yes
    Large File ............. yes
    QML debugging .......... yes
    Use system proxies ..... no

    Support enabled for:
    Accessibility .......... yes
    ALSA ................... no
    CUPS ................... no
    Evdev .................. yes
    FontConfig ............. no
    FreeType ............... yes (bundled copy)
    Glib ................... no
    GTK theme .............. no
    HarfBuzz ............... no
    Iconv .................. yes
    ICU .................... no
    Image formats:
    GIF .................. yes (plugin, using bundled copy)
    JPEG ................. yes (plugin, using bundled copy)
    PNG .................. yes (in QtGui, using bundled copy)
    journald ............... no
    mtdev .................. no
    Networking:
    getaddrinfo .......... yes
    getifaddrs ........... yes
    IPv6 ifname .......... yes
    OpenSSL .............. no
    NIS .................... yes
    OpenGL / OpenVG:
    EGL .................. yes
    OpenGL ............... yes (OpenGL ES 2.x)
    OpenVG ............... no
    PCRE ................... yes (bundled copy)
    pkg-config ............. yes
    PulseAudio ............. no
    QPA backends:
    DirectFB ............. no
    EGLFS ................ yes
    KMS .................. no
    LinuxFB .............. yes
    XCB .................. yes (bundled copy)
    EGL on X ........... no
    GLX ................ no
    MIT-SHM ............ yes
    Xcb-Xlib ........... no
    Xcursor ............ yes (loaded at runtime)
    Xfixes ............. yes (loaded at runtime)
    Xi ................. yes (loaded at runtime)
    Xi2 ................ no
    Xinerama ........... yes (loaded at runtime)
    Xrandr ............. yes (loaded at runtime)
    Xrender ............ no
    XKB ................ yes
    XShape ............. yes
    XSync .............. yes
    XVideo ............. yes
    Session management ..... yes
    SQL drivers:
    DB2 .................. no
    InterBase ............ no
    MySQL ................ no
    OCI .................. no
    ODBC ................. no
    PostgreSQL ........... no
    SQLite 2 ............. no
    SQLite ............... yes (plugin, using bundled copy)
    TDS .................. no
    udev ................... no
    xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
    zlib ................... yes (system library)

    NOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use
    the bundled version from 3rd party directory.
    NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
    Configure with '-qreal float' to create a build that is binary compatible with 5.1.
    @



  • VNC is designed to remote control a desktop, you have no desktop so nothing happens. An alternative way is ssh x11 forwarding.



  • What do you mean by "have no desktop" ? If I launch startx and the VNC server on the RPi, I can connect with a VNC client, and I can see the default Raspian LXDE desktop.

    Do you mean "ssh -X pi@xxx.xxx.xxx.xxx" ? It doesn't work either. It shows up on the HDMI monitor all the same. Doesn't work either if the monitor is physically disconnected.



    1. locally on raspi in X:
      @./program -platform xcb@


  • Excellent, it works ! Thanks a lot.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.