如何让联发科 MT 7601 USB Wifi 在 Ubuntu 18.04 上运行?

如何让联发科 MT 7601 USB Wifi 在 Ubuntu 18.04 上运行?

首先要说的是,我已经探索并尝试了其他类似问题中建议的解决方案,但到目前为止,没有任何效果。我知道 USB Wifi 没有问题,因为它在同一台机器上的 Windows 10 中运行良好。顺便说一句,它在 Mac OS 10.13.6 中也无法工作(这是一台 2011 年的 MacBook Pro,内部 WiFi 适配器坏了)。

lsusb

给出以下内容:总线 002 设备 006:ID 148f:7601 Ralink Technology, Corp. MT7601U 无线适配器

dmesg

插入设备后立即显示:

[ 2265.257271] usb 1-1.3: new high-speed USB device number 11 using ehci-pci
[ 2265.376911] usb 1-1.3: New USB device found, idVendor=148f, idProduct=7601
[ 2265.376915] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2265.376917] usb 1-1.3: Product: 802.11 n WLAN
[ 2265.376919] usb 1-1.3: Manufacturer: MediaTek
[ 2265.376921] usb 1-1.3: SerialNumber: 1.0

如果我尝试 iwconfig:

$ iwconfig
lo        no wireless extensions.

enp2s0f0  no wireless extensions.

我从联发科网站下载了固件并将其放在正确的文件夹中,还尝试编译或安装各种软件包,但这些软件包要么引发编译错误,要么根本无法使 WiFi 正常工作。

有人对此有什么建议或最新的解决方案吗?

我尝试按照@chili555 的回答给出的说明进行操作:

     $ make
    make -C tools
    make[1]: Entering directory '/home/baldwin/mt7601usta/src/tools'
    gcc -g bin2h.c -o bin2h
    make[1]: Leaving directory '/home/baldwin/mt7601usta/src/tools'
    /home/baldwin/mt7601usta/src/tools/bin2h
    cp -f os/linux/Makefile.6 /home/baldwin/mt7601usta/src/os/linux   /Makefile
    make -C /lib/modules/4.15.0-39-generic/build SUBDIRS=/home/baldwin  /mt7601usta/src/os/linux modules
    make[1]: Entering directory '/usr/src/linux-headers-4.15.0-39-generic'
     CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../os/linux /rt_profile.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/assoc.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/auth.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/auth_rsp.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/sync.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/sanity.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/rtmp_data.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/connect.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/wpa.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.o
     /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c: In           function ‘Set_EncrypType_Proc’:
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:1104:5: warning:   this ‘else’ clause does not guard... [-Wmisleading-indentation]
        else
         ^~~~
        /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:1107:2:    note: ...this statement, but the latter is misleadingly indented as if it were    guarded by the ‘else’
      if (pAd->StaCfg.BssType == BSS_ADHOC)
      ^~
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c: In function      ‘RtmpIoctl_rt_ioctl_siwfreq’:
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:6018:5:     warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
         else
         ^~~~
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:6021:2:   note: ...this statement, but the latter is misleadingly indented as if it were  guarded by the ‘else’
      return NDIS_STATUS_SUCCESS;
      ^~~~~~
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c: In function      ‘RtmpIoctl_rt_ioctl_giwrate’:
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:7928:5:  warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
          if (rate_index >= rate_count)
          ^~
    /home/baldwin/mt7601usta/src/os/linux/../../sta/sta_cfg.c:7931:2:  note: ...this statement, but the latter is misleadingly indented as if it were  guarded by the ‘if’
      *(ULONG *)pData = ralinkrate[rate_index] * 500000;
      ^
     CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common /crypt_md5.o
     CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/crypt_sha2.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/crypt_hmac.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/crypt_aes.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common   /crypt_arc4.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/mlme.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_wep.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/action.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_data.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/rtmp_init.o
    /home/baldwin/mt7601usta/src/os/linux/../../common/rtmp_init.c: In  function ‘NICInitializeAsic’:
    /home/baldwin/mt7601usta/src/os/linux/../../common/rtmp_init.c:1656:1:  warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe- larger-than=]
     }
     ^
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common /rtmp_init_inf.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_tkip.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_aes.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_sync.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/eeprom.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_sanity.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common /cmm_info.o
     /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c: In    function ‘GetEncryptType’:
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1752:5:      warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
         if(enc == Ndis802_11Encryption3Enabled)
         ^~
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1754:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
       if(enc == Ndis802_11Encryption4Enabled)
       ^~
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c: In function ‘GetAuthMode’:
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1764:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
         if(auth == Ndis802_11AuthModeShared)
         ^~
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1766:2:    note: ...this statement, but the latter is misleadingly indented as if it were   guarded by the ‘if’
      if(auth == Ndis802_11AuthModeAutoSwitch)
      ^~
     /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1776:5:   warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
         if(auth == Ndis802_11AuthModeWPA2PSK)
         ^~
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:1778:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
       if(auth == Ndis802_11AuthModeWPA1WPA2)
      ^~
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c: In  function ‘Show_PMK_Proc’:
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:4198:5:  warning: this ‘for’ clause does not guard... [-Wmisleading-indentation]
 for (idx = 0; idx < 32; idx++)
 ^~~
   /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_info.c:4201:2:  note: ...this statement, but the latter is misleadingly indented as if it were  guarded by the ‘for’
      return 0;
      ^~~~~~
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_cfg.o
     CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_wpa.o
    /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_wpa.c: In    function ‘WPAStart2WayGroupHS’:
     /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_wpa.c:1257:5:      warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
        if ((!pEntry) || !IS_ENTRY_CLIENT(pEntry))
         ^~
     /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_wpa.c:1262:2:    note: ...this statement, but the latter is misleadingly indented as if it were  guarded by the ‘if’
       os_alloc_mem(NULL, (PUCHAR *)&mpool, TX_EAPOL_BUFFER);
      ^~~~~~~~~~~~
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_radar.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/spectrum.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/rtmp_timer.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/rt_channel.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_profile.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_asic.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/scan.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/cmm_cmd.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/uapsd.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/ps.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../rate_ctrl/ra_ctrl.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../rate_ctrl/alg_legacy.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../rate_ctrl/alg_ags.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../chips/rtmp_chip.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/txpower.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../mac/rtmp_mac.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../mgmt/mgmt_hw.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../..       /mgmt/mgmt_entrytb.o
   /home/baldwin/mt7601usta/src/os/linux/../../mgmt/mgmt_entrytb.c: In    function ‘MacTableInsertEntry’:
     /home/baldwin/mt7601usta/src/os/linux/../../mgmt/mgmt_entrytb.c:103:2: warning: this ‘if’ clause does not guard...  [-Wmisleading-indentation]
      if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
      ^~
    /home/baldwin/mt7601usta/src/os/linux/../../mgmt/mgmt_entrytb.c:106:3:   note: ...this statement, but the latter is misleadingly indented as if it were   guarded by the ‘if’
      FirstWcid = 1;
       ^~~~~~~~~
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../phy/rtmp_phy.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../phy/rlt_phy.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../phy/rlt_rf.o
      CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/ba_action.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../mgmt/mgmt_ht.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../common/rt_os_util.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../os/linux/sta_ioctl.o
       CC [M]  /home/baldwin/mt7601usta/src/os/linux/../../os/linux  /rt_linux.o
    /home/baldwin/mt7601usta/src/os/linux/../../os/linux/rt_linux.c: In function ‘__RTMP_OS_Init_Timer’:
    /home/baldwin/mt7601usta/src/os/linux/../../os/linux/rt_linux.c:120:3: error: implicit declaration of function ‘init_timer’; did you mean  ‘init_timers’? [-Werror=implicit-function-declaration]
       init_timer(pTimer);
       ^~~~~~~~~~
        init_timers
    /home/baldwin/mt7601usta/src/os/linux/../../os/linux/rt_linux.c:121:9: error: ‘OS_NDIS_MINIPORT_TIMER {aka struct timer_list}’ has no member named  ‘data’
        pTimer->data = (unsigned long)data;
             ^~
     /home/baldwin/mt7601usta/src/os/linux/../../os/linux       /rt_linux.c:122:20: error: assignment from incompatible pointer type    [-Werror=incompatible-pointer-types]
      pTimer->function = function;
                ^
     cc1: some warnings being treated as errors
     scripts/Makefile.build:332: recipe for target '/home/baldwin/mt7601usta/src/os/linux/../../os/linux/rt_linux.o' failed
     make[2]: *** [/home/baldwin/mt7601usta/src/os/linux/../../os/linux/rt_linux.o] Error 1
      Makefile:1551: recipe for target '_module_/home/baldwin/mt7601usta /src/os/linux' failed
      make[1]: *** [_module_/home/baldwin/mt7601usta/src/os/linux] Error 2
       make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-39-   generic'
     Makefile:418: recipe for target 'LINUX' failed
     make: *** [LINUX] Error 2

然后,以防万一它以某种方式起作用:

$ sudo modprobe mt7601Usta

    modprobe: FATAL: Module mt7601Usta not found in directory /lib/modules  /4.15.0-39-generic

来自最新评论的信息:$ sudo updatedb && location mt7601u.ko

/lib/modules/4.15.0-38-generic/kernel/drivers/net/wireless/mediatek  /mt7601u/mt7601u.ko
/lib/modules/4.15.0-39-generic/kernel/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko

    $ sudo modprobe mt7601u && dmesg | grep mt76
[ 1102.391048] mt7601u 1-1.3:1.0: ASIC revision: 76010001 MAC revision:     76010500
[ 1102.432663] mt7601u 1-1.3:1.0: EEPROM ver:0c fae:00
[ 1102.610548] mt7601u 1-1.3:1.0: Error: RX urb failed:-71
[ 1102.610690] mt7601u 1-1.3:1.0: Error: MCU resp urb failed:-71
[ 1102.610703] mt7601u 1-1.3:1.0: Error: MCU resp evt:0 seq:5-4!
[ 1102.614793] mt7601u 1-1.3:1.0: Error: RX urb failed:-71
[ 1102.615055] mt7601u 1-1.3:1.0: Error: MCU resp urb failed:-71
[ 1102.615063] mt7601u 1-1.3:1.0: Error: MCU resp evt:0 seq:5-4!
[ 1102.619034] mt7601u 1-1.3:1.0: Error: RX urb failed:-71
[ 1102.619356] mt7601u 1-1.3:1.0: Error: MCU resp urb failed:-71
[ 1102.619375] mt7601u 1-1.3:1.0: Error: MCU resp evt:0 seq:5-4!
[ 1102.623360] mt7601u 1-1.3:1.0: Error: RX urb failed:-71
[ 1102.623598] mt7601u 1-1.3:1.0: Error: MCU resp urb failed:-71
[ 1102.623619] mt7601u 1-1.3:1.0: Error: MCU resp evt:0 seq:5-4!
[ 1102.627523] mt7601u 1-1.3:1.0: Error: RX urb failed:-71
[ 1102.627782] mt7601u 1-1.3:1.0: Error: MCU resp urb failed:-71
[ 1102.627785] mt7601u 1-1.3:1.0: Error: MCU resp evt:0 seq:5-4!
[ 1102.627787] mt7601u 1-1.3:1.0: Error: mt7601u_mcu_wait_resp timed out
[ 1102.795071] mt7601u: probe of 1-1.3:1.0 failed with error -110
[ 1102.795178] usbcore: registered new interface driver mt7601u

现在我尝试了:

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

然后:

$ sudo dpkg -s linux-firmware | grep Version
Version: 1.173.2

遵循以下建议并安装最新版本的固件:

$ dmesg | grep ath
$ md5sum /lib/firmware/mt7610u.bin
696cedb8e76ecc0cda9f9b0d3972c64d  /lib/firmware/mt7610u.bin

这还是和以前一样。

答案1

您的固件文件 mt7610u.bin 具有不同的 md5sum,可能与最新版本的不同。Linux 固件。让我们安装后面的包,看看神秘的错误是否消失。

通过以太网、网络共享或任何可能的方式建立有效的互联网连接,打开终端并执行以下操作:

cd /tmp
wget http://mirrors.kernel.org/ubuntu/pool/main/l/linux-firmware/linux-firmware_1.175.1_all.deb
sudo dpkg -i linux-firmware*.deb

重启并检查:

dmesg | grep ath

相关内容