USB Wifi Scan issues AR9271

Creating a bug report/issue

I have searched the existing open and closed issues and couldn’t find any details that can help me with this, at first i thought it was because of the initial MediaTek adapter that i was using, so i switched to an Atheros 9271 and ended up with the same results

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=3
    G_DIETPI_VERSION_RC=0
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    Bookworm

  • Kernel version | uname --all
    6.6.16-current-meson64 #1 SMP PREEMPT Fri Feb 23 08:25:28 UTC 2024 aarch64 GNU/Linux

  • Architecture | dpkg --print-architecture
    arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    Khadas Vim3 Pro

  • Power supply used | (EG: 5V 1A RAVpower)
    Official Khadas Power Supply

  • SD card used | (EG: SanDisk ultra)
    64GB Sandisk Ultra

Additional Information (if applicable)

  • Can this issue be replicated on a fresh installation of DietPi?
    YES, I have tested multiple devices with multiple distros including Armbian and Raspian OS, only one affected by this issue is DietPi

Steps to reproduce

Using a Fresh install of DietPi on a raspberry pi:

  1. Connect an AR9721 USB adapter
  2. did all updates and checks, confirmed that the adapter is detected through lsusb and lsmod
  3. adapter does not show up in ifconfig or iwconfig
  4. checking journalctl shows that there is a trouble loading the driver
  5. re-installed driver using “sudo apt install firmware-atheros” and restarted

Adapter now shows up and semi-functional, meaning if provide the details to connect to an SSID, it will connect with no issues, but it has no ability to scan, no ability to auto select channel when attempting to create a hotspot, and when running “sudo Iw wlan1 scan” i get “command failed: Network is down (-100)”

Expected behaviour

  • The adapter should be able to scan and list the available networks + auto select channel when used in hostapd
  • The adapter was tested on Raspian, Armbian and Ubuntu and worked as intended, although its worth noting that Armbian had the same issue with the adapter not running out of the box and needing driver installation

Actual behaviour

  • no ability to scan or auto select channel

Extra details

  • At first i thought it was a debian issue, but i was not able to reproduce this issue except on Dietpi, and tested on both the Khadas Vim3 and a Pi3 and Pi4

  • internal Wifi adapters do not face this issue, they have the ability to scan and auto select channels with no issue

Is the interface up and running? You can check it with ip link show.

Well the device is not supported by us. It might be an issue with kernel or device tree overlay for this board.

yes sir, interface is up and running and i can use it to either connect to an SSID or create a hotspot.

I can’t put my finger on the cause here but it feels like a bad driver which doesn’t make sense since i did the same thing on Armbian to install the driver and it worked with no issues

I understand that Khadas Vim3 is not supported, but this is not unique to Khadas, i guess i should’ve added the other devices i was able to replicate this issue on, but basically I also tested on the Raspberry pi3 and pi4 running DietPi and same behavior, switched those devices to Raspian OS and Armbian with the same exact adapter, and everything worked as expected

I’m not an expert by all means, but i did my best to try to isolate the cause of this issue by testing multiple devices, making sure the Wifi adapter works and testing other distros, so far everything points to DietPi but i could be wrong of course

Let’s use RPi OS as example.

Did you used 32 or 64bit version?
Desktop or light version?

At the end DietPi is not an own operating system. It’s a set of bash scripts on top of Debian. Just more lightweight/diet. Therefore it could easily miss packages or drivers as we don’t ship everything pre installed.

Of course i fully understand that an appreciate all the work you guys do on DietPi. And for for the raspberry pi devices i used the following:
Pi4 : Raspbian Bookworm 64bit - Desktop
Pi3 : Raspbian Bookworm 32bit - Desktop

What i did not test is DietPi or Raspbian Bullseye to see if the issue is the same but i can do that if you think it would be helpful

EDIT: I will flash a Raspbian lite and test it on my pi3 for further testing

Please test with the 64bit light version of RPi OS. This will be the most similar to DietPi. Ensure you have all apt packages and kernel up to date. And yes, try to use Bookworm and not Bullseye. Can you share kernel version of RPi OS?

Raspian OS 64bit bookworm light tested on Pi3 and everything worked out of the box, there was no need to do "sudo apt install firmware-atheros’

Here’s the kernel version:
Linux raspberrypi 6.6.28+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.28-1+rpt1 (2024-04-22) aarch64 GNU/Linux

Here are more details about the device using ethtool from the Pi3-RaspianOS Lite:

sudo ethtool -i wlan1
driver: ath9k_htc
version: 6.6.28+rpt-rpi-v8
firmware-version: 1.3
expansion-rom-version:
bus-info: 1-1.5:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

And here it is from Pi4-dietpi:

sudo ethtool -i wlan1
driver: ath9k_htc
version: 6.1.21-v8+
firmware-version: 1.3
expansion-rom-version:
bus-info: 1-1.1:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

I managed to replicate the same behavior in a dietpi VM, just for a sanity check

For testing, don’t mix SBC and architecture. All are using different kernel and overlay.

Let’s stick to RPi SBC running 64bit.

You could test whether it works with the new kernel/firmware package stack: #6676. Just to ensure it’s similar to RPi OS 64bit

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