web-dev-qa-db-fra.com

Comment faire pour que Mediatek MT 7601 USB Wifi fonctionne sur Ubuntu 18.04?

La première chose à dire est que j'ai exploré et essayé les solutions suggérées dans d'autres questions similaires, mais jusqu'à présent, rien n'a fonctionné. Je sais que l'USB Wifi n'est pas défectueux car il fonctionne très bien sous Windows 10 sur la même machine. Incidemment, cela ne fonctionne pas non plus sous Mac OS 10.13.6 (il s'agit d'un MacBook Pro 2011 avec un adaptateur WiFi interne cassé).

lsusb

donne les informations suivantes: Bus 002 Périphérique 006: ID 148f: 7601 Ralink Technology, Corp. MT7601U Adaptateur sans fil

dmesg

juste après avoir branché l'appareil donne:

[ 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

Si j'essaye iwconfig:

$ iwconfig
lo        no wireless extensions.

enp2s0f0  no wireless extensions.

J'ai téléchargé le firmware sur le site Web de Mediatek et l'ai mis dans le bon dossier et j'ai également essayé de compiler ou d'installer divers packages qui ont soit généré des erreurs de compilation, soit n'ont rien fait pour que le WiFi fonctionne.

Quelqu'un a-t-il des conseils ou une solution à jour pour cela?

J'ai essayé de suivre les instructions données pour la réponse de @ 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

Ensuite, juste au cas où cela aurait fonctionné de toute façon:

$ Sudo modprobe mt7601Usta

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

Information du dernier commentaire: $ Sudo mis à jourb && Locate 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

Maintenant, j'ai essayé:

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

Alors:

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

Après avoir suivi les conseils ci-dessous et installé la dernière version du firmware:

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

C'est toujours la même chose qu'avant.

1
Simon Baldwin

Votre fichier de firmware, mt7610u.bin, a une somme md5 différente et est probablement différente de la dernière incluse dans linux-firmware. Installons le dernier package et voyons si les mystérieuses erreurs disparaissent.

Avec une connexion Internet fonctionnelle par Ethernet, partage de connexion ou par tout autre moyen possible, ouvrez un terminal et faites:

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

Redémarrez et vérifiez:

dmesg | grep ath
1
chili555