And, the script should better test some conditions (obtained via cmdline arguments) to know that it's the right time to reset the NetworkManager. Namely, /lib/systemd/system-sleep/ looks like a good place to put your script. I've first tried creating a desktop launcher to invoke the wifi reset manually, which works, and requires a password - but then I found several notes by people putting the reset curse into places in the system that run scripts after resume. The workaround using "systemctl restart NetworkManager" works for me on two different notebooks with Broadcom and Atheros WiFi under Debian Buster and Ubuntu 19.04 - where the problem with "wifi won't wake up on resume" happens on every fourth resume or so (= it typically works just fine.) If you don't know what init system you use, try both commands and see what works. Otherwise, you can use sudo initctl restart network-manager. If you use systemctl as your init system (as is the case with newer versions of Ubuntu), you can use systemctl restart NetworkManager. This option can also be done as a regular user, no root needed. In fact, on my machine, I don't need to wait at all, although I suspect this depends on your WiFi hardware. ![]() This second option should be faster, since you only need to wait 2-3 seconds between commands, as opposed to 10-15 seconds. To do so, run rfkill block wifi, followed by rfkill unblock wifi. Or, you can simply run rfkill and block/unblock your device. ![]() I would then wait 10-15 seconds to make sure whatever hardware issue has caused the problem has been stopped, then: iwconfig wlan0 txpower auto. Assuming you are unable/unwilling to physically disconnect the device, you should run (as root): iwconfig wlan0 txpower off. You could try killing the power to your device. What it does effectively is "reload the driver". This is the only procedure that worked for me in resetting low level settings (frag, rate) that I had set using iwconfig. If this works, then we can now successfully disable iwlwifi $ sudo modprobe -r iwlwifiĪnd now re-enable both modules in the reverse order: $ sudo modprobe iwlwifi So let's try disabling iwldvm first: $ sudo modprobe -r iwldvm On the left is the module name, and on the right are the other modules using it. So we go looking for other modules using iwlwifi: $ lsmod |grep iwlwifiĬfg80211 765952 4 iwldvm,iwlwifi,mac80211,rtl8187 Modprobe: FATAL: Module iwlwifi is in use. You might get lucky with no error message, in which case you can immediately reload it with $ sudo modprobe iwlwifiīut most probably you will get this failure message: $ sudo modprobe -r iwlwifi Look for the module name in the "Driver" line. (Install package hwinfo if you don't have it.) ![]() Let's find the name of the kernel module for your wireless connection: sudo hwinfo -network
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |