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

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.

Join the Conversation

18 Comments

  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+

    1. 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”

        1. 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

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

  5. Bothering again.. installed and rebooted the raspberry but it still shows no wireless interface on the gui

    1. 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

      1. 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

        1. 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

    1. Sorry Daniel, I not sure if I can assist. May be I need to try it again. Hope to do it when get some free time.

Leave a comment

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