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

TP-Link TL-WN725N does not connect to router with latest master #404

Closed
mcraveiro opened this issue Apr 9, 2022 · 5 comments
Closed

TP-Link TL-WN725N does not connect to router with latest master #404

mcraveiro opened this issue Apr 9, 2022 · 5 comments

Comments

@mcraveiro
Copy link

mcraveiro commented Apr 9, 2022

Hi rtl8188eu developers,

Many thanks for maintaining this driver. I just bought a new TP-Link TL-WN725N device which I would like to setup with your driver, but I haven't quite figured out how to do so. In this ticket I will outline my setup as well as the steps I have taken so far; if you can spot where I am going wrong, or provide any other pointers, I would be very grateful.

I apologise in advance for the length of the post, but it should at least save me some time if I ever need to do this again :-)

I suspect my problems have much in common with #390, but I did not want to hijack that ticket just in case it's not the same issue.

Problem Summary

The kernel module loads correctly, but I cannot connect to my router. The device appears to be in some kind of weird state.

Linux Kernel

I am using Debian testing, updated today.

$ uname -a
Linux lovelace 5.16.0-6-amd64 #1 SMP PREEMPT Debian 5.16.18-1 (2022-03-29) x86_64 GNU/Linux

Networking Hardware Setup

My networking setup is sadly a bit complicated. The PCI networking devices are as follows:

$ lspci | grep -i netw
05:00.0 Network controller: Ralink corp. RT5392 PCIe Wireless Network Adapter
$ lspci | grep -i eth
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)

After a similar effort to the present, I'm afraid I did not manage to get RT5392 to work; so I bought myself the afore-mentioned USB based WNIC:

# lsusb | grep -i net
Bus 001 Device 015: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter

I chose this device based on the reports of Linux compatibility. The detailed lsusb for the device is as follows:

# lsusb -vv -s 016

Bus 001 Device 016: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8179 RTL8188EUS 802.11n Wireless Network Adapter
  bcdDevice            0.00
  iManufacturer           1 Realtek
  iProduct                2 802.11n NIC
  iSerial                 3 00E04C0001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0002
  (Bus Powered)
  Remote Wakeup Enabled

Finally, as I have not yet managed to get either wireless device to work, I am relying on USB tethering from an android phone. I do not think information about it is required, but let me know if you disagree.

Build and Installation of the Driver

I have cloned, compiled and setup the driver as per instructions in the README [1], using the master branch:

$ git clone https://github.com/lwfinger/rtl8188eu
$ make all
$ make install

Compilation appeared successful, with a couple of warnings which I decided to ignore:

/bin/sh: 1: /usr/src/linux-headers-5.16.0-6-common/scripts/pahole-flags.sh: not found
/bin/sh: 1: /usr/src/linux-headers-5.16.0-6-common/scripts/pahole-flags.sh: not found
<snip>
  BTF [M] /home/marco/Development/rtl8188eu/8188eu.ko
Skipping BTF generation for /home/marco/Development/rtl8188eu/8188eu.ko due to unavailability of vmlinux

I may attempt to resolve these issues, as per this reddit thread. [2]

Software Setup

As I was not sure if there were some incompatibilities between the wireless devices, I decided to remove the drivers before proceeding:

# lsmod | grep rt
snd_hrtimer            16384  1
qrtr                   45056  4
rt2800pci              16384  0
rt2800mmio             20480  1 rt2800pci
rt2800lib             139264  2 rt2800mmio,rt2800pci
rt2x00pci              16384  1 rt2800pci
rt2x00mmio             16384  2 rt2800mmio,rt2800pci
rt2x00lib              69632  5 rt2x00mmio,rt2x00pci,rt2800mmio,rt2800pci,rt2800lib
mac80211             1073152  3 rt2x00pci,rt2x00lib,rt2800lib
snd_timer              45056  3 snd_seq,snd_hrtimer,snd_pcm
iTCO_vendor_support    16384  1 iTCO_wdt
cfg80211             1052672  2 rt2x00lib,mac80211
eeprom_93cx6           16384  1 rt2800pci
rfkill                 32768  7 rt2x00lib,asus_wmi,cfg80211
parport_pc             40960  0
parport                69632  3 parport_pc,lp,ppdev
# rmmod rt2800pci
# rmmod rt2800mmio
# rmmod rt2800lib
# rmmod rt2x00pci
# rmmod rt2x00mmio
# rmmod rt2x00lib

I had a look at modinfo and it looks healthy to a layperson:

# modinfo 8188eu
filename:       /lib/modules/5.16.0-6-amd64/kernel/drivers/net/wireless/8188eu.ko
version:        v4.1.4_6773.20130222
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     FB647C367C5096AA1F62D1D
alias:          usb:v7392pB811d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0B05p18F0d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2C4Ep0102d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0111d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p010Cd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v056Ep4008d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p331Bd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3311d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p3310d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2001p330Fd*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0DF6p0076d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v07B8p8179d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDApF179d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp0179d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp8179d*dc*dsc*dp*ic*isc*ip*in*
depends:        usbcore
retpoline:      Y
name:           8188eu
vermagic:       5.16.0-6-amd64 SMP preempt mod_unload modversions 
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           ifname:The default name to allocate for first interface (charp)
parm:           if2name:The default name to allocate for second interface (charp)
parm:           rtw_initmac:charp
parm:           rtw_channel_plan:int
parm:           rtw_chip_version:int
parm:           rtw_rfintfs:int
parm:           rtw_lbkmode:int
parm:           rtw_network_mode:int
parm:           rtw_channel:int
parm:           rtw_mp_mode:int
parm:           rtw_wmm_enable:int
parm:           rtw_vrtl_carrier_sense:int
parm:           rtw_vcs_type:int
parm:           rtw_busy_thresh:int
parm:           rtw_led_enable:int
parm:           rtw_ht_enable:int
parm:           rtw_cbw40_enable:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_ampdu_amsdu:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_rf_config:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_fw_iol:FW IOL (int)
parm:           rtw_mc2u_disable:int
parm:           rtw_80211d:Enable 802.11d mechanism (int)
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           debug:Set debug level (1-9) (default 1) (int)

Similarly, dmesg looks like this after unplugging and plugging back in the device:

[Sat Apr  9 18:10:25 2022] usb 1-10: USB disconnect, device number 15
[Sat Apr  9 18:10:38 2022] usb 1-9: new high-speed USB device number 16 using xhci_hcd
[Sat Apr  9 18:10:38 2022] usb 1-9: New USB device found, idVendor=0bda, idProduct=8179, bcdDevice= 0.00
[Sat Apr  9 18:10:38 2022] usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sat Apr  9 18:10:38 2022] usb 1-9: Product: 802.11n NIC
[Sat Apr  9 18:10:38 2022] usb 1-9: Manufacturer: Realtek
[Sat Apr  9 18:10:38 2022] usb 1-9: SerialNumber: 00E04C0001
[Sat Apr  9 18:10:38 2022] Chip Version Info: CHIP_8188E_Normal_Chip_TSMC_D_CUT_1T1R_RomVer(0)
[Sat Apr  9 18:10:38 2022] EEPROM ID = 0x8129
[Sat Apr  9 18:10:38 2022] r8188eu 1-9:1.0 wlx14ebb6309493: renamed from wlan0
[Sat Apr  9 18:10:38 2022] r8188eu 1-9:1.0: firmware: direct-loading firmware rtlwifi/rtl8188eufw.bin
[Sat Apr  9 18:10:39 2022] MAC Address = 14:eb:b6:30:94:93
[Sat Apr  9 18:10:40 2022] R8188EU: INFO indicate disassoc

Of particular interest is wlx14ebb6309493: renamed from wlan0; this rather strange device name is similar to what was reported in #400.

In order to try to understand in what state the device is, I used nmcli:

# nmcli -f GENERAL,WIFI-PROPERTIES dev show wlx14ebb6309493
GENERAL.DEVICE:                         wlx14ebb6309493
GENERAL.TYPE:                           wifi
GENERAL.NM-TYPE:                        NMDeviceWifi
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/Devices/7
GENERAL.VENDOR:                         Realtek Semiconductor Corp.
GENERAL.PRODUCT:                        RTL8188EUS 802.11n Wireless Network Adapter
GENERAL.DRIVER:                         r8188eu
GENERAL.DRIVER-VERSION:                 5.16.0-6-amd64
GENERAL.FIRMWARE-VERSION:               --
GENERAL.HWADDR:                         14:EB:B6:30:94:93
GENERAL.MTU:                            1500
GENERAL.STATE:                          30 (disconnected)
GENERAL.REASON:                         42 (The supplicant is now available)
GENERAL.IP4-CONNECTIVITY:               1 (none)
GENERAL.IP6-CONNECTIVITY:               1 (none)
GENERAL.UDI:                            /sys/devices/pci0000:00/0000:00:14.0/usb1/1-9/1-9:1.0/net/wlx14ebb6309493
GENERAL.PATH:                           pci-0000:00:14.0-usb-0:9:1.0
GENERAL.IP-IFACE:                       --
GENERAL.IS-SOFTWARE:                    no
GENERAL.NM-MANAGED:                     yes
GENERAL.AUTOCONNECT:                    yes
GENERAL.FIRMWARE-MISSING:               no
GENERAL.NM-PLUGIN-MISSING:              no
GENERAL.PHYS-PORT-ID:                   --
GENERAL.CONNECTION:                     --
GENERAL.CON-UUID:                       --
GENERAL.CON-PATH:                       --
GENERAL.METERED:                        unknown
WIFI-PROPERTIES.WEP:                    yes
WIFI-PROPERTIES.WPA:                    yes
WIFI-PROPERTIES.WPA2:                   yes
WIFI-PROPERTIES.TKIP:                   yes
WIFI-PROPERTIES.CCMP:                   yes
WIFI-PROPERTIES.AP:                     no
WIFI-PROPERTIES.ADHOC:                  yes
WIFI-PROPERTIES.2GHZ:                   yes
WIFI-PROPERTIES.5GHZ:                   no
WIFI-PROPERTIES.MESH:                   no
WIFI-PROPERTIES.IBSS-RSN:               no

Switching wifi on and off does not seem to help, as dmesg shows:

[Sat Apr  9 18:10:38 2022] r8188eu 1-9:1.0: firmware: direct-loading firmware rtlwifi/rtl8188eufw.bin
[Sat Apr  9 18:10:39 2022] MAC Address = AA:BB:CC:DD:EE:FF
[Sat Apr  9 18:10:40 2022] R8188EU: INFO indicate disassoc
[Sat Apr  9 18:25:31 2022] R8188EU: INFO indicate disassoc
[Sat Apr  9 18:25:33 2022] R8188EU: INFO indicate disassoc
[Sat Apr  9 18:25:34 2022] r8188eu 1-9:1.0: firmware: direct-loading firmware rtlwifi/rtl8188eufw.bin
[Sat Apr  9 18:25:36 2022] R8188EU: INFO indicate disassoc

When I double click on any network nothing seems to happen. Similarly, from the shell I get:

# iw dev wlx14ebb6309493 connect SOME-SSID
command failed: No such device (-19)

And predictably:

# iw dev wlx14ebb6309493 link 
Not connected.

Also when I monitor for events using iw I do not get any output:

# iw event -t -f

At this point I ran out of ideas and decided to post this ticket. It appears the device is in some sort of weird state, on but not quite on. For good measure, I removed and re-added the kernel module, to no avail:

# rmmod 8188eu
# dmesg -T | tail
Sat Apr  9 18:56:40 2022] usbcore: deregistering interface driver r8188eu
[Sat Apr  9 18:56:40 2022] ~~~ MAC IOL_exec_cmds Failed !!!
[Sat Apr  9 18:56:40 2022] ~~~ MAC IOL_exec_cmds Failed !!!
[Sat Apr  9 18:56:40 2022] usb 1-9: reset high-speed USB device number 16 using xhci_hcd
# modprobe 8188eu
# dmesg -T | tail
[Sat Apr  9 18:57:35 2022] usbcore: registered new interface driver r8188eu
[Sat Apr  9 18:57:35 2022] r8188eu 1-9:1.0 wlx14ebb6309493: renamed from wlan0
[Sat Apr  9 18:57:35 2022] r8188eu 1-9:1.0: firmware: direct-loading firmware rtlwifi/rtl8188eufw.bin
[Sat Apr  9 18:57:35 2022] R8188EU: Firmware Version 11, SubVersion 1, Signature 0x88e1
[Sat Apr  9 18:57:36 2022] MAC Address = 14:eb:b6:30:94:93
[Sat Apr  9 18:57:37 2022] R8188EU: INFO indicate disassoc

I will continue to investigate and update the ticket, but do let me know of any suggestions of where to look.

Many thanks for your time.

Sources Consulted

References

[1] https://github.com/lwfinger/rtl8188eu/blob/master/README.md
[2] https://www.reddit.com/r/openSUSE/comments/pwxs3i/btf_file_not_generated_because_vmlinux_could_not/

@mcraveiro
Copy link
Author

mcraveiro commented Apr 9, 2022

TP-Link devices are not the most Linux-Friendly

Actually, I wonder if I made a mistake in buying a TP-Link device and assuming it would be Linux-friendly :-) According to this source [1]:

Note: I will not list any products made by TP-Link and D-Link. Both companies regularly change chipsets while keeping the same model number on their products. This makes it very difficult for Linux users to buy a product with a specific chipset with any degree of certainty. This also makes it difficult for me to post links and recommendations so I will not do so but that is okay because there are many good adapters available. TP-Link and D-Link's Linux support is very poor as their product support sites generally only contain very old Linux drivers that won't work with modern distros... if they post any drivers at all and neither company does a good job of supplying adapters that use in-kernel drivers. We know that Linux cannot be properly supported in the manner that both companies use. This is sad because both companies have made a lot of money from Linux by using it inside many of their products, yet they do not return the support. My recommendation is to avoid TP-Link and D-Link products.

Oh well, one can but try.

[1] https://github.com/morrownr/USB-WiFi

@mcraveiro
Copy link
Author

mcraveiro commented Apr 9, 2022

Explanation for weird device names

I was wondering if my problems were connected to this message:

 wlx14ebb6309493: renamed from wlan0

However, it appears that the strange device names are by design [1],[2]. In particular:

It's being renamed so that it has a consistent name regardless of what order network devices are probed/connected (otherwise, if you had two USB wifi devices, which is wlan0 and wlan1 would potentially change every boot — or when doing it by MAC address, replacing a NIC suddenly made eth0 become eth1 causing all kinds of failure). More details & rationale can be found at https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

[1] [Why is my wlan device being renamed?
[2] How can I change the default "ens33" network device to old "eth0" on Fedora 19?

@lwfinger
Copy link
Owner

lwfinger commented Apr 9, 2022

It is your distro's user-space software that sets the device name. That one is pretty strange. On my system, I get names like wlp0s20u6, which is derived from the bus connectivity. lsusb shows
Bus 002 Device 006: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter

Note that it has the same vendor and device IDs as yours.

There should not have been any interference between that rt2800 and the rtl8188eus. I frequently run several wireless devices for testing. At the moment, I have two PCI devices and one USB wireless interfaces installed.

Are you using NetworkManager to try to make a connection, or some other management software?

If you use NetworkManager, the fact that the rt2800 cannot connect suggests that something is wrong with the user-space end of your system. The rt2800 driver is solid.

To check your hardware download https://download.opensuse.org/distribution/leap/15.3/live/openSUSE-Leap-15.3-GNOME-Live-x86_64-Build9.443-Media.iso, burn it to a USB stick, and boot it. You should be able to make a connection using the rt2800. I do not suspect your hardware, but this will prove it.

@mcraveiro
Copy link
Author

Actually, after a lot of investigation I didn't make much progress on this. I decided to just get an ethernet cable and that worked fine. Thanks very much for all your help.

@gszy
Copy link

gszy commented Jul 31, 2022

# iw dev wlx14ebb6309493 connect SOME-SSID
command failed: No such device (-19)

IIRC, when using RTL8188-based cards, wpa_supplicant (or was it Netplan?) fails with the same error if the nl80211 driver is used instead of (or without fallback to) wext. See wpa_supplicant(8).

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

3 participants