WiFi module 8812AU not working with kernel version >= 4.4.0-28-generic

13,733

Solution 1

Here is a quick script that I wrote to manually fix a broken rtl8812au-dkms driver issue that occurs after every kernel software update. Run the script with sudo after a kernel software update has occurred. The problem with this driver is that dkms builds it for the wrong kernel. It's a problem with dkms.conf, in the source code. I may have a permanent fix pending.

You can tell if you've got a kernel module load error in /var/log/syslog at boot time. In terminal, a modinfo 8812au will show vermagic as incorrect.

#!/bin/bash  
# save as ~/Desktop/fix_8812au.sh  
# in terminal: chmod +x ~/Desktop/fix_8812au.sh
# in terminal, run with: sudo ~/Desktop/fix_8812au.sh

cd /var/lib/dkms

# rtl8812au  

dkms remove rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"  
dkms build rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"  
dkms install rtl8812au/4.3.8.12175.20140902+dfsg -k "$(uname -r)/$(uname -p)"

Update: the user was also using an older version of the 8812au driver, so we installed the current version of rtl8812au-dkms from the repositories, and it all worked. The script will be required immediately after the next kernel software update.

Update #2: the proper fix (thanks @Jeremy31) for this bug is to edit these two files:

gksudo gedit /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/dkms.conf

gksudo gedit /var/lib/dkms/rtl8812au/4.3.8.12175.20140902+dfsg/build/dkms.conf

and replace MAKE="'make' all" with this line:

MAKE[0]="'make' all KVER=${kernelver}"

Solution 2

This package can be fixed by editing the dkms.conf files...

sudo -H gedit /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/dkms.conf

Then change line 4 from MAKE="'make' all" to MAKE="'make' all KVER=${kernelver}"

Save and exit the editor then do the same with:

sudo -H gedit /var/lib/dkms/rtl8812au/4.3.8.12175.20140902+dfsg/build/dkms.conf

As a similar problem was reported on Ubuntu Forums and my edits have worked for the last kernel update I got.

For your current kernel you should be able to:

dkms build rtl8812au/4.3.8.12175.20140902+dfsg -k $(uname -r)
dkms install rtl8812au/4.3.8.12175.20140902+dfsg -k $(uname -r)
Reboot
Share:
13,733
mz1000
Author by

mz1000

Updated on September 18, 2022

Comments

  • mz1000
    mz1000 over 1 year

    Problem

    I had a Linksys WUSB 6300 dual-band USB WiFi adapter happily running on on my desktop PC with driver module 8812AU.

    When I first got it to work I used the driver signing method to get it to work with Secure Boot. It worked fine with Kernel version 4.4.0-23-generic and later also with 4.4.0-24-generic where I resigned it after the update.

    After the update to 4.4.0-28-generic resigning for some reason does not have the desired effect anymore and it does not seem to load the driver module 8812AU.

    After updating to 4.4.0-38-generic the behavior remains the same.

    The Additional Drivers tool now shows me this, so I am not sure if somehow the module files got messed up. I am pretty new to Ubuntu, so I wouldn't know how to tell. When it was still working it showed me this.

    So in consequence the network adapter is not working and I am out of ideas what to check or do in order to get it back to work.

    Details

    lsusb shows me that the adapter is recognized as USB device:

    Bus 002 Device 002: ID 13b1:003f Linksys WUSB6300 802.11a/b/g/n/ac Wireless Adapter [Realtek RTL8812AU]
    

    sudo lshw -C network only shows me the Ethernet and the internal WiFi (it has a very similar name). It is an integrated WiFi adapter which is working poorly under Ubuntu and is thus not useful for me.

    Note: 8821AE is the internal WiFi. I am trying to get 8812AU to run which is not listed here because it does not seem to be loaded.

    *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:03:00.0
       logical name: enp3s0
       version: 11
       serial: 54:a0:50:d5:4b:0b
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8168g-2_0.0.1 02/06/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:42 ioport:e000(size=256) memory:f7d00000-f7d00fff memory:f0000000-f0003fff
    *-network
       description: Wireless interface
       product: RTL8821AE 802.11ac PCIe Wireless Network Adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlp4s0
       version: 00
       serial: 54:27:1e:d6:91:8d
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtl8821ae driverversion=4.4.0-22-generic firmware=N/A ip=192.168.0.20 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:46 ioport:d000(size=256) memory:f7c00000-f7c03fff
    

    Running rfkill list all shows that nothing seems to be blocked:

    0: hci0: Bluetooth
        Soft blocked: no
        Hard blocked: no
    1: phy0: Wireless LAN
        Soft blocked: no
        Hard blocked: no
    

    Any help would be greatly appreciated!

    Many thanks.

    • chili555
      chili555 over 7 years
      I believe the correct driver for the USB is 8812au. What is the exact result of: sudo modprobe -r rtl8821ae and next: sudo modprobe 8812au ? Welcome to askubuntu.
    • Boris Hamanov
      Boris Hamanov over 7 years
      Oh. The 8812au dkms driver has a problem. DKMS builds a module for the prior kernel during the MAKE step, and it won't load in the current kernel (where it's supposed to). You can tell if you've got a kernel module load error at boot time. A modinfo 8812au will show vermagic as incorrect. A manual dkms remove/build/install works though. There's a problem in makefile, if memory serves me, and I haven't been able to fix it yet. Cheers, Al
    • Boris Hamanov
      Boris Hamanov over 7 years
      See my manual dkms fix it script below in an answer. Adjust the version number if you need to. Cheers, Al
    • WinEunuuchs2Unix
      WinEunuuchs2Unix over 7 years
      Don't feel bad the Additional Drivers screen kept changing around inexplicably on me too during same boot visits. After picking a Nvidia driver to install the entire section disappeared altogether. Someone here told me this was because I picked a PPA to install from shrugs.
    • Boris Hamanov
      Boris Hamanov over 7 years
      @mz1000 the short answer is that you need to install rtl8812au-dkms using Synaptic. Also read and download my fixit script so that after any kernel software update, you can fix that the driver broke again (until somebody fixes it). Cheers, Al
  • Pilot6
    Pilot6 over 7 years
    How is this related to the question?
  • Pilot6
    Pilot6 over 7 years
    The question is about SIGNING of kernel modules.
  • Boris Hamanov
    Boris Hamanov over 7 years
    @Pilot6, yes, signing, but actually, getting the 8812au driver to work again.
  • Boris Hamanov
    Boris Hamanov over 7 years
    for shame, giggle. Force loading a bad module. See my comments above about the defective 8812au driver... and learn some dkms... it's not hard, really. Cheers, Al
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    Haha I clearly stated never force a kernel module before I said how to do it. FTR I learned dkms for EnhanceIO (HDD to SSD disk caching software) 2 years ago in that scenario forcing an incompatible kernel version in would be disastrous, unlike forcing an internet connection in. As it were using Intel RST and EnhanceIO to accelerate the same HDD (two partitions) to the same mSata SSD (two cache volumes) turned out to be a bad idea after 18 months... Hello bricked windows HDD :(
  • mz1000
    mz1000 over 7 years
    @heynnema Seems like you are on the right track. In the syslog I see the message: 8812au: disagrees about version of symbol module_layout. modinfo gives me this. Should I change the version in your script to 4.2.2_7502.20130517? Above you mentioned I should use Synaptic to install the driver. How to do that?
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 Your paste.ubuntu.com lead to a blank page. Did you get the URL correct? I'm sure that it said vermagic was for an old kernel, not the one that you're running now. Also, also your version number is lower than mine (the one in the Ubuntu repositories), the date on yours is 2013, and mine is 2014. Hum. If I had to, I'd recommend using the one from the repositories, as I don't know where you got your version from. But yes, if you decide to use what you've got, you'll have to update the script with the correct version numbers. Cheers, Al
  • mz1000
    mz1000 over 7 years
    Thanks for your answer, but I'll avoid the force for now ;-)
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 to use Synaptic to load the newer driver, start Synaptic, click the RELOAD icon, then SEARCH icon, enter rtl8812au-dkms, mark it for install, click APPLY icon. Cheers, Al
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 remember that my script is only required 1) if the kernel gets updated during a software update, and 2) if nobody comes up with a fix for the bug in the driver (I may have a fix pending). Cheers, Al
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 and oh, you'll want to dkms remove your older driver, else you'll get two of them trying to load. Just use the single command from my script as an example, and using sudo dkms remove and changing the version number. You'll also need to sudo rmmod 8814au to unload the older driver from the kernel. Cheers, Al
  • mz1000
    mz1000 over 7 years
    @heynnema Thanks a lot for all your suggestions. I used Synaptic to install the newer driver version and it worked. Even without running your script. I didn't remove the previous module version, should I clean up now or leave it because it is working now? I am wondering why I was stuck on the old version and why apt-get upgrade didn't give me the newer version.
  • mz1000
    mz1000 over 7 years
    @heynnema Your comments solved my problem because I could install the newer driver version with Synaptic. I would like to appreciate your help by marking it as accepted. But I am not sure because the solution that worked for me is actually not mentioned in the answer (I am new to askubuntu). What do you recommend?
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 you'll only need the script if they update the kernel in future software updates. You don't need the rmmod command if installing the new version overwrote it, and it's working. A reboot would tell for sure. You do need to cleanup the old driver... in terminal, type dkms status, and if you see the old version listed, we should sudo dkms remove it (and then you may have to reinstall the new one again). Go ahead and vote/accept the answer, as the comments support what it says well enough. Cheers, Al
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    May the force be with you :)
  • Boris Hamanov
    Boris Hamanov over 7 years
    @mz1000 I did a minor edit to my answer. Cheers, Al
  • Boris Hamanov
    Boris Hamanov over 7 years
    Your dkms build and dkms install commands have an incorrect -k parameter. You have an older kernel listed. Should be 4.4.0-38-generic/x86_64. See my script for another way to get the correct kernel. Thanks for the potential fix! Cheers, Al
  • Jeremy31
    Jeremy31 over 7 years
    I am sorry about that as I was also trying to put a fixed version on github. The poster must have posted lshw -c net results from the older kernel Thanks heynnema
  • mz1000
    mz1000 over 7 years
    @heynnema I got a new kernel version and I am trying to get the WiFi back to run with your script. I successfully removed the module from dkms and built it again. But when installing I get already installed on kernel ... dkms status shows the module with WARNING! Diff between built and installed module! Do you have any hint to get it back to work?
  • Boris Hamanov
    Boris Hamanov over 7 years
    Use the sudo rmmod 8812au to remove the old module currently installed in the kernel, then you can use the entire script, or just the dkms install part of it. Let me know how you do. Cheers, Al
  • mz1000
    mz1000 over 7 years
    @heyennema No luck so far. It says: rmmod: ERROR: Module 8812au is not currently loaded
  • Boris Hamanov
    Boris Hamanov over 7 years
    Do modinfo 8812au and make sure the version number displayed in filename equals the version number displayed in vermagic. If so, do sudo modprobe 8812au. Cheers, Al
  • mz1000
    mz1000 over 7 years
    modinfo 8812au shows filename: /lib/modules/4.4.0-43-generic/updates/dkms/8812au.ko and vermagic: 4.4.0-38-generic SMP mod_unload modversions, so the versions do not match.
  • Boris Hamanov
    Boris Hamanov over 7 years
    That's wrong. Those two fields should have similar 4.4.0-xx version numbers. Did you execute my script entirely, or do one command at a time? Did you copy/paste, or manually type in the commands? Try the entire script. Check the vermagic field when it's done. Also, check my updated answer for a permanent fix so you won't have to deal with this in the future. Cheers, Al
  • WinEunuuchs2Unix
    WinEunuuchs2Unix over 7 years
    @heynnema For those of us that don't have the rtl drivers it would have been interesting if you could have shown the MAKE line before it is changed.
  • Boris Hamanov
    Boris Hamanov over 7 years
    @WinEunuuchs2Unix your wish is my command :-) Cheers, Al
  • Boris Hamanov
    Boris Hamanov over 7 years
    Are you using sudo with the script? Also, make sure to use @heynnema in your comment replies, otherwise I may not see them. Easiest then to use Synaptic to do a "complete removal" of rtl8812au-dkms, and then reinstall it. You'll have to edit those two files again so that the next kernel update will go without this problem. Let me know how you do. Cheers, Al
  • mz1000
    mz1000 over 7 years
    @heynnema I did as you suggested without success. And yes, I used sudo with the script. I noticed a few things, maybe it helps somehow: After complete removal with Synaptic dkms status does not show anything related to 8812au, but modinfo 8812au still shows the same as before and sudo rmmod 8812au also still shows the same as before. Another thing I noticed: When the script calls dkms remove ... there is a message displayed saying: rmdir: failed to remove '': No such file or directory. Full script output.
  • Boris Hamanov
    Boris Hamanov over 7 years
    Manually delete the driver with sudo rm /lib/modules/4.4.0-43-generic/updates/dkms/8812au.ko (change the 4.4.0-43 if you have a different current version). sudo rmmod 8812au should show no such module loaded. dkms status should show no 8812au installed. Now reinstall r8812au-dkms, and at this point your wireless should be working. If not, first do a modinfo 8812au and reverify vermagic. If it's ok, the sudo modprobe 8812au. Then, finally edit the two dkms.conf files. You won't need my script this time, or in the future. Let me know. Cheers, Al
  • mz1000
    mz1000 over 7 years
    @heynnema That did the trick, after manually removing the file and re-installing everything works again. Super, THX!!