USB WLAN - TP-Link TL-WN821N v2 [Atheros AR9170] - Device cannot be used

Hello,

unfortunately I can't get my USB WLAN stick to work. I would like to start by briefly describing what I am using and what I have done so far.

I have a freshly installed and updated OPNSense version running in my test lab.

The OPNSense dashboard currently shows the following versions:
OPNsense 23.7.8-amd64
FreeBSD 13.2-RELEASE-p5
OpenSSL 1.1.1w 11 Sep 2023

Various compatible WLAN USB adapters are listed in the FreeBSD 13.2-RELEASE Hardware Notes. I have the version 2 of this adapter -> Qualcomm Atheros Communications TP-Link TL-WN821N v2 802.11n [Atheros AR9170]. According to the hardware notes, the TP-Link TL-WN821N v1, v2 is listed as compatible with the otus driver.

I have created the file /boot/loader.conf.local and inserted the following lines, which may not even be necessary:
Code:
    if_otus_load="YES"
    otusfw_main_load="YES"
    otusfw_init_load="YES"
The otusfw* files are already available here via the initial installation, I have not changed them:
Code:
    /boot/kernel/otusfw-init.ko
    /boot/kernel/otusfw-main.ko

When the system boots, the following error messages appear when trying to load the otus driver:
Code:
    otus0: otus_load_firmware: otusfw_main: error=5
    otus0: otus_attachhook: could not load main firmware
    device_attach: otus0 attach returned 6

Unfortunately I cannot get the WLAN adapter to work and it is not offered for selection in the web console.

Does anyone have any idea how I can track down the problem and how I can solve it?
 
Last edited by a moderator:
That's right, sorry for my mistake. I have now downloaded the latest FreeBSD version 13.2 (File Name: FreeBSD-13.2-RELEASE-amd64-dvd1.iso.xz / File Size: 2997185540 / Date: 2023-Apr-07 05:29) and installed the latest available updates ('freebsd-update fetch' | 'freebsd-update install').

Output of 'freebsd-version -kru' is:
13.2-RELEASE-p4
13.2-RELEASE-p4
13.2-RELEASE-p5


Output of 'uname -a' is:
FreeBSD freebsd 13.2-RELEASE-p4 FreeBSD 13.2-RELEASE-p4 GENERIC amd64

I then edited the file "/boot/loader.conf" and added the following entries at the end:
if_otus_load="YES"
otusfw_init_load="YES"
otusfw_main_load="YES"


The otusfw* files are already available here via the initial installation, I have not changed them:
/boot/kernel/otusfw-init.ko
/boot/kernel/otusfw-main.ko


When the system boots, the following error messages appear when trying to load the otus driver:
otus0: otus_load_firmware: otusfw_main: error=5
otus0: otus_attachhook: could not load main firmware
device_attach: otus0 attach returned 6

13-11-2023_19-06-30.jpg


Unfortunately I cannot get the WLAN adapter to work. Does anyone have any tips on how I could solve the problem?
 
Many thanks for the tip.

I have edited the file /boot/loader.conf, added the following entry at the end and rebooted the system:
Code:
boot_verbose="YES"

The command dmesg returns the following information -> see attached file dmesg.txt

The only thing I can identify here for "otus" are the entries:
Code:
wlan: <802.11 Link Layer>
firmware: 'otusfw_init' version 1: 83968 bytes loaded at 0xffffffff826e0000
firmware: 'otusfw_main' version 1: 3508 bytes loaded at 0xffffffff82703000
[...]
ugen1.2: <ATHER USB2.0 WLAN> at usbus1
otus0 on uhub1
otus0: <ATHER USB2.0 WLAN, rev 2.00/1.06, addr 1> on usbus1
Root mount waiting for: usbus1
otus0: otus_load_firmware: otusfw_main: error=5
otus0: otus_attachhook: could not load main firmware
device_attach: otus0 attach returned 6

However, I cannot do anything further with this information.

Only as additional information, the command usbconfig returns this information:
Code:
ugen0.1: <Intel UHCI root HUB> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE (0mA)
ugen1.1: <(0x1b36) XHCI root HUB> at usbus1, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen1.2: <ATHER USB2.0 WLAN> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
 

Attachments

  • dmesg.txt
    31.2 KB · Views: 45
The problem has now been solved for me by buying a different USB WLAN stick with a different chipset. This USB WLAN stick uses the run driver and works straight away.
 
The problem has now been solved for me by buying a different USB WLAN stick with a different chipset. This USB WLAN stick uses the run driver and works straight away.
Care to share what USB Dongle you used so anyone that comes to this thread will know and buy the one you bought ?

Thanks
 
Back
Top