Skip Navigation

Suspension on my laptop (closing the lid) causes Wifi to not be available.

Hi, this is a long lasting problem that I didn't really manage to fix when I started using linux (Mint, Cinnamon). But now that I've been using it regularly for half a year and I have more experience in fiddling around, I'm trying to get it resolved.

Whenever I suspend the laptop (or close the lid, which does it automatically) the Wifi and sometimes an external monitor don't work anymore, I don't know what the problem is. The wifi is fixed by powering on and off again. To fix the monitor sometimes even powering off and on again didn't fix it, I usually waited for the next day and it worked again.

I've no idea of how to fix this (Linux Mint forums didn't help at the time)

Laptop is an MSI GS65-Stealth-Thin-8RF running Linux Mint, with Cinnamon Desktop

journalctl output: https://sharetext.me/q7eo87psmq

33 comments
  • You need to unload your wifi module before suspend.

    Without systemd it's easy:

    create a file /etc/pm/config.d/config containing:

     undefined
        
    HOOK_BLACKLIST="wireless"
    SUSPEND_MODULES=”NAME_OF_YOUR_WIFI_MODULE”
    SUSPEND_MODULES=”wl”
    
      

    With systemd try this

    create a file /usr/lib/systemd/system-sleep/fix-wifi.sh containing (fuck this editor, replace the "##" with "&&") :

     undefined
            #!/bin/bash
        [ "$1" = "post" ] ## exec /usr/sbin/modprobe NAME_OF_YOUR_WIFI_MODULE
        [ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r NAME_OF_YOUR_WIFI_MODULE
        exit 0
    
    
      

    and make it executable with chmod 755 /usr/lib/systemd/system-sleep/fix-wifi.sh

    • It doesn't work, should it look like this the script?

       undefined
          
      #!/bin/sh
      [ "$1" = "post" ] ## exec /usr/sbin/modprobe Intel Corporation Wireless-AC 9260
      [ "$1" = "pre" ] ## exec /usr/sbin/modprobe -r Intel Corporation Wireless-AC 9260
      exit 0
      
      
        

      EDIT: should the name be something like wlp62s0 ??? I'm going to try it

33 comments