I had a weird case that my laptop wifi does not connect to the internet. It was a librebooted machine with an Atheros wifi chipset. It runs internally as "ath9k" (as lcpci -v indicates). I have looked through many solutions but they did not solve it completely.
Then ran: sudo powertop
Pressed Tab key until the "WakeUp" tab is reached. Found the device named wlpxxx and see if it's showing "Disable" in front of it. If not, then selected the device and pressed enter to make it "Enable". If it says "Disable" already then pressed enter twice to register the change.
sudo systemctl restart NetworkManager
If running once did not work, maybe sometimes running 2-3 times work. Out of all the other methods, this worked the most of the times for me.
sudo nano /etc/modprobe.d/ath9k.conf
Then I put these lines and saved:
Then I hit restart. I check if it solved the problem. If yes, great! If not, I would try another method.
I also try this sometimes:
* Where `wlpXYZ` being your wifi card's interface name. You can use `ip addr show` command to determine your interface name.
sudo pacman -S dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
Then run: sudo nano /etc/nsswitch.conf
Change hosts: to...
I also did:
sudo nano /etc/resolv.conf.head
and added some DNS IPs in case it was the problem.
A good place to look for DNS IPs is OpenNIC.org.
Other things:
- disable dhcpcd
- ensure wpa supplicant is installed
sudo nano /etc/udev/rules.d/70-wifi-powersave.rules
It may need a restart of udev or computer to take effect.
sudo udevadm trigger
I still did not find a proper solution to the problem. I am trying out things to make it work. I am not sure, but it seems that some powersaving stuff is causing it to stop working some times.
Ref:
https://wiki.archlinux.org/index.php/Wireless_network_configuration#Power_saving_2
https://www.linuxsecrets.com/archlinux-wiki/wiki.archlinux.org/index.php/Dnsmasq.html
https://superuser.com/questions/629039/disabling-power-save-option-on-wifi-device
Method 1: Powertop
I installed powertop with: sudo pacman -S powertopThen ran: sudo powertop
Pressed Tab key until the "WakeUp" tab is reached. Found the device named wlpxxx and see if it's showing "Disable" in front of it. If not, then selected the device and pressed enter to make it "Enable". If it says "Disable" already then pressed enter twice to register the change.
Method 2: Restart NetworkManager service
Tried running this:sudo systemctl restart NetworkManager
If running once did not work, maybe sometimes running 2-3 times work. Out of all the other methods, this worked the most of the times for me.
Method 3: Modprobe config / Disabling Power Saving Mode
I ran:sudo nano /etc/modprobe.d/ath9k.conf
Then I put these lines and saved:
options ath9k ps_enable=0
options ath9k nohwcrypt=1
Then I hit restart. I check if it solved the problem. If yes, great! If not, I would try another method.
I also try this sometimes:
sudo iw dev wlpXYZ set power_save off
* Where `wlpXYZ` being your wifi card's interface name. You can use `ip addr show` command to determine your interface name.
Method 4: Dnsmasq
Install dnsmasq:sudo pacman -S dnsmasq
sudo nano /etc/NetworkManager/NetworkManager.conf
[main]
...
dns=dnsmasq
Then run: sudo nano /etc/nsswitch.conf
Change hosts: to...
hosts: files dns
I also did:
sudo nano /etc/resolv.conf.head
and added some DNS IPs in case it was the problem.
nameserver xx.yy.xx.yy
nameserver xx.yy.xx.yy
A good place to look for DNS IPs is OpenNIC.org.
Other things:
- disable dhcpcd
- ensure wpa supplicant is installed
Method 5: udev rule
Created a new udev rule file:sudo nano /etc/udev/rules.d/70-wifi-powersave.rules
ACTION=="add", SUBSYSTEM=="net", KERNEL=="wlp*" RUN+="/usr/bin/iw dev %k set power_save off"
It may need a restart of udev or computer to take effect.
sudo udevadm trigger
I still did not find a proper solution to the problem. I am trying out things to make it work. I am not sure, but it seems that some powersaving stuff is causing it to stop working some times.
Ref:
https://wiki.archlinux.org/index.php/Wireless_network_configuration#Power_saving_2
https://www.linuxsecrets.com/archlinux-wiki/wiki.archlinux.org/index.php/Dnsmasq.html
https://superuser.com/questions/629039/disabling-power-save-option-on-wifi-device
No comments:
Post a Comment