Realtek Wifi is Not Working on Xubuntu 18.04 LTS

5,002

Solution 1

After deep analysis with the help of chili555 & other different source My problem was solved by Following way:

1st Step:

sudo apt install build-essential dkms
sudo apt install git
git clone https://github.com/lwfinger/rtl8723bu.git
sudo apt install libelf-dev

2nd Step:

sudo -i
echo blacklist rtl8xxxu >> /etc/modprobe.d/blacklist.conf
exit

This ensured that the old driver was not be used for my device. In my case the problematic driver was rtl8xxxu. So I black listed it.

3rd Step: Now I disabled a line in the makefile of the new driver, because without this hack, two instances of the wireless chipset was shown in Network Manager (as like chili555's Edit 3)

cd rtl8723bu
nano Makefile

Go down to line 21 and change this line:

EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

To comment it out, like this:

#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

Save (Ctrl+o followed by Enter) and exit (Ctrl+x) the text editor.

4th Step: Now build and install the driver:

source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

5th Step: Finally, install the compiled module with this command:

make
sudo make install

Reboot your computer.

Solution 2

Your device uses the driver 8723bu. It must be compiled from source code. With a working internet connection by ethernet, tethered or whatever means possible, open a terminal and do:

sudo apt install build-essential dkms
git clone https://github.com/lwfinger/rtl8723bu.git
cd rtl8723bu
source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

Reboot. If secure boot is enabled, it must be disabled to load an out-of-kernel module.

EDIT: Quite often, the weak signal is a symptom of the antenna wire being connected to connection #1 on the card when the default driver is expecting to see the signal at connection #2. Of course, you could open the laptop and switch the wire or you could add a driver parameter that permits antenna selection at the driver level.

sudo -i
echo “options 8723bu rtw_ant_num=1”  >  /etc/modprobe.d/8723bu.conf
exit

Reboot.

If this is ineffective, repeat the process with rtw_ant_num=2. Reboot.

EDIT 2: We see that the router you prefer is set to use TKIP encryption as well as WPA and WPA2 mixed mode. Please change the settings in the router.

WPA2-AES is preferred; not any WPA and WPA2 mixed mode and certainly not TKIP. Second, if your router is capable of N speeds, you may have better connectivity with a channel width of 20 MHz in the 2.4 GHz band instead of automatic 20/40 MHz, although it is likely to affect N speeds. I also have better luck with a fixed channel, either 1, 6 or 11, rather than automatic channel selection. Also, be certain the router is not set to use N speeds only; auto B, G and N is preferred. After making these changes, reboot the router.

Next, I recommend that your regulatory domain be set explicitly. Check yours:

sudo iw reg get

If you get 00, that is a one-size-maybe-fits-all setting. Find yours here: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 Then set it temporarily:

sudo iw reg set IS

Of course, substitute your country code if not Iceland. Set it permanently:

sudo nano /etc/default/crda

Change the last line to read:

REGDOMAIN=IS

Proofread carefully, save and close the text editor.

Next, let’s try every setting in the driver that may possibly be useful and test:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=2

Now test:

sudo iwlist scan

Is your preferred router now at a better strength? If not, try:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=3

Now test:

sudo iwlist scan

Is your preferred router now at a better strength? If not, try:

sudo modprobe -r 8723bu
sudo modprobe 8723bu rtw_ant_num=1

...which was the original setting that you set.

If none of these steps are useful, I suggest that you file an issue with the author of the driver here: https://github.com/lwfinger/rtl8723bu/issues

EDIT 3: We are going to make an amendment to the Makefile. First, we need to remove the module; next, change the Makefile and finally, rebuild.

From the terminal:

sudo dkms remove rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40 --all

Now navigate to the location where you git cloned the driver; perhaps it was your home directory:

cd ~/rtl8723bu
git pull
nano Makefile

Go down to line 21 and change this line:

EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

To comment it out, like this:

#EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE

Proofread carefully twice. Save (Ctrl+o followed by Enter) and exit (Ctrl+x) the text editor.

Now rebuild and install the driver:

source dkms.conf
sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION

Reboot and tell us if there is any improvement.

Share:
5,002

Related videos on Youtube

boundule
Author by

boundule

Updated on September 18, 2022

Comments

  • boundule
    boundule almost 2 years

    I have just installed latest Xubuntu 18.04 LTS on my new purchased low config laptop along side Windows 10 (duel boot). Everything of Installation was working fine but the Wifi is not working. Sometimes (rarely) i was able to connect to my wifi router but the network strength is too much week. My laptop uses realtek driver (may be RTL8723BU) for wifi. It is working fine in Windows 10 system. From inxi -Fxz command I found that my Network card not installed somehow. In Xumuntu I am now totally without internet. Here I want to add that I have no Wired LAN option in this laptop.

    How can I fix / solve this wifi / network card problem??

    Here's the output of inxi -Fxz

    boundule@BUDDY:~$ inxi -Fxz
    System:    Host: BUDDY Kernel: 4.15.0-30-generic x86_64 bits: 64 gcc: 7.3.0 Desktop: Xfce 4.12.3 (Gtk 2.24.31)
               Distro: Ubuntu 18.04.1 LTS
    Machine:   Device: laptop System: Walton product: Prelude R1 serial: N/A
               Mobo: N/A model: N/A serial: N/A
               UEFI: American Megatrends v: WH-BI-14-Y116AR120-105-C date: 03/13/2018
    CPU:       Dual core Intel Celeron N3350 (-MCP-) arch: N/A cache: 1024 KB
               flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 4377
               clock speeds: max: 2400 MHz 1: 869 MHz 2: 861 MHz
    Graphics:  Card: Intel Device 5a85 bus-ID: 00:02.0
               Display Server: x11 (X.Org 1.19.6 ) drivers: modesetting (unloaded: fbdev,vesa)
               Resolution: [email protected]
               OpenGL: renderer: Mesa DRI Intel HD Graphics 500 (Broxton 2x6)
               version: 4.5 Mesa 18.0.5 Direct Render: Yes
    Audio:     Card Intel Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster
               driver: snd_hda_intel bus-ID: 00:0e.0
               Sound: Advanced Linux Sound Architecture v: k4.15.0-30-generic
    Network:   Card: Failed to Detect Network Card!
    Drives:    HDD Total Size: 1008.2GB (1.2% used)
               ID-1: /dev/sda model: HGST_HTS541010B7 size: 1000.2GB
               ID-2: USB /dev/sdb model: Transcend_8GB size: 8.0GB
    Partition: ID-1: / size: 19G used: 4.6G (27%) fs: ext4 dev: /dev/sda7
               ID-2: /home size: 35G used: 51M (1%) fs: ext4 dev: /dev/sda9
               ID-3: swap-1 size: 6.14GB used: 0.00GB (0%) fs: swap dev: /dev/sda8
    RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
    Sensors:   System Temperatures: cpu: 49.0C mobo: N/A
               Fan Speeds (in rpm): cpu: N/A
    Info:      Processes: 166 Uptime: 37 min Memory: 397.8/3778.5MB Init: systemd runlevel: 5 Gcc sys: 7.3.0
               Client: Shell (bash 4.4.191) inxi: 2.3.56 
    

    Here's the output of lspci; lsusb

    00:00.0 Host bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge (rev 0b)
    00:00.1 Signal processing controller: Intel Corporation Device 5a8c (rev 0b)
    00:02.0 VGA compatible controller: Intel Corporation Device 5a85 (rev 0b)
    00:0e.0 Audio device: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster (rev 0b)
    00:0f.0 Communication controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine (rev 0b)
    00:12.0 SATA controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller (rev 0b)
    00:15.0 USB controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI (rev 0b)
    00:16.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 (rev 0b)
    00:16.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 (rev 0b)
    00:16.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 (rev 0b)
    00:16.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 (rev 0b)
    00:17.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 (rev 0b)
    00:17.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 (rev 0b)
    00:17.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #7 (rev 0b)
    00:17.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #8 (rev 0b)
    00:18.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 (rev 0b)
    00:18.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 (rev 0b)
    00:18.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 (rev 0b)
    00:18.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #4 (rev 0b)
    00:19.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 (rev 0b)
    00:19.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #2 (rev 0b)
    00:19.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #3 (rev 0b)
    00:1c.0 SD Host controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller (rev 0b)
    00:1f.0 ISA bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface (rev 0b)
    00:1f.1 SMBus: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller (rev 0b)
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 005: ID 058f:5608 Alcor Micro Corp. 
    Bus 001 Device 004: ID 0bda:b720 Realtek Semiconductor Corp. 
    Bus 001 Device 003: ID 09da:c10a A4Tech Co., Ltd. 
    Bus 001 Device 002: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
    Bus 001 Device 006: ID 058f:6387 Alcor Micro Corp. Flash Drive
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

    Here's the output of usb-devices | awk '/b720/' RS=

    T:  Bus=01 Lev=01 Prnt=01 Port=06 Cnt=04 Dev#=  4 Spd=480 MxCh= 0
    D:  Ver= 2.10 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=0bda ProdID=b720 Rev=02.00
    S:  Manufacturer=Realtek
    S:  Product=802.11n WLAN Adapter
    S:  SerialNumber=00e04c000001
    C:  #Ifs= 3 Cfg#= 1 Atr=e0 MxPwr=500mA
    I:  If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
    I:  If#= 2 Alt= 0 #EPs= 6 Cls=ff(vend.) Sub=ff Prot=ff Driver=rtl8xxxu
    

    the problem still exist after running the command & reboot.

    boundule@BUDDY:~$ sudo apt install build-essential dkms
    [sudo] password for boundule: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    build-essential is already the newest version (12.4ubuntu1).
    build-essential set to manually installed.
    Suggested packages:
      menu
    The following packages will be upgraded:
      dkms
    1 upgraded, 0 newly installed, 0 to remove and 18 not upgraded.
    Need to get 68.0 kB of archives.
    After this operation, 19.5 kB of additional disk space will be used.
    Do you want to continue? [Y/n] Y
    Get:1 http://bd.archive.ubuntu.com/ubuntu bionic-updates/main amd64 dkms all 2.3-3ubuntu9.2 [68.0 kB]
    Fetched 68.0 kB in 3s (19.6 kB/s)
    (Reading database ... 185574 files and directories currently installed.)
    Preparing to unpack .../dkms_2.3-3ubuntu9.2_all.deb ...
    Unpacking dkms (2.3-3ubuntu9.2) over (2.2.0.3-2ubuntu11) ...
    Setting up dkms (2.3-3ubuntu9.2) ...
    Installing new version of config file /etc/dkms/framework.conf ...
    Installing new version of config file /etc/dkms/template-dkms-mkdeb/debian/control ...
    Installing new version of config file /etc/kernel/prerm.d/dkms ...
    Processing triggers for man-db (2.8.3-2) ...
    boundule@BUDDY:~$ git clone https://github.com/lwfinger/rtl8723bu.git
    Cloning into 'rtl8723bu'...
    remote: Counting objects: 2438, done.
    remote: Total 2438 (delta 0), reused 0 (delta 0), pack-reused 2438
    Receiving objects: 100% (2438/2438), 7.41 MiB | 63.00 KiB/s, done.
    Resolving deltas: 100% (1960/1960), done.
    boundule@BUDDY:~$ cd rtl8723bu
    boundule@BUDDY:~/rtl8723bu$ source dkms.conf
    boundule@BUDDY:~/rtl8723bu$ sudo mkdir /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
    boundule@BUDDY:~/rtl8723bu$ sudo cp -r core hal include os_dep platform dkms.conf Makefile rtl8723b_fw.bin /usr/src/$PACKAGE_NAME-$PACKAGE_VERSION
    boundule@BUDDY:~/rtl8723bu$ sudo dkms add $PACKAGE_NAME/$PACKAGE_VERSION
    
    Creating symlink /var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/source ->
                     /usr/src/rtl8723bu-4.3.6.11_12942.20141204_BTCOEX20140507-4E40
    
    DKMS: add completed.
    boundule@BUDDY:~/rtl8723bu$ sudo dkms autoinstall $PACKAGE_NAME/$PACKAGE_VERSION
    
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area...
    make -j2 KERNELRELEASE=4.15.0-30-generic -C /lib/modules/4.15.0-30-generic/build M=/var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/build..........................
    Signing module:
    Generating a new Secure Boot signing key:
    Generating a 2048 bit RSA private key
    ...............................................+++
    ...........+++
    writing new private key to '/var/lib/shim-signed/mok/MOK.priv'
    -----
     - /var/lib/dkms/rtl8723bu/4.3.6.11_12942.20141204_BTCOEX20140507-4E40/4.15.0-30-generic/x86_64/module/rtl8723bu.ko
    Secure Boot not enabled on this system.
    cleaning build area...
    
    DKMS: build completed.
    
    rtl8723bu.ko:
    Running module version sanity check.
     - Original module
       - No original module exists within this kernel
     - Installation
       - Installing to /lib/modules/4.15.0-30-generic/updates/dkms/
    
    depmod......
    
    DKMS: install completed.
    
    Kernel preparation unnecessary for this kernel.  Skipping...
    
    Building module:
    cleaning build area...
    make -j2 KERNELRELEASE=4.15.0-30-generic -C /lib/modules/4.15.0-30-generic/build M=/var/lib/dkms/rtlwifi-new/0.10/build....(bad exit status: 2)
    ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/rtlwifi-new-dkms.0.crash'
    Error! Bad return status for module build on kernel: 4.15.0-30-generic (x86_64)
    Consult /var/lib/dkms/rtlwifi-new/0.10/build/make.log for more information.
    boundule@BUDDY:~/rtl8723bu$ 
    
  • Thomas Ward
    Thomas Ward almost 6 years
    Comments are not for extended discussion; this conversation has been moved to chat.