Solve the problem of failing to connect to certain Wifi occasionally when using NetworkManger on archlinux

I use archlinux and network-manager, and every now and then, I failed to connect to a certain wifi, while the other wifi worked pretty well. I didn’t figure out the reason, but I found a solution.

First check which wifi connections do you have.

1
2
sudo ls /etc/NetworkManager/system-connections
AndroidAP OpenWrt15

Suppose we have a problem connecting to OpenWrt15, what we need to do is just run the following command to move OpenWrt15 to another location(Warning: make sure you know the wifi password of OpenWrt15 before moving the file, because you will need to re-input the password again later on. Usually you can find the password in the OpenWrt15 file)

1
sudo mv /etc/NetworkManager/system-connections/OpenWrt15 /tmp

Then restart NetworkManager.

1
sudo systemctl restart NetworkManager.service

And try connecting to that wifi again. You will need to re-input the password. If you don’t know the password, you can probably find it in the original /tmp/OpenWrt15 file.

Happy Hacking!

Share