Can't get my USB wifi to work

Hello all. I’ve been trying to get my USB wifi dongle to work, but with little success so far. I bought a TP-Link TL-WN822N because it is supposed to work out of the box, but I’ve been having no luck. I think I’ve the right drivers and I can get a list of the available networks, but I can’t connect to any of them. Something times out and fails, regardless of whether I enter the correct WPA2 password to the network or not.

I’ve been using Arch Linux’s guides here and here.

Hardware information
cpu:                                                            
                       Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 2930 MHz
                       Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 3118 MHz
                       Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 3140 MHz
                       Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz, 3150 MHz
keyboard:
                       Metadot - Das Keyboard Das Keyboard
mouse:
                       Logitech USB-PS/2 Optical Mouse
graphics card:
                       nVidia VGA compatible controller
sound:
                       Intel Audio device
                       nVidia Audio device
storage:
                       Intel SATA controller
network:
  enp0s31f6            Intel Ethernet controller
  wlp0s20f0u4          Realtek 802.11n NIC
network interface:
  enp0s31f6            Ethernet network interface
  wlp0s20f0u4          Ethernet network interface
  lo                   Loopback network interface
disk:
  /dev/sdd             Garmin FR620 Flash
  /dev/sdb             TOSHIBA DT01ACA2
  /dev/sda             TOSHIBA-TR150
partition:
  /dev/sdb1            Partition
  /dev/sdb2            Partition
  /dev/sda1            Partition
  /dev/sda2            Partition
  /dev/sda3            Partition
  /dev/sda4            Partition
cdrom:
  /dev/sr0             TSSTcorp CDDVDW SH-224GB
usb controller:
                       Intel USB Controller
bios:
                       BIOS
bridge:
                       Intel PCI bridge
                       Intel ISA bridge
                       Intel PCI bridge
                       Intel PCI bridge
                       Intel Host bridge
                       Intel PCI bridge
hub:
                       VIA USB3.0 Hub
                       Linux 4.19.26-1-CHAKRA xhci-hcd xHCI Host Controller
                       VIA USB2.0 Hub
                       Linux 4.19.26-1-CHAKRA xhci-hcd xHCI Host Controller
memory:
                       Main Memory
unknown:
                       FPU
                       DMA controller
                       PIC
                       Keyboard controller
                       Intel Memory controller
                       Intel Communication controller
                       Intel Signal processing controller
                       Intel SMBus
                       Serial controller
                       Microsoft Xbox 360 Wireless Receiver for Windows
                       Metadot - Das Keyboard Das Keyboard

This is what happens when trying to connect using wpa_supplicant:

wpa_supplicant -B -i wlp0s20f0u4 -c <(wpa_passphrase "MyWifi" "MyPassword") Successfully initialized wpa_supplicant nl80211: deinit ifname=wlp0s20f0u4 disabled_11b_rates=0 wlp0s20f0u4: Failed to initialize driver interface

The interface is up:

$ ip link 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether d0:50:99:82:29:42 brd ff:ff:ff:ff:ff:ff 3: wlp0s20f0u4: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 link/ether 6e:ec:d7:ec:bc:b8 brd ff:ff:ff:ff:ff:ff

It’s not connected;

$ iw dev wlp0s20f0u4 link Not connected.

And this is what happens when running dhcpcd:

sudo dhcpcd wlp0s20f0u4 Failed to revert interface configuration: Unit dbus-org.freedesktop.resolve1.service not found. wlp0s20f0u4: waiting for carrier timed out dhcpcd exited

I’m quite new to all this, but it’d be great to get this working. Your help is much appreciated <3

is dhcpcd running?
…and why are you not using networkmanager?

I think so - how would I check?

NetworkManager stays stuck at “Configuring interface” with any network I try to connect to, so I tried to do it manually…

These are the logs trying to log in with NetworkManager:

[Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4902] device (wlp0s20f0u4): Activation: (wifi) connection 'Altibox893372' has security, and secrets exist>
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4902] Config: added 'ssid' value 'MyWifi'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4903] Config: added 'scan_ssid' value '1'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4903] Config: added 'bgscan' value 'simple:30:-80:86400'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4903] Config: added 'key_mgmt' value 'WPA-PSK'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4903] Config: added 'auth_alg' value 'OPEN'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.4903] Config: added 'psk' value '<hidden>'
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5112] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5317] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5459] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5577] device (wlp0s20f0u4): supplicant interface state: disabled -> inactive
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5608] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5673] device (wlp0s20f0u4): supplicant interface state: inactive -> scanning
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.5883] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:33 oslopc NetworkManager[367]: <info>  [1566932433.6024] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:34 oslopc NetworkManager[367]: <info>  [1566932434.8007] device (wlp0s20f0u4): supplicant interface state: scanning -> authenticating
Aug 27 21:00:34 oslopc NetworkManager[367]: <info>  [1566932434.8414] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:35 oslopc NetworkManager[367]: <info>  [1566932435.4514] device (wlp0s20f0u4): supplicant interface state: authenticating -> disconnected
Aug 27 21:00:42 oslopc NetworkManager[367]: <info>  [1566932442.1173] audit: op="statistics" arg="refresh-rate-ms" pid=556 uid=1000 result="success"
Aug 27 21:00:45 oslopc NetworkManager[367]: <info>  [1566932445.4574] device (wlp0s20f0u4): supplicant interface state: disconnected -> scanning
Aug 27 21:00:46 oslopc NetworkManager[367]: <info>  [1566932446.7122] device (wlp0s20f0u4): supplicant interface state: scanning -> authenticating
Aug 27 21:00:47 oslopc NetworkManager[367]: <info>  [1566932447.3915] device (wlp0s20f0u4): supplicant interface state: authenticating -> disconnected
Aug 27 21:00:57 oslopc NetworkManager[367]: <info>  [1566932457.3976] device (wlp0s20f0u4): supplicant interface state: disconnected -> scanning
Aug 27 21:00:58 oslopc NetworkManager[367]: <warn>  [1566932458.7726] device (wlp0s20f0u4): Activation: (wifi) association took too long, failing activation

ok, check step by step:

  1. do you talk to the correct interface?
    to check this: journalctl | grep wlp
  2. does the kernel load a driver for your usb wifi dongle?

I installed the rtl8xxxu driver and made sure the module’s loaded at start. This is what journalctl returns:

Aug 28 16:03:48 oslopc kernel: rtl8xxxu 1-4:1.0 wlp0s20f0u4: renamed from wlan0
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.6823] wifi-nl80211: (wlp0s20f0u4): using nl80211 for WiFi device control
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.6839] manager: (wlp0s20f0u4): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/3)
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.6966] device (wlp0s20f0u4): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Aug 28 16:03:48 oslopc kernel: IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u4: link is not ready
Aug 28 16:03:48 oslopc kernel: IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u4: link is not ready
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.7044] device (wlp0s20f0u4): set-hw-addr: set MAC address to 4E:D9:BD:A9:54:A8 (scanning)
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.7112] device (wlp0s20f0u4): supplicant interface state: init -> starting
Aug 28 16:03:48 oslopc kernel: IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u4: link is not ready
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.7917] sup-iface[0x55cb3ee60980,wlp0s20f0u4]: supports 4 scan SSIDs
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.7933] device (wlp0s20f0u4): supplicant interface state: starting -> ready
Aug 28 16:03:48 oslopc NetworkManager[370]: <info>  [1567001028.7935] device (wlp0s20f0u4): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Aug 28 16:03:48 oslopc kernel: IPv6: ADDRCONF(NETDEV_UP): wlp0s20f0u4: link is not ready
Aug 28 16:04:48 oslopc wpa_supplicant[404]: wlp0s20f0u4: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN

I blacklisted the rtl8xxxu driver, and now it’s using the 8192eu driver instead. It works now!

Thanks so much for putting me on the track of looking for driver errors, I was going around in circles playing around with wpa issues :slight_smile:

please mark this thread as solved :slight_smile:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.