DEV Community

Wataru Taniguchi
Wataru Taniguchi

Posted on • Updated on

How to build a 6GHz WiFi client with a Raspberry Pi and Netgear A8000

The use of 6GHz WiFi band has been approved in Japan since September 2022.
This article (Japanese) provides detailed instructions to build a 6GHz WiFi client there, using a Raspberry Pi and a Netgear A8000.
It is most likely that these instructions are applicable in any country where the use of 6GHz is allowed. However, it is not tested outside of Japan.
Instructions to build a 6GHz Access Point is covered by separate articles How to build a 6GHz WiFi Router Mode AP with a Raspberry Pi and Netgear A8000 and How to build a 6GHz WiFi Bridge Mode AP with a Raspberry Pi and Netgear A8000.

Task Summary

  • Force the standard mt7921u driver to recognize A8000
  • Refresh Linux Wireless Regulatory Database to reflect the addition of 6GHz band WiFi
  • Renew MediaTek WiFi firmware
  • Upgrade WPA Supplicant to v2.10

Prerequisites and Assumptions

  • Raspberry Pi OS version is Bullseye, i.e., kernel 6.1
  • Interface name for the onboard WiFi is wlan0 while that for A8000 is wlan1
  • Instructions described in this article are for Japan

Force the standard mt7921u driver to recognize A8000

Create a new file /etc/udev/rules.d/90-usb-0846:9060-mt7921u.rules as below, following the instructions about A8000 on this page.

ACTION=="add", \
    SUBSYSTEM=="usb", \
    ENV{ID_VENDOR_ID}=="0846", \
    ENV{ID_MODEL_ID}=="9060", \
    RUN+="/usr/sbin/modprobe mt7921u", \
    RUN+="/bin/sh -c 'echo 0846 9060 > /sys/bus/usb/drivers/mt7921u/new_id'"
Enter fullscreen mode Exit fullscreen mode

This enables A8000 to be automatically recognized at boot for the use of existing WiFi bands.

Refresh Linux Wireless Regulatory Database to reflect the addition of 6GHz band WiFi

You can see that the use of 6GHz WiFi in Japan has not yet been reflected to the Bullseye's regulatory database by the command iw reg get. The timestamp of wireless-regdb package, April 2022, explains why. It is before the approval that took place in September of the year.

~ $ iw reg get
global
country JP: DFS-JP
    (2402 - 2482 @ 40), (N/A, 20), (N/A)
    (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM
    (4910 - 4990 @ 40), (N/A, 23), (N/A)
    (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW
    (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW
    (5490 - 5710 @ 160), (N/A, 23), (0 ms), DFS
    (57000 - 66000 @ 2160), (N/A, 10), (N/A)
~ $ apt list --installed | grep regdb
wireless-regdb/stable,now 2022.04.08-2~deb11u1 all [installed]
Enter fullscreen mode Exit fullscreen mode

Obtain the newest distribution file from the distribution site and copy its binary database file to /lib/crda.

xzcat wireless-regdb-2023.05.03.tar.xz | tar -xvf -
cd wireless-regdb-2023.05.03/
sudo mv /lib/crda/regulatory.bin /lib/crda/regulatory.bin.orig
sudo cp regulatory.bin /lib/crda
Enter fullscreen mode Exit fullscreen mode

Make sure the new band gets included by the command iw reg get after reboot.

~ $ iw reg get
global
country JP: DFS-JP
    (2402 - 2482 @ 40), (N/A, 20), (N/A)
    (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM
    (4910 - 4990 @ 40), (N/A, 23), (N/A)
    (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW
    (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW
    (5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
    (5925 - 6425 @ 160), (N/A, 23), (N/A), NO-OUTDOOR
    (57000 - 66000 @ 2160), (N/A, 10), (N/A)
Enter fullscreen mode Exit fullscreen mode

Renew MediaTek WiFi firmware

Bullseye comes with a version of MediaTek WiFi firmware, which is no longer the newest. You can renew the firmware, following the instructions on this page.
The original version is found to be ____010000-20220908211021 by the command ethtool -i wlan1.

~ $ ethtool -i wlan1
driver: mt7921u
version: 6.1.21-v8+
firmware-version: ____010000-20220908211021
expansion-rom-version: 
bus-info: 1-1.4:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
Enter fullscreen mode Exit fullscreen mode

Download files for MT7921 chipset from MediaTek firmware for Linux distribution site and copy them to /lib/firmware/mediatek.

sudo mv /lib/firmware/mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin /lib/firmware/mediatek/WIFI_MT7961_patch_mcu_1_2_hdr.bin.orig
sudo mv /lib/firmware/mediatek/WIFI_RAM_CODE_MT7961_1.bin /lib/firmware/mediatek/WIFI_RAM_CODE_MT7961_1.bin.orig
sudo cp WIFI_MT7961_patch_mcu_1_2_hdr.bin /lib/firmware/mediatek
sudo cp WIFI_RAM_CODE_MT7961_1.bin /lib/firmware/mediatek
Enter fullscreen mode Exit fullscreen mode

The refreshed version is found to be ____010000-20230526130958 by the command ethtool -i wlan1.

~ $ ethtool -i wlan1
driver: mt7921u
version: 6.1.21-v8+
firmware-version: ____010000-20230526130958
expansion-rom-version: 
bus-info: 1-1.4:1.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
Enter fullscreen mode Exit fullscreen mode

Upgrade WPA Supplicant to v2.10

You have to upgrade WPA Supplicant to v2.10 as there are some WiFi 6E functionalities not ready on v2.9. Since hostapd is also have to be upgraded to v2.10 for AP, let's download hostap_2_10.tar.gz package that incorporate both WPA Supplicant and hostapd from its distribution site.

tar -xzvf hostap_2_10.tar.gz
cd hostap_2_10/wpa_supplicant
cp defconfig .config
make
sudo mv /usr/sbin/wpa_supplicant /usr/sbin/wpa_supplicant_2_9
sudo cp wpa_supplicant /usr/sbin
sudo mv /usr/sbin/wpa_cli /usr/sbin/wpa_cli_2_9
sudo cp wpa_cli /usr/sbin
Enter fullscreen mode Exit fullscreen mode

Direct wlan1/A8000 to connect to a different network

Change WPA supplicant configuration such that wlan0/onboard WiFi and wlan1/A8000 to connect to different networks.

cd /etc/wpa_supplicant
sudo mv wpa_supplicant.conf wpa_supplicant-wlan0.conf
Enter fullscreen mode Exit fullscreen mode

Create a new file wpa_supplicant-wlan1.conf as below. Do not forget to change ssid= and sae_password= appropriately.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
pmf=2
sae_pwe=1

network={
    scan_ssid=1
    ssid="foo-ax"
    key_mgmt=SAE
    proto=RSN
    ieee80211w=2
    sae_password="foobar"
    pairwise=CCMP
    group=CCMP
}
Enter fullscreen mode Exit fullscreen mode

You can optionally disable the use of wlan0/onboard WiFi by sudo iwconfig wlan0 txpower off.

Done

See if you are on 6GHz by iwconfig.

~ $ iwconfig
lo        no wireless extensions.

wlan0     IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

wlan1     IEEE 802.11  ESSID:"foo-ax"  
          Mode:Managed  Frequency:6.235 GHz  Access Point: 94:18:65:xx:xx:xx   
          Bit Rate=286.7 Mb/s   Tx-Power=3 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=70/70  Signal level=-31 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
bakavalen profile image
Valen

What is the pi doesnt use regulatory.bin? Just install crda and hope for the best?