Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt D-Bus



  • Hi,

    It may not relates directly to qt.
    I have created simple d-bus application it works fine on desktop, but when I try to run it in embedded linux it says.
    "Not connected to D-Bus server"

    I am new to d-bus and I don't even know what to begin from to start to debug it. Maybe it possible to output some additional information.

    Regards,
    Daniil


  • Moderators

    Is a dbus daemon running on the embedded system?



  • Yes.

    I noticed one thing, on my desktop I see dbus-daemon and dbus-launch.
    But on embedded system only dbus-daemon.

    I don't know is it ok or not. If I run dbus-launch another dbus-daemon appears.



  • Hi
    I have the same problem when running from embedded.
    I put libdbus-1.so, libQtDBus.so.4, libQtXml.so.4, libexpat.so.1 along with a test executable below.

    The following is the test code for checking DBus Connection.

    #include <QtCore>
    #include <QtDBus>

    int main( int argc, char *argv[] )
    {
    QCoreApplication app(argc, argv);

    QDBusConnection bus = QDBusConnection::sessionBus();
    
    if (!QDBusConnection::sessionBus().isConnected()) {
        qDebug() << "DBUS Connection Fail";
        return 1;
    }
    QStringList serviceNames = bus.interface()->registeredServiceNames();
    qDebug() << serviceNames;
    
    return app.exec();
    

    }

    In addition I set /opt/arm/dbus/lib to the LD_LIBRARY_PATH.

    Does anyone know how to solve this problem regarding
    checking sessionBus?


Log in to reply