Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problems with QDBus on an embedded Linux device - registerService returns false.
Forum Updated to NodeBB v4.3 + New Features

Problems with QDBus on an embedded Linux device - registerService returns false.

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 1 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    darenT
    wrote on last edited by
    #1

    Greetings,

    I'm new to DBus, but I'm trying to use it in two Qt applications on an embedded device. I have a very simple interface that consists of one slot:

    @QString SendMessage(const QString &cmd);@

    The server application is then using the following code to start the connection:

    @ DbusService* dBus = new DbusService;
    new interfaceIfAdaptor(dBus);

    QDBusConnection connection = QDBusConnection::sessionBus();
    bool ret = connection.registerService("com.domain.project.interface");
    qDebug() << "returns" << ret;
    ret = connection.registerObject("/", dBus);
    qDebug() << "returns" << ret;@
    

    This works fine on the desktop. In the embedded system, the connection.registerService function returns false. As a result, any messages to the server fail. I'm not sure why. Running 'ps' tells me that [dbus-daemon --system] and [dbus-daemon --sesson] are both running.

    Finally, I have noticed that Qt Creator complains when I debug the application. I see the following warning messages:

    bq. Could not load shared library symbols for 10 libraries, e.g. /opt/arm/lib/libQtDBus.so.4.
    Use the "info sharedlibrary" command to see the complete listing.
    Do you need "set solib-search-path" or "set sysroot"?Could not load shared library symbols for /usr/lib/libdbus-1.so.3.
    Do you need "set solib-search-path" or "set sysroot"?

    If additional information is required to debug this problem, please let me know. I'll be happy to update my post. Thanks!

    1 Reply Last reply
    0
    • D Offline
      D Offline
      darenT
      wrote on last edited by
      #2

      It turns out the session bus was not getting started on the device. I enabled it, but then I ran into the problem of the address not getting propagated to the environment variables. I can manually set it in a terminal, but I'm not sure how to do the same in Qt Creator.

      Anyway, rather than spend more time figuring out the issues with the session bus, I switched to using the system bus. I just had to change the /etc/dbus-1/system.conf file to allow anyone to talk to the system bus and my applications work on the embedded device. I know that's probably not the long term solution, but it works for now.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved