LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2022, 02:17 AM   #1
ZoMBiE_KiLLeR
Member
 
Registered: Apr 2006
Posts: 34

Rep: Reputation: 16
Exclamation Need help with TP-Link Archer T4U V3.2 USB WiFi dongle


Hello everyone, I’m trying to get a TP-Link Archer T4U V3.2 USB WiFi adapter to work on my Raspberry Pi 2 with Raspberry Pi OS (5.15.32-v7+).

The amount of time spent tying to get this to work is killing me, every error I fix another pops up... A lot of the other forum posts I've found are out of date or don’t apply. Also, is it normal for the LEDs to not light up while in the PI2 but light up when plugged into a laptop? Doesn’t show up when I check ifconfig.

What I’ve tried so far:

Installing the official Linux drivers (not working)
https://www.tp-link.com/ca/support/download/archer-t4u/

Bypassing make file and installing other drivers (still not working)
http://downloads.fars-robotics.net/
http://downloads.fars-robotics.net/w...s/install-wifi

Updating the headers, trying the official again (nope)
https://github.com/gnab/rtl8812au/issues/147
sudo apt-get install raspberrypi-kernel-headers

Copying header files from one folder to another (further along but still no)
sudo cp -r /usr/src/linux-headers-5.15.32-v7+/* /lib/modules/5.15.32-v7+/build/

Now I get this error after trying to make the official drivers:

Quote:
CC [M] /home/pi/driver/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_br_ext.o
/home/pi/driver/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_br_ext.c:20:11: fatal error: net/ipx.h: No such file or directory
20 | #include <net/ipx.h>
| ^~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:277: /home/pi/driver/T4Uv3_WiFi_linux_v5.3.1_beta/core/rtw_br_ext.o] Error 1
make[1]: *** [Makefile:1868: /home/pi/driver/T4Uv3_WiFi_linux_v5.3.1_beta] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.15.32-v7+/build'
make: *** [Makefile:1998: modules] Error 2
The Pi2 setup is headless meaning command line only (no Xwindows) and I SSH into it with different less powerful WiFi dongle (I need both to run at the same time). The end goal is the less powerful one will connect to my phone and the TP-Link Archer T4U V3.2 connects to other networks but I don't want to get ahead of myself, trying to get the TP-Link to work is the focus of this post.
Thanks.
 
Old 07-01-2022, 06:48 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
net/ipx.h is /usr/include/net/ipx.h, part of glibc. You probably need to install glibc-devel, if there is such a package.

RPi OS is based on Debian, which installs skimpy but functional packages. You're compiling. You'll need devel packages for anything that's involved. A simple web search would probably have got you that much.
 
1 members found this post helpful.
Old 07-01-2022, 05:15 PM   #3
ZoMBiE_KiLLeR
Member
 
Registered: Apr 2006
Posts: 34

Original Poster
Rep: Reputation: 16
Talking

Quote:
Originally Posted by business_kid View Post
net/ipx.h is /usr/include/net/ipx.h, part of glibc. You probably need to install glibc-devel, if there is such a package.

RPi OS is based on Debian, which installs skimpy but functional packages. You're compiling.
Ok thanks, I'll update you when I try some more.

Quote:
Originally Posted by business_kid View Post
You'll need devel packages for anything that's involved.
Interesting point, I didn't realize how important that would be.

If anyone has some experience with the TP-Link Archer T4U V3.2 USB WiFi dongle and Raspberry Pi 2 (5.15.32-v7+) or similar, don't hesitate to post! That one little idea you have could end up fixing everything.

Last edited by ZoMBiE_KiLLeR; 07-01-2022 at 05:22 PM.
 
Old 07-02-2022, 09:37 AM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
Quote:
Originally Posted by business_kid
/usr/include/net/ipx.h
I actually needed it and found it in /usr/include/netipx/ipx.h in glibc-2.33

EDIT: One other thing: These Pis are big users of usb wifi dongles, and distributions go to considerable lengths to bend some very dodgy drivers straight to support these dongles for you . Have a good hunt in /lib/modules/<kernel-version>/kernel/drivers/net/wireless, as there's probably more support for usb wifi than you'll find in the mainline kernel.

Last edited by business_kid; 07-02-2022 at 09:50 AM.
 
1 members found this post helpful.
Old 07-05-2022, 04:58 PM   #5
ZoMBiE_KiLLeR
Member
 
Registered: Apr 2006
Posts: 34

Original Poster
Rep: Reputation: 16
Found another thread that's a little different but same error and fixed with newer drivers. Once I get a little more free time I'm going to try everything suggested so far.

https://forums.debian.net/viewtopic.php?t=151844
Quote:
stevepusser wrote: ↑2022-04-05 19:19
Try the source zip from this more recently updated github repo: https://github.com/cilynx/rtl88x2bu
It compiles successfully on the 5.16 Liquorix kernel that I'm running. You also have the option to use the dkms option.
 
Old 07-05-2022, 06:53 PM   #6
ZoMBiE_KiLLeR
Member
 
Registered: Apr 2006
Posts: 34

Original Poster
Rep: Reputation: 16
OMFG! IT LIGHTS UP NOW!! When I type ifconfig it shows the TP-Link Archer T4U V3.2 USB WiFi adapter as wlan1 and my other adapter as wlan0. No ethernet is plugged into eth0.

Here is what I did:

I copied /usr/include/netipx/ipx.h to /usr/include/net
cp /usr/include/netipx/./ipx.h /usr/include/net

Then I fallowed these instructions from https://github.com/cilynx/rtl88x2bu

Quote:
Raspberry Pi Access Point

# Update all packages per normal
sudo apt update
sudo apt upgrade

# Install prereqs
sudo apt install git dnsmasq hostapd bc build-essential dkms raspberrypi-kernel-headers

# Reboot just in case there were any kernel updates
sudo reboot

# Pull down the driver source
git clone https://github.com/cilynx/rtl88x2bu
cd rtl88x2bu/

# Configure for RasPi
sed -i 's/I386_PC = y/I386_PC = n/' Makefile
sed -i 's/ARM_RPI = n/ARM_RPI = y/' Makefile

# DKMS as above
VER=$(sed -n 's/\PACKAGE_VERSION="\(.*\)"/\1/p' dkms.conf)
sudo rsync -rvhP ./ /usr/src/rtl88x2bu-${VER}
sudo dkms add -m rtl88x2bu -v ${VER}
sudo dkms build -m rtl88x2bu -v ${VER} # Takes ~3-minutes on a 3B+
sudo dkms install -m rtl88x2bu -v ${VER}
Thanks for your help business_kid!

I'm going to test it out more and find out the command-line syntax to send, receive and connect to stuff only from TP-Link Archer T4U AKA wlan1 through wlan0 then I'll get back to you.

EDIT:
Also, when I ping it from other computers on the network I get a replay so that's good.

Last edited by ZoMBiE_KiLLeR; 07-05-2022 at 08:26 PM.
 
Old 07-07-2022, 12:39 AM   #7
ZoMBiE_KiLLeR
Member
 
Registered: Apr 2006
Posts: 34

Original Poster
Rep: Reputation: 16
If you have two working wireless wifi adapters (wlan0, wlan1) and you only want to see the stats of one of them type (might need to put sudo before these commands and take out wlan1 to see for all):

sudo ifconfig wlan1
(this one is my TP-Link Archer T4U 3, if you only have one wifi adapter change wlan1 to wlan0 for all the commands below)

A way to list all network interfaces type:
ls /sys/class/net

To make sure it’s up and running type:
sudo ifconfig wlan1 up

To stop it type:
sudo ifconfig wlan1 down (it needs to be up to work)

Scan for wireless networks type (I’m doing this with wlan1 because the TP-Link Archer T4U has a better and bigger antenna then my other wifi adapter. If you only have one adapter you should probably use lwan0):
sudo iwlist wlan1 scan

To see just the wireless network names (ESSIDs, that strait line is called a “pipe” it takes output from one command and puts it in another) type:
sudo iwlist wlan1 scan | grep ESSID

To connect to a wifi network type:
iwconfig wlan1 essid NETWORK_NAME key s:WIRELESS_KEY_PASSWORD
(if the password is not ascii you might have to take out “s:” after key.)

Connect to a WPA/WPA2 wifi network with wpa_supplicant:
Here is a website to help you
https://linuxcommando.blogspot.com/2...i-network.html
and a video I found on the topic of connecting to WPA/WPA2 wifi networks using wpa_supplicant.
https://www.youtube.com/watch?v=QGyHDIYlLFA

If you are connected but not getting an IP address, get one by typing:
sudo dhclient wlan1

If you want more information type
sudo iwconfig wlan1

Quick hack, if you have a nub or crappy wifi antenna, plug your USB wifi adapter into a USB extension cable and move it around to a better spot but you are better off getting an adapter with a bigger antenna. If you want to do more advance stuff including monitoring mode, make sure to read up on your wifi adapters features and find out if it’s compatible with your system before you buy it.

Most routers have two bands 2.4GHz and 5GHz, you may want to separate your wireless adapters to other signals if you are getting slow speeds because of interference.

If you want to install graphical user interface for your Wifi adapters and Ethernet like nmtui (network-manager) it will force a change of your IP addresses (kick you off your headless connection) and you’ll have to go looking for those new IPs. Also, some commands will stop working (I had to remove it). If anyone has a suggestion of a CLI-Based GUI application for networking that wont change your settings post it here please.

If you have anything to add let me know.

Last edited by ZoMBiE_KiLLeR; 07-07-2022 at 01:09 AM.
 
Old 03-01-2023, 07:44 PM   #8
stevebox
LQ Newbie
 
Registered: Mar 2023
Posts: 1

Rep: Reputation: 0
Wink works for Pi4B

Thanks for pointing out this method of compiling a loadable kernel module! It also worked for me on my Pi 4B.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Install TP-Link AC600 Archer T2U Nano WiFi USB Adapter In Linux LXer Syndicated Linux News 0 04-25-2021 04:05 PM
TP-LINK Archer T4U on USB 2.0 c7aig2123 Linux - Hardware 2 02-24-2017 06:12 AM
[SOLVED] Installing TP-LINK T4U (USB WLAN ADAPTER) on Kali Linux 2.0 VM impossible YouGamePlayHD Debian 3 02-14-2016 03:56 AM
Install wireless adapter (TP-Link Archer T4U) on Kali virtual machine WZalm Linux - Newbie 1 04-30-2015 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration