How to change to a new WIFI network using Qt 5.13?
-
wrote on 26 Aug 2019, 01:27 last edited by Oshio
I have a device that is running Qt 13 and a microcontroller(esp8266) that is running as an Access Point. So here is my network:
SSID1: "HomeRouter" Password: 1234 SSID2: "MCU" Password: 1234
The device running the Qt application is already connected to SSID1.
How I make the qt application change from SSID1 to SSID2?Although its a straightforward problem I could not found a explicit example or instruction that a newbie could figure out.
-
I have a device that is running Qt 13 and a microcontroller(esp8266) that is running as an Access Point. So here is my network:
SSID1: "HomeRouter" Password: 1234 SSID2: "MCU" Password: 1234
The device running the Qt application is already connected to SSID1.
How I make the qt application change from SSID1 to SSID2?Although its a straightforward problem I could not found a explicit example or instruction that a newbie could figure out.
wrote on 26 Aug 2019, 18:15 last edited by@oshio what about Bearer Management support?
-
wrote on 27 Aug 2019, 18:15 last edited by
@Pablo-J-Rogina thanks for pointing out this link. But the documentation isn't clear.
The QNetworkSession seems to be responsible for telling the system to change to a new network. But how I tell the class to connect to the SSID2 from my original example?The docs says that configuration should be passed as a QNetworkConfiguration class to QNetworkSession's constructor. If we look at QNetworkConfiguration there is no instruction on how to set a name or password to connect in a new network.
-
Hi,
Because it is outside of Qt's scope. The setup and handling of network connections is handled by your OS and some dedicated tools like iwconfig.
-
wrote on 27 Aug 2019, 18:38 last edited by Oshio
Now that you mentioned, it makes sense that this should not be handled by Qt.
Thanks! -
You can use Qt to run the tools if you want to. QProcess comes to mind for that.
3/6