1

I'm using Ubuntu 18.04 in a HP notebook. I downloaded the driver using:

git clone https://github.com/tomaspinho/rtl8821ce.git

I followed the instructions in the README file for the installation.

The driver worked well after a computer reboot, but if I try to change wireless network or if the computer goes to suspension, network-manager can no longer connect. Network manager sees the ssid of Wi-fi in the air but fails to make the connection. In short, it only works on the first connection.

I've tried restarting network manager, and uninstalling and reinstalling it, but the problem persists. The only solution is restarting Ubuntu, and it is very annoying for me.

How can I resolve this issue?

1

The main issue is that the wifi driver installed by dkms does not reload itself after suspend for some unknown reason.

I HAVE RTL8821CE AS MY WIFI CHIP SO MY KERNEL MODULE IS NAMED AS 8821ce

Open terminal login as root by issuing command sudo -s then issue the following commands (you may also use sudo instead of logging in as root)

modprobe -r 8821ce and

modprobe -i 8821ce

these commands will reload the wifi modules and your wifi will work again after suspend.

I found a temporary workaround so as to avoid issuing those commands every time you resume from suspend.

NOTE:

  1. THIS WORKAROUND SOMETIMES WORKS AND SOMETIMES DOES NOT WORK

  2. THIS MIGHT BREAK YOUR SUSPEND/RESUME BUT YOU CAN SIMPLY REVERT TO PREVIOUS STATE BY DISABLING THE SERVICE AND DELETING FILES.

The steps are;

  1. Create a script that issues the above commands at resume (not at suspend) by

sudo nano /etc/pm/sleep.d 20_anyname.sh (replace anyname with anything of your choice)

and enter the following lines in the script

#!/bin/sh

# This script Restarts rtl8821ce kernel modules
# Use this if your wifi not working after suspend/resume

case "${1}" in
        resume|thaw)
               sudo modprobe -r 8821ce
               sudo modprobe -i 8821ce
;;
esac

then press CTRL+X and save changes by entering yes

Make sure that proper permissions are granted by

sudo chown root:root /etc/pm/sleep.d/20_anyname.sh

sudo chmod 755 /etc/pm/sleep.d/20_anyname.sh

  1. Create a systemd service by

sudo nano /etc/systemd/system/somename.service

Enter the following text

[Unit]
Description=Wifi Resume Service
After=sleep.target
After=hibernate.target
After=hybrid-sleep.target

[Service]
Type=oneshot
ExecStart=/path/to/your/script

[Install]
WantedBy=sleep.target
WantedBy=hibernate.target
WantedBy=hybrid-sleep.target

and save by CTRL+X then type yes then enter.

Then make sure proper permissions are granted by

sudo chown root:root /etc/systemd/system/somename.service

sudo chmod 755 /etc/systemd/system/somename.service

  1. Enable your script using sudo systemctl enable somename

  2. Reboot and enjoy

AS I SAID BEFORE IT SOMETIMES WORK AND SOMETIMES NOT. I really don't know why is that so. To get a fully working wifi you need to wait for developers to put the bug free module in upcoming kernels as rtl8821ce is still a new chip.

First enable your local wifi network then suspend your laptop. Now to tell whether the script succeeded or not see the top right corner just after resume if you don't see any kind of wifi sign then you are good to go and if you see a wifi sign at first sight then script failed.

To see errors journctl -u somename.service

0

I have experienced the same issue on a Lenovo Ideapad330. Same wireless chipset, and same problem when resuming after a suspend.

When reading the readme for the 8821ce driver on GitHub, tomaspinho talk about possible issues, especially "PCIe Activate State Power Management".

I have followed his recommendations, and I have added the following parameter to the grub cmdline

pci=noaer

Now I have no more wireless problem after suspend.

New contributor
benoit mordac is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.