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

libqofono Can't get modems for because of error_name=org.freedesktop.DBus.Error.MatchRuleNotFound



  • I am trying to use libqofono-0.92 (a Qt library developed by Sailfish OS and ported to Ubuntu and Yocto) in an embedded machine in order to retrieve modems from ofono's DBus API. I am looking for people who used it before or encountered the error I'm having. Here's what I have in code from test examples:

    QOfonoManager manager;
    QOfonoModem modem;
    QStringList modems = manager.modems();
    

    The output of modems is null. When QOfonoManager is instantiated, the dbus monitoring output is as follows:

    method call time=1537964753.056662 sender=:1.86 -> destination=org.freedesktop.DBus serial=7 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
       string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.ofono'"
    method call time=1537964753.056723 sender=:1.86 -> destination=org.freedesktop.DBus serial=8 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetNameOwner
       string "org.ofono"
    method return time=1537964753.056776 sender=org.freedesktop.DBus -> destination=:1.86 serial=5 reply_serial=8
       string ":1.62"
    method call time=1537964753.056818 sender=:1.86 -> destination=org.freedesktop.DBus serial=9 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
       string "type='signal',sender='org.ofono',path='/',interface='org.ofono.Manager',member='ModemRemoved'"
    method call time=1537964753.056868 sender=:1.86 -> destination=org.freedesktop.DBus serial=10 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameHasOwner
       string "org.ofono"
    method return time=1537964753.056924 sender=org.freedesktop.DBus -> destination=:1.86 serial=6 reply_serial=10
       boolean true
    method call time=1537964753.056974 sender=:1.86 -> destination=org.ofono serial=11 path=/; interface=org.ofono.Manager; member=GetModems
    method return time=1537964753.057007 sender=:1.62 -> destination=:1.86 serial=95 reply_serial=11
       array [
          struct {
             object path "/hfp/org/bluez/hci0/dev_D8_5F_2A_5B_7B_E6"
             array [
                dict entry(
                   string "Online"
                   variant                   boolean true
                )
                dict entry(
                   string "Powered"
                   variant                   boolean true
                )
                dict entry(
                   string "Lockdown"
                   variant                   boolean false
                )
                dict entry(
                   string "Emergency"
                   variant                   boolean false
                )
                dict entry(
                   string "Serial"
                   variant                   string "D8:5F:2A:5B:7B:E6"
                )
                dict entry(
                   string "Interfaces"
                   variant                   array [
                         string "org.ofono.VoiceCallManager"
                         string "org.ofono.CallVolume"
                         string "org.ofono.Handsfree"
                         string "org.ofono.NetworkRegistration"
                      ]
                )
                dict entry(
                   string "Features"
                   variant                   array [
                         string "net"
                      ]
                )
                dict entry(
                   string "Name"
                   variant                   string "Samsung Galaxy S7"
                )
                dict entry(
                   string "Type"
                   variant                   string "hfp"
                )
             ]
          }
          struct {
             object path "/phonesim"
             array [
                dict entry(
                   string "Online"
                   variant                   boolean false
                )
                dict entry(
                   string "Powered"
                   variant                   boolean false
                )
                dict entry(
                   string "Lockdown"
                   variant                   boolean false
                )
                dict entry(
                   string "Emergency"
                   variant                   boolean false
                )
                dict entry(
                   string "Interfaces"
                   variant                   array [
                      ]
                )
                dict entry(
                   string "Features"
                   variant                   array [
                      ]
                )
                dict entry(
                   string "Type"
                   variant                   string "hardware"
                )
             ]
          }
       ]
    method call time=1537964753.060383 sender=:1.86 -> destination=org.freedesktop.DBus serial=12 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
       string "type='signal',sender='org.ofono',path='/',interface='org.ofono.Manager',member='ModemAdded'"
    method call time=1537964753.060427 sender=:1.86 -> destination=org.freedesktop.DBus serial=13 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
       string "type='signal',sender='org.ofono',path='/',interface='org.ofono.Manager',member='ModemRemoved'"
    method call time=1537964753.060471 sender=:1.86 -> destination=org.freedesktop.DBus serial=14 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
       string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.ofono'"
    method call time=1537964753.060517 sender=:1.86 -> destination=org.freedesktop.DBus serial=15 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
       string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.ofono'"
    method call time=1537964753.060564 sender=:1.86 -> destination=org.freedesktop.DBus serial=16 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
       string "type='signal',sender='org.freedesktop.DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',arg0='org.freedesktop.DBus'"
    error time=1537964753.060621 sender=org.freedesktop.DBus -> destination=:1.86 error_name=org.freedesktop.DBus.Error.MatchRuleNotFound reply_serial=16
       string "The given match rule wasn't found and can't be removed"
    

    At the end we get,

    error_name=org.freedesktop.DBus.Error.MatchRuleNotFound reply_serial=16
           string "The given match rule wasn't found and can't be removed"
    

    In the constructor of the QOfonoManager, the following is happening:

    QOfonoManager::QOfonoManager(QObject *parent) :
        QObject(parent),
        d_ptr(new Private)
    {
        QOfonoDbusTypes::registerObjectPathProperties();
        QDBusConnection systemBus(QDBusConnection::systemBus());
        QDBusServiceWatcher *ofonoWatcher = new QDBusServiceWatcher("org.ofono", systemBus,
                QDBusServiceWatcher::WatchForRegistration |
                QDBusServiceWatcher::WatchForUnregistration, this);
    
        connect(ofonoWatcher, SIGNAL(serviceRegistered(QString)),
                this, SLOT(connectToOfono(QString)));
        connect(ofonoWatcher, SIGNAL(serviceUnregistered(QString)),
                this, SLOT(ofonoUnregistered(QString)));
    
        if (systemBus.interface()->isServiceRegistered("org.ofono")) {
            connectToOfono(QString());
        }
    }
    

    (full code: https://github.com/ubports/libqofono/blob/xenial/src/qofonomanager.cpp)

    So it seems like there is something going on with dbus, but I am not exactly sure what. The constructor I gave you begins to cause it. Could it maybe be a bug in libqofono-0.92 ? Second opinion or guidance is much appreciated. Thanks in advance.


Log in to reply