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. Connecting to wifi
Qt 6.11 is out! See what's new in the release blog

Connecting to wifi

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 4.7k 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.
  • E Offline
    E Offline
    Eligijus
    wrote on last edited by Eligijus
    #1

    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");
        process.waitForFinished(-1);
        arguments << "-c" << "iw dev wlan0 scan | grep SSID";
        process.start("sh" ,arguments);
        process.waitForFinished();
    

    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.

    jsulmJ 1 Reply Last reply
    0
    • E Eligijus

      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");
          process.waitForFinished(-1);
          arguments << "-c" << "iw dev wlan0 scan | grep SSID";
          process.start("sh" ,arguments);
          process.waitForFinished();
      

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

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

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • E Offline
        E Offline
        Eligijus
        wrote on last edited by
        #3

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

            ncm->updateConfigurations();
            myList = ncm->allConfigurations();
            for(int i = 0; i < myList.size(); i ++)
            {
                qDebug() << myList.at(i).name();
            }
        

        outputs:
        "Wired"
        "sit0"
        "wlan0"
        "can0"
        "eth0"
        "eth1"
        "eth0"
        And executing "iw dev wlan0 scan | grep SSID" i get:
        SSID: Lina
        SSID: VAI-FI
        SSID: Liblanka
        SSID: Cgates_FB5C
        SSID: 40
        SSID: Linksys2

        jsulmJ 1 Reply Last reply
        0
        • E Eligijus

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

              ncm->updateConfigurations();
              myList = ncm->allConfigurations();
              for(int i = 0; i < myList.size(); i ++)
              {
                  qDebug() << myList.at(i).name();
              }
          

          outputs:
          "Wired"
          "sit0"
          "wlan0"
          "can0"
          "eth0"
          "eth1"
          "eth0"
          And executing "iw dev wlan0 scan | grep SSID" i get:
          SSID: Lina
          SSID: VAI-FI
          SSID: Liblanka
          SSID: Cgates_FB5C
          SSID: 40
          SSID: Linksys2

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

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

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          E 1 Reply Last reply
          0
          • jsulmJ jsulm

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

            E Offline
            E Offline
            Eligijus
            wrote on last edited by
            #5

            @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.

            1 Reply Last reply
            0
            • GilbertoAGJG Offline
              GilbertoAGJG Offline
              GilbertoAGJ
              wrote on last edited by
              #6

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

              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