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”
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
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”
Was this issue resolved i get the same error as StevePhilips?
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
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……
I have tried to enhance that section.
Thank you for the feedback.
Hope it worked for you.
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.
It gives an error that the command dkms is not found. I have modified the makefile as per instruction.
Please run this command:
sudo apt-get install dkms
Then try again.
Bothering again.. installed and rebooted the raspberry but it still shows no wireless interface on the gui
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
It shows that it’s installed:
rtl8192eu, 1.0, 4.9.59+, armv6l: installed
So are you able to assist?
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.
I had to also install dkms before I could do the dkms commands.
Yes we have to.
I updated post to include that.
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:
You can see the “Makefile” at https://github.com/Mange/rtl8192eu-linux-driver .
May be you are not familiar with Git. With the “git clone” command I put below, all the files from above link will be copied to your computer in folder “rtl8192eu-linux-driver”:
git clone –branch realtek-4.4.x https://github.com/Mange/rtl8192eu-linux-driver.git
You saved me a lot of hairs, thank you!
Glad to hear that.
Are you same Daniel commented earlier?
worked perfectly
Glad to hear that.
Hi there,
This worked really well for me on my Rpi 3
Thanks a lot
You are welcome.
Glad to hear it helped you.
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.
Looks like your Pi not having Internet connection.
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!
Make sure you installed kernel headers with the command:
sudo apt-get install raspberrypi-kernel-headers dkms
I just found another repo having latest code: https://github.com/clnhub/rtl8192eu-linux
Please try this new repo with above instructions.
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 🙁
Hi – It worked for me. Any clue why the dongle connectivity green led stopped working (it is always off now)?
Glad to know it worked for you too!
No idea about LED. Actually I did not use it for years now!
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+.
Just wondering why you need to use the WiFi adapter on RPi3B as it already has WiFi capability built-in? 🙂
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.
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!
You need to install kernel headers and other required stuffs with this command:
sudo apt-get install raspberrypi-kernel-headers dkms
Hi
I have the same problem, only for kernel 6.1.31-v7+
Can you please help?
Please see if this post helps you: https://nerdgineer.com/tl-wn823n-for-raspberry-pi/
Well it did help eventually 🙂
I already tried it before but I guess I had some “leftovers” from previous tries, so after a reboot and some cleaning it worked!
Thanks a lot
….and it still works like a charme
Thank you so much.
Works great, thanks, but the activity LED does not work! Any fix for this? Thanks!
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.
[…] There are clearly numerous sources, however they all point back to one main source of knowledge, a blog post from Junaid’s […]