Install Driver for TP-Link TL-WN823N in Raspberry Pi 2 Model B


Recently I brought TP-Link TL-WN823N wireless USB adapter to connect my Raspberry Pi over wireless network. Mine is Raspberry Pi 2 Model B, so not having built in wireless capability. I chose TP-Link TL-WN823N over Edimax EW-7811Un because of its 300 Mbps speed, both were available on amazon.in with similar price.

It did not get detected out of box when plugged into my laptop running Ubuntu 16.04. The driver available at TP-Link website could not be installed because it was for older version of kernel. However, I could easily find driver over Googling and it worked fine.

Then I tried to make it work on my Raspberry Pi 2 model B. As expected it did not get detected. I searched over Internet for driver installation. I could see many postings around installing driver for Raspberry Pi but most of them were outdated and did not work for me. Finally I could find a way to install driver after searching further and trying many methods.

First, create directory to keep the driver source files in a common place if you don’t have it already.

mkdir drivers && cd drivers

Install Prerequisites

I used latest Raspbian Jessie released on 5th of July 2017. For me it required only to install kernel header files as shown below.

sudo apt-get install raspberrypi-kernel-headers dkms

Get Driver Source

Get the driver source files hosted at github repo https://github.com/Mange/rtl8192eu-linux-driver. The driver source seems like for D-Link DWA-131, which is having same chipset, rtl8192eu, as my TP-Link TL-WN823N v2.

We have to clone realtek-4.4.x branch, which is for Linux kernel 4.4. However it worked for my Raspbian having kernel version 4.9.35.

git clone --branch realtek-4.4.x https://github.com/Mange/rtl8192eu-linux-driver.git

Target Raspberry Pi

By default the building process will target desktop systems. We have to change that, to build the driver for Raspberry Pi.

You will see Makefile within driver source directory you just cloned above. Open it in a text editor. You can find following line:

CONFIG_PLATFORM_I386_PC = y

Change it to:

CONFIG_PLATFORM_I386_PC = n

Then find following line.

CONFIG_PLATFORM_ARM_RPI = n

Change it to:

CONFIG_PLATFORM_ARM_RPI = y

Build and Install Driver from Source

Now we can build and install the driver.

cd rtl8192eu-linux-driver/
sudo dkms add .
sudo dkms install rtl8192eu/1.0

If everything went well, then WiFi adapter should get detected once you restart networking service or reboot Pi.


48 responses to “Install Driver for TP-Link TL-WN823N in Raspberry Pi 2 Model B”

  1. Thanks for this! I used it to get an old Model B up and running again using a new TP-Link TL-WN823N v2 adapter.

    However, I had to make a small change to the Makefile *BEFORE* running the “sudo dkms add .” command.

    1. Change CONFIG_PLATFORM_I386_PC from y to n
    2. Change CONFIG_PLATFORM_ARM_RPI from n to y

  2. When I attempt to compile with ‘sudo dkms install rtl8192eu/1.0’ I recieve the following error:

    Kernel preparation unnecessary for this kernel. Skipping…
    Building module:
    cleaning build area…
    ‘make’ all KVER=4.9.41-v7+…(bad exit status: 2)
    Error! Bad return status for module build on kernel: 4.9.41-v7+ (armv7l)
    Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.

    My kernal version is: 4.9.41-v7+

    • Please make sure modified Makefile as per above instructions. Regarding lines containing CONFIG_PLATFORM_I386_PC and adding new line “CONFIG_PLATFORM_ARM_RPI = y”

        • Not sure if you have solved this by now but I was having same problem. I got it work by using

          sudo make clean
          sudo make
          sudo make install
          sudo modprobe -a 8192eu

          after making the changes in the makefile. You also don’t need to add a new line for the ARM_RPI because you can change the existing which is about 5 lines down.

          The name still doesn’t show up when using lsusb but if it use sudo lshw -c network it shows the correct driver.

          See https://github.com/Mange/rtl8192eu-linux-driver

  3. Open the Makefile in text editor. Can you explain…..I lost you just here……
    You need to add…

    “sudo nano rtl8192eu-linux-driver/Makefile”
    This opens the file that you then can edit……

  4. Having an error building and installing the driver. Could you please assist? Version: raspberrypi 4.9.24+ #993 Wed Apr 26 17:56:54 BST 2017 armv6l GNU/Linux

    • Let me try.
      What error is you getting? Please paste it here.
      Hope you modified Makefile per my above instruction.

    • Sorry to hear that.
      I may have to try my Pi which I did not touch for last may months.
      Btw, please let me know you get when running following command?:

      sudo lsusb

      • The following is printed:

        Bus 001 Device 006: ID 046d:c31c Logitech, Inc. Keyboard K120
        Bus 001 Device 005: ID 2357:0109
        Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
        Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. SMC9514 Hub
        Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

        • It looks like the second one is your WiFi adapter, but wondering why it is not showing the name. Did it get installed properly?

          Also, what you get if run command?:

          sudo dkms status

  5. can you tell me how can i find that makefile? i’m newbe here thx
    By default the building process will target desktop systems. We have to change that, to build the driver for Raspberry Pi.

    You will see Makefile within driver source directory you just cloned above. Open it in a text editor. You can find following line:

  6. Hi! This hasn’t really worked for me. I was wondering if you could help. First of when I try to install dkms, I run the command and get the errors as followed: Temporary failure resolving ‘raspbian.raspberrypi.org’
    Err:2 http://archive.rasperrypi.org/Debian buster/main armhf raspberrypi kernel-headera armf 1.20210108-1

    I also get more errors. I also can’t clone the git package.

  7. As soon as I get to the final install: sudo dkms install rtl8192eu/1.0 an error occurs: “Your kernel headers for kernel 5.4.79-v7+ cannot be found at /lib/modules/5.4.79-v7+/build or /lib/modules/5.4.79-v7+/source.” Any help would be greatly appreciated!

      • Hi, I just removed the 4.4.x version and tried to install the 5.6.3.1 but it failed. The command

        “sudo dkms install -m rtl8192eu -v 1.0”

        returns

        “user@hostname:/home/pi/drivers/rtl8192eu-linux# sudo dkms install -m rtl8192eu -v 1.0

        Kernel preparation unnecessary for this kernel. Skipping…

        Building module:
        cleaning build area…
        ‘make’ all KVER=5.10.52-v7+…(bad exit status: 2)
        Error! Bad return status for module build on kernel: 5.10.52-v7+ (armv7l)
        Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.”

        Not sure where the issue is – Just rolled back to 4.4.x 🙁

  8. Hi – It worked for me. Any clue why the dongle connectivity green led stopped working (it is always off now)?

  9. Thanks for this! After researching which Wifi USB sticks are suitable for the RPi3B, I decided on the TP-Link TL-WN823N. This came (of course) as an “EU” version, and therefore did not work “out of the box”. With these instructions (and after deactivating the internal Wifi) it worked immediately. Deployment: “RaspAp”, Raspbian GNU/Linux 10 (buster), Linux raspberrypi 5.10.52-v7+.

      • Of course, the Wifi built into the RPi3B is sufficient for “proof of concept” for the RaspAp application. The connection over a short distance without obstacles works. However, the performance is not sufficient for a stable connection from the living room to the kitchen in my flat. With this Wifi adapter, I can easily connect two PCs (in different rooms) and a smartphone to RaspAp.

  10. Hi everyone, I’ve done everything up until; SUDO DKMS INSTALL RT18192eu/1.0, I get the following error….
    Your kernel headers for kernel 5.4.79+ cannot be found at
    /lib/modules/5.4.79+/build or /lib/modules/5.4.79+/source.

    Anyone know a fix for this? Thanks!

  11. Just a quick message to say thanks to Junaid as this is still working and got me out of a jam after others’ suggested methods hadn’t worked for me. Many thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *