Intel AC 3168NGW - Wifi not working after suspension

Hello,

some time ago I switched to Manjaro 19.0 Xfce on my laptop and everything worked fine. However, few days ago I started having wifi issues - sometimes system recognized the adpater but couldn't find any network, sometimes it couldn't even find the adapter. After some googling I realised it worked fine only when I booted my laptop pluged in, although later the connection would be extremely slow or even not working (that's rather not the router's fault, other devices worked alright and the problem occured also with my phone's hotspot). I tried those kernels:

  • linux419 - 4th and the last one installed
  • linux53 - installed as the 1st one
  • linux55 - 3rd
  • linux54-rt - 2nd

On 4.19 it seemed to work fine, but then after waking from suspension the network manager would show device not ready info. After changing back to 5.3 kernel the wifi would work exactly as on the 4.19 kernel.

I also tried to reinstall linux-firmware, but with no effect.

The system couldn't recognize the BT adapter once, if it has any connection with the issue.

Here's my inxi -Fdxxx output:

System:    Host: radek-MSI Kernel: 5.3.18-1-MANJARO x86_64 bits: 64 compiler: gcc v: 9.2.0 Desktop: Xfce 4.14.2 
           tk: Gtk 3.24.13 info: xfce4-panel wm: xfwm4 dm: LightDM 1.30.0 Distro: Manjaro Linux 
Machine:   Type: Laptop System: Micro-Star product: PS42 8RB v: REV:0.B serial: <root required> 
           Mobo: Micro-Star model: MS-14B1 v: REV:1.0 serial: <root required> UEFI: American Megatrends v: E14B1IMS.10C 
           date: 09/04/2018 
Battery:   ID-1: BAT1 charge: 25.5 Wh condition: 33.4/50.0 Wh (67%) volts: 15.2/15.2 model: BIF0_9 type: Li-ion serial: N/A 
           status: Discharging 
           Device-1: hidpp_battery_0 model: Logitech Wireless Mouse M525 serial: 4013-be-29-dd-3c 
           charge: 100% (should be ignored) rechargeable: yes status: Discharging 
CPU:       Topology: Quad Core model: Intel Core i5-8250U bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 28808 
           Speed: 800 MHz min/max: 400/3400 MHz Core speeds (MHz): 1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
Graphics:  Device-1: Intel UHD Graphics 620 vendor: Micro-Star MSI driver: i915 v: kernel bus ID: 00:02.0 chip ID: 8086:5917 
           Device-2: NVIDIA GP108M [GeForce MX150] vendor: Micro-Star MSI driver: nvidia v: 440.59 bus ID: 03:00.0 
           chip ID: 10de:1d10 
           Display: x11 server: X.Org 1.20.7 driver: modesetting,nvidia resolution: 1920x1080~60Hz 
           OpenGL: renderer: GeForce MX150/PCIe/SSE2 v: 4.6.0 NVIDIA 440.59 direct render: Yes 
Audio:     Device-1: Intel Sunrise Point-LP HD Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           chip ID: 8086:9d71 
           Sound Server: ALSA v: k5.3.18-1-MANJARO 
Network:   Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel port: f040 bus ID: 02:00.0 
           chip ID: 8086:24fb 
           IF: wlp2s0 state: up mac: 18:56:80:e4:ec:ec 
Drives:    Local Storage: total: 238.47 GiB used: 91.00 GiB (38.2%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLW256HEHP-00000 size: 238.47 GiB speed: 31.6 Gb/s lanes: 4 
           serial: S33VNX0K900604 rev: CXB7401Q scheme: GPT 
           Message: No Optical or Floppy data was found. 
Partition: ID-1: / size: 19.56 GiB used: 15.81 GiB (80.8%) fs: ext4 dev: /dev/nvme0n1p3 
           ID-2: /home size: 91.97 GiB used: 75.18 GiB (81.7%) fs: ext4 dev: /dev/nvme0n1p5 
           ID-3: swap-1 size: 7.63 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p2 
Sensors:   System Temperatures: cpu: 48.0 C mobo: 27.8 C gpu: nvidia temp: 49 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 256 Uptime: 2m Memory: 7.65 GiB used: 1.45 GiB (18.9%) Init: systemd v: 242 Compilers: gcc: 9.2.0 
           Shell: bash v: 5.0.11 running in: xfce4-terminal inxi: 3.0.37 

EDIT: Just before a moment the connection cracked out of the blue. The network manager showed wifi as connected, but no website would load.

Not a fix, but a workaround. You could use kernel 4.19 with a suspend service for your wifi.

You will need to update my service with your network particulars. Change wlo1 to wlp2s0 in the service.

Thanks, but unfortunately it doesn't work. It worked only the first time and I'm not even sure if it wasn't a coincidence.

Post your unit please:

cat /etc/systemd/system/iwlwifi.service

Also:

systemctl status iwlwifi.service
#/etc/systemd/system/iwlwifi.service
#sudo systemctl enable iwlwifi.service
#sudo systemctl start iwlwifi.service
#sudo systemctl stop iwlwifi.service
#sudo systemctl disable iwlwifi.service
#systemctl status iwlwifi.service
#sudo systemctl daemon-reload

[Unit]
Description=Network Suspend/Resume Service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/bin/sudo -u radek /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/ip link set wlp2s0 down
ExecStart=/usr/bin/sleep 1
ExecStart=-/bin/bash -c "lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs sudo rmmod"
ExecStop=/usr/bin/sleep 5
ExecStop=-/usr/bin/modprobe iwlwifi
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/ip link set wlp2s0 up
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/systemctl start NetworkManager
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi off'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi on'

[Install]
WantedBy=sleep.target
● iwlwifi.service - Network Suspend/Resume Service
   Loaded: loaded (/etc/systemd/system/iwlwifi.service; enabled; vendor preset: disabled)
   Active: inactive (dead)

lut 22 19:06:29 radek-MSI sudo[3640]: pam_unix(sudo:session): session opened for user root by (uid=0)
lut 22 19:06:29 radek-MSI sudo[3640]: pam_unix(sudo:session): session closed for user root
lut 22 19:06:30 radek-MSI sudo[3657]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/bash -lc nmcli r wifi off
lut 22 19:06:30 radek-MSI sudo[3657]: pam_unix(sudo:session): session opened for user root by (uid=0)
lut 22 19:06:30 radek-MSI sudo[3657]: pam_unix(sudo:session): session closed for user root
lut 22 19:06:31 radek-MSI sudo[3668]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/bash -lc nmcli r wifi on
lut 22 19:06:31 radek-MSI sudo[3668]: pam_unix(sudo:session): session opened for user root by (uid=0)
lut 22 19:06:31 radek-MSI sudo[3668]: pam_unix(sudo:session): session closed for user root
lut 22 19:06:31 radek-MSI systemd[1]: iwlwifi.service: Succeeded.
lut 22 19:06:31 radek-MSI systemd[1]: Stopped Network Suspend/Resume Service.

Switch radek to $USER then save the service changes and reboot.

I've started with this one and changed to radek when it didn't work.

Is this a wifi/bluetooth combo chip?

Do you use BT.

The unit you posted is incorrect you need to change all instances of $USER to radek, or they must all be $USER. You can not combine/mix them as you have.

Did you restart after making changes to the service.

Yes, it is. BT is turned off at the moment, but there's a status tray icon. Should I disable it? I also disabled one of the BT plugins ("ShowConnected") and wifi worked, but only for one session - after next reboot the situation's the same.

Try this:

#/etc/systemd/system/iwlwifi.service
#sudo systemctl enable iwlwifi.service
#sudo systemctl start iwlwifi.service
#sudo systemctl stop iwlwifi.service
#sudo systemctl disable iwlwifi.service
#systemctl status iwlwifi.service
#sudo systemctl daemon-reload

[Unit]
Description=Network Suspend/Resume Service 
Before=sleep.target
StopWhenUnneeded=yes

[Service]
User=root
Type=oneshot
RemainAfterExit=yes
ExecStartPre=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking off'
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/systemctl stop NetworkManager
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/ip link set wlp2s0 down
ExecStart=/usr/bin/sleep 1
ExecStart=-/usr/bin/rmmod btusb
ExecStart=-/bin/bash -c "lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs sudo rmmod"
ExecStop=/usr/bin/sleep 5
ExecStop=-/usr/bin/modprobe iwlwifi
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/ip link set wlp2s0 up
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/systemctl start NetworkManager
ExecStop=/usr/bin/sleep 2
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli networking on'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi off'
ExecStop=/usr/bin/sleep 1
ExecStop=-/usr/bin/sudo -u $USER /bin/bash -lc 'nmcli r wifi on'

[Install]
WantedBy=sleep.target

Once you have finished editing, (and saved) the service file, restart.

I rebooted twice to make sure, but it still doesn't work. The first time the BT icon disappeared, but nothing beyond that.

Change wlo1 to wlp2s0 in the service.

I've done it.

change all sleeps to:

sleep 3

It is possible a tlp misconfiguration is creating this problem.

Test to see if tlp is causing this by disabling tlp temporarily.

To prevent tlp from starting it can be masked:

sudo systemctl mask tlp && sudo systemctl mask tlp-sleep.service

Reboot, then test if the problem persists.

If this is a desktop system you can leave tlp disabled without any complications.

On a laptop TLP is important for managing power saving, fan speeds, battery charging, etc and is best not disabled.

On a laptop the best long term solution is to find and modify the tlp setting that is causing your issue.

It is also possible this is a firmware issue.

I would also recommend testing the real time kernels.

It works! Thank you!

In /etc/tlp.conf I found this:
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"
and changed to:
DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE=""

It now works also with the 5.3 kernel and the iwlwifi.service isn't neccessary anymore.

EDIT: the default value for that parameter is <none>, so what I did shouldn't have changed anything, but it still works after a few reboots.

1 Like

That's great news.

I'm glad that got things working for you, and you're very welcome.

Hi guys.
will it be possible that you help me to resolve my problem, is very similar to the radek1 but in this case don't show in driver: N/A. I read every replies and I tried everything but I don't works yet for me.
I recently installed Manjaro KDE and I've been set up somethings. but the wifi network it haven't worked me.
inxi -N
Network: Device-1: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: N/A
Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8168

I would be very thankful if you help me to resolve this problem.

when I write this command "cat /etc/systemd/system/iwlwifi.service" on my terminal, it shows this: cat: /etc/systemd/system/iwlwifi.service: No such file or directory.

should I do? thanks

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by