Connect to specific WiFi from command line
Hello,
I have two wifi access points A and B. When I am connected to B and go close to A, B has very weak signal and doesn't work fast / reliable. Since the SailfishX doesn't handle it's own to jump from B to A (it could be an option for that maybe?), I created an "App" in the desktop so it can run a shell script to connect to specific Access Point (one for A one for B). I tried as root:
# wpa_supplicant -B -i wlan0 -c <(wpa_passphrase "A" A_WIFI_PASS )
the result was I could not connect at any wifi, network restart from Utilities didn't work and I had to reboot my device.
Then I tried the following:
# iw wlan0 connect A
and returns: command failed: Operation already in progress (-114)
The access points I am trying to connect to (A, B) are configured on my phone with WPA password / static IP.
Is there any way I can select from command line specific wifi to connect to? Does anyone have any idea about that?
sailfishos uses connman. you can use it from dbus
coderus ( 2020-04-22 13:44:45 +0200 )editalso for a reliable signals: often its enough to turn off and on wifi and sfos will reconnect to most strength point again.
coderus ( 2020-04-22 13:45:28 +0200 )edit@coderus thank you for the info and the idea coderus! I found in tjc a solution about turning off and on the wifi using dbus, but I suppose it will be faster if you connect directly to the new wifi.
nas ( 2020-04-22 14:35:28 +0200 )edit@coderus I did made some tries, I used the dbus commands from this post https://together.jolla.com/question/56437/i-would-like-to-toggle-internet-connectivity-via-terminal-with-dbus/ and I ended up with that:
It turns off and on the wifi but it doesn't seem to scan / connect to any wifi.. As far as I tried to see this dbus couldn't find anything to set specific WiFi
nas ( 2020-04-22 16:10:51 +0200 )editJust tested and it worked fine (as root).
peterleinchen ( 2020-04-23 00:13:51 +0200 )editDisconnected and connected to my hone network on its own (ANY, no specific, nerwork).