Wi-Fi not working on Lenovo ThinkPad E570 (Realtek RTL8821CE)

Solution 1:

This is a follow up to stason's answer who suggests using dkms.

As far as I can tell, at the time of writing this, there is not yet a Wifi Driver for the Realtek RTL8821CE in the official Ubuntu Repositories.

Over on github there is a repository with an RTL8821CE driver aimed at kernels 4.14 and above and specifically for Arch Linux with no support provided for other Linux Distros: https://github.com/tomaspinho/rtl8821ce

(Minor note: as of February 2019 tomaspinho is sadly no longer able to maintain the driver as he no longer has access to a computer with this chipset, and so a new maintainer may be needed, but the driver still works with Ubuntu 18.04 as at that time.)

It has, however, been reported to work just fine with Ubuntu 18.04.

A temporary internet connection will be required (such as an ethernet cable, USB wifi dongle or connecting your phone with a usb cable and 'tethering' it to use your phone's Wifi)

The solution is taken directly from post #4 by Praseodym (much praise to their wisdom!): https://ubuntuforums.org/showthread.php?t=2398917 and will install a number of packages for building the wifi driver module (git, dkms, build-essential & linux-headers) and clone the rtl8821ce git repository from tomaspinho (much praise also!).

DKMS is used because it's "a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated."


Open up a terminal and type the following lines (You can cut and paste if you prefer):

sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
sudo ./dkms-install.sh

After this is completed successfully, you should reboot and find that your Wifi is working.

You also want to make sure SecureBoot is Disabled in the BIOS settings or it won't let you load the unsigned self-complied kernel module.

Solution 2:

First, I would suggest that these instructions are more likely to work with Ubuntu 17.10. If you are not currently running it now, I suggest that you re-install it.

Click this link to download the driver file: https://minhaskamal.github.io/DownGit/#/home?url=https://github.com/endlessm/linux/tree/master/drivers/net/wireless/rtl8821ce

Unless you have specified otherwise in your browser, downloads go to the directory Downloads. Open a terminal and do:

cd ~/Downloads
unzip rtl8821ce.zip
cd rtl8821ce
nano Makefile

Scroll down to line 152 and change the line that now reads:

export TopDIR ?= $(srctree)/drivers/net/wireless/rtl8821ce

To now read:

export TopDIR ?= $ ~/Downloads/rtl8821ce

Proofread carefully, twice, and save (Ctrl+o followed by Enter) and close (Ctrl+x) the text editor.

Now do:

make
sudo make install
sudo modprobe 8821ce

Your wireless should now be working.

EDIT: You have compiled the module for your currently running kernel version only. When Update Manager offers a later kernel version, known as linux-image, after the requested reboot, you must recompile:

cd rtl8821ce
make clean
make
sudo make install
sudo modprobe 8821ce

Please retain the file and these instructions for that time.

Solution 3:

Ran in the same problem today with ubuntu 20.04.

Reading through https://github.com/tomaspinho/rtl8821ce carefully I found out that there is a ready made package by Canonical: rtl8821ce-dkms

Installation boils down to:

  1. sudo apt install rtl8821ce-dkms
  2. Reboot

That's it. Nothing else. After reboot everything just works.

Solution 4:

Update 2018-02-27

Please note the suggested driver is for Endless OS and therefore it might break at any point. If any body has an official driver for Ubuntu it will be better.

Original Answer

This is not a new answer, would be better a comment.

So I tried to follow @chili555 answer but I kept getting errors while trying to make the module.

Errors like:

/rtl8821ce/include/osdep_service_linux.h:294:2: error: implicit declaration of function ‘timer_setup’; did you mean ‘ether_setup’?
[-Werror=implicit-function-declaration]
   timer_setup(ptimer, pfunc, 0);
   ^~~~~~~~~~~   ether_setup

So I tried downloading a different revision (zip archive direct download link) which by the time of the original answer might be master as well. Then I was able to make the module and install following the steps provided by @chili555

Solution 5:

dkms build/install for rtl8821ce can be found here: https://github.com/tomaspinho/rtl8821ce

When you use that approach you won't need to rebuild the module each time kernel is updated.

I have just built it on Lenovo Idea 720s with kubuntu 18.04.


Also I suggest you edit Makefile to change the log level from 4 (info) to 3 (warnings). Otherwise you will find your /var/log/syslog filling up at a crazy speed with useless info messages from the driver.

So edit Makefile, to change:

CONFIG_RTW_LOG_LEVEL = 4

to:

CONFIG_RTW_LOG_LEVEL = 3

and then build and install the module as per instructions. If you already installed it, you need to uninstall it (using dkms-remove.sh) and then reinstall it again.

Alternatively you can manually change the log level until next reboot with:

echo 3 > /proc/net/rtl8821ce/log_level

update: the maintainer changed the Makefile to reflect this suggestion, so if you make a fresh checkout/download it'll already have the right (quiet) setting.