Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works with tp-link TXE70UH (8852cu) #17

Open
skyer9 opened this issue Jun 18, 2024 · 11 comments
Open

Works with tp-link TXE70UH (8852cu) #17

skyer9 opened this issue Jun 18, 2024 · 11 comments

Comments

@skyer9
Copy link

skyer9 commented Jun 18, 2024

My Product is TXE70UH.

lsusb
Bus 001 Device 004: ID 35bc:0102 Realtek 802.11ax WLAN Adapter

modified some code.

	{USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8832CU) */
	{USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0102, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8852CU) */

and built source.

if OS is Ubuntu, below command is needed.

# https://github.com/McMCCRU/rtl8188gu 
sudo rmmod option
sudo rm /lib/modules/$(uname -r)/kernel/drivers/usb/serial/option.ko
sudo depmod -a

in Ubuntu, kernel module option breaks usb type detection.
kernel module option means GSM modem driver.

Jun 18 13:32:37 kernel: [ 4453.602089] usb 1-2: new high-speed USB device number 8 using xhci_hcd
Jun 18 13:32:38 kernel: [ 4453.750658] usb 1-2: New USB device found, idVendor=35bc, idProduct=0102, bcdDevice= 0.00
Jun 18 13:32:38 kernel: [ 4453.750665] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 18 13:32:38 kernel: [ 4453.750669] usb 1-2: Product: 802.11ax WLAN Adapter
Jun 18 13:32:38 kernel: [ 4453.750672] usb 1-2: Manufacturer: Realtek
Jun 18 13:32:38 kernel: [ 4453.750675] usb 1-2: SerialNumber: 00e04c000001
Jun 18 13:32:38 kernel: [ 4453.755453] option 1-2:1.0: GSM modem (1-port) converter detected
Jun 18 13:32:38 kernel: [ 4453.758561] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
Jun 18 13:32:38 snapd[753]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug
Jun 18 13:32:38 usb_modeswitch[6920]: usb_modeswitch: switched to 35bc:0102 on 1/8
Jun 18 13:32:39 usb_modeswitch_dispatcher[6920]: Unable to open bind list file: No such file or directory
Jun 18 13:32:39 usb_modeswitch[6920]: usb_modeswitch: add device ID 35bc:0102 to driver option
Jun 18 13:32:39 usb_modeswitch[6920]: usb_modeswitch: please report the device ID to the Linux USB developers!
Jun 18 13:32:46 systemd[1]: [email protected]: Succeeded.

=============================================

additionally

sudo vi /lib/udev/rules.d/40-usb_modeswitch.rules
......
# Realtek 8852CU Wifi USB
ATTR{idVendor}=="35bc", ATTR{idProduct}=="0102", RUN+="/usr/sbin/usb_modeswitch -K -v 35bc -p 0102"
......

i needed to change usb type as dongle mode.
more over, it needs reboot.

sudo reboot

and i can find dongle.

ifconfig
......
wlx60XXXXXXXXXX: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 60:XX:XX:XX:XX:XX  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

but some error exists.

if i plug out TXE70UH and plug in this, it dose not work.
it needs reboot too.

@pigbrian
Copy link

Hi skyer9,

Do you using kernel above 6.5 ?

When I checked kernel 5.10, 5.15(ubuntu 20.04), 6.5(ubuntu22.04), TXE70UH is not working.
On the ubuntu 24.04 (kernel 6.8), driver have some errors, but iw scan is work.

@skyer9
Copy link
Author

skyer9 commented Jun 18, 2024

uname -a
Linux XXXXXX 5.4.0-124-generic #140-Ubuntu SMP Thu Aug 4 02:23:37 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

for some reason, i use kernel 5.4.0.
Ubuntu 20.04.

i think problem is USB Type auto detection.

without usb_modeswitch,
LAN Card recognized as GSM modem and fails.
you can check it in dmesg or syslog.

Jun 18 13:32:37 kernel: [ 4453.602089] usb 1-2: new high-speed USB device number 8 using xhci_hcd
Jun 18 13:32:38 kernel: [ 4453.750658] usb 1-2: New USB device found, idVendor=35bc, idProduct=0102, bcdDevice= 0.00
Jun 18 13:32:38 kernel: [ 4453.750665] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 18 13:32:38 kernel: [ 4453.750669] usb 1-2: Product: 802.11ax WLAN Adapter
Jun 18 13:32:38 kernel: [ 4453.750672] usb 1-2: Manufacturer: Realtek
Jun 18 13:32:38 kernel: [ 4453.750675] usb 1-2: SerialNumber: 00e04c000001
Jun 18 13:32:38 kernel: [ 4453.755453] option 1-2:1.0: GSM modem (1-port) converter detected
Jun 18 13:32:38 kernel: [ 4453.758561] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
Jun 18 13:32:38 snapd[753]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug
Jun 18 13:32:38 usb_modeswitch[6920]: usb_modeswitch: switched to 35bc:0102 on 1/8
Jun 18 13:32:39 usb_modeswitch_dispatcher[6920]: Unable to open bind list file: No such file or directory
Jun 18 13:32:39 usb_modeswitch[6920]: usb_modeswitch: add device ID 35bc:0102 to driver option
Jun 18 13:32:39 usb_modeswitch[6920]: usb_modeswitch: please report the device ID to the Linux USB developers!
Jun 18 13:32:46 systemd[1]: [email protected]: Succeeded.

@pigbrian
Copy link

Thank you skyer9.

Based on your comment, I checked it in kernel 5.15.
It works well.

[ 170.118473] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 170.118579] cfg80211: Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[ 170.118672] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 170.120984] 8852cu: loading out-of-tree module taints kernel.
[ 170.122187] 8852cu: module verification failed: signature and/or required key missing - tainting kernel
[ 170.460125] eric-tx CALL alloc_txring !!!!
[ 170.465948] usbcore: registered new interface driver rtl8852cu
[ 170.474249] rtl8852cu 1-9.1:1.0 wlxd84489034f3d: renamed from wlan0

@Logzy72
Copy link

Logzy72 commented Jun 27, 2024

I also have a Txe70uh trying to use this with Linux mint.
Could someone please give me detailed instructions how I load the driver into Linux mint.
Thank you.

@skyer9
Copy link
Author

skyer9 commented Jun 28, 2024

Tested on Ubuntu.

  1. check lan card

plug lan card and check recognition.

lsusb
......
Bus 001 Device 004: ID 35bc:0102 Realtek 802.11ax WLAN Adapter
......
  1. compile
git clone https://github.com/lwfinger/rtw8852cu
cd rtw8852cu
vi Makefile
......
#CONFIG_RTW_COUNTRY_CODE = XX
CONFIG_RTW_COUNTRY_CODE = US
......
vi os_dep/linux/usb_intf.c
......
	{USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8832CU) */
	{USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0102, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8852CU) */
......
make
ll *.ko
  1. install
sudo mkdir -p /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
sudo cp 8852cu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
sudo chmod 644 /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko
sudo depmod -a
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko
  1. check
lsmod | grep 8852cu
  1. on Ubuntu
lsmod | grep option

# https://github.com/McMCCRU/rtl8188gu 
sudo rmmod option
sudo rm /lib/modules/$(uname -r)/kernel/drivers/usb/serial/option.ko
sudo depmod -a
  1. reboot

@Logzy72
Copy link

Logzy72 commented Jun 28, 2024 via email

@AdrianDC
Copy link

Working tp-link TXE70UH (2024, 8852cu) on Ubuntu 23.10 here too, mixing this issue and #20 :

  • USB 35b2:0502: TP-Link AXE5400 ? (RTW8832CU)
  • USB 35bc:0101: TP-Link AXE5400 TX50UH (RTW8832CU)
  • USB 35bc:0102: TP-Link AXE5400 TXE70UH (RTW8852CU)

Stable 305 Mbits/s download + upload, both with the tp-link AX3000 Archer AX55 router and the ISP WiFi 6 box.

{
  # Patch
  cat >../rtw8852cu.patch <<EOF
diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c
index 760030b..64298f1 100755
--- a/os_dep/linux/usb_intf.c
+++ b/os_dep/linux/usb_intf.c
@@ -145,7 +145,9 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
 	{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xC85A, 0xff, 0xff, 0xff), .driver_info = RTL8852C},
 	{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xC832, 0xff, 0xff, 0xff), .driver_info = RTL8852C},
 	{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDER_ID_REALTEK, 0xC85D, 0xff, 0xff, 0xff), .driver_info = RTL8852C},
-	{USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400 */
+	{USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400 (RTW8832CU) */
+	{USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0101, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400 TX50UH (RTW8832CU) */
+	{USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0102, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400 TXE70UH (RTW8852CU) */
 	{}	/* Terminating entry */
 };
 
EOF

  # Apply
  git stash
  git apply --stat ../rtw8852cu.patch
  git apply --summary ../rtw8852cu.patch
  git apply -v ../rtw8852cu.patch

  # Build
  make

  # Install
  sudo make install

  # Reload
  sudo modprobe -r 8852cu || true
  sudo modprobe 8852cu
}

@UncleRaymondo
Copy link

Does not appear to work on Kali Linux 2024.3, running on ESXi 6.7 via VMWare Workstation 17.6, and with Kernel 6.10.9 :(

lsusb just seems to hang with no response when trying to probe. 35bc:0102 TXE70UH(EU) Ver 1.0 is the USB dongle.

@vincelawdev
Copy link

Tested on Ubuntu.

1. check lan card

plug lan card and check recognition.

lsusb
......
Bus 001 Device 004: ID 35bc:0102 Realtek 802.11ax WLAN Adapter
......
2. compile
git clone https://github.com/lwfinger/rtw8852cu
cd rtw8852cu
vi Makefile
......
#CONFIG_RTW_COUNTRY_CODE = XX
CONFIG_RTW_COUNTRY_CODE = US
......
vi os_dep/linux/usb_intf.c
......
	{USB_DEVICE_AND_INTERFACE_INFO(0x35b2, 0x0502, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8832CU) */
	{USB_DEVICE_AND_INTERFACE_INFO(0x35bc, 0x0102, 0xff, 0xff, 0xff), .driver_info = RTL8852C}, /* TP-Link AXE5400(RTW8852CU) */
......
make
ll *.ko
3. install
sudo mkdir -p /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
sudo cp 8852cu.ko /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
sudo chmod 644 /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko
sudo depmod -a
sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko
4. check
lsmod | grep 8852cu
5. on Ubuntu
lsmod | grep option

# https://github.com/McMCCRU/rtl8188gu 
sudo rmmod option
sudo rm /lib/modules/$(uname -r)/kernel/drivers/usb/serial/option.ko
sudo depmod -a
6. reboot

sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko insmod: ERROR: could not insert module /lib/modules/6.8.0-41-generic/kernel/drivers/net/wireless/8852cu.ko: Key was rejected by service

I get an error at this step on my Linux Mint. Any ideas?

@vincelawdev
Copy link

I got this from ChatGPT.

The error message indicates that the kernel module you are trying to load (8852cu.ko) is being rejected due to an issue with its cryptographic signature. This often happens on systems with Secure Boot enabled. Here’s how you can troubleshoot and fix the issue:

  1. Check Secure Boot Status

Secure Boot can block unsigned or improperly signed modules.

Run the following command to check Secure Boot status:

`mokutil --sb-state

If Secure Boot is enabled, you’ll need to either disable it or sign the module.`

  1. Disable Secure Boot (if appropriate)
  • Reboot your system and enter the BIOS/UEFI settings.
  • Locate the Secure Boot option and disable it.
  • Save and exit the BIOS, then retry loading the module.
  1. Sign the Module for Secure Boot

If you don’t want to disable Secure Boot, you can sign the module instead:

a. Generate a Signing Key

mkdir ~/module-signing

cd ~/module-signing

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.key -out MOK.crt -nodes -days 365 -subj "/CN=Module Signing/"

b. Convert PEM to DER Format

openssl x509 -in MOK.crt -outform DER -out MOK.der

c. Import the Key

sudo mokutil --import MOK.der

  • You will be prompted to create a password.
  • Reboot your system, and during the boot process, enroll the key using the password you set.

d. Sign the Module

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ~/module-signing/MOK.key ~/module-signing/MOK.crt /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko

e. Verify the Signature

sudo modinfo /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko | grep "sig"

  1. Retry Loading the Module

sudo insmod /lib/modules/$(uname -r)/kernel/drivers/net/wireless/8852cu.ko

  1. Check Logs

If the module still doesn’t load, check system logs for more information:

dmesg | tail -n 20

@kovaacs
Copy link

kovaacs commented Jan 19, 2025

#17 (comment) also works on Ubuntu 24.04.1 LTS, just make sure wpasupplicant is installed

Also, the mode switching needs to be set up (source):

sudo vi /lib/udev/rules.d/40-usb_modeswitch.rules
......
# Realtek 8852CU Wifi USB
ATTR{idVendor}=="0bda", ATTR{idProduct}=="1a2b", RUN+="usb_modeswitch -K -v 35bc -p 0102"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants