Sam Hooke

These are rough notes from whatever I was working on, interested in or thinking about at the time. They vary greatly in quality and length, but prove useful to me, and hopefully to you too!

Troubleshooting wifi driver crashing (part 4)

The USB Wi-Fi adapter I ordered a month ago arrived today! It took so longer because the first order got lost in the post. Once I reached out to the Think Penguin support, they were very quick to help and sent my order again. It arrived 3 days later.

Now let’s try and get this USB Wi-Fi adapter working. (Skip to the end to see how to actually do it. There is a lot of meandering first…)


I am running Debian 9.5. It looks like this is the firmware we need:

sudo apt install firmware-atheros

Didn’t show up after running ip a. Time for a reboot.


It shows up as wlx2824ff1a0472, but the state is DOWN, which is no good.

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 60:57:18:79:04:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.13/24 brd 192.168.0.255 scope global dynamic wlp2s0
       valid_lft 863983sec preferred_lft 863983sec
    inet6 fe80::72e4:ddb6:2205:80a0/64 scope link 
       valid_lft forever preferred_lft forever
3: wlx2824ff1a0472: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 42:be:cb:c1:f9:97 brd ff:ff:ff:ff:ff:ff

Let’s try brining it up:

sudo ip link set up wlx2824ff1a0472

That did not work.

Found reddit comment which linked to this page on the Think Penguin website. It is the installation instructions for this USB Wi-Fi adapater on Debian.

(That page timed out for me at first, so I had to dig up a copy of it on Google cache. It appears to work again now though).

The instructions are:

wget https://www.thinkpenguin.com/files/ath9k_firmware_free-version/deb9.tar.gz
tar xf deb9.tar.gz 
sudo cp htc_7010.fw htc_9271.fw /lib/firmware

After a reboot that did not seem to work.

Some other instructions mention trying these steps:

sudo nano /etc/NetworkManager/conf.d/l.conf

Then adding this to the above file:

[device]
wifi.scan-rand-mac-address=0

Then restart network manager:

sudo service network-manager restart

Nope, still not working. Perhaps the firmware from the start is causing problems:

sudo apt remove firmware-atheros
reboot

Removing that firmware appears to have made things worse. Upon booting I saw a firmware related error mentioning the word “suitable”. Let’s see:

$ sudo dmesg | grep suitable --context=10
[    2.737486] input: Video Bus as /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input19
[    2.737719] snd_hda_intel 0000:00:03.0: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
[    2.737727] [drm] Initialized i915 1.6.0 20160919 for 0000:00:02.0 on minor 0
[    2.740131] fbcon: inteldrmfb (fb0) is primary device
[    2.780307] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    2.780343] usb 1-1: firmware: failed to load ath9k_htc/htc_9271-1.4.0.fw (-2)
[    2.780347] usb 1-1: Direct firmware load for ath9k_htc/htc_9271-1.4.0.fw failed with error -2
[    2.780353] usb 1-1: ath9k_htc: Firmware htc_9271.fw requested
[    2.780372] usb 1-1: firmware: failed to load htc_9271.fw (-2)
[    2.780375] usb 1-1: Direct firmware load for htc_9271.fw failed with error -2
[    2.780379] usb 1-1: no suitable firmware found!
[    2.782461] usb 1-1: ath9k_htc: USB layer deinitialized
[    2.782564] usbcore: registered new interface driver ath9k_htc
[    2.784659] input: HDA Intel HDMI HDMI/DP,pcm=3 as /devices/pci0000:00/0000:00:03.0/sound/card0/input20
[    2.784773] input: HDA Intel HDMI HDMI/DP,pcm=7 as /devices/pci0000:00/0000:00:03.0/sound/card0/input21
[    2.784882] input: HDA Intel HDMI HDMI/DP,pcm=8 as /devices/pci0000:00/0000:00:03.0/sound/card0/input22
[    2.786610] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[    2.980263] iwlwifi 0000:02:00.0 wlp2s0: renamed from wlan0
[    2.997156] Adding 8288252k swap on /dev/sda3.  Priority:-1 extents:1 across:8288252k SSFS
[    3.652364] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    3.652366] Bluetooth: BNEP filters: protocol multicast

Let’s install the firmware again and try to load:

sudo apt install firmware-atheros
sudo modprobe ath9k_htc

That didn’t seem to work. Let’s reboot. (Are you keeping count?).


After reboot we can see it is loading the firmware from firmware-atheros:

$ sudo dmesg | grep ath9k_htc
[    2.662564] usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
[    2.664721] usbcore: registered new interface driver ath9k_htc
[    2.668126] usb 1-1: firmware: direct-loading firmware ath9k_htc/htc_9271-1.4.0.fw
[    2.951481] usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
[    3.203100] ath9k_htc 1-1:1.0: ath9k_htc: HTC initialized with 33 credits
[    3.484170] ath9k_htc 1-1:1.0: ath9k_htc: FW Version: 1.4
[    3.484174] ath9k_htc 1-1:1.0: FW RMW support: On
[    3.499813] ath9k_htc 1-1:1.0 wlx2824ff1a0472: renamed from wlan0

Still not brining the network up though:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 60:57:18:79:04:28 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.13/24 brd 192.168.0.255 scope global dynamic wlp2s0
       valid_lft 863917sec preferred_lft 863917sec
    inet6 fe80::72e4:ddb6:2205:80a0/64 scope link 
       valid_lft forever preferred_lft forever
3: wlx2824ff1a0472: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 28:24:ff:1a:04:72 brd ff:ff:ff:ff:ff:ff

Perhaps this is because of Network Manager? It is probably helpfully enabling/disabling network interfaces for us.

Let’s try installing a network manager interface:

sudo apt install network-manager-gnome
reboot

I’m not sure installing that changed anything.

(The actual solution starts here).

Regardless, in GNOME under the top-right drown-down menu noticed that two wifi networks were listed. One called “PCI Wi-FI” and the other called “USB Wi-Fi”. Tried disabling “PCI Wi-Fi” and enabling “USB Wi-Fi”, but even with many attempts this always caused the “PCI Wi-Fi” to end up enabling.

Then tried clicking “Wi-Fi Settings” which opened up a window with a slider for toggling each network connection on or off. Again I tried disabling the “PCI Wi-Fi” and enabling the “USB Wi-Fi” but it always resulted in the “PCI Wi-Fi” being enabled. Checking with ip a also confirmed that the wlp2s0 (PCI) interface was being brought up, but the wlx2824ff1a0472 (USB) interface was not.

Screenshot of GNOME Wi-Fi Settings window
Should have tried looking here in the first place

Finally I noticed that when I selected the “USB Wi-Fi”, it listed the available Wi-Fi networks. I selected my home network and was prompted for the password. I entered the password, and the “USB Wi-Fi” stayed enabled and the “PCI Wi-Fi” stayed disabled! Running ip a confirmed that this had worked:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 60:57:18:79:04:28 brd ff:ff:ff:ff:ff:ff
6: wlx2824ff1a0472: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 28:24:ff:1a:04:72 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.38/24 brd 192.168.0.255 scope global dynamic wlx2824ff1a0472
       valid_lft 863564sec preferred_lft 863564sec
    inet6 fe80::87e7:5f23:9e20:8c34/64 scope link 
       valid_lft forever preferred_lft forever

It would appear then that each Wi-Fi connection stores network credentials separately. Presumably when I first tried enabling the “USB Wi-Fi” connection it would fail because there were no networks nearby on which it was authenticated, so the network manager tried to be helpful and automatically fell back to the “PCI Wi-Fi” which did have available connections nearby.

Ideally I should find a way to permanently disable the PCI Wi-Fi, but at least for now I can use the internet wirelessly again!


So to summarise the actual solution:

  1. Run sudo apt install firmware-atheros
  2. reboot
  3. Open the Wi-Fi Settings GUI
  4. Find the “USB Wi-Fi” section, select your network and authenticate

All articles in this series:

<< Previous: That weird feeling...
Next: libusb usb_open error -4 >>