USB WiFi Dongle

Appreciate this isn’t really a Shake technical matter but here goes anyway…

I recently bought this USB WiFi dongle USB WiFi Adapter for Raspberry Pi | The Pi Hut for its “Plug n’ play WiFi with the Raspberry Pi” compatibility but unfortunately it isn’t.

Have looked through this forum & manual referring to the many useful posts and guides but unfortunately http://downloads.fars-robotics.net/wifi-drivers/install-wifi is no longer online (2023-08-25 @ 14:30 hrs UTC).

The internal wifi shows but not the usb wifi dongle. Thought I’d check in here first before I attempt to find, download and install the correct driver in case anyone has a better lead.

root@raspberryshake:~# iwconfig

eth0 no wireless extensions.

lo no wireless extensions.

vethfae0974 no wireless extensions.

veth8fb308b no wireless extensions.

wlan0 IEEE 802.11 ESSID:“MYSSID”
Mode:Managed Frequency:2.412 GHz Access Point: xx:xx:xx:xx:xx:xx
Bit Rate=72.2 Mb/s Tx-Power=31 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality=66/70 Signal level=-44 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0

docker0 no wireless extensions.

veth443233e no wireless extensions.

root@raspberryshake:~# uname -a
Linux raspberryshake 4.19.97-v7l+ #8 SMP Tue Apr 25 11:50:30 UTC 2023 armv7l GNU/Linux

root@raspberryshake:~# cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”

root@raspberryshake:~# cat /etc/debian_version
10.3

root@raspberryshake:~# cat /proc/cpuinfo

Model : Raspberry Pi 4 Model B Rev 1.5

root@raspberryshake:~# lsusb -v

idVendor 0x148f Ralink Technology, Corp.
idProduct 0x7601 MT7601U Wireless Adapter
bcdDevice 0.00
iManufacturer 1 MediaTek
iProduct 2 802.11 n WLAN
iSerial 3 1.0
bNumConfigurations 1

1 Like

Strange.

root@raspberryshake:~# lsmod | grep -i mt7601u
mt7601u 102400 0
mac80211 708608 1 mt7601u
cfg80211 647168 3 mac80211,mt7601u,brcmfmac

root@raspberryshake:~# dmesg | grep 7601
[ 1.366112] usb 1-1.4: New USB device found, idVendor=148f, idProduct=7601, bcdDevice= 0.00
[ 2.762506] mt7601u 1-1.4:1.0: ASIC revision: 76010001 MAC revision: 76010500
[ 2.763736] mt7601u 1-1.4:1.0: Direct firmware load for mt7601u.bin failed with error -2
[ 2.764439] mt7601u: probe of 1-1.4:1.0 failed with error -2
[ 2.764495] usbcore: registered new interface driver mt7601u

root@raspberryshake:~# find /lib/firmware -name “*7601*” -print
→ returns nothing

According to GitHub - art567/mt7601usta: Linux driver for MT7601U with patch for stability and performance on recent kernel versions “If you have Linux 4.2 or later the new driver is already part of the kernel (it’s called mt7601u).”

1 Like

A fresh night’s sleep and a search of duckduckgo instead of google provided a lead that solved the problem.

MediaTek provide a Linux Driver on this page https://www.mediatek.com/products/broadband-wifi/mt7601u

I downloaded and extracted the files

$ wget https://d86o2zu8ugzlg.cloudfront.net/mediatek-craft/drivers/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913.tar.bz2

Searched through and found this

$ find ~/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913 -name “*7601*” -print

/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/include/chip/mt7601.h
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/include/mcu/MT7601_firmware.h
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/ate/chips/mt7601_ate.c
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/chips/mt7601.c
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/chips/mt7601.c.bak
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/mcu/bin/MT7601_formal_1.7.bin
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/mcu/bin/MT7601.bin
/home/user/Downloads/wifi/DPO_MT7601U_LinuxSTA_3.0.0.4_20130913/mcu/bin/MT7601_formal_1.7_Debug.bin

Had a look

$ ls -l MT7601.bin
-rwxrwxr-x 1 user user 45412 Sep 12 2013 MT7601.bin

I wonder if this is the same size as the one on my Ubuntu 22.04 installation

$ ls -l /lib/firmware/mt7601u.bin
-rw-r–r-- 1 root root 45412 Aug 4 14:01 /lib/firmware/mt7601u.bin

It is, let’s double check they’re the same

$ md5sum /lib/firmware/mt7601u.bin
696cedb8e76ecc0cda9f9b0d3972c64d /lib/firmware/mt7601u.bin

$ md5sum MT7601.bin
696cedb8e76ecc0cda9f9b0d3972c64d MT7601.bin

What happens if I copy it over to where the missing firmware file should be and then power down / up? In this case I copied over my Ubuntu one, not as though there should be any difference.

It worked! Two wlan0 entries but we can soon sort that out.

Add this to bottom of /boot/config.txt (newer syntax):

dtoverlay=disable-wifi

Blacklist in /etc/modprobe.d/raspi-blacklist.conf

blacklist brcmfmac
blacklist brcmutil

Add the Power Management off option (and reference) to the bottom of rc.local so it now looks like this

root@raspberryshake:~# cat /etc/rc.local


# Ref Wifi Dongle - #7 by iannesbitt - turn off Power Management
/sbin/iwconfig wlan0 power off

exit 0

Power down / power up and hey presto only one wlan0 from iwconfig. Run ifconfig to check MAC address and yep that’s not the internal one.

Job done, time for breakfast.

1 Like

Hello Hadders,

Just a note to thank you for showing all the steps you’ve taken to identify, address, and fix the issue you were experiencing with your USB WiFi dongle.

I’m sure it will be of help to other users in similar situations.

Thanks for this! I am folllowing you up until “I copy it over to where the missing firmware file should be”. I tried to do the same and copied MT7601.bin to /lib/firmware, powered down and up, did the iwconfig command…but it’s not showing up? Am I missing something?

Here is my lsusb command result of interest:

Bus 001 Device 004: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter

EDIT:
I was able to get it to work.

@Hadders I got the dongle mentioned in your first post. I downloaded the MT7601u.bin file from here: mediatek - kernel/git/firmware/linux-firmware.git - Repository of firmware blobs for use with the Linux kernel

I copied that into /lib/firmware, powered down/up, and that seemed to do it?

Thank you!

3 Likes

Just an amendment since I had to do this again, here are the commands I used:

From my windows computer (where I have the mt7601u.bin file stored):

I had issues putting it anywhere other than the home directory using scp, so I put it there (and then moved it):

First, use scp to copy it from my computer to Raspberry PI (obviously, you need to have a network connection to it):
scp "c:/path/to/mt7601u.bin" "myshake@rs.local:mt7601u.bin"
It will ask for your password.

ssh myshake@rs.local
(it will ask for your password again)

Now, within the Raspberry PI:
sudo mv "~/mt7601u.bin" "../lib/firmware"

This will move your file in the home directory to the correct /lib/firmware directory.

Now:
sudo reboot

And you should be good to go

2 Likes

Thank you for the updated instructions rbalik!

Having this kind of step-by-step commands is always great for the community.