How to disable autoconnect for known Wi-Fi connections?
-
I don't think you can do that with the UT UI, but since there is a NetworkManager behind all this you should be able to configure things manually in a console.
e.g. like this:
sudo nano /etc/NetworkManager/system-connections/MyNetorkSSID
and add
autoconnect=false
somewhere under[connection]
. I haven't tested it but based on some sources like these config examples on the Gnome web it should be correct.Not sure if there is a way to do that for all as well as new networks (maybe), but from what I've seen on various forums this may not be possible.
-
@AppLee This rough workaround is ok.
@zubozrout Unfortunately, the change has no effect before a reboot. After a reboot, I could not reactivate the connection by removing
autoconnect=false
. -
@sven
I think you can try to connect manually by tapping on the wifi SSID (white label) withautoconnect=false
but I'm not sure it will work.
I think changes to/etc/NetworkManager/system-connections/MyNetorkSSID
are only applied after a reboot. -
@sven i had a bug filed sonewhere to enable that setting, although the existing gsetting seems not to work
-
@sven said in How to disable autoconnect for known Wi-Fi connections?:
autoconnect=false
Weird, I've just tried it and upon inserting
autoconnect=false
to the[connection]
section in that file the respective WiFi network is not autoconnected on reboot and only if clicked on in the list of available WiFi networks with the UI. I am not sure if you need a different usecase and I misunderstood that but this config should definitely work as the network manager on the phone is basically the same thing as the one you can find on the desktop.Perhaps a stupid question to ask but did you save the changes in the file before leaving the nano text editor? As I have no idea what else could cause the issue. Also for changes to this folder remounting / fs to read/write should not be necessary.
-
@zubozrout Thanks for checking; and yes, that is the behavior I am looking for, but I cannot reproduce it on my device. What device and UT version did you use for your test?
-
You can also run this instead of rebooting
sudo service network-manager restart
-
@sven Meizu MX4, latest devel. But I don't think this could be device or some OS version specific :(, so have no idea what could be causing NetworkManager to ignore these config file changes. After all it must be using them since it autoconnects to known networks listed in that
/etc/NetworkManager/system-connections
folder. -
@zubozrout Try to check the previous networks list. Some networks are duplicated and maybe the one you modified isn't the one you connected.
-
@kugiigi Thanks for your help. I can confirm that your method works on my OnePlus3T. The problem on the Cosmo seems to be a more general Wi-Fi problem that is Cosmo-specific. (In short: the Wi-Fi interface is named
wlan0
instead ofwlp1s0
in normal UT, see https://gitlab.com/ubports/community-ports/android9/planet-cosmocom/planet-cosmocom/-/issues/4 ) -
@sven said in How to disable autoconnect for known Wi-Fi connections?:
The problem on the Cosmo seems to be a more general Wi-Fi problem that is Cosmo-specific. (In short: the Wi-Fi interface is named wlan0 instead of wlp1s0 in normal UT, see https://gitlab.com/ubports/community-ports/android9/planet-cosmocom/planet-cosmocom/-/issues/4 )
I doubt very much that the name of the wireless network interface is contributing to the problem. The name the kernel assigns to an interface is based on the actual hardware and the kernel version.
For instance the wifi interface is also calledwlan0
on my Meizu Pro 5. And wifi hotspot works on his device. -
@arubislander OK, and I thought I had a suspect for the non-operational hotspot on the Cosmo