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