0

I have the following code to retrieve access points information using NetworkManager dbus api:

//---------------------------------------------------------------------------------
    QDBusInterface dbus_iface("org.freedesktop.NetworkManager",                     
                              "/org/freedesktop/NetworkManager/Devices/2",     // path (might be different in other systems)
                              "org.freedesktop.NetworkManager.Device.Wireless",     
                              bus);


    QDBusMessage query = dbus_iface.call("GetAllAccessPoints");

    qDebug() << query;

    if(query.type() == QDBusMessage::ReplyMessage) {

        QDBusArgument arg = query.arguments().at(0).value<QDBusArgument>();
        arg.beginArray();
        while(!arg.atEnd()) {
            QString element = qdbus_cast<QString>(arg);
            netList->append(element);
            showAccessPointProperties(element);
        }
        arg.endArray();
    } else {
        qDebug() << " dbus error: " << query.errorName();
    }

This code works on desktop linux (ubuntu 18.04).

But in raspbian (buster, raspberry pi 3 B/B+) this code doesn't work! The problem is that this call :

dbus_iface.call("GetAllAccessPoints");

returns empty reply.

Is it anything different on how to use NM dbus interface in raspbian and ubuntu?

payman
  • 167
  • 7

1 Answers1

2

It seems that other network managing packages prevent Network Manager to access wireless.

For me the issue resolved by removing dhcpcd5 and openresolve packages :

sudo apt-get remove --purge dhcpcd5 openresolve

payman
  • 167
  • 7