Monday, December 21, 2020

Wifi wont work after suspend in AntiX

My MSI Wind u90x laptop with Antix 19.3 installed has a Wi-Fi problem. Wifi does not reconnect after hibernate/sleep. Generally, Wi-Fi works fine, except for resuming from suspension. To be honest, earlier when I used Lubuntu 18.04, I had the same problem.

Solution #1

I found out that wifi works well if I shut off networking BEFORE suspend and shut on AFTER resume.
The terminal-command to do this: `sudo ifconfig wlan0 [down|up]`.
(In Ubuntu-based distros - `nmcli networking [on|off]`)

Solution #2

The previous solution can be automated using a shell script located in the /etc/pm/sleep.d/ directory.
I created /etc/pm/sleep.d/wifi-fix.sh with the following content:
#!/bin/bash

case "$1" in
suspend|hibernate)
    ifconfig wlan0 down
    ;;
resume|thaw)
    ifconfig wlan0 up
    ;;
esac

 

In case you want to know which device provides wireless capability on my laptop:
$ inxi -N
Network:   Device-1: Realtek RTL8101/2/6E PCI Express Fast/Gigabit Ethernet driver: r8169
           Device-2: Realtek RTL8187SE Wireless LAN driver: rtl818x_pci