(TLDR; - sorry for the rather long post but I wanted to provide all the gory detail)
I have been trying to get an external USB WiFi dongle working on a UNO Q that has faulty WiFi.
Initially I tried this with a TP-Link TL-WN722N which has been my testing go-to for any Linux machine. It uses the ath9k driver and is just plug-n-play pretty much on any Linux distro without any configuration. Well it doesn't work on the UNO Q. I am currently using the official Arduino USB-C hub to connect the dongle, monitor, mouse and keyboard to the UNO Q.
As for the process that I have followed:
-
install the required tools (some were already present)
sudo apt-get update && sudo apt-get install firmware-ath9k-htc
sudo apt-get install wireless-tools wpasupplicant -
Disable the broken internal WiFi
- edit: sudo nano /etc/modprobe.d/blacklist.conf
- add:
blacklist wcn36xx
- save the file
-
sudo nmcli device set wlan0 managed no
-
Configure the external adapter
sudo nano /etc/network/interfaces
Add:
allow-hotplug wlan1
iface wlan1 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Save the file.
-
set up the wifi credential in the wpa_supplicant file
-
ip -br a
This did not show a wlan1 device, so I tried modprobing the ath9k driver but got:
modprobe: FATAL: Module ath9k not found in directory /lin/modules/6.16.7-g0dd6551ae96b
A little Googling suggested that this was because the kernel on the UNO Q was compiled without this driver. Given the space constraints, reducing the number of compiled-in drivers makes sense.
I therefore had a look at what other drivers were available on the UNO Q using the following command:
ls -R /lib/modules/$(uname -r)/kernel/
This does list the mt7921 and files called mt7921-common.ko and mt7921e.ko are present in the 'net' sub-directory in the kernel drivers directory. I also Googled it and got this re-assurance from its AI:
Yes, an external MediaTek MT7921U (USB) dongle will work on the Arduino UNO Q, but you should keep a few critical setup requirements in mind regarding its Debian Linux environment, hardware configuration, and built-in features.
I therefore went ahead and purchased a generic dongle (cost 11gbp) based on the mt7921 chip. It supports WiFi 6 and would be an upgrade to the 2.4GHz only TL-WN722N. Sure enough if I plug the mt7921 dongle into either of the Linux computer I have here, it works immediately without configuration. Unfortunately plugging it into the UNO Q does not produce the same result. So much for the AI reply.
I ran modprobe and loaded the mt7921e driver, which did load up along with mt7921-common:
$ sudo modprobe mt7921-common
Module Size Used by
mt7921e 16384 0
mt7921_common 65536 1 mt7921e
mt792x_lib 49152 2 mt7921e,mt7921_common
However, nmcli does not show a wireless interface. Furthermore, after a restart, it does not load up automatically and has to be modprobed again.
I compared this to what happens on my Linux machine and found that plugging in the dongle there loads the mt7921u driver. A quick comparison between mt7921e and mt7921u reveals that the 'e' variant supports the PCI bus, but the 'u' variant, which is not present on the UNO Q, supports USB devices. It seems I am back to square one again.
I have had a look at the wireless drivers directory using this command:
$ ls -R /lib/modules/$(uname -r)/kernel/drivers/net/wireless/
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/:
ath broadcom intel marvell mediatek rsi ti
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ath:
ath10k ath11k ath12k ath.ko wcn36xx
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ath/ath10k:
ath10k_core.ko ath10k_pci.ko ath10k_sdio.ko ath10k_snoc.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ath/ath11k:
ath11k_ahb.ko ath11k.ko ath11k_pci.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ath/ath12k:
ath12k.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ath/wcn36xx:
wcn36xx.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom:
brcm80211
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211:
brcmfmac brcmutil
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac:
bca brcmfmac.ko cyw wcc
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca:
brcmfmac-bca.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw:
brcmfmac-cyw.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc:
brcmfmac-wcc.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/broadcom/brcm80211/brcmutil:
brcmutil.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/intel:
iwlwifi
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/intel/iwlwifi:
dvm iwlwifi.ko mvm
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/intel/iwlwifi/dvm:
iwldvm.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/intel/iwlwifi/mvm:
iwlmvm.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/marvell:
mwifiex
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/marvell/mwifiex:
mwifiex.ko mwifiex_pcie.ko mwifiex_sdio.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/mediatek:
mt76
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/mediatek/mt76:
mt76-connac-lib.ko mt76.ko mt7921 mt792x-lib.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/mediatek/mt76/mt7921:
mt7921-common.ko mt7921e.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/rsi:
rsi_91x.ko rsi_sdio.ko rsi_usb.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ti:
wl18xx wlcore
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ti/wl18xx:
wl18xx.ko
/lib/modules/6.16.7-g0dd6551ae96b/kernel/drivers/net/wireless/ti/wlcore:
wlcore.ko wlcore_sdio.ko
Unfortunately, I don't know by looking at the file names whether all of them are PCI drivers? Some are clearly labelled as such with a '_pci' suffiix, but not all. I Googled the ath10k, ath11k and ath12k and they all seem to be PCI only, so am beginning to suspect that perhaps the others are also? Will have to Google a few more I guess.
Has anyone succeeded connecting any kind of USB WiFi dongle to the UNO Q? If so, then which one?
The other "sledge hammer" option apparently is to recompile the kernel adding in the relevant driver flags so they get compiled in. At the moment I am not sure how I would go about this, but also wondering whether a subsequent update would wipe any changes I make anyway? Furthermore, I doubt there would be enough space on the UNO Q itself, so would probably require cross-compiling on a PC, which I have not done before. I would also need help setting up the toolchain for the UNO Q. Is there a FAQ or guide on this anywhere?
(I did get some info from Google's AI, but not sure how accurate it is. I am hoping that someone from Arduino can help me with this?)