Please nominate your Qt Champions for 2021!

Connecting to wifi

  • Hello,

    is there a better way to connect to wifi on embedded linux device(variscite DART-6UL) than to use Qprocess and manipulate terminal like so:

        QProcess process;
        QStringList arguments;
        QString stdout;
        process.start("ifconfig wlan0 up");
        arguments << "-c" << "iw dev wlan0 scan | grep SSID";
        process.start("sh" ,arguments);

    I've seen a few posts recommending to look into QNetworkConfigurationManager but all it does is list network interfaces not wifi networks i could connect to.

  • Lifetime Qt Champion

    @Eligijus If WLAN is activated on your device (ifconfig wlan0 up) then QNetworkConfigurationManager should actually show it.

  • WLAN is activated on my device and QNetworkConfigurationManager shows wlan0 but NOT the networks.

        myList = ncm->allConfigurations();
        for(int i = 0; i < myList.size(); i ++)
            qDebug() <<;

    And executing "iw dev wlan0 scan | grep SSID" i get:
    SSID: Lina
    SSID: Liblanka
    SSID: Cgates_FB5C
    SSID: 40
    SSID: Linksys2

  • Lifetime Qt Champion

    @Eligijus What is your use case? Usually you connect to a network using the OS not your app.

  • @jsulm On embedded linux device a qt application is ran on startup. So within that application i need to provide interface for wifi(scanning networks, connecting to network, getting information about network...). Touchscreen is my only way to interact with application so i can't just whip out a terminal and connect to wifi :).
    Yesterday i have found a possible solution - libconnman-qt. It is a qt bindings for connman(network manager for linux) but haven't tested it yet.

  • I have the same problem. Have you you solved the problem ?

Log in to reply